[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xlibs-commit
Subject:    [xlibs-commit] X11/src xclint.h,1.1,3.1 ClDisplay.c,1.7,1.8 Makefile.am,1.20,1.21 OpenDis.c,3.19,3.2
From:       Jamey Sharp <xlibs-commit () pdx ! freedesktop ! org>
Date:       2003-11-28 10:49:46
Message-ID: E1APgC2-000055-Dk () pdx ! freedesktop ! org
[Download RAW message or body]

Committed by: jamey

Update of /cvs/xlibs/X11/src
In directory pdx:/tmp/cvs-serv32471/src

Modified Files:
	ClDisplay.c Makefile.am OpenDis.c Xintconn.h XlibInt.c 
Added Files:
	xclint.h 
Log Message:
A better-tested version of XCL is now available as a configure-time option.
Unlike the version that was on the XCL branch, this removes no code from CVS;
but when --with-xcb is given to configure, the old code is simply not compiled.
The new code is isolated in the xcl subdirectory.

Note that this version of XCL requires the XCB version with the pre_sendrequest
tag. Versions newer than that have API changes that XCL needs to track, but I
wanted to commit the conditional compile patches first.



Index: ClDisplay.c
===================================================================
RCS file: /cvs/xlibs/X11/src/ClDisplay.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- ClDisplay.c	27 Oct 2003 06:03:00 -0000	1.7
+++ ClDisplay.c	28 Nov 2003 10:49:43 -0000	1.8
@@ -29,7 +29,11 @@
 */
 /* $XFree86: xc/lib/X11/ClDisplay.c,v 1.4 2001/12/14 19:53:58 dawes Exp $ */
 
+#if !USE_XCB
 #include "x11_trans.h"
+#else /* USE_XCB */
+#include "xclint.h"
+#endif /* USE_XCB */
 #include "Xlib.h"
 #include "Xlibint.h"
 #include "Xintconn.h"
@@ -67,7 +71,11 @@
 	    if (dpy->request != dpy->last_request_read)
 		XSync(dpy, 1);
 	}
+#if !USE_XCB
 	_XDisconnectDisplay(dpy->trans_conn);
+#else /* USE_XCB */
+	XCBDisconnect(XCBConnectionOfDisplay(dpy));
+#endif /* USE_XCB */
 	_XFreeDisplayStructure (dpy);
 	return 0;
 }

Index: Makefile.am
===================================================================
RCS file: /cvs/xlibs/X11/src/Makefile.am,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- Makefile.am	31 Oct 2003 23:43:06 -0000	1.20
+++ Makefile.am	28 Nov 2003 10:49:43 -0000	1.21
@@ -215,8 +215,7 @@
                   lcUniConv/utf8.h \
                   lcUniConv/viscii.h
 
-X11_SRCS=         x11_trans.c \
-                  x11_trans.h \
+X11_SRCS= \
                   AllCells.c \
                   AllPlanes.c \
                   AllowEv.c \
@@ -248,7 +247,6 @@
                   Clear.c \
                   ClearArea.c \
                   ConfWind.c \
-                  ConnDis.c \
                   Context.c \
                   ConvSel.c \
                   CopyArea.c \
@@ -496,6 +494,17 @@
 
 libX11_la_SOURCES = $(X11_SRCS)
 
+if XCB
+libX11_la_SOURCES += \
+                  xcl/display.c \
+                  xcl/io.c
+else
+libX11_la_SOURCES += \
+                  x11_trans.c \
+                  x11_trans.h \
+                  ConnDis.c
+endif
+
 if DISABLE_XLOCALE
 libX11_la_SOURCES+= X18NCMSstubs.c 
 else

Index: OpenDis.c
===================================================================
RCS file: /cvs/xlibs/X11/src/OpenDis.c,v
retrieving revision 3.19
retrieving revision 3.20
diff -u -d -r3.19 -r3.20
--- OpenDis.c	27 Oct 2003 06:03:00 -0000	3.19
+++ OpenDis.c	28 Nov 2003 10:49:43 -0000	3.20
@@ -29,7 +29,11 @@
 #define NEED_REPLIES
 #define NEED_EVENTS
 #include "Xlibint.h"
