VISTAIOSETWARNINGHANDLER(3)
π VistaIOSetWarningHandler β Library Functions Manual π
okay bestie, gather round, because we're about to talk about how you tell vistaio what to do when something goes slightly wrong but not, like, catastrophic. this is VistaIOSetWarningHandler(3) and she's giving "let me set up my warning handler" energy β¨
πΈ NAME πΈ
VistaIOSetWarningHandler β register a procedure to be called on any nonfatal error π«Ά
β¨ SYNOPSIS β¨
void VistaIOSetWarningHandler (VistaIOWarningHandler *handler)
typedef void VistaIOWarningHandler (VistaIOStringConst message);
void VistaIODefaultWarning (VistaIOStringConst message);
π ARGUMENTS π
handlerβ this is the new nonfatal error handler you're handing over. the new main character, if you will πmessageβ a null-terminated error message string that's getting reported. yes it's a string, yes it ends in a null, no we don't make the rules π
π¦ DESCRIPTION π¦
so like, VistaIOSetWarningHandler registers a procedure β that's your handler β as the nonfatal error handler. that procedure gets called by VistaIOWarning(3) or by VistaIOSystemWarning(3) whenever there's a nonfatal error to report. and when it gets called? it's passed a string, message, that contains a textual description of whatever went wrong. lowkey iconic behavior π
only one procedure can serve as the nonfatal error handler at any one time. one. singular. no polycule of handlers, sorry π
before the very first call to VistaIOSetWarningHandler, the procedure VistaIODefaultWarning is the nonfatal error handler. what does she do? she writes the error message to the standard error stream, then returns. that's it. no notes. π
heads up bestie:VistaIODefaultWarningcan be re-established as the fatal error handler at any time β literally any time β by callingVistaIOSetWarningHandlerwith aNULLargument. yes, it says "fatal" there. we're keeping it exactly as the manpage says it, periodt π
π EXAMPLES π
so say you want a warning handler that writes messages both to the standard error stream and to a log file. you might do the following, no cap:
FILE *log_file;
void MyWarningHandler (message)
VistaIOStringConst message;
{
fputs (message, stderr);
fputs (message, log_file);
}
int main (...)
{
...
log_file = fopen ("log", "w");
VistaIOSetWarningHandler (MyWarningHandler);
...
}
see how she's just vibing? fputs twice, once to stderr, once to log_file, and the handler is registered in main. obsessed. π
π SEE ALSO π
VistaIOWarning(3)VistaIOSetErrorHandler(3)
π AUTHOR π
- Art Pope
<pope@cs.ubc.ca> - Adaption to vistaio: Gert Wollny
<gw.fossdev@gmail.com>
and that's the whole page, bestie!! this was VistaIO Version 1.2.14, dated 16 February 1994 β yeah she's vintage, she's an elder, and she still slays π
β¨ thanks for reading VistaIOSetWarningHandler(3), mwah π«Άπ
π¦ where this page comes from
- debian bookworm: libvistaio-dev 1.2.19-3 Β· libvista-orig
- debian trixie: libvistaio-dev 1.2.19-3+b2 Β· libvista-orig
- ubuntu jammy: libvistaio-dev 1.2.19-3 Β· libvista-orig
- ubuntu noble: libvistaio-dev 1.2.19-3 Β· libvista-orig
- ubuntu questing: libvistaio-dev 1.2.19-4
- ubuntu resolute: libvistaio-dev 1.2.19-4build1 Β· libvista-orig
- ubuntu stonking: libvistaio-dev 1.2.19-4build1 Β· libvista-orig
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms