.ds Vv 1.2.14 .TH VistaIOSetWarningHandler 3 "16 February 1994" "VistaIO Version \*(Vv" .SH NAME VistaIOSetWarningHandler \- register a procedure to be called on any nonfatal error .SH SYNOPSIS .nf .ft B void VistaIOSetWarningHandler (VistaIOWarningHandler *\fIhandler\fP) .PP .ft B typedef void VistaIOWarningHandler (VistaIOStringConst \fImessage\fP); .PP .ft B void VistaIODefaultWarning (VistaIOStringConst \fImessage\fP); .fi .SH ARGUMENTS .IP \fIhandler\fP 10n Specifies the new nonfatal error handler. .IP \fImessage\fP 10n Specifies a null-terminated error message string to be reported. .SH DESCRIPTION \fBVistaIOSetWarningHandler\fP registers a procedure, \fIhandler\fP, as the nonfatal error handler. That procedure is called by \fBVistaIOWarning\fP(3) or by \fBVistaIOSystemWarning\fP(3) to report any nonfatal error. When called it is passed a string, \fImessage\fP, containing a textual description of the error. .PP Only one procedure serves as the nonfatal error handler at any one time. .PP Prior to the first call to \fBVistaIOSetWarningHandler\fP, the procedure \fBVistaIODefaultWarning\fP is the nonfatal error handler. This procedure will write the error message to the standard error stream, then return. \fBVistaIODefaultWarning\fP can be re-established as the fatal error handler at any time by calling \fBVistaIOSetWarningHandler\fP with a .SB NULL argument. .SH EXAMPLES To adopt a warning handler that writes messages both to the standard error stream and to a log file, one might do the following: .RS .PP .nf .ft B FILE *log_file; void MyWarningHandler (message) VistaIOStringConst message; { fputs (message, stderr); fputs (message, log_file); } int main (\fR...\fP) { \fR...\fP log_file = fopen ("log", "w"); VistaIOSetWarningHandler (MyWarningHandler); \fR...\fP } .fi .RE .SH "SEE ALSO" .BR VistaIOWarning (3), .BR VistaIOSetErrorHandler (3), .SH AUTHOR Art Pope Adaption to vistaio: Gert Wollny