+#if !USE_XCB
 #include "x11_trans.h"
+#else /* USE_XCB */
+#include "xclint.h"
+#endif /* USE_XCB */
 #include <X11/Xatom.h>
 #include <X11/Xresource.h>
 #include <X11/extensions/bigreqstr.h>
@@ -40,6 +44,7 @@
 #include "XKBlib.h"
 #endif /* XKB */
 
+#if !USE_XCB
 #ifdef X_NOT_POSIX
 #define Size_t unsigned int
 #else
@@ -52,6 +57,7 @@
     unsigned long seq;
     int opcode;
 } _XBigReqState;
+#endif /* !USE_XCB */
 
 #ifdef WIN32
 int *_Xdebug_p = &_Xdebug;
@@ -74,8 +80,10 @@
 };
 
 static void OutOfMemory(Display *dpy, char *setup);
+#if !USE_XCB
 static Bool _XBigReqHandler(Display *dpy, xReply *rep, char *buf, int len,
 				XPointer data);
+#endif /* !USE_XCB */
 
 /* 
  * Connects to a server, creates a Display object and returns a pointer to
@@ -91,16 +99,21 @@
 {
 	register Display *dpy;		/* New Display object being created. */
 	register int i;
+#if !USE_XCB
 	int j, k;			/* random iterator indexes */
 	char *display_name;		/* pointer to display name */
 	int endian;			/* to determine which endian. */
 	xConnClientPrefix client;	/* client information */
 	xConnSetupPrefix prefix;	/* prefix information */
 	int vendorlen;			/* length of vendor string */
+#endif /* !USE_XCB */
 	char *setup = NULL;		/* memory allocated at startup */
 	char *fullname = NULL;		/* expanded name of display */
+#if !USE_XCB
 	int idisplay;			/* display number */
+#endif /* !USE_XCB */
 	int iscreen;			/* screen number */
+#if !USE_XCB
 	int prefixread = 0;             /* setup prefix already read? */
 	union {
 		xConnSetup *setup;
@@ -116,9 +129,11 @@
 	char *conn_auth_name, *conn_auth_data;
 	int conn_auth_namelen, conn_auth_datalen;
 	unsigned long mask;
+#endif /* !USE_XCB */
        long int conn_buf_size;
        char *xlib_buffer_size;
 
+#if !USE_XCB
 	bzero((char *) &client, sizeof(client));
 	bzero((char *) &prefix, sizeof(prefix));
 
@@ -136,6 +151,8 @@
 		/* Display is non-NULL, copy the pointer */
 		display_name = (char *)display;
 	}
+#endif /* !USE_XCB */
+
 /*
  * Set the default error handlers.  This allows the global variables to
  * default to NULL for use with shared libraries.
@@ -156,6 +173,7 @@
  * will set fullname to point to the expanded name.
  */
 
