[Xcb-commit] xcb/src Makefile.am, 1.25, 1.26 xcb_out.c, 1.8, 1.9 xcb_xlib.c, NONE, 1.1 xcbint.h, 1.22, 1.23 xcbxlib.h, NONE, 1.1

Jamey Sharp xcb-commit at lists.freedesktop.org
Sat Dec 24 02:30:17 PST 2005


Update of /cvs/xcb/xcb/src
In directory gabe:/tmp/cvs-serv5237/src

Modified Files:
	Makefile.am xcb_out.c xcbint.h 
Added Files:
	xcb_xlib.c xcbxlib.h 
Log Message:
* src/xcb_xlib.c, src/xcbxlib.h, src/Makefile.am:
New header and two functions specifically for Xlib's use, so
we can quit installing xcbint.h.

* src/xcb_out.c, src/xcbint.h:
Now that Xlib uses entirely public API, force_sequence_wrap is
purely internal to xcb_out.


--- NEW FILE: xcb_xlib.c ---
/* Copyright (C) 2005 Bart Massey and Jamey Sharp.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * 
 * Except as contained in this notice, the names of the authors or their
 * institutions shall not be used in advertising or otherwise to promote the
 * sale, use or other dealings in this Software without prior written
 * authorization from the authors.
 */

#include "xcbxlib.h"
#include "xcbint.h"

unsigned int XCBGetRequestSent(XCBConnection *c)
{
    unsigned int ret;
    pthread_mutex_lock(&c->iolock);
    ret = c->out.request;
    pthread_mutex_unlock(&c->iolock);
    return ret;
}

pthread_mutex_t *XCBGetIOLock(XCBConnection *c)
{
    return &c->iolock;
}

Index: xcb_out.c
===================================================================
RCS file: /cvs/xcb/xcb/src/xcb_out.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- xcb_out.c	1 Apr 2005 05:51:02 -0000	1.8
+++ xcb_out.c	24 Dec 2005 10:30:15 -0000	1.9
@@ -35,6 +35,18 @@
 #include "xcbint.h"
 #include "extensions/bigreq.h"
 
+static int force_sequence_wrap(XCBConnection *c)
+{
+    int ret = 1;
+    if((c->out.request - c->in.request_read) > 65530)
+    {
+        pthread_mutex_unlock(&c->iolock);
+        ret = XCBSync(c, 0);
+        pthread_mutex_lock(&c->iolock);
+    }
+    return ret;
+}
+
 /* Public interface */
 
 CARD32 XCBGetMaximumRequestLength(XCBConnection *c)
@@ -115,7 +127,7 @@
 
     /* get a sequence number and arrange for delivery. */
     pthread_mutex_lock(&c->iolock);
-    if(req->isvoid && !_xcb_out_force_sequence_wrap(c))
+    if(req->isvoid && !force_sequence_wrap(c))
     {
         pthread_mutex_unlock(&c->iolock);
         return -1;
@@ -173,18 +185,6 @@
     free(out->vec);
 }
 
-int _xcb_out_force_sequence_wrap(XCBConnection *c)
-{
-    int ret = 1;
-    if((c->out.request - c->in.request_read) > 65530)
-    {
-        pthread_mutex_unlock(&c->iolock);
-        ret = XCBSync(c, 0);
-        pthread_mutex_lock(&c->iolock);
-    }
-    return ret;
-}
-
 int _xcb_out_write(XCBConnection *c)
 {
     int n;

Index: Makefile.am
===================================================================
RCS file: /cvs/xcb/xcb/src/Makefile.am,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- Makefile.am	30 Sep 2005 05:39:00 -0000	1.25
+++ Makefile.am	24 Dec 2005 10:30:15 -0000	1.26
@@ -38,14 +38,14 @@
 CORESOURCES = xproto.c xcb_types.c
 COREPROTO   = $(CORESOURCES) $(COREHEADERS)
 
-xcbinclude_HEADERS = xcb.h xcbext.h xcbint.h $(COREHEADERS) $(EXTHEADERS)
+xcbinclude_HEADERS = xcb.h xcbext.h xcbxlib.h $(COREHEADERS) $(EXTHEADERS)
 
 CFLAGS =
 AM_CFLAGS = -include config.h $(CDEBUGFLAGS) $(XCBPROTO_CFLAGS) $(XPROTO_CFLAGS) $(XAU_CFLAGS)
 libXCB_la_LIBADD = $(XCBPROTO_LIBS) $(XPROTO_LIBS) $(XAU_LIBS)
 libXCB_la_SOURCES = \
 		xcb_conn.c xcb_out.c xcb_in.c xcb_ext.c xcb_xid.c \
-		xcb_list.c xcb_util.c xcb_auth.c xcb_des.c \
+		xcb_list.c xcb_util.c xcb_xlib.c xcb_auth.c xcb_des.c \
 		$(COREPROTO) $(EXTENSIONS)
 
 xcb_des.c:

Index: xcbint.h
===================================================================
RCS file: /cvs/xcb/xcb/src/xcbint.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- xcbint.h	9 Apr 2005 23:58:11 -0000	1.22
+++ xcbint.h	24 Dec 2005 10:30:15 -0000	1.23
@@ -105,7 +105,6 @@
 int _xcb_out_init(_xcb_out *out);
 void _xcb_out_destroy(_xcb_out *out);
 
-int _xcb_out_force_sequence_wrap(XCBConnection *c);
 int _xcb_out_write(XCBConnection *c);
 int _xcb_out_write_block(XCBConnection *c, struct iovec *vector, size_t count);
 int _xcb_out_flush(XCBConnection *c);

--- NEW FILE: xcbxlib.h ---
/*
 * Copyright (C) 2005 Bart Massey and Jamey Sharp.
 * All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * 
 * Except as contained in this notice, the names of the authors or their
 * institutions shall not be used in advertising or otherwise to promote the
 * sale, use or other dealings in this Software without prior written
 * authorization from the authors.
 */

#ifndef __XCBXLIB_H
#define __XCBXLIB_H

#include <pthread.h>
#include "xcb.h"

unsigned int XCBGetRequestSent(XCBConnection *c);

pthread_mutex_t *XCBGetIOLock(XCBConnection *c);

#endif



More information about the xcb-commit mailing list