error(3w) — OLIT Widget Set
NAME
OlError, OlWarning, OlVaDisplayErrorMsg, OlVaDisplayWarningMsg, OlSetErrorHandler, OlSetWarningHandler, OlSetVaDisplayErrorMsgHandler, OlSetVaDisplayWarningMsgHandler − error and warning message handling
SYNOPSIS AND DESCRIPTION
The following functions offer varying error and warning message services.
NOTE
Most programs should not use OlError and OlWarning since they don’t allow for customization or internationalization.
Since OpenLook.h does not include stdarg.h (or varargs.h), an application using OlSetVaDisplayErrorMsgHandler or OlSetVaDisplayWarningMsgHandler should include one of these two headers before including OpenLook.h to insure the correct function prototype will be used for the application’s error/warning handler.
OlError
Synopsis:
#include <X11/Intrinsic.h>
#include <Xol/OpenLook.h>
. . .
void OlError(
String msg);
OlError writes a simple string to stderr and then exits.
OlWarning
Synopsis:
#include <X11/Intrinsic.h>
#include <Xol/OpenLook.h>
. . .
void OlWarning(
String msg);
OlWarning writes a simple string to stderr and then returns.
OlVaDisplayErrorMsg
Synopsis:
#include <X11/Intrinsic.h>
#include <Xol/OpenLook.h>
. . .
void OlVaDisplayErrorMsg(
Display ∗dpy,
String name,
String type,
String class,
String default_msg,);
OlVaDisplayErrorMsg writes an error to stderr and exits. The error message is looked up in the error database by calling XtAppGetErrorDatabaseText using the name, type, and class arguments. If no message is found in the error database, the default_msg string is used. The application context is determined by calling XtDisplayToApplicationContext with the supplied Display pointer. If the display pointer is NULL, the display created at application startup is used to determine the application context.
OlVaDisplayWarningMsg
Synopsis:
#include <X11/Intrinsic.h>
#include <Xol/OpenLook.h>
. . .
void OlVaDisplayWarningMsg(
Display ∗dpy,
String name,
String type,
String class,
String default_msg,);
OlVaDisplayWarningMsg has the same semantics as OlVaDisplayErrorMsg except it returns instead of exiting.
OlSetErrorHandler
Synopsis:
#include <X11/Intrinsic.h>
#include <Xol/OpenLook.h>
. . .
OlErrorHandler OlSetErrorHandler(
OlErrorHandler handler);
OlSetErrorHandler, OlSetWarningHandler, OlSetVaDisplayErrorMsgHandler, and OlSetVaDisplayWarningMsgHandler allow an application to override the various warning and error handlers. These routines return a pointer to the previous handler. If NULL is supplied to any of these routines, the default handler will be used.
Since the error routines normally exit the program, application-supplied error handlers should do the same since continuation of an application will result in undefined behavior.
OlSetWarningHandler
Synopsis:
#include <X11/Intrinsic.h>
#include <Xol/OpenLook.h>
. . .
OlWarningHandler OlSetWarningHandler(
OlWarningHandler handler);
See OlSetErrorHandler above.
OlSetVaDisplayErrorMsgHandler
Synopsis:
#include <X11/Intrinsic.h>
#include <Xol/OpenLook.h>
. . .
OlVaDisplayErrorMsgHandler OlSetVaDisplayErrorMsgHandler(
OlVaDisplayErrorMsgHandler handler);
See OlSetErrorHandler above.
OlSetVaDisplayWarningMsgHandler
Synopsis:
#include <X11/Intrinsic.h>
#include <Xol/OpenLook.h>
. . .
OlVaDisplayWarningMsgHandler OlSetVaDisplayWarningMsgHandler(
OlVaDisplayWarningMsgHandler handler);
See OlSetErrorHandler above.
OlErrorHandler
Synopsis:
#include <X11/Intrinsic.h>
#include <Xol/OpenLook.h>
. . .
typedef void (∗OlErrorHandler)(
String msg);
OlWarningHandler
Synopsis:
#include <X11/Intrinsic.h>
#include <Xol/OpenLook.h>
. . .
typedef void (∗OlWarningHandler)(
String msg);
OlVaDisplayErrorMsgHandler
Synopsis:
#include <X11/Intrinsic.h>
#include <Xol/OpenLook.h>
. . .
typedef void (∗OlVaDisplayErrorMsgHandler)(
Display ∗dpy,
String name,
String type,
String class,
String default_msg,
va_list ap);
OlVaDisplayWarningMsgHandlerr
Synopsis:
#include <X11/Intrinsic.h>
#include <Xol/OpenLook.h>
. . .
typedef void (∗OlVaDisplayWarningMsgHandler)(
Display ∗dpy,
String name,
String type,
String class,
String default_msg,
va_list ap);
Version 3.0 — Last change: 19 July 91