BRender Technical Reference Manual:4 Data Structures (Alphabetical Reference):br_diag_failure_cbfn
Next|Prev|Up
The Call-Back Function
Specification
CBFnDiagFailure()

br_diag_failure_cbfn


The Call-Back Function

This type defines a call-back function, primarily intended for the failure member of the br_diaghandler
115 structure.

The typedef

(See brdiag.h for a precise declaration)

void br_diag_failure_cbfn(const char *) Handle failure and message

Specification


CBFnDiagFailure()

Description:
An application defined call-back function that is called upon a serious, unexpected error or failure, with a descriptive message. Remember, a release version of your software should never fail.

Declaration:
void BR_CALLBACK CBFnDiagFailure(const char* message)

Arguments:
const char * message

Pointer to zero terminated character string describing the failure.

Preconditions:
The diagnostic handler has been setup (BrDiagHandlerSet()
116). BRender has not necessarily completed initialisation. In an unknown state. A failure has occurred. BRender is not expecting the function to return.

Effects:
Behaviour is up to the application, but the following procedure can be taken as a suggestion.

Set a failure condition flag (to detect escalation). Optionally, immediately inform user of failure. Re-establish a known state. Perform diagnostics of hardware and software, inform user of any diagnosed faults (optionally, also of original failure). End failure condition, and resume (do not return).

Remarks:
Avoid allocating memory in your failure call-back function, or you may need special care in handling out-of-memory conditions. BRender's default failure call-back function does not allocate memory.

Example:
See stddiag.c for examples of diagnostic handler functions.

See Also:
CBFnDiagWarning()114.



Generated with CERN WebMaker