Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
Collaboration diagram for error handling:

Typedefs

typedef int(* agusererrf) (char *)
 

Enumerations

enum  agerrlevel_t { AGWARN , AGERR , AGMAX , AGPREV }
 

Functions

agerrlevel_t agseterr (agerrlevel_t)
 
char * aglasterr (void)
 
int agerr (agerrlevel_t level, const char *fmt,...)
 
void agerrorf (const char *fmt,...)
 
void agwarningf (const char *fmt,...)
 
int agerrors (void)
 
int agreseterrors (void)
 
agusererrf agseterrf (agusererrf)
 

Detailed Description

The library provides a variety of mechanisms to control the reporting of errors and warnings. A message is only written if its type has higher priority than a programmer-controlled minimum, which is AGWARN by default. The programmer can set this value using agseterr, which returns the previous value. Calling agseterr(AGMAX) turns off the writing of messages.

The function agerr is the main entry point for reporting an anomaly. The first argument indicates the type of message. Usually, the first argument is AGWARN or AGERR to indicate warnings and errors, respectively. Sometimes additional context information is only available in functions calling the function where the error is actually caught. In this case, the calling function can indicate that it is continuing the current error by using AGPREV as the first argument. The remaining arguments to agerr are the same as the arguments to printf.

The functions agwarningf and agerrorf are shorthand for agerr(AGWARN,...) and agerr(AGERR,...), respectively.

Some applications desire to directly control the writing of messages. Such an application can use the function agseterrf to register the function that the library should call to actually write the message. The previous error function is returned. By default, the message is written to stderr.

Errors not written are stored in a log file. The last recorded error can be retrieved by calling aglasterr. Unless the printing of error messages has been completely disabled by a call to agseterr(AGMAX), standard error must not be wide-oriented, even if a user-provided error printing function is provided.

The function agerrors returns non-zero if errors have been reported.

Typedef Documentation

◆ agusererrf

typedef int(* agusererrf) (char *)

Definition at line 850 of file cgraph.h.

Enumeration Type Documentation

◆ agerrlevel_t

Enumerator
AGWARN 
AGERR 
AGMAX 
AGPREV 

Definition at line 849 of file cgraph.h.

Function Documentation

◆ agerr()

int agerr ( agerrlevel_t  level,
const char *  fmt,
  ... 
)

Definition at line 155 of file agerror.c.

References agerr_va().

Referenced by bundle(), compoundEdges(), dot_concentrate(), emit_clusters(), error_context(), init_rank(), init_xdot(), kkNeato(), majorization(), make_flat_adj_edges(), make_label(), multicolor(), neato_layout(), neatoModel(), poly_gencode(), setEdgeLen(), stress_majorization_kD_mkernel(), and twopi_layout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ agerrorf()

void agerrorf ( const char *  fmt,
  ... 
)

Definition at line 165 of file agerror.c.

References AGERR, and agerr_va().

Referenced by aagerror(), aagerror(), add_tree_edge(), agapply(), agdelete(), agdictof(), aggetrec(), agraphof(), agroot(), boxIntersectf(), bundle(), charsetToStr(), checkpath(), circleLayout(), clarify(), conjugate_gradient(), conjugate_gradient_f(), conjugate_gradient_mkernel(), contain_nodes(), coordOf(), delaunay_tri(), delaunay_triangulation(), deriveGraph(), do_ordering_for_nodes(), dotneato_args_initialize(), find_ints(), freeSurface(), get_triangles(), getsplinepoints(), gvconfig(), gvLayout(), gvLayoutJobs(), gvNEWcontext(), gvNextInputGraph(), gvplugin_library_load(), gvplugin_package_record(), gvPluginList(), gvprintf(), gvRender(), gvrender_resolve_color(), gvRenderContext(), gvRenderData(), gvRenderFilename(), gvRenderJobs(), htmlerror(), htmllex(), init_nop(), init_rank(), install_in_rank(), invalidate_path(), largeMinlen(), makeAddPoly(), makePoly(), makeSpline(), map_edge(), mkSurface(), neato_extra_args(), opensubg(), opensubg(), ordered_edges(), parse_style(), parseSegs(), picfontname(), PQ_insert(), rebuild_vlists(), record_init(), RectArea(), remove_overlap(), routesplines_(), seg_cmp(), setDouble(), setInt(), simpleSplineRoute(), size_html_img(), SparseMatrix_import_dot(), strong(), update(), user_pos(), virtual_weight(), and x_cutval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ agerrors()

int agerrors ( void  )

Definition at line 181 of file agerror.c.

References agmaxerr.

Referenced by dotread(), dotstring(), gvFreeContext(), and main().

Here is the caller graph for this function:

◆ aglasterr()

char * aglasterr ( void  )

Definition at line 44 of file agerror.c.

References agxbdisown(), agxbput(), free(), last, NULL, and streq().

Here is the call graph for this function:

◆ agreseterrors()

int agreseterrors ( void  )

Definition at line 183 of file agerror.c.

References agmaxerr.

Referenced by CFrmSettings::drawGraph(), and main().

Here is the caller graph for this function:

◆ agseterr()

agerrlevel_t agseterr ( agerrlevel_t  lvl)

Definition at line 38 of file agerror.c.

References agerrlevel.

Referenced by dotneato_args_initialize().

Here is the caller graph for this function:

◆ agseterrf()

agusererrf agseterrf ( agusererrf  newf)

Definition at line 32 of file agerror.c.

References usererrf.

◆ agwarningf()

void agwarningf ( const char *  fmt,
  ... 
)

Definition at line 173 of file agerror.c.

References agerr_va(), and AGWARN.

Referenced by addXLabels(), arrow_match_name(), cat_libfile(), check_fontname(), checkCompound(), checkExp(), checkStart(), chkNum(), chkNum(), chkPos(), compile_samerank(), compoundEdges(), dot_mincross(), dot_splines_(), edgeType(), emit_xdot(), epsf_init(), estimate_character_width_canonical(), fdp_initParams(), fdpSplines(), fillMap(), findCharset(), findStopColor(), firstlayer(), genroute(), get_metrics_for_font_family(), getAdjustMode(), getCluster(), gmlerror(), gvloadimage(), gvplugin_library_load(), gvrender_resolve_color(), gvrender_set_style(), gvusershape_file_access(), gvusershape_open(), htmlEntityUTF8(), init_job_pagination(), init_xdot(), initHTMLlexer(), initial_positions(), insert(), kkNeato(), layout(), lenattr(), make_flat_adj_edges(), makeCompoundEdge(), mark_clusters(), merge_oneway(), neatoMode(), neatoModel(), nomacros(), nomacros(), orthoEdges(), parse_layers(), parse_layerselect(), parse_style(), parseSegs(), poly_init(), poly_port(), ps_string(), rebuild_vlists(), record_port(), removeOverlapWith(), routesplines_(), safefile(), setAspect(), setattr(), setFDPAttr(), sgd(), size_html_cell(), size_html_tbl(), solve_model(), spline_edges0(), spline_edges_(), stress_majorization_kD_mkernel(), tuneControl(), twopi_layout(), unrecognized(), unsupported(), user_init(), user_shape(), user_spline(), versionStr2Version(), and write_xdots().

Here is the call graph for this function:
Here is the caller graph for this function: