[comp.windows.x] Need Help on XESetErrorString

ksung@uiucdcsm.cs.uiuc.edu (06/17/88)

I'm working on a X-Extension, and here is a problem with ErrorString
hook into the Xlib.

Can someone help me with <XESetErrorString> ?

The C binding Xlib has a very confusing decription, which I couldn't
understand. (AppendixA in X11R1 1 and appendixD in X11R2)

Xlib seemed to suggest that XESetErrorString sets the function 
to be called when there is an I/O error, and XESetFlushGC sets
the function to be called when application calls XGetErrorText.

but I looked at the source code of

	XESetErrorString in 	./lib/X/XInitExt.c  	and
	XGetErrorText  	 in	./lib/X/XErrDes.c 

seems to me XESetErrorString is setting the function to be
called when XGetErrorText is called. Then what's XESetFlushGC do, 
and how to set the function to be called when there are I/O errors?

Thanks in advance.

ksung@m.cs.uiuc.edu
	

RWS@ZERMATT.LCS.MIT.EDU (Robert Scheifler) (06/17/88)

The I/O error handler is controlled with XSetIOErrorHandler.
This cannot be controlled per-extension.

XESetErrorString is for generating error strings for new errors defined
by extensions.  It is not for I/O errors (the comment in Xlib is
incorrect).  Note that *all* handlers are called for *every* error, even
core ones; your handler needs to check the error code to see if it is
"yours" and generally do nothing if it isn't.

XESetFlushGC is used to define a handler to be called whenever Xlib
forces its internal cached state of a GC out to the server.  It has
nothing to do with errors.