(3M) Calculator User Manual
7.12 Error handling routines
The handling of errors that occur within library routines is often difficult, because
library routines should be able to issue error messages that help the application
programmer to find the error, while being compatible with the way the application
handles its own errors.
To match these two requirements, all the error and warning messages pro-
duced by the routines of the libScotch library are issued using the user-definable
variable-length argument routines SCOTCH errorPrint and SCOTCH errorPrintW.
Thus, one ca n redirect these error messages to his own error handling routines, and
can choo se if he wants his program to termina te on er ror or to resume exec ution
after the erroneous function has returned.
In order to free the user from the burden of writing a basic error handler
from scratch, the libscotcherr.a libr ary provides error routines that print error
messages on the standard error stream stderr and r e tur n control to the applica-
tion. Application programmers who want to take advantage of them have to add
-lscotcherr to the list of arguments of the linker, after the -lscotch argument.
7.12.1 SCOTCH
errorPrint
Synopsis
void SCOTCH
errorPrint (const char * const errstr, ...)
Description
The SCOTCH
errorPrint function is designed to output a variable-length ar-
gument er ror string to some stream.
7.12.2 SCOTCH
errorPrintW
Synopsis
void SCOTCH
errorPrintW (const char * const errstr, ...)
Description
The SCOTCH
errorPrintW function is designed to output a variable-length
argument warning string to some stream.
7.12.3 SCOTCH errorProg
Synopsis
void SCOTCH
errorProg (const char * progstr)
Description
120