+#if !USE_XCB
 	if ((dpy->trans_conn = _X11TransConnectDisplay (
 					 display_name, &fullname, &idisplay,
 					 &iscreen, &conn_auth_name,
@@ -166,6 +184,12 @@
 	}
 
 	dpy->fd = _X11TransGetConnectionNumber (dpy->trans_conn);
+#else /* USE_XCB */
+	if(!_XConnectXCB(dpy, display, &fullname, &iscreen)) {
+		OutOfMemory(dpy, 0);
+		return 0;
+	}
+#endif /* USE_XCB */
 
 	/* Initialize as much of the display structure as we can.
 	 * Initialize pointers to NULL so that XFreeDisplayStructure will
@@ -282,6 +306,7 @@
 	    return(NULL);
 	}
 
+#if !USE_XCB
 /*
  * The xConnClientPrefix describes the initial connection setup information
  * and is followed by the authorization information.  Sites that are interested
@@ -595,6 +620,12 @@
  */
 
 	Xfree (setup);	/* all finished with setup information */
+#else /* USE_XCB */
+	if(!_XConnectSetupXCB(dpy)) {
+		OutOfMemory(dpy, 0);
+		return 0;
+	}
+#endif /* USE_XCB */
 
 /*
  * Make sure default screen is legal.
@@ -636,11 +667,12 @@
  */
 	LockDisplay(dpy);
 	{
+	    xGetPropertyReply reply;
+	    xGetPropertyReq *req;
+#if !USE_XCB
 	    _XAsyncHandler async;
 	    _XBigReqState async_state;
 	    xQueryExtensionReq *qreq;
-	    xGetPropertyReply reply;
-	    xGetPropertyReq *req;
 	    xBigReqEnableReq *breq;
 	    xBigReqEnableReply brep;
 
@@ -654,6 +686,7 @@
 	    qreq->nbytes = bignamelen;
 	    qreq->length += (bignamelen+3)>>2;
 	    Data(dpy, XBigReqExtensionName, bignamelen);
+#endif /* !USE_XCB */
 
 	    GetReq (GetProperty, req);
 	    req->window = RootWindow(dpy, 0);
@@ -674,6 +707,7 @@
 		else if (reply.propertyType != None)
 		    _XEatData(dpy, reply.nItems * (reply.format >> 3));
 	    }
+#if !USE_XCB
 	    DeqAsyncHandler(dpy, &async);
 	    if (async_state.opcode) {
 		GetReq(BigReqEnable, breq);
@@ -682,6 +716,7 @@
 		if (_XReply(dpy, (xReply *)&brep, 0, xFalse))
 		    dpy->bigreq_size = brep.max_request_size;
 	    }
+#endif /* !USE_XCB */
 	}
 	UnlockDisplay(dpy);
 
@@ -700,6 +735,7 @@
  	return(dpy);
 }
 
+#if !USE_XCB
 static Bool
 _XBigReqHandler(dpy, rep, buf, len, data)
     register Display *dpy;
@@ -725,6 +761,7 @@
 	state->opcode = repl->major_opcode;
     return True;
 }
+#endif /* !USE_XCB */
 
 
 /* XFreeDisplayStructure frees all the storage associated with a 
@@ -851,6 +888,12 @@
 	if (dpy->filedes)
 	    Xfree (dpy->filedes);
 
+#if USE_XCB
+	/* reply_data was allocated by system malloc, not Xmalloc */
+	free(dpy->xcl->reply_data);
+	Xfree(dpy->xcl);
+#endif /* USE_XCB */
+
 	Xfree ((char *)dpy);
 }
 
@@ -861,7 +904,11 @@
     Display *dpy;
     char *setup;
 {
+#if !USE_XCB
     _XDisconnectDisplay (dpy->trans_conn);
+#else /* USE_XCB */
+    XCBDisconnect(XCBConnectionOfDisplay(dpy));
+#endif /* USE_XCB */
     _XFreeDisplayStructure (dpy);
     if (setup) Xfree (setup);
 }

Index: Xintconn.h
===================================================================
RCS file: /cvs/xlibs/X11/src/Xintconn.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Xintconn.h	13 Apr 2003 19:22:19 -0000	1.2
+++ Xintconn.h	28 Nov 2003 10:49:43 -0000	1.3
@@ -7,6 +7,7 @@
 
 _XFUNCPROTOBEGIN
 
+#if !USE_XCB
 /* ConnDis.c */
 
 int _XConnectDisplay (
@@ -27,6 +28,7 @@
 				int *screenp, char **auth_namep,
 				int *auth_namelenp, char **auth_datap,
 				int *auth_datalenp);
+#endif /* !USE_XCB */
 
 /* OpenDis.c */
 extern void _XFreeDisplayStructure(Display *dpy);

