RbError routines

Overview

The RbError_init() function is used to setup your own custom fatal-error and warning functions. Pass in two RbErrorFunc pointers (or a NULL to use the default function).

The RbError_exit() function is called whenever a fatal error is produced. If you have setup a hook function for fatal errors, it is called immediately prior the exit(1) call, otherwise the error is simply output to stderr.

The RbError_warn() function is called to output a warning. If you have setup a hook function for warnings, it is called instead of outputting the warning to stderr.

Callbacks

Each of the two callback functions takes a character pointer (for the sprintf-type format string) and a va_list pointer (for the arguments). Each function is expected to show the error message to the user in some manner, and the fatal-error function may also perform whatever fatal-error cleanup it wants to do prior to exiting.