[xorg-commit-diffs] xc/lib/Xst Xst_util.c, 1.1.4.3,
1.1.4.4 Xst_util.h, 1.1.4.3, 1.1.4.4
Jay Hobson
xorg-commit at pdx.freedesktop.org
Wed Apr 14 14:43:02 PDT 2004
Committed by: jhobson
Update of /cvs/xorg/xc/lib/Xst
In directory pdx:/tmp/cvs-serv3867
Modified Files:
Tag: XORG-RELEASE-1-STSF
Xst_util.c Xst_util.h
Log Message:
Added new function to allow user to determine if particular XError has been
received, regardless of client or server side use.
Index: Xst_util.c
===================================================================
RCS file: /cvs/xorg/xc/lib/Xst/Attic/Xst_util.c,v
retrieving revision 1.1.4.3
retrieving revision 1.1.4.4
diff -u -d -r1.1.4.3 -r1.1.4.4
--- a/Xst_util.c 14 Apr 2004 20:56:29 -0000 1.1.4.3
+++ b/Xst_util.c 14 Apr 2004 21:43:00 -0000 1.1.4.4
@@ -216,13 +216,12 @@
void XST_Error ( Display *dpy, int iFunc, STStatus iError )
{
- extern int XSTClientErrorBase;
xError rep;
rep.errorCode = iError + XSTClientErrorBase;
rep.minorCode = iFunc;
rep.resourceID = 0;
- rep.majorCode = 182;
+ rep.majorCode = 256;
_XError ( dpy, (xError *)&rep );
}
@@ -231,7 +230,7 @@
{
extern int _XDefaultError ( Display *, XErrorEvent *);
- if ( rep->request_code == 182 )
+ if ( rep->request_code == 256 )
{
if ( rep->error_code < ST_MAX_ERROR + XSTClientErrorBase &&
rep->error_code > XSTClientErrorBase &&
@@ -250,6 +249,27 @@
_XDefaultError ( dpy, rep );
}
+int
+XSTErrorIsErrorCode ( Display *dpy, int iXErrorNum, int iSTSFerrorNum )
+{
+#ifdef USE_XST_EXTENSION
+ XSTCodes *extcodes = _XSTCodes ( dpy );
+#endif
+
+ if ( extcodes )
+ {
+ if ( iXErrorNum == iSTSFerrorNum + extcodes->codes->first_error )
+ return 1;
+ }
+ else
+ {
+ if ( iXErrorNum == iSTSFerrorNum + XSTClientErrorBase )
+ return 1;
+ }
+
+ return 0;
+}
+
void
XSTHandleClientErrors ( Display *dpy )
{
Index: Xst_util.h
===================================================================
RCS file: /cvs/xorg/xc/lib/Xst/Attic/Xst_util.h,v
retrieving revision 1.1.4.3
retrieving revision 1.1.4.4
diff -u -d -r1.1.4.3 -r1.1.4.4
--- a/Xst_util.h 14 Apr 2004 20:56:29 -0000 1.1.4.3
+++ b/Xst_util.h 14 Apr 2004 21:43:00 -0000 1.1.4.4
@@ -75,6 +75,8 @@
int XSTClientErrorHandler ( Display *dpy, XErrorEvent *rep );
+int
+XSTErrorIsErrorCode ( Display *dpy, int iXErrorNum, int iSTSFerrorNum );
/**
*
* @param dpy Display
More information about the xorg-commit-diffs
mailing list