XGetErrorDatabaseText() XGetErrorDatabaseText()
Name
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
display Specifies a connection to an X server; returned from XOpenDisplay().
name Specifies the name of the application.
message Specifies the type of the error message. One of XProtoError, XlibMessage, or XRequest (see the "Description" section below).
default_string
Specifies the default error message.
buffer_return
Returns the error description. You allocate this memory.
length Specifies 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 prede-
fined message types are used by Xlib to report errors:
XProtoError The protocol error number is used as a string for the message argument.
XlibMessage These are the message strings that are used internally by Xlib.
XRequest For 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 mes-
sage 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
XDisplayName(), XGetErrorText(), XSetAfterFunction(), XSetErrorHandler(), XSetIOErrorHandler(), XSynchronize().
Xlib - Error Handling XGetErrorDatabaseText()