Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

XGetErrorDatabaseText − obtain error messages from the error database. 

Synopsis

XGetErrorDatabaseText(display, name, message,

default_string, buffer_return, length)
Display display;
char *name, *message;
char *default_string;
char *buffer_return;
int length;

Arguments

displaySpecifies a connection to an X server; returned from XOpenDisplay(). 

nameSpecifies the name of the application. 

messageSpecifies the type of the error message. One of XProtoError, XlibMessage, or XRequest (see Description below). 

default_string
Specifies the default error message.

bufferReturns the error description. 

lengthSpecifies the size of the return buffer. 

Description

XGetErrorDatabaseText() returns a message from the error message database.  Given name and message as keys, XGetErrorDatabaseText() uses the resource manager to look up a string and returns it in the buffer argument.  Xlib uses this function internally to look up its error messages.  On a UNIX-based system, the error message database is usually /usr/lib/X11/XErrorDB.  The name argument should generally be the name of your application.  The message argument should indicate which type of error message you want.  If the name and message are not in the Host Portable Character Encoding, then the result is implementation-dependent.  Three predefined message types are used by Xlib to report errors:

XProtoErrorThe protocol error number is used as a string for the message argument. 

XlibMessageThese are the message strings that are used internally by Xlib. 

XRequestFor a core protocol request, the major request protocol number is used for the message argument.  For an extension request, the extension name (as given by InitExtension) followed by a period (.) and the minor request protocol number is used for the message argument.  If no string is found in the error database, XGetErrorDatabaseText() returns the default_string that you specify to the buffer.  The string in buffer will be of length length.  The default_string is assumed to be in the encoding of the current locale.  The buffer_return text is in the encoding of the current locale. 

See Also

XGetErrorText(), XSetAfterFunction(), XSetErrorHandler(), XSetIOErrorHandler(), XSynchronize(). 

Copyright O’Reilly & Assoc.  —  

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