ct_report_error

The ct_report_error function receives a character string, which will ordinarily be displayed or otherwise relayed to the user as an error message.

Prototype:

void ct_report_error( const char * msg );

Parameters:

msg
Pointer to a null-terminated character string.

Return Value:

None.

Discussion:

If the pointer passed to it is not NULL, ct_report_error() passes it to another function for reporting.

The default reporting function writes the input character string to standard error, followed by a newline. In some environments, such as a graphical user interface, this default treatment is not appropriate. By using ct_install_error_reporter() the application can replace the default reporting function with a customized callback function.

The Cheap Threads software uses ct_report_error() to report internal error conditions. Hence an application may need to install a reporting function even if it never calls ct_report_error() on its own.

Restrictions:

An application may call ct_report_error() at any time. A customized reporting function may of course impose restrictions of its own.
Home