Skip to main content

Module diag

Module diag 

Source
Expand description

Diagnostics as lib/cgraph/agerror.c reports them: agerrorf prints Error: ... and raises the error level that dot’s main returns as its exit status (graphviz_errors + agerrors()), while the layout and the output go on. agwarningf prints Warning: ... and does not change the status.

The level is per thread, so concurrent in-process renders do not see each other’s errors.

Functions§

agerr_prev
agerr(AGPREV, msg): continues the previous message.
agerrorf
agerrorf(msg): msg is the C format output, normally ending in a newline.
agwarningf
agwarningf(msg).
emit_once
emit_once(str): true the first time key is seen on this thread.
error_count
Number of errors reported on this thread since the last reset_errors.
fmt_g
C printf("%.{prec}g", v) on the reference platform (macOS libc), as diagnostics and renderers print numbers.
quietly
Runs f as a repeat of work C does once. The port sizes labels and nodes again after C’s common_init_node/common_init_edge/do_graph_label (for ports, splines and rendering), and the diagnostics of those calls (HTML label warnings and errors, bad label format, size too small for label) must not print a second time.
reporting
False inside quietly and silently: label and node sizing diagnostics are reported only outside them.
reporting_ports
False inside silently: port warnings are reported only outside it.
reset_errors
Clears the error count and the once-only messages of this thread.
silently
quietly, and port warnings too, for a repeat that C does not make at all.