XGetErrorDatabaseText()XGetErrorDatabaseText()NameXGetErrorDatabaseText – 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 XProtoEr‐
ror, XlibMessage, or XRequest (see the "Description" sec‐
tion 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.
DescriptionXGetErrorDatabaseText() returns a message from the error message data‐
base. Given name and message as keys, XGetErrorDatabaseText() uses the
resource manager to look up a string and returns it in the buffer argu‐
ment. Xlib uses this function internally to look up its error mes‐
sages. 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 mes‐
sage 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 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 AlsoXDisplayName(), XGetErrorText(), XSetAfterFunction(), XSetErrorHan‐
dler(), XSetIOErrorHandler(), XSynchronize().
Xlib - Error Handling XGetErrorDatabaseText()