Diagnostic Managers

type diagnostic_manager;

A diagnostic_manager is an opaque bundle of state for a client of libgdiagnostics.

It has zero of more “output sinks” to which diagnostics are emitted.

Responsibilities include:

  • location-management

  • caching of source file content

  • patch generation

diagnostic_manager *diagnostic_manager_new(void)

Create a new diagnostic_manager. The caller will need to call diagnostic_release_manager() on it at some point.

Note

No output sinks are created by default; so you will want to create one with something like:

diagnostic_manager_add_text_sink (diag_mgr, stderr,
                                  DIAGNOSTIC_COLORIZE_IF_TTY);
void diagnostic_manager_release(diagnostic_manager *diag_mgr)

Release a diagnostic_manager.

This will flush output to all of the output sinks, and clean up.

The parameter must be non-NULL.