XESetError

Syntax

int (*XESetError(display, extension, proc))()
      Display *display;
      int extension;
      int (*proc)();

Arguments

display Specifies the connection to the X server.
extension Specifies the extension number.
proc Specifies the procedure to call when an error is received.

Description

Inside Xlib, there are times that you may want to suppress the calling of the external error handling when an error occurs. This allows status to be returned on a call at the cost of the call being synchronous (though most such functions are query operations, in any case, and are typically programmed to be synchronous).

When Xlib detects a protocol error in _XReply, it calls your procedure with these arguments:


int (*proc)(display, err, codes, ret_code)
	Display *display;
	xError *err;
	XExtCodes *codes;
	int *ret_code;

The err argument is a pointer to the 32-byte wire format error. The codes argument is a pointer to the extension codes structure. The ret_code argument is the return code you may want _XReply returned to.

If your procedure returns a zero value, the error is not suppressed, and the client's error handler is called. (For further information, see "Using the Default Error Handlers".) If your procedure returns nonzero, the error is suppressed, and _XReply returns the value of ret_code.

See also

XESetBeforeFlush(), XESetCloseDisplay(), XESetCopyGC(), XESetCreateFont(), XESetCreateGC(), XESetErrorString(), XESetEventToWire(), XESetFlushGC(), XESetFreeFont(), XESetFreeGC(), XESetPrintErrorValues(), XESetWireToError(), XESetWireToEvent(), _XSetLastRequestRead(), "Hooks into the Library"
Christophe Tronche, ch@tronche.com