Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XtErrorHand(3x) — HP-UX 9.10

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XtAppError(1)

XtAppSetErrorHandler(1)

XtAppSetWarningHandler(1)

XtAppWarning(1)

XtErrorMsgHandler(1)

 

NAME

XtErrorHandler − interface definition for low-level error and warning handler procedures. 

Synopsis

typedef void (*XtErrorHandler)(String);

    String message;

Inputs

messageSpecifies the error message. 

Description

An XtErrorHandler is registered as an error or warning handler with XtAppSetErrorHandler() or XtAppSetWarningHandler().  It is invoked by XtAppError() or XtAppError().  The error handler should display the specified string in some appropriate fashion.  Some applications may wish to log errors to a file as well.  Error handlers should exit; warning handlers should return.  See XtErrorMsgHandler(2) for a description of the high-level error and warning handler procedure. 

Example

The Intrinsics default error and warning handlers are shown below.  The XTERROR_PREFIX and XTWARNING_PREFIX symbols are by default the empty string in the MIT implementation, but may be configured when the Intrinsics are compiled. 

void _XtDefaultError(message)
    String message;
{
    extern void exit();
     (void)fprintf(stderr, "%sError: %s0, XTERROR_PREFIX, message);
    exit(1);
}
 void _XtDefaultWarning(message)
    String message;
{
    if (message && *message)
       (void)fprintf(stderr, "%sWarning: %s0, XTWARNING_PREFIX, message);
    return;
}

See Also

XtAppError(1), XtAppSetErrorHandler(1), XtAppSetWarningHandler(1), XtAppWarning(1),
XtErrorMsgHandler(1). 

Copyright O’Reilly & Assoc.  —  X Toolkit Intrinsics Reference Manual © O’Reilly & Associates

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026