From fc577b81bfeb79bb78ee529278ed52d59d489f89 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Tue, 21 Mar 2006 14:22:21 -0800 Subject: [PATCH 01/18] Remove outdated fd.o-* entries from */debian/.gitignore (obsolete since before they came from .cvsignore). --- debian/.gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/.gitignore b/debian/.gitignore index cad8b05..a6db18d 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -1,6 +1,5 @@ compat copyright -fd.o-* stamp-* tmp files From 66a88ed0e556ca869ddc9df5a35e3d6446d12b02 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 9 Apr 2006 19:19:12 -0700 Subject: [PATCH 02/18] Remove unnecessary include. Noticed by jamey. --- src/xcb_util.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/xcb_util.c b/src/xcb_util.c index 93e180c..343e21f 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -27,7 +27,6 @@ #include #include -#include #include #include #include From 8275ac3a4a23220b5c3b4f191a45befe2d34d6bd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 9 Apr 2006 19:51:10 -0700 Subject: [PATCH 03/18] Retry a select() if it returns with EINTR. Fixes IO errors in Xephyr, which is often interrupted by timers. --- src/xcb_conn.c | 6 +++++- src/xcb_in.c | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/xcb_conn.c b/src/xcb_conn.c index 1e93137..95b5fa2 100644 --- a/src/xcb_conn.c +++ b/src/xcb_conn.c @@ -253,7 +253,11 @@ int _xcb_conn_wait(XCBConnection *c, pthread_cond_t *cond, struct iovec **vector } pthread_mutex_unlock(&c->iolock); - ret = select(c->fd + 1, &rfds, &wfds, 0, 0) > 0; + do { + ret = select(c->fd + 1, &rfds, &wfds, 0, 0); + } while (ret == -1 && errno == EINTR); + if (ret < 0) + ret = 0; pthread_mutex_lock(&c->iolock); if(ret) diff --git a/src/xcb_in.c b/src/xcb_in.c index fa13e90..76f9702 100644 --- a/src/xcb_in.c +++ b/src/xcb_in.c @@ -229,7 +229,9 @@ static int read_block(const int fd, void *buf, const size_t len) fd_set fds; FD_ZERO(&fds); FD_SET(fd, &fds); - ret = select(fd + 1, &fds, 0, 0, 0); + do { + ret = select(fd + 1, &fds, 0, 0, 0); + } while (ret == -1 && errno == EINTR); } if(ret <= 0) return ret; From ff38c17c48c271847d12c81cbf80142c6918dc78 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 15 Apr 2006 12:26:03 -0700 Subject: [PATCH 04/18] Split all non-essential extensions into their own separate libraries, named libXCBextname. To use extension extname, include extname.h and link with -lXCBextname. This allows extensions to change without bumping the main libXCB version. bigreq and xc_misc remain in libXCB, because XCB uses them internally to make big requests and to allocate XIDs, respectively. --- src/Makefile.am | 64 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 41c261e..ffb70b9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,21 @@ -lib_LTLIBRARIES = libXCB.la +lib_LTLIBRARIES = libXCB.la \ + libXCBcomposite.la \ + libXCBdamage.la \ + libXCBdpms.la \ + libXCBglx.la \ + libXCBrandr.la \ + libXCBrecord.la \ + libXCBrender.la \ + libXCBres.la \ + libXCBshape.la \ + libXCBshm.la \ + libXCBsync.la \ + libXCBxevie.la \ + libXCBxf86dri.la \ + libXCBxfixes.la \ + libXCBxprint.la \ + libXCBxv.la \ + libXCBxvmc.la EXTHEADERS = \ extensions/bigreq.h \ @@ -42,6 +59,12 @@ EXTSOURCES = \ extensions/xvmc.c EXTENSIONS = $(EXTSOURCES) $(EXTHEADERS) +ESSENTIAL_EXTENSIONS = \ + extensions/bigreq.h \ + extensions/bigreq.c \ + extensions/xc_misc.h \ + extensions/xc_misc.c + COREHEADERS = xproto.h xcb_types.h CORESOURCES = xproto.c xcb_types.c COREPROTO = $(CORESOURCES) $(COREHEADERS) @@ -54,13 +77,50 @@ libXCB_la_LIBADD = $(XCBPROTO_LIBS) $(XPROTO_LIBS) $(XAU_LIBS) $(XDMCP_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_xlib.c xcb_auth.c \ - $(COREPROTO) $(EXTENSIONS) + $(COREPROTO) $(ESSENTIAL_EXTENSIONS) BUILT_SOURCES = $(COREPROTO) $(EXTENSIONS) CLEANFILES = $(COREPROTO) $(EXTENSIONS) clean-local: rmdir extensions || true +XCB_LIBS = $(top_builddir)/src/libXCB.la + +libXCBcomposite_la_LIBADD = $(XCB_LIBS) +libXCBcomposite_la_SOURCES = extensions/composite.c extensions/composite.h +libXCBdamage_la_LIBADD = $(XCB_LIBS) +libXCBdamage_la_SOURCES = extensions/damage.c extensions/damage.h +libXCBdpms_la_LIBADD = $(XCB_LIBS) +libXCBdpms_la_SOURCES = extensions/dpms.c extensions/dpms.h +libXCBglx_la_LIBADD = $(XCB_LIBS) +libXCBglx_la_SOURCES = extensions/glx.c extensions/glx.h +libXCBrandr_la_LIBADD = $(XCB_LIBS) +libXCBrandr_la_SOURCES = extensions/randr.c extensions/randr.h +libXCBrecord_la_LIBADD = $(XCB_LIBS) +libXCBrecord_la_SOURCES = extensions/record.c extensions/record.h +libXCBrender_la_LIBADD = $(XCB_LIBS) +libXCBrender_la_SOURCES = extensions/render.c extensions/render.h +libXCBres_la_LIBADD = $(XCB_LIBS) +libXCBres_la_SOURCES = extensions/res.c extensions/res.h +libXCBshape_la_LIBADD = $(XCB_LIBS) +libXCBshape_la_SOURCES = extensions/shape.c extensions/shape.h +libXCBshm_la_LIBADD = $(XCB_LIBS) +libXCBshm_la_SOURCES = extensions/shm.c extensions/shm.h +libXCBsync_la_LIBADD = $(XCB_LIBS) +libXCBsync_la_SOURCES = extensions/sync.c extensions/sync.h +libXCBxevie_la_LIBADD = $(XCB_LIBS) +libXCBxevie_la_SOURCES = extensions/xevie.c extensions/xevie.h +libXCBxf86dri_la_LIBADD = $(XCB_LIBS) +libXCBxf86dri_la_SOURCES = extensions/xf86dri.c extensions/xf86dri.h +libXCBxfixes_la_LIBADD = $(XCB_LIBS) +libXCBxfixes_la_SOURCES = extensions/xfixes.c extensions/xfixes.h +libXCBxprint_la_LIBADD = $(XCB_LIBS) +libXCBxprint_la_SOURCES = extensions/xprint.c extensions/xprint.h +libXCBxv_la_LIBADD = $(XCB_LIBS) +libXCBxv_la_SOURCES = extensions/xv.c extensions/xv.h +libXCBxvmc_la_LIBADD = $(XCB_LIBS) +libXCBxvmc_la_SOURCES = extensions/xvmc.c extensions/xvmc.h + vpath %.xml $(XCBPROTO_XCBINCLUDEDIR) $(XCBPROTO_XCBINCLUDEDIR)/extensions %.h: %.xml c-client.xsl From 91aeea2a3e72af16733ddcba037541440c0c4739 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 15 Apr 2006 12:52:05 -0700 Subject: [PATCH 05/18] Put EXTHEADERS and EXTSOURCES in order. --- src/Makefile.am | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index ffb70b9..d38b5cb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,14 +21,14 @@ EXTHEADERS = \ extensions/bigreq.h \ extensions/composite.h \ extensions/damage.h \ + extensions/dpms.h \ extensions/glx.h \ - extensions/shm.h \ - extensions/shape.h \ extensions/randr.h \ extensions/record.h \ extensions/render.h \ extensions/res.h \ - extensions/dpms.h \ + extensions/shape.h \ + extensions/shm.h \ extensions/sync.h \ extensions/xc_misc.h \ extensions/xevie.h \ @@ -41,14 +41,14 @@ EXTSOURCES = \ extensions/bigreq.c \ extensions/composite.c \ extensions/damage.c \ + extensions/dpms.c \ extensions/glx.c \ - extensions/shm.c \ - extensions/shape.c \ extensions/randr.c \ extensions/record.c \ extensions/render.c \ extensions/res.c \ - extensions/dpms.c \ + extensions/shape.c \ + extensions/shm.c \ extensions/sync.c \ extensions/xc_misc.c \ extensions/xevie.c \ From cb6e1849b66c17f96d79598adb740ed16325a9c1 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 15 Apr 2006 14:17:52 -0700 Subject: [PATCH 06/18] Use screensaver.xml --- src/Makefile.am | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index d38b5cb..4002fd3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,6 +7,7 @@ lib_LTLIBRARIES = libXCB.la \ libXCBrecord.la \ libXCBrender.la \ libXCBres.la \ + libXCBscreensaver.la \ libXCBshape.la \ libXCBshm.la \ libXCBsync.la \ @@ -27,6 +28,7 @@ EXTHEADERS = \ extensions/record.h \ extensions/render.h \ extensions/res.h \ + extensions/screensaver.h \ extensions/shape.h \ extensions/shm.h \ extensions/sync.h \ @@ -47,6 +49,7 @@ EXTSOURCES = \ extensions/record.c \ extensions/render.c \ extensions/res.c \ + extensions/screensaver.c \ extensions/shape.c \ extensions/shm.c \ extensions/sync.c \ @@ -102,6 +105,8 @@ libXCBrender_la_LIBADD = $(XCB_LIBS) libXCBrender_la_SOURCES = extensions/render.c extensions/render.h libXCBres_la_LIBADD = $(XCB_LIBS) libXCBres_la_SOURCES = extensions/res.c extensions/res.h +libXCBscreensaver_la_LIBADD = $(XCB_LIBS) +libXCBscreensaver_la_SOURCES = extensions/screensaver.c extensions/screensaver.h libXCBshape_la_LIBADD = $(XCB_LIBS) libXCBshape_la_SOURCES = extensions/shape.c extensions/shape.h libXCBshm_la_LIBADD = $(XCB_LIBS) From cc075990f4fc2ed09c708036569049ddd24605ac Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 15 Apr 2006 20:21:22 -0700 Subject: [PATCH 07/18] Add xcbint.h to noinst_HEADERS, so it gets distributed. --- src/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Makefile.am b/src/Makefile.am index 4002fd3..4a154a1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -73,6 +73,7 @@ CORESOURCES = xproto.c xcb_types.c COREPROTO = $(CORESOURCES) $(COREHEADERS) xcbinclude_HEADERS = xcb.h xcbext.h xcbxlib.h $(COREHEADERS) $(EXTHEADERS) +noinst_HEADERS = xcbint.h CFLAGS = AM_CFLAGS = $(COPTFLAGS) $(CWARNFLAGS) $(CDEBUGFLAGS) $(XCBPROTO_CFLAGS) $(XPROTO_CFLAGS) $(XAU_CFLAGS) $(XDMCP_CFLAGS) From 8eedb4a487dcede0e52849e36c4da13bdf0c8b51 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 15 Apr 2006 20:22:05 -0700 Subject: [PATCH 08/18] Stop running autoreconf in debian/rules, and remove Build-Depends for autoconf, automake, and libtool. --- debian/changelog | 42 ++++++++++++++++++++---------------------- debian/control | 3 +-- debian/rules | 4 ---- 3 files changed, 21 insertions(+), 28 deletions(-) diff --git a/debian/changelog b/debian/changelog index 148dd94..a0501f3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,28 +1,26 @@ -libxcb0 (0.9-1pre2v4) unstable; urgency=low +libxcb0 (0.9-3) UNRELEASED; urgency=low - pre2v1: - * Split into libxcb0 and libxcb0-dev. - * Change control file for new packages. - * Add install and dirs files for new packages. - * Update Build-Depends for renaming of fd.o-xau, fd.o-xproto, and - fd.o-xcb-proto. - * Remove fd.o prefix from package name. - * Change Maintainer to xcb@lists.freedesktop.org, move myself to - Uploaders, and add Jamey Sharp to Uploaders. Update copyright.debian - accordingly. - * Add Bugs field pointing to xcb@lists.freedesktop.org. - * Update homepage URL in description and copyright.debian to - http://xcb.freedesktop.org, and put it in a Homepage: field in the - description. + * Stop running autoreconf in debian/rules, and remove Build-Depends for + autoconf, automake, and libtool. - pre2v2: - * Add libxcb0-dbg package. - - pre2v3: - * New upstream snapshot. + -- Josh Triplett Sat, 15 Apr 2006 19:20:07 -0700 - pre2v4: - * New upstream snapshot. +libxcb0 (0.9-2) unstable; urgency=low + + * Split into libxcb0 and libxcb0-dev. + * Change control file for new packages. + * Add install and dirs files for new packages. + * Update Build-Depends for renaming of fd.o-xau, fd.o-xproto, and + fd.o-xcb-proto. + * Remove fd.o prefix from package name. + * Change Maintainer to xcb@lists.freedesktop.org, move myself to + Uploaders, and add Jamey Sharp to Uploaders. Update copyright.debian + accordingly. + * Add Bugs field pointing to xcb@lists.freedesktop.org. + * Update homepage URL in description and copyright.debian to + http://xcb.freedesktop.org, and put it in a Homepage: field in the + description. + * Add libxcb0-dbg package. -- Josh Triplett Tue, 17 May 2005 12:53:53 -0700 diff --git a/debian/control b/debian/control index 33c61c0..d019630 100644 --- a/debian/control +++ b/debian/control @@ -2,8 +2,7 @@ Source: libxcb0 Priority: optional Maintainer: XCB Developers Uploaders: Jamey Sharp , Josh Triplett -Build-Depends: x-dev, libxau-dev, xcb-proto, cdbs, debhelper (>= 4.1.76), pkg-config, autoconf, automake1.9 | automaken, libtool, xsltproc, check, binutils (>= 2.12.90.0.9) -Build-Conflicts: automake1.4, automake1.5, automake1.6 +Build-Depends: x-dev, libxau-dev, xcb-proto, cdbs, debhelper (>= 4.1.76), pkg-config, xsltproc, check, binutils (>= 2.12.90.0.9) Standards-Version: 3.6.1 Bugs: mailto:xcb@lists.freedesktop.org diff --git a/debian/rules b/debian/rules index e81cbea..8a10683 100755 --- a/debian/rules +++ b/debian/rules @@ -9,10 +9,6 @@ DEB_CONFIGURE_EXTRA_FLAGS = --with-opt DEB_CONFIGURE_INCLUDEDIR = "\$${prefix}/X11R6/include" DEB_DH_STRIP_ARGS=--dbg-package=libxcb0 -debian/stamp-autotools-files: - autoreconf -v --install - touch debian/stamp-autotools-files - debian/copyright: debian/copyright.debian COPYING cat $+ > $@ From 057ae541a3a73cffd58533029292c1c721fa3162 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 15 Apr 2006 20:44:11 -0700 Subject: [PATCH 09/18] Update -dbg package handling to work with debhelper compat level 5. Increase minimum version on debhelper Build-Depends to 5.0.0. --- debian/changelog | 2 ++ debian/control | 2 +- debian/rules | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index a0501f3..1b7ee20 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ libxcb0 (0.9-3) UNRELEASED; urgency=low * Stop running autoreconf in debian/rules, and remove Build-Depends for autoconf, automake, and libtool. + * Update -dbg package handling to work with debhelper compat level 5. + Increase minimum version on debhelper Build-Depends to 5.0.0. -- Josh Triplett Sat, 15 Apr 2006 19:20:07 -0700 diff --git a/debian/control b/debian/control index d019630..3a8e50d 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: libxcb0 Priority: optional Maintainer: XCB Developers Uploaders: Jamey Sharp , Josh Triplett -Build-Depends: x-dev, libxau-dev, xcb-proto, cdbs, debhelper (>= 4.1.76), pkg-config, xsltproc, check, binutils (>= 2.12.90.0.9) +Build-Depends: x-dev, libxau-dev, xcb-proto, cdbs, debhelper (>= 5.0.0), pkg-config, xsltproc, check, binutils (>= 2.12.90.0.9) Standards-Version: 3.6.1 Bugs: mailto:xcb@lists.freedesktop.org diff --git a/debian/rules b/debian/rules index 8a10683..e31478a 100755 --- a/debian/rules +++ b/debian/rules @@ -7,7 +7,6 @@ include /usr/share/cdbs/1/class/autotools.mk DEB_CONFIGURE_EXTRA_FLAGS = --with-opt DEB_CONFIGURE_INCLUDEDIR = "\$${prefix}/X11R6/include" -DEB_DH_STRIP_ARGS=--dbg-package=libxcb0 debian/copyright: debian/copyright.debian COPYING cat $+ > $@ From 11c62f7d9d65c10c796c2199c73c8f167e53f234 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 15 Apr 2006 22:50:33 -0700 Subject: [PATCH 10/18] Stop installing the libtool .la files. --- debian/changelog | 3 ++- debian/libxcb0-dev.install | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1b7ee20..76fb69d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,9 @@ libxcb0 (0.9-3) UNRELEASED; urgency=low autoconf, automake, and libtool. * Update -dbg package handling to work with debhelper compat level 5. Increase minimum version on debhelper Build-Depends to 5.0.0. + * Stop installing the libtool .la files. - -- Josh Triplett Sat, 15 Apr 2006 19:20:07 -0700 + -- Josh Triplett Sat, 15 Apr 2006 22:16:33 -0700 libxcb0 (0.9-2) unstable; urgency=low diff --git a/debian/libxcb0-dev.install b/debian/libxcb0-dev.install index 5ab44bc..f680b2b 100644 --- a/debian/libxcb0-dev.install +++ b/debian/libxcb0-dev.install @@ -2,4 +2,3 @@ usr/X11R6/include/X11/* usr/lib/lib*.a usr/lib/lib*.so usr/lib/pkgconfig/* -usr/lib/*.la From a0057d7a48b90b8f11fc9d5c82b5b8d800c34db5 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sun, 16 Apr 2006 09:24:01 -0700 Subject: [PATCH 11/18] * Debian X11R7 transition: * Change Build-Depends on x-dev to x11proto-core-dev. * Install headers to /usr/include/X11, not /usr/X11R6/include/X11. * Pre-Depends: x11-common (>= 1:1.09). --- debian/changelog | 6 +++++- debian/control | 3 ++- debian/libxcb0-dev.install | 2 +- debian/rules | 1 - 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 76fb69d..b9bdb46 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,8 +5,12 @@ libxcb0 (0.9-3) UNRELEASED; urgency=low * Update -dbg package handling to work with debhelper compat level 5. Increase minimum version on debhelper Build-Depends to 5.0.0. * Stop installing the libtool .la files. + * Debian X11R7 transition: + * Change Build-Depends on x-dev to x11proto-core-dev. + * Install headers to /usr/include/X11, not /usr/X11R6/include/X11. + * Pre-Depends: x11-common (>= 1:1.09). - -- Josh Triplett Sat, 15 Apr 2006 22:16:33 -0700 + -- Josh Triplett Sun, 16 Apr 2006 09:16:45 -0700 libxcb0 (0.9-2) unstable; urgency=low diff --git a/debian/control b/debian/control index 3a8e50d..8dc3917 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: libxcb0 Priority: optional Maintainer: XCB Developers Uploaders: Jamey Sharp , Josh Triplett -Build-Depends: x-dev, libxau-dev, xcb-proto, cdbs, debhelper (>= 5.0.0), pkg-config, xsltproc, check, binutils (>= 2.12.90.0.9) +Build-Depends: x11proto-core-dev, libxau-dev, xcb-proto, cdbs, debhelper (>= 5.0.0), pkg-config, xsltproc, check, binutils (>= 2.12.90.0.9) Standards-Version: 3.6.1 Bugs: mailto:xcb@lists.freedesktop.org @@ -26,6 +26,7 @@ Package: libxcb0-dev Section: libdevel Architecture: any Depends: libxcb0 (= ${Source-Version}), x-dev +Pre-Depends: x11-common (>= 1:1.09) Description: X C Binding, development files Xlib has been the standard C binding for the X Window System protocol for many years now. It is an excellent piece of work, but there are applications diff --git a/debian/libxcb0-dev.install b/debian/libxcb0-dev.install index f680b2b..9cc96e7 100644 --- a/debian/libxcb0-dev.install +++ b/debian/libxcb0-dev.install @@ -1,4 +1,4 @@ -usr/X11R6/include/X11/* +usr/include/X11/* usr/lib/lib*.a usr/lib/lib*.so usr/lib/pkgconfig/* diff --git a/debian/rules b/debian/rules index e31478a..f07c082 100755 --- a/debian/rules +++ b/debian/rules @@ -6,7 +6,6 @@ include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk DEB_CONFIGURE_EXTRA_FLAGS = --with-opt -DEB_CONFIGURE_INCLUDEDIR = "\$${prefix}/X11R6/include" debian/copyright: debian/copyright.debian COPYING cat $+ > $@ From eca61f6b5e9df7321222499a1f660f6eb7e6112e Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sun, 16 Apr 2006 09:25:36 -0700 Subject: [PATCH 12/18] Add Build-Depends on libxdmcp-dev. --- debian/changelog | 3 ++- debian/control | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index b9bdb46..4471b9f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,12 +5,13 @@ libxcb0 (0.9-3) UNRELEASED; urgency=low * Update -dbg package handling to work with debhelper compat level 5. Increase minimum version on debhelper Build-Depends to 5.0.0. * Stop installing the libtool .la files. + * Add Build-Depends on libxdmcp-dev. * Debian X11R7 transition: * Change Build-Depends on x-dev to x11proto-core-dev. * Install headers to /usr/include/X11, not /usr/X11R6/include/X11. * Pre-Depends: x11-common (>= 1:1.09). - -- Josh Triplett Sun, 16 Apr 2006 09:16:45 -0700 + -- Josh Triplett Sun, 16 Apr 2006 09:25:09 -0700 libxcb0 (0.9-2) unstable; urgency=low diff --git a/debian/control b/debian/control index 8dc3917..f144deb 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: libxcb0 Priority: optional Maintainer: XCB Developers Uploaders: Jamey Sharp , Josh Triplett -Build-Depends: x11proto-core-dev, libxau-dev, xcb-proto, cdbs, debhelper (>= 5.0.0), pkg-config, xsltproc, check, binutils (>= 2.12.90.0.9) +Build-Depends: x11proto-core-dev, libxau-dev, libxdmcp-dev, xcb-proto, cdbs, debhelper (>= 5.0.0), pkg-config, xsltproc, check, binutils (>= 2.12.90.0.9) Standards-Version: 3.6.1 Bugs: mailto:xcb@lists.freedesktop.org From e92bde6e5152c6d0c4efa9240604e75178c1a3db Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sun, 16 Apr 2006 09:59:13 -0700 Subject: [PATCH 13/18] Change Depends on x-dev to x11proto-core-dev. --- debian/changelog | 2 +- debian/control | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4471b9f..d48a072 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,7 +7,7 @@ libxcb0 (0.9-3) UNRELEASED; urgency=low * Stop installing the libtool .la files. * Add Build-Depends on libxdmcp-dev. * Debian X11R7 transition: - * Change Build-Depends on x-dev to x11proto-core-dev. + * Change Depends and Build-Depends on x-dev to x11proto-core-dev. * Install headers to /usr/include/X11, not /usr/X11R6/include/X11. * Pre-Depends: x11-common (>= 1:1.09). diff --git a/debian/control b/debian/control index f144deb..b3cea3d 100644 --- a/debian/control +++ b/debian/control @@ -25,7 +25,7 @@ Description: X C Binding Package: libxcb0-dev Section: libdevel Architecture: any -Depends: libxcb0 (= ${Source-Version}), x-dev +Depends: libxcb0 (= ${Source-Version}), x11proto-core-dev Pre-Depends: x11-common (>= 1:1.09) Description: X C Binding, development files Xlib has been the standard C binding for the X Window System protocol for From 71de16fac2a145d5ef8069d2d28d7c32cea603cf Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sun, 16 Apr 2006 11:05:50 -0700 Subject: [PATCH 14/18] Improve package descriptions. --- debian/control | 55 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/debian/control b/debian/control index b3cea3d..d3d80e0 100644 --- a/debian/control +++ b/debian/control @@ -11,14 +11,19 @@ Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: X C Binding - Xlib has been the standard C binding for the X Window System protocol for - many years now. It is an excellent piece of work, but there are applications - for which it is not ideal. XCB builds on nearly two decades of experience - with X specifically and software engineering in general in an effort to - replace the aging Xlib code base. + This package contains the library files needed to run software using the X C + Binding (XCB). . - This package contains the library files needed to run software using - XCB. + The XCB library provides an interface to the X Window System protocol, + designed to replace the Xlib interface. XCB provides several advantages over + Xlib: + . + * Size: small library and lower memory footprint + * Latency hiding: batch several requests and wait for the replies later + * Direct protocol access: one-to-one mapping between interface and protocol + * Thread support: access XCB from multiple threads, with no explicit locking + * Easy creation of new extensions: automatically generates interface from + machine-parsable protocol descriptions . Homepage: http://xcb.freedesktop.org @@ -28,14 +33,19 @@ Architecture: any Depends: libxcb0 (= ${Source-Version}), x11proto-core-dev Pre-Depends: x11-common (>= 1:1.09) Description: X C Binding, development files - Xlib has been the standard C binding for the X Window System protocol for - many years now. It is an excellent piece of work, but there are applications - for which it is not ideal. XCB builds on nearly two decades of experience - with X specifically and software engineering in general in an effort to - replace the aging Xlib code base. - . This package contains the header and library files needed to build software - using XCB. + using the X C Binding (XCB) library. + . + The XCB library provides an interface to the X Window System protocol, + designed to replace the Xlib interface. XCB provides several advantages over + Xlib: + . + * Size: small library and lower memory footprint + * Latency hiding: batch several requests and wait for the replies later + * Direct protocol access: one-to-one mapping between interface and protocol + * Thread support: access XCB from multiple threads, with no explicit locking + * Easy creation of new extensions: automatically generates interface from + machine-parsable protocol descriptions . Homepage: http://xcb.freedesktop.org @@ -44,13 +54,18 @@ Section: libdevel Architecture: any Depends: libxcb0 (= ${Source-Version}) Description: X C Binding, debugging symbols - Xlib has been the standard C binding for the X Window System protocol for - many years now. It is an excellent piece of work, but there are applications - for which it is not ideal. XCB builds on nearly two decades of experience - with X specifically and software engineering in general in an effort to - replace the aging Xlib code base. - . This package contains the debugging symbols associated with libxcb0. gdb will automatically use these symbols when debugging libxcb0. . + The XCB library provides an interface to the X Window System protocol, + designed to replace the Xlib interface. XCB provides several advantages over + Xlib: + . + * Size: small library and lower memory footprint + * Latency hiding: batch several requests and wait for the replies later + * Direct protocol access: one-to-one mapping between interface and protocol + * Thread support: access XCB from multiple threads, with no explicit locking + * Easy creation of new extensions: automatically generates interface from + machine-parsable protocol descriptions + . Homepage: http://xcb.freedesktop.org From 7667adbc631119ec39f3ef5a316aec42dbf5f393 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Wed, 19 Apr 2006 16:49:32 -0700 Subject: [PATCH 15/18] Add XCBPollForReply and deprecate XCBGetRequestRead and XCBGetQueuedRequestRead. --- src/xcb.h | 5 +++-- src/xcb_in.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/xcbext.h | 1 + src/xcbxlib.h | 2 +- 4 files changed, 60 insertions(+), 3 deletions(-) diff --git a/src/xcb.h b/src/xcb.h index 204164a..d4d02b4 100644 --- a/src/xcb.h +++ b/src/xcb.h @@ -273,9 +273,10 @@ XCBGenericEvent *XCBPollForEvent(XCBConnection *c, int *error); * processed. This function enables applications to determine whether * forcing a cookie is going to block. * - * @todo review that function. + * @deprecated This function is deprecated in favor of XCBPollForReply. + * It must not be used in newly written code. */ -unsigned int XCBGetRequestRead(XCBConnection *c); +unsigned int XCBGetRequestRead(XCBConnection *c) deprecated; /* xcb_ext.c */ diff --git a/src/xcb_in.c b/src/xcb_in.c index 76f9702..4ad4654 100644 --- a/src/xcb_in.c +++ b/src/xcb_in.c @@ -239,6 +239,51 @@ static int read_block(const int fd, void *buf, const size_t len) return len; } +static int poll_for_reply(XCBConnection *c, unsigned int request, void **reply, XCBGenericError **error) +{ + struct reply_list *head; + + if(!request) + head = 0; + else if(c->in.request_completed >= request) + { + head = _xcb_map_remove(c->in.replies, request); + if(head && head->next) + _xcb_map_put(c->in.replies, request, head->next); + } + else if(c->in.request_read == request && c->in.current_reply) + { + head = c->in.current_reply; + c->in.current_reply = head->next; + if(!head->next) + c->in.current_reply_tail = &c->in.current_reply; + } + else + /* Would block: do nothing. */ + return 0; + + if(error) + *error = 0; + *reply = 0; + + if(head) + { + if(((XCBGenericRep *) head->reply)->response_type == XCBError) + { + if(error) + *error = head->reply; + else + free(head->reply); + } + else + *reply = head->reply; + + free(head); + } + + return 1; +} + /* Public interface */ void *XCBWaitForReply(XCBConnection *c, unsigned int request, XCBGenericError **e) @@ -323,6 +368,16 @@ done: return ret; } +int XCBPollForReply(XCBConnection *c, unsigned int request, void **reply, XCBGenericError **error) +{ + int ret; + assert(reply != 0); + pthread_mutex_lock(&c->iolock); + ret = poll_for_reply(c, request, reply, error); + pthread_mutex_unlock(&c->iolock); + return ret; +} + XCBGenericEvent *XCBWaitEvent(XCBConnection *c) { return XCBWaitForEvent(c); diff --git a/src/xcbext.h b/src/xcbext.h index 0d172e9..508ebf0 100644 --- a/src/xcbext.h +++ b/src/xcbext.h @@ -63,6 +63,7 @@ unsigned int XCBSendRequest(XCBConnection *c, int flags, struct iovec *vector, c /* xcb_in.c */ void *XCBWaitForReply(XCBConnection *c, unsigned int request, XCBGenericError **e); +int XCBPollForReply(XCBConnection *c, unsigned int request, void **reply, XCBGenericError **error); /* xcb_xid.c */ diff --git a/src/xcbxlib.h b/src/xcbxlib.h index 462e2e3..4ceb03e 100644 --- a/src/xcbxlib.h +++ b/src/xcbxlib.h @@ -32,7 +32,7 @@ #include "xcb.h" /* This function must be called with the IOLock held. */ -unsigned int XCBGetQueuedRequestRead(XCBConnection *c); +unsigned int XCBGetQueuedRequestRead(XCBConnection *c) deprecated; /* This function must be called with the IOLock held. */ unsigned int XCBGetRequestSent(XCBConnection *c); From d5ab03b4b71648bf0a06e42e3c288a68c46ba497 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Wed, 19 Apr 2006 20:15:15 -0700 Subject: [PATCH 16/18] Fixed poll_for_reply, added comments, and refactored XCBWaitForReply to call poll_for_reply. --- src/xcb_in.c | 56 +++++++++++++--------------------------------------- 1 file changed, 14 insertions(+), 42 deletions(-) diff --git a/src/xcb_in.c b/src/xcb_in.c index 4ad4654..24fb041 100644 --- a/src/xcb_in.c +++ b/src/xcb_in.c @@ -243,23 +243,33 @@ static int poll_for_reply(XCBConnection *c, unsigned int request, void **reply, { struct reply_list *head; + /* If an error occurred when issuing the request, fail immediately. */ if(!request) head = 0; - else if(c->in.request_completed >= request) + /* We've read requests past the one we want, so if it has replies we have + * them all and they're in the replies map. */ + else if(request < c->in.request_read) { head = _xcb_map_remove(c->in.replies, request); if(head && head->next) _xcb_map_put(c->in.replies, request, head->next); } - else if(c->in.request_read == request && c->in.current_reply) + /* We're currently processing the responses to the request we want, and we + * have a reply ready to return. So just return it without blocking. */ + else if(request == c->in.request_read && c->in.current_reply) { head = c->in.current_reply; c->in.current_reply = head->next; if(!head->next) c->in.current_reply_tail = &c->in.current_reply; } + /* We know this request can't have any more replies, and we've already + * established it doesn't have a reply now. Don't bother blocking. */ + else if(request == c->in.request_completed) + head = 0; + /* We may have more replies on the way for this request: block until we're + * sure. */ else - /* Would block: do nothing. */ return 0; if(error) @@ -291,15 +301,10 @@ void *XCBWaitForReply(XCBConnection *c, unsigned int request, XCBGenericError ** pthread_cond_t cond = PTHREAD_COND_INITIALIZER; reader_list reader; reader_list **prev_reader; - struct reply_list *head; void *ret = 0; if(e) *e = 0; - /* If an error occurred when issuing the request, fail immediately. */ - if(!request) - return 0; - pthread_mutex_lock(&c->iolock); /* If this request has not been written yet, write it. */ @@ -317,43 +322,10 @@ void *XCBWaitForReply(XCBConnection *c, unsigned int request, XCBGenericError ** /* If this request has not completed yet and has no reply waiting, * wait for one. */ - while(c->in.request_completed < request && - !(c->in.request_read == request && c->in.current_reply)) + while(!poll_for_reply(c, request, &ret, e)) if(!_xcb_conn_wait(c, &cond, 0, 0)) goto done; - if(c->in.request_read != request) - { - head = _xcb_map_remove(c->in.replies, request); - if(head && head->next) - _xcb_map_put(c->in.replies, request, head->next); - } - else - { - head = c->in.current_reply; - if(head) - { - c->in.current_reply = head->next; - if(!head->next) - c->in.current_reply_tail = &c->in.current_reply; - } - } - - if(head) - { - ret = head->reply; - free(head); - - if(((XCBGenericRep *) ret)->response_type == XCBError) - { - if(e) - *e = ret; - else - free(ret); - ret = 0; - } - } - done: for(prev_reader = &c->in.readers; *prev_reader && (*prev_reader)->request <= request; prev_reader = &(*prev_reader)->next) if(*prev_reader == &reader) From d5347485a55e58381781d803e19bfdd982a4685b Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Wed, 19 Apr 2006 20:23:37 -0700 Subject: [PATCH 17/18] Restructure XCBWaitForReply to eliminate two gotos. --- src/xcb_in.c | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/src/xcb_in.c b/src/xcb_in.c index 24fb041..15bc915 100644 --- a/src/xcb_in.c +++ b/src/xcb_in.c @@ -298,9 +298,6 @@ static int poll_for_reply(XCBConnection *c, unsigned int request, void **reply, void *XCBWaitForReply(XCBConnection *c, unsigned int request, XCBGenericError **e) { - pthread_cond_t cond = PTHREAD_COND_INITIALIZER; - reader_list reader; - reader_list **prev_reader; void *ret = 0; if(e) *e = 0; @@ -308,32 +305,34 @@ void *XCBWaitForReply(XCBConnection *c, unsigned int request, XCBGenericError ** pthread_mutex_lock(&c->iolock); /* If this request has not been written yet, write it. */ - if(!_xcb_out_flush_to(c, request)) - goto done; /* error */ + if(_xcb_out_flush_to(c, request)) + { + pthread_cond_t cond = PTHREAD_COND_INITIALIZER; + reader_list reader; + reader_list **prev_reader; - for(prev_reader = &c->in.readers; *prev_reader && (*prev_reader)->request <= request; prev_reader = &(*prev_reader)->next) - if((*prev_reader)->request == request) - goto done; /* error */ + for(prev_reader = &c->in.readers; *prev_reader && (*prev_reader)->request <= request; prev_reader = &(*prev_reader)->next) + if((*prev_reader)->request == request) + goto done; /* error */ - reader.request = request; - reader.data = &cond; - reader.next = *prev_reader; - *prev_reader = &reader; + reader.request = request; + reader.data = &cond; + reader.next = *prev_reader; + *prev_reader = &reader; - /* If this request has not completed yet and has no reply waiting, - * wait for one. */ - while(!poll_for_reply(c, request, &ret, e)) - if(!_xcb_conn_wait(c, &cond, 0, 0)) - goto done; + while(!poll_for_reply(c, request, &ret, e)) + if(!_xcb_conn_wait(c, &cond, 0, 0)) + break; done: - for(prev_reader = &c->in.readers; *prev_reader && (*prev_reader)->request <= request; prev_reader = &(*prev_reader)->next) - if(*prev_reader == &reader) - { - *prev_reader = (*prev_reader)->next; - break; - } - pthread_cond_destroy(&cond); + for(prev_reader = &c->in.readers; *prev_reader && (*prev_reader)->request <= request; prev_reader = &(*prev_reader)->next) + if(*prev_reader == &reader) + { + *prev_reader = (*prev_reader)->next; + break; + } + pthread_cond_destroy(&cond); + } wake_up_next_reader(c); pthread_mutex_unlock(&c->iolock); From f090da98f367ed869fd9277d2fef22555be0f91d Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Wed, 19 Apr 2006 20:31:20 -0700 Subject: [PATCH 18/18] Remove the last goto in XCB: XCBWaitForReply now permits multiple threads to force the same cookie. --- src/xcb_in.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/xcb_in.c b/src/xcb_in.c index 15bc915..db9d1ca 100644 --- a/src/xcb_in.c +++ b/src/xcb_in.c @@ -312,9 +312,7 @@ void *XCBWaitForReply(XCBConnection *c, unsigned int request, XCBGenericError ** reader_list **prev_reader; for(prev_reader = &c->in.readers; *prev_reader && (*prev_reader)->request <= request; prev_reader = &(*prev_reader)->next) - if((*prev_reader)->request == request) - goto done; /* error */ - + /* empty */; reader.request = request; reader.data = &cond; reader.next = *prev_reader; @@ -324,7 +322,6 @@ void *XCBWaitForReply(XCBConnection *c, unsigned int request, XCBGenericError ** if(!_xcb_conn_wait(c, &cond, 0, 0)) break; -done: for(prev_reader = &c->in.readers; *prev_reader && (*prev_reader)->request <= request; prev_reader = &(*prev_reader)->next) if(*prev_reader == &reader) {