logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

VistaIOSetErrorHandler - register a procedure to be called on any fatal error

Arguments

handler   Specifies the new fatal error handler.

       message   Specifies a null-terminated error message string to be reported.

Author

       Art Pope <pope@cs.ubc.ca>

       Adaption to vistaio: Gert Wollny <gw.fossdev@gmail.com>

VistaIO Version 1.2.14                          16 February 1994                       VistaIOSetErrorHandler(3)

Description

VistaIOSetErrorHandler  registers  a  procedure,  handler,  as the fatal error handler. That procedure is
       called by VistaIOError(3) or by VistaIOSystemError(3) to report any  fatal  error.  When  called,  it  is
       passed a string, message, containing a textual description of the error.

       Only one procedure serves as the fatal error handler at any one time.

       Prior  to  the first call to VistaIOSetErrorHandler, the procedure VistaIODefaultError is the fatal error
       handler. This procedure will write the error message to the standard error  stream,  then  terminate  the
       program  by  calling  exit(3) with a status value of 1.  VistaIODefaultError can be re-established as the
       fatal error handler at any time by calling VistaIOSetErrorHandler with a NULL argument.

Examples

       To adopt an error handler that writes messages both to the standard error stream and to a log  file,  one
       might do the following:

              FILE*log_file;voidMyErrorHandler(message)VistaIOStringConstmessage;{fputs(message,stderr);fputs(message,log_file);exit(1);}intmain(...){
                   ...
                   log_file=fopen("log","w");VistaIOSetErrorHandler(MyErrorHandler);
                   ...
              }

Name

       VistaIOSetErrorHandler - register a procedure to be called on any fatal error

Return Values

       A fatal error handler should never return.

See Also

VistaIOError(3), VistaIOSetWarningHandler(3),

Synopsis

voidVistaIOSetErrorHandler(VistaIOErrorHandler*handler);typedefvoidVistaIOErrorHandler(VistaIOStringConstmessage);voidVistaIODefaultError(VistaIOStringConstmessage);

See Also