Index: XlibInt.c
===================================================================
RCS file: /cvs/xlibs/X11/src/XlibInt.c,v
retrieving revision 3.42
retrieving revision 3.43
diff -u -d -r3.42 -r3.43
--- XlibInt.c	1 Nov 2003 00:33:15 -0000	3.42
+++ XlibInt.c	28 Nov 2003 10:49:43 -0000	3.43
@@ -39,9 +39,13 @@
 #include "config.h"
 #endif
 #include "Xlibint.h"
+#if !USE_XCB
 #include "x11_trans.h"
+#endif /* !USE_XCB */
 #include <X11/Xpoll.h>
+#if !USE_XCB
 #include <X11/extensions/xcmiscstr.h>
+#endif /* !USE_XCB */
 #include <stdio.h>
 
 #ifdef XTHREADS
@@ -70,6 +74,7 @@
 
 #define XThread_Self()	((*_Xthread_self_fn)())
 
+#if !USE_XCB
 #define UnlockNextReplyReader(d) if ((d)->lock) \
     (*(d)->lock->pop_reader)((d),&(d)->lock->reply_awaiters,&(d)->lock->reply_awaiters_tail)
 
@@ -85,12 +90,15 @@
 #define InternalLockDisplay(d,wskip) if ((d)->lock) \
     (*(d)->lock->internal_lock_display)(d,wskip)
 #endif
+#endif /* !USE_XCB */
 
 #else /* XTHREADS else */
 
+#if !USE_XCB
 #define UnlockNextReplyReader(d)   
 #define UnlockNextEventReader(d)
 #define InternalLockDisplay(d,wskip)
+#endif /* !USE_XCB */
 
 #endif /* XTHREADS else */ 
 
@@ -145,11 +153,14 @@
 #endif
 
 #ifdef __UNIXOS2__
+#if !USE_XCB
 #define select(n,r,w,x,t) os2ClientSelect(n,r,w,x,t)
+#endif /* !USE_XCB */
 #include <limits.h>
 #define MAX_PATH _POSIX_PATH_MAX
 #endif
 
+#if !USE_XCB
 #ifdef MUSTCOPY
 
 #define STARTITERATE(tpvar,type,start,endcond) \
@@ -188,6 +199,7 @@
 static void _XProcessInternalConnection(
     Display *dpy,
     struct _XConnectionInfo *conn_info);
+#endif /* !USE_XCB */
 
 #define SEQLIMIT (65535 - (BUFSIZE / SIZEOF(xReq)) - 10)
 
@@ -209,6 +221,7 @@
  * the object they have created.
  */
 
+#if !USE_XCB
 static xReq _dummy_request = {
 	0, 0, 0
 };
@@ -361,6 +374,7 @@
 	}
     }
 }
+#endif /* !USE_XCB */
 
 
 #define POLLFD_CACHE_SIZE 5
@@ -418,6 +432,7 @@
 #endif
 }
 
+#if !USE_XCB
 /* returns True iff there is an event in the queue newer than serial_num */
 
 static Bool
@@ -1104,6 +1119,7 @@
 #endif /* XTHREADS*/
 	return 0;
 }
+#endif /* !USE_XCB */
 
 #ifdef LONG64
 void _XRead32(
@@ -1245,6 +1261,7 @@
 #endif /* WORD64 */
 
 
+#if !USE_XCB
 /*
  * _XReadPad - Read bytes from the socket taking into account incomplete
  * reads.  If the number of bytes is not 0 mod 4, read additional pad
@@ -1920,6 +1937,7 @@
     }
     return nbuf;
 }
+#endif /* !USE_XCB */
 
 /*
  * Support for internal connections, such as an IM might use.
@@ -2255,6 +2273,7 @@
 /* end of internal connections support */
 
 
+#if !USE_XCB
 /* Read and discard "n" 8-bit bytes of data */
 
 void _XEatData(
@@ -2271,6 +2290,7 @@
     }
 #undef SCRATCHSIZE
 }
+#endif /* !USE_XCB */
 
 
 /*



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic