12.07.2015 Views

Xlib − C Language X Interface

Xlib − C Language X Interface

Xlib − C Language X Interface

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Xlib</strong> − C LibraryX11, Release 6.7 DRAFTBool (*XESetWireToError(display, error_number, proc)( )Display *display;int error_number;Bool (*proc)( );displayerror_numberprocSpecifies the connection to the X server.Specifies the error code.Specifies the procedure to call when an error is received.The XESetWireToError function defines a procedure to be called when an extension error needsto be converted from wire format to host format. The error number defines which protocol errorcode to install the conversion procedure for. XESetWireToError returns any previously definedprocedure.Use this function for extension errors that contain additional error values beyond those in a core Xerror, when multiple wire errors must be combined into a single <strong>Xlib</strong> error, orwhen it is necessaryto intercept an X error before it is otherwise examined.When <strong>Xlib</strong> needs to convert an error from wire format to host format, the procedure is called withthese arguments:Bool (*proc)(display, he, we)Display *display;XErrorEvent *he;xError *we;The he argument is a pointer to where the host format error should be stored. The structurepointed at by he is guaranteed to be as large as an XEvent structure and so can be cast to a typelarger than an XErrorEvent to store additional values. If the error is to be completely ignoredby <strong>Xlib</strong> (for example, several protocol error structures will be combined into one <strong>Xlib</strong> error), thenthe function should return False; otherwise, it should return True.int (*XESetError(display, extension, proc))( )Display *display;int extension;int (*proc)( );displayextensionprocSpecifies the connection to the X server.Specifies the extension number.Specifies the procedure to call when an error is received.Inside <strong>Xlib</strong>, there are times that you may want to suppress the calling of the external error handlingwhen an error occurs. This allows status to be returned on a call at the cost of the call beingsynchronous (though most such functions are query operations, in any case, and are typically programmedto be synchronous).When <strong>Xlib</strong> detects a protocol error in _XReply, itcalls your procedure with these arguments:446

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!