br_diaghandler
stdout
and stderr
(as used by the standard C library functions) are not available (or not suitable).
typedef
brdiag.h
for precise declaration and ordering)
br_diag_warning_cbfn * warning Warning delivery function
br_diag_failure_cbfn * failure Failure delivery function
char * identifier Diagnostic handler name
Members
Handling Functions
This is a pointer to the warning delivery function (See br_diag_warning_cbfn * warning
br_diag_warning_cbfn
114). This is invoked by the warning macros (See Diagnostic Support, page 65).
br_diag_failure_cbfn * failure
br_diag_failure_cbfn
113
). This is invoked by the failure, fatal and assertion macros (See Diagnostic Support).
char * identifier
Null
if not required). A string constant is recommended.
Operations
Description:
Install a new diagnostic handler.BrDiagHandlerSet()
br_diaghandler* BrDiagHandlerSet(br_diaghandler* newdh)
br_diaghandler * newdh
structure (should really be static). If Null
the default diagnostic handler will be used (uses the standard C I/O library).
Result:
br_diaghandler *
Returns a pointer to the old diagnostic handler (possibly Null
). This may be used to pass diagnostics on, if desired.
Remarks: The diagnostic handler may be specified at any suitable time.
BrBegin()
10
will specify a default diagnostic handler if no handler is currently defined.Note that diagnostics generated without a diagnostic handler present will only be caught in the debug build.
If not BrBegin()
10, This should be the first BRender function called.
You should cater for the circumstance arising, if in the process of handling diagnostics, your diagnostic handler may call functions that may themselves generate diagnostics.
identifier
has been allocated from the heap.
Access & Maintenance
While the structure is the current handler (most recently passed to BrDiagHandlerSet()
116) the members should not be changed. No maintenance required.
Referencing & Lifetime
The structure must remain valid at least until a new handler is passed to BrDiagHandlerSet()
116, and may need to remain valid longer if a newer diagnostic handler uses it to pass diagnostics on.
Initialisation
The members should be set before the structure is passed to BrDiagHandlerSet()
116.
Construction & Destruction
The structure should ideally be statically constructed. Supplementary
The identifier
may be used to determine the current handler in use.
Generated with CERN WebMaker