commit 1ead02e88eb9f37757eeb1cc8c762fc48d6d08ee Author: Julien Danjou Date: Wed Aug 27 13:56:22 2008 +0200 initialize global_id to 0 Signed-off-by: Julien Danjou diff --git a/src/c_client.py b/src/c_client.py index 19c8015..1c6ad16 100755 --- a/src/c_client.py +++ b/src/c_client.py @@ -183,7 +183,7 @@ def c_open(self): _h('extern xcb_extension_t %s;', _ns.c_ext_global_name) _c('') - _c('xcb_extension_t %s = { "%s" };', _ns.c_ext_global_name, _ns.ext_xname) + _c('xcb_extension_t %s = { "%s", 0 };', _ns.c_ext_global_name, _ns.ext_xname) def c_close(self): ''' commit 6438584285de72858f97be891e16a125d13471d8 Author: Julien Danjou Date: Wed Aug 27 13:56:23 2008 +0200 Fix htonl() arg & convert sizeof() to signed Signed-off-by: Julien Danjou diff --git a/src/xcb_conn.c b/src/xcb_conn.c index e7856c3..02f60bd 100644 --- a/src/xcb_conn.c +++ b/src/xcb_conn.c @@ -80,7 +80,7 @@ static int write_setup(xcb_connection_t *c, xcb_auth_info_t *auth_info) xcb_setup_request_t out; struct iovec parts[6]; int count = 0; - int endian = 0x01020304; + static const uint32_t endian = 0x01020304; int ret; memset(&out, 0, sizeof(out)); @@ -110,7 +110,7 @@ static int write_setup(xcb_connection_t *c, xcb_auth_info_t *auth_info) parts[count].iov_len = XCB_PAD(out.authorization_protocol_data_len); parts[count++].iov_base = (char *) pad; } - assert(count <= sizeof(parts) / sizeof(*parts)); + assert(count <= (int) (sizeof(parts) / sizeof(*parts))); _xcb_lock_io(c); { commit 1bbdba52116f127bed3ce812a00240b4009bbf22 Author: Julien Danjou Date: Wed Aug 27 13:56:24 2008 +0200 Use unsigned to compare and rename sync - i must be unsigned to be compare in the loop - sync shadow global sync() function Signed-off-by: Julien Danjou diff --git a/src/xcb_out.c b/src/xcb_out.c index 60226e5..000b121 100644 --- a/src/xcb_out.c +++ b/src/xcb_out.c @@ -111,7 +111,7 @@ unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vect uint16_t len; } fields; uint32_t packet; - } sync = { { /* GetInputFocus */ 43, 0, 1 } }; + } sync_req = { { /* GetInputFocus */ 43, 0, 1 } }; unsigned int request; uint32_t prefix[3] = { 0 }; int veclen = req->count; @@ -127,7 +127,7 @@ unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vect if(!(flags & XCB_REQUEST_RAW)) { static const char pad[3]; - int i; + unsigned int i; uint16_t shortlen = 0; size_t longlen = 0; assert(vector[0].iov_len >= 4); @@ -193,16 +193,16 @@ unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vect _xcb_wait_io(c, &c->out.cond); request = ++c->out.request; - /* send GetInputFocus (sync) when 64k-2 requests have been sent without + /* send GetInputFocus (sync_req) when 64k-2 requests have been sent without * a reply. - * Also send sync (could use NoOp) at 32-bit wrap to avoid having + * Also send sync_req (could use NoOp) at 32-bit wrap to avoid having * applications see sequence 0 as that is used to indicate * an error in sending the request */ while((req->isvoid && c->out.request == c->in.request_expected + (1 << 16) - 1) || request == 0) { - prefix[0] = sync.packet; + prefix[0] = sync_req.packet; _xcb_in_expect_reply(c, request, WORKAROUND_NONE, XCB_REQUEST_DISCARD_REPLY); c->in.request_expected = c->out.request; request = ++c->out.request; commit c5b2e53abf0b113d4cc4105127cf848ee450aa98 Author: Julien Danjou Date: Wed Aug 27 13:56:25 2008 +0200 Use a signed size in read_block() Signed-off-by: Julien Danjou diff --git a/src/xcb_in.c b/src/xcb_in.c index 31a1e60..1d029af 100644 --- a/src/xcb_in.c +++ b/src/xcb_in.c @@ -252,7 +252,7 @@ static void free_reply_list(struct reply_list *head) } } -static int read_block(const int fd, void *buf, const size_t len) +static int read_block(const int fd, void *buf, const ssize_t len) { int done = 0; while(done < len) commit 9c9c09b376fe1ddcedd03c52cfc0b06867d998c9 Author: Julien Danjou Date: Wed Aug 27 13:56:26 2008 +0200 Rename index to idx to avoid shadowing Signed-off-by: Julien Danjou diff --git a/src/xcb_ext.c b/src/xcb_ext.c index 12cb164..68bb29b 100644 --- a/src/xcb_ext.c +++ b/src/xcb_ext.c @@ -40,11 +40,11 @@ typedef struct lazyreply { } value; } lazyreply; -static lazyreply *get_index(xcb_connection_t *c, int index) +static lazyreply *get_index(xcb_connection_t *c, int idx) { - if(index > c->ext.extensions_size) + if(idx > c->ext.extensions_size) { - int new_size = index << 1; + int new_size = idx << 1; lazyreply *new_extensions = realloc(c->ext.extensions, sizeof(lazyreply) * new_size); if(!new_extensions) return 0; @@ -52,7 +52,7 @@ static lazyreply *get_index(xcb_connection_t *c, int index) c->ext.extensions = new_extensions; c->ext.extensions_size = new_size; } - return c->ext.extensions + index - 1; + return c->ext.extensions + idx - 1; } static lazyreply *get_lazyreply(xcb_connection_t *c, xcb_extension_t *ext) commit 38d5de3a5573b2e89e97d04a809a3dd38a0fe8a7 Author: Julien Danjou Date: Wed Aug 27 13:56:28 2008 +0200 Set namelen unsigned Signed-off-by: Julien Danjou diff --git a/src/xcb_auth.c b/src/xcb_auth.c index 3f24690..b44855e 100644 --- a/src/xcb_auth.c +++ b/src/xcb_auth.c @@ -68,7 +68,7 @@ static size_t memdup(char **dst, void *src, size_t len) return len; } -static int authname_match(enum auth_protos kind, char *name, int namelen) +static int authname_match(enum auth_protos kind, char *name, size_t namelen) { if(strlen(authnames[kind]) != namelen) return 0; commit baf31b1bf20b49ec00d0f64bb7cc9c788a28c088 Author: Julien Danjou Date: Thu Aug 28 13:51:38 2008 +0200 Use ifdef instead of if for defined value Signed-off-by: Julien Danjou diff --git a/src/xcb_util.c b/src/xcb_util.c index 8c18d71..c772908 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -253,7 +253,7 @@ static int _xcb_open_unix(char *protocol, const char *file) strcpy(addr.sun_path, file); addr.sun_family = AF_UNIX; -#if HAVE_SOCKADDR_SUN_LEN +#ifdef HAVE_SOCKADDR_SUN_LEN addr.sun_len = SUN_LEN(&addr); #endif fd = socket(AF_UNIX, SOCK_STREAM, 0); commit bcf662c1b433b296060c66ae1656fcb5c6e697ef Author: Julien Danjou Date: Thu Aug 28 14:35:54 2008 +0200 Initialize all fields of addrinfo Signed-off-by: Julien Danjou diff --git a/src/xcb_util.c b/src/xcb_util.c index c772908..c6c5189 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -201,14 +201,7 @@ static int _xcb_open_decnet(const char *host, const char *protocol, const unsign static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port) { int fd = -1; - struct addrinfo hints = { 0 -#ifdef AI_ADDRCONFIG - | AI_ADDRCONFIG -#endif -#ifdef AI_NUMERICSERV - | AI_NUMERICSERV -#endif - , AF_UNSPEC, SOCK_STREAM }; + struct addrinfo hints; char service[6]; /* "65535" with the trailing '\0' */ struct addrinfo *results, *addr; char *bracket; @@ -216,6 +209,16 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port) if (protocol && strcmp("tcp",protocol)) return -1; + memset(&hints, 0, sizeof(hints)); +#ifdef AI_ADDRCONFIG + hints.ai_flags |= AI_ADDRCONFIG; +#endif +#ifdef AI_NUMERICSERV + hints.ai_flags |= AI_NUMERICSERV; +#endif + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + #ifdef AF_INET6 /* Allow IPv6 addresses enclosed in brackets. */ if(host[0] == '[' && (bracket = strrchr(host, ']')) && bracket[1] == '\0') commit 2d04a1e6cedcdc832e2db3c65ababc3aff904ec4 Author: Vincent Torri Date: Sun Aug 31 10:33:31 2008 +0200 factorize m4 macros and add one to set X extensions Signed-off-by: Julien Danjou diff --git a/Makefile.am b/Makefile.am index 2bf2d0f..ee97180 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,7 +27,7 @@ endif if BUILD_RENDER pkgconfig_DATA += xcb-render.pc endif -if BUILD_RES +if BUILD_RESOURCE pkgconfig_DATA += xcb-res.pc endif if BUILD_SCREENSAVER @@ -45,7 +45,7 @@ endif if BUILD_XEVIE pkgconfig_DATA += xcb-xevie.pc endif -if BUILD_XF86DRI +if BUILD_XFREE86_DRI pkgconfig_DATA += xcb-xf86dri.pc endif if BUILD_XFIXES diff --git a/acinclude.m4 b/acinclude.m4 index 8b240ad..bc98150 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,109 +1,137 @@ dnl Detection and configuration of the visibility feature of gcc dnl Vincent Torri 2006-02-11 dnl -dnl GCC_CHECK_VISIBILITY([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl XCB_CHECK_VISIBILITY([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl Check the visibility feature of gcc dnl -AC_DEFUN([GCC_CHECK_VISIBILITY], - [AC_MSG_CHECKING([whether ${CC} supports symbol visibility]) - save_CFLAGS=${CFLAGS} - CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[ +AC_DEFUN([XCB_CHECK_VISIBILITY], +[ +AC_MSG_CHECKING([whether ${CC} supports symbol visibility]) + +save_CFLAGS=${CFLAGS} +CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden" +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ #pragma GCC visibility push(hidden) extern void f(int); #pragma GCC visibility pop - ]], - [[]] - )], - [AC_DEFINE( - GCC_HAS_VISIBILITY, - [], - [Defined if GCC supports the visibility feature]) - m4_if([$1], [], [:], [$1]) - AC_MSG_RESULT(yes)], - [m4_if([$2], [], [:], [$2]) - AC_MSG_RESULT(no)]) - CFLAGS=${save_CFLAGS} - ]) + ]], + [[]] + )], + [AC_DEFINE( + GCC_HAS_VISIBILITY, + [], + [Defined if GCC supports the visibility feature]) + m4_if([$1], [], [:], [$1]) + AC_MSG_RESULT(yes)], + [m4_if([$2], [], [:], [$2]) + AC_MSG_RESULT(no)]) + +CFLAGS=${save_CFLAGS} +]) + dnl Configure script for doxygen dnl Vincent Torri 2006-05-11 dnl -dnl AM_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl XCB_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl Test for the doxygen program, and define BUILD_DOCS and DOXYGEN. dnl -AC_DEFUN([AM_CHECK_DOXYGEN], - [ - DOXYGEN="doxygen" - dnl - dnl Disable the build of the documentation - dnl - AC_ARG_ENABLE( - [build_docs], - AC_HELP_STRING( - [--disable-build-docs], - [Disable the build of the documentation]), - [if test x"$enableval" != x"yes" ; then - enable_build_docs="no" - else - enable_build_docs="yes" - fi], - [enable_build_docs="yes"]) +AC_DEFUN([XCB_CHECK_DOXYGEN], +[ +DOXYGEN="doxygen" - if test "$enable_build_docs" = "no" ; then - BUILD_DOCS=no +dnl +dnl Disable the build of the documentation +dnl +AC_ARG_ENABLE( + [build_docs], + AC_HELP_STRING( + [--disable-build-docs], + [Disable the build of the documentation]), + [if test x"$enableval" != x"yes" ; then + enable_build_docs="no" else - dnl - dnl Get the prefix where doxygen is installed. - dnl - AC_ARG_WITH( - [doxygen], - AC_HELP_STRING( - [--with-doxygen=FILE], - [doxygen program to use (eg /usr/bin/doxygen)]), - dnl - dnl Check the given doxygen program. - dnl - [DOXYGEN=${withval} - AC_CHECK_PROG( - [BUILD_DOCS], - [${DOXYGEN}], - [yes], - [no]) - if test $BUILD_DOCS = no; then - echo "WARNING:" - echo "The doxygen program you specified:" - echo "$DOXYGEN" - echo "was not found. Please check the path and make sure " - echo "the program exists and is executable." - AC_MSG_WARN( - [Warning: no doxygen detected. Documentation will not be built]) - fi], - [AC_CHECK_PROG( - [BUILD_DOCS], - [${DOXYGEN}], - [yes], - [no]) - if test ${BUILD_DOCS} = no; then - echo "WARNING:" - echo "The doxygen program was not found in your execute" - echo "You may have doxygen installed somewhere not covered by your path." - echo "" - echo "If this is the case make sure you have the packages installed, AND" - echo "that the doxygen program is in your execute path (see your" - echo "shell's manual page on setting the \$PATH environment variable), OR" - echo "alternatively, specify the program to use with --with-doxygen." - AC_MSG_WARN( - [Warning: no doxygen detected. Documentation will not be built]) - fi]) - fi - AC_MSG_CHECKING([whether documentation is built]) - AC_MSG_RESULT([${BUILD_DOCS}]) - dnl - dnl Substitution - dnl - AC_SUBST([DOXYGEN]) - AM_CONDITIONAL(BUILD_DOCS, test "x$BUILD_DOCS" = "xyes") - ]) + enable_build_docs="yes" + fi], + [enable_build_docs="yes"]) + +if test "$enable_build_docs" = "no" ; then + BUILD_DOCS=no +else +dnl +dnl Get the prefix where doxygen is installed. +dnl +AC_ARG_WITH( + [doxygen], + AC_HELP_STRING( + [--with-doxygen=FILE], + [doxygen program to use (eg /usr/bin/doxygen)]), + dnl + dnl Check the given doxygen program. + dnl + [DOXYGEN=${withval} + AC_CHECK_PROG( + [BUILD_DOCS], + [${DOXYGEN}], + [yes], + [no]) + if test $BUILD_DOCS = no; then + echo "WARNING:" + echo "The doxygen program you specified:" + echo "$DOXYGEN" + echo "was not found. Please check the path and make sure " + echo "the program exists and is executable." + AC_MSG_WARN( + [Warning: no doxygen detected. Documentation will not be built]) + fi], + [AC_CHECK_PROG( + [BUILD_DOCS], + [${DOXYGEN}], + [yes], + [no]) + if test ${BUILD_DOCS} = no; then + echo "WARNING:" + echo "The doxygen program was not found in your execute" + echo "You may have doxygen installed somewhere not covered by your path." + echo "" + echo "If this is the case make sure you have the packages installed, AND" + echo "that the doxygen program is in your execute path (see your" + echo "shell manual page on setting the \$PATH environment variable), OR" + echo "alternatively, specify the program to use with --with-doxygen." + AC_MSG_WARN( + [Warning: no doxygen detected. Documentation will not be built]) + fi]) +fi +AC_MSG_CHECKING([whether documentation is built]) +AC_MSG_RESULT([${BUILD_DOCS}]) + +dnl +dnl Substitution +dnl +AC_SUBST([DOXYGEN]) + +AM_CONDITIONAL(BUILD_DOCS, test "x$BUILD_DOCS" = "xyes") + +]) + +dnl Detection and configuration of the visibility feature of gcc +dnl Vincent Torri 2006-02-11 +dnl +dnl XCB_EXTENSION(name, default) +dnl set the X extension +dnl +AC_DEFUN([XCB_EXTENSION], +[ +pushdef([UP], translit([$1], [-a-z], [_A-Z]))dnl +pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl + +AC_ARG_ENABLE(DOWN, + [AS_HELP_STRING([--enable-[]DOWN], [Build XCB $1 Extension (default: $2)])], + [BUILD_[]UP=$enableval], + [BUILD_[]UP=$2]) + +AM_CONDITIONAL(BUILD_[]UP, [test "x$BUILD_[]UP" = "xyes"]) +]) + dnl End of acinclude.m4 diff --git a/configure.ac b/configure.ac index deb50b7..c9cbd0c 100644 --- a/configure.ac +++ b/configure.ac @@ -77,7 +77,7 @@ AC_CHECK_MEMBER([struct sockaddr_un.sun_len], [ #include #include ]) - + xcbincludedir='${includedir}/xcb' AC_SUBST(xcbincludedir) @@ -92,7 +92,7 @@ else fi AC_SUBST(CWARNFLAGS) -GCC_CHECK_VISIBILITY() +XCB_CHECK_VISIBILITY() # htmldir is not defined prior to autoconf 2.59c, so on earlier versions # set an equivalent value. @@ -100,57 +100,72 @@ AC_PREREQ([2.59c], [], [AC_SUBST([htmldir], [m4_ifset([AC_PACKAGE_TARNAME], ['${datadir}/doc/${PACKAGE_TARNAME}'], ['${datadir}/doc/${PACKAGE}']) ])]) -AM_CHECK_DOXYGEN() - -AC_ARG_ENABLE(composite, AS_HELP_STRING([--enable-composite], [Build XCB Composite Extension (default: yes)]), [BUILD_COMPOSITE=$enableval], [BUILD_COMPOSITE=yes]) -AM_CONDITIONAL(BUILD_COMPOSITE, [test "x$BUILD_COMPOSITE" = xyes]) -AC_ARG_ENABLE(damage, AS_HELP_STRING([--enable-damage], [Build XCB Damage Extension (default: yes)]), [BUILD_DAMAGE=$enableval], [BUILD_DAMAGE=yes]) -AM_CONDITIONAL(BUILD_DAMAGE, [test "x$BUILD_DAMAGE" = xyes]) -AC_ARG_ENABLE(dpms, AS_HELP_STRING([--enable-dpms], [Build XCB DPMS Extension (default: yes)]), [BUILD_DPMS=$enableval], [BUILD_DPMS=yes]) -AM_CONDITIONAL(BUILD_DPMS, [test "x$BUILD_DPMS" = xyes]) -AC_ARG_ENABLE(glx, AS_HELP_STRING([--enable-glx], [Build XCB GLX Extension (default: yes)]), [BUILD_GLX=$enableval], [BUILD_GLX=yes]) -AM_CONDITIONAL(BUILD_GLX, [test "x$BUILD_GLX" = xyes]) -AC_ARG_ENABLE(randr, AS_HELP_STRING([--enable-randr], [Build XCB RandR Extension (default: yes)]), [BUILD_RANDR=$enableval], [BUILD_RANDR=yes]) -AM_CONDITIONAL(BUILD_RANDR, [test "x$BUILD_RANDR" = xyes]) -AC_ARG_ENABLE(record, AS_HELP_STRING([--enable-record], [Build XCB Record Extension (default: yes)]), [BUILD_RECORD=$enableval], [BUILD_RECORD=yes]) -AM_CONDITIONAL(BUILD_RECORD, [test "x$BUILD_RECORD" = xyes]) -AC_ARG_ENABLE(render, AS_HELP_STRING([--enable-render], [Build XCB Render Extension (default: yes)]), [BUILD_RENDER=$enableval], [BUILD_RENDER=yes]) -AM_CONDITIONAL(BUILD_RENDER, [test "x$BUILD_RENDER" = xyes]) -AC_ARG_ENABLE(res, AS_HELP_STRING([--enable-res], [Build XCB X-Resource Extension (default: yes)]), [BUILD_RES=$enableval], [BUILD_RES=yes]) -AM_CONDITIONAL(BUILD_RES, [test "x$BUILD_RES" = xyes]) -AC_ARG_ENABLE(screensaver, AS_HELP_STRING([--enable-screensaver], [Build XCB Screensaver Extension (default: yes)]), [BUILD_SCREENSAVER=$enableval], [BUILD_SCREENSAVER=yes]) -AM_CONDITIONAL(BUILD_SCREENSAVER, [test "x$BUILD_SCREENSAVER" = xyes]) -AC_ARG_ENABLE(shape, AS_HELP_STRING([--enable-shape], [Build XCB Shape Extension (default: yes)]), [BUILD_SHAPE=$enableval], [BUILD_SHAPE=yes]) -AM_CONDITIONAL(BUILD_SHAPE, [test "x$BUILD_SHAPE" = xyes]) -AC_ARG_ENABLE(shm, AS_HELP_STRING([--enable-shm], [Build XCB Shm Extension (default: yes)]), [BUILD_SHM=$enableval], [BUILD_SHM=yes]) -AM_CONDITIONAL(BUILD_SHM, [test "x$BUILD_SHM" = xyes]) -AC_ARG_ENABLE(sync, AS_HELP_STRING([--enable-sync], [Build XCB Sync Extension (default: yes)]), [BUILD_SYNC=$enableval], [BUILD_SYNC=yes]) -AM_CONDITIONAL(BUILD_SYNC, [test "x$BUILD_SYNC" = xyes]) -AC_ARG_ENABLE(xevie, AS_HELP_STRING([--enable-xevie], [Build XCB Xevie Extension (default: yes)]), [BUILD_XEVIE=$enableval], [BUILD_XEVIE=yes]) -AM_CONDITIONAL(BUILD_XEVIE, [test "x$BUILD_XEVIE" = xyes]) -AC_ARG_ENABLE(xf86dri, AS_HELP_STRING([--enable-xf86dri], [Build XCB XFree86-DRI Extension (default: yes)]), [BUILD_XF86DRI=$enableval], [BUILD_XF86DRI=yes]) -AM_CONDITIONAL(BUILD_XF86DRI, [test "x$BUILD_XF86DRI" = xyes]) -AC_ARG_ENABLE(xfixes, AS_HELP_STRING([--enable-xfixes], [Build XCB XFixes Extension (default: yes)]), [BUILD_XFIXES=$enableval], [BUILD_XFIXES=yes]) -AM_CONDITIONAL(BUILD_XFIXES, [test "x$BUILD_XFIXES" = xyes]) -AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--enable-xinerama], [Build XCB Xinerama Extension (default: yes)]), [BUILD_XINERAMA=$enableval], [BUILD_XINERAMA=yes]) -AM_CONDITIONAL(BUILD_XINERAMA, [test "x$BUILD_XINERAMA" = xyes]) -AC_ARG_ENABLE(xinput, AS_HELP_STRING([--enable-xinput], [Build XCB XInput Extension (EXPERIMENTAL) (default: no)]), [BUILD_XINPUT=$enableval], [BUILD_XINPUT=no]) -AM_CONDITIONAL(BUILD_XINPUT, [test "x$BUILD_XINPUT" = xyes]) -AC_ARG_ENABLE(xprint, AS_HELP_STRING([--enable-xprint], [Build XCB Xprint Extension (default: yes)]), [BUILD_XPRINT=$enableval], [BUILD_XPRINT=yes]) -AM_CONDITIONAL(BUILD_XPRINT, [test "x$BUILD_XPRINT" = xyes]) -AC_ARG_ENABLE(xselinux, AS_HELP_STRING([--enable-xselinux], [Build XCB SELinux Extension (default: no)]), [BUILD_SELINUX=$enableval], [BUILD_SELINUX=no]) -AM_CONDITIONAL(BUILD_SELINUX, [test "x$BUILD_SELINUX" = xyes]) -AC_ARG_ENABLE(xtest, AS_HELP_STRING([--enable-xtest], [Build XCB XTEST Extension (default: yes)]), [BUILD_XTEST=$enableval], [BUILD_XTEST=yes]) -AM_CONDITIONAL(BUILD_XTEST, [test "x$BUILD_XTEST" = xyes]) -AC_ARG_ENABLE(xv, AS_HELP_STRING([--enable-xv], [Build XCB Xv Extension (default: yes)]), [BUILD_XV=$enableval], [BUILD_XV=yes]) -AM_CONDITIONAL(BUILD_XV, [test "x$BUILD_XV" = xyes]) -AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--enable-xvmc], [Build XCB XvMC Extension (default: yes)]), [BUILD_XVMC=$enableval], [BUILD_XVMC=yes]) -AM_CONDITIONAL(BUILD_XVMC, [test "x$BUILD_XVMC" = xyes]) - - -AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile doc/Makefile]) -AC_CONFIG_FILES([xcb.pc xcb-xlib.pc xcb-composite.pc xcb-damage.pc xcb-dpms.pc xcb-glx.pc xcb-randr.pc xcb-record.pc xcb-render.pc xcb-res.pc xcb-screensaver.pc xcb-shape.pc xcb-shm.pc xcb-sync.pc xcb-xevie.pc xcb-xf86dri.pc xcb-xfixes.pc xcb-xinerama.pc xcb-xinput.pc xcb-xprint.pc xcb-xselinux.pc xcb-xtest.pc xcb-xv.pc xcb-xvmc.pc]) -AC_CONFIG_FILES([doc/xcb.doxygen]) + +XCB_CHECK_DOXYGEN() + +XCB_EXTENSION(Composite, "yes") +XCB_EXTENSION(Damage, "yes") +XCB_EXTENSION(DPMS, "yes") +XCB_EXTENSION(GLX, "yes") +XCB_EXTENSION(RandR, "yes") +XCB_EXTENSION(Record, "yes") +XCB_EXTENSION(Render, "yes") +XCB_EXTENSION(Resource, "yes") +XCB_EXTENSION(Screensaver, "yes") +XCB_EXTENSION(Shape, "yes") +XCB_EXTENSION(Shm, "yes") +XCB_EXTENSION(Sync, "yes") +XCB_EXTENSION(Xevie, "yes") +XCB_EXTENSION(XFixes, "yes") +XCB_EXTENSION(XFree86-DRI, "yes") +XCB_EXTENSION(Xinerama, "yes") +XCB_EXTENSION(XInput, "no") +XCB_EXTENSION(Xprint, "yes") +XCB_EXTENSION(SELinux, "no") +XCB_EXTENSION(XTest, "yes") +XCB_EXTENSION(Xv, "yes") +XCB_EXTENSION(XvMC, "yes") +XCB_EXTENSION(Composite, "yes") +XCB_EXTENSION(Composite, "yes") + + +AC_CONFIG_FILES([ +Makefile +doc/Makefile +src/Makefile +tests/Makefile +]) + +AC_CONFIG_FILES([ +xcb.pc +xcb-xlib.pc +xcb-composite.pc +xcb-damage.pc +xcb-dpms.pc +xcb-glx.pc +xcb-randr.pc +xcb-record.pc +xcb-render.pc +xcb-res.pc +xcb-screensaver.pc +xcb-shape.pc +xcb-shm.pc +xcb-sync.pc +xcb-xevie.pc +xcb-xf86dri.pc +xcb-xfixes.pc +xcb-xinerama.pc +xcb-xinput.pc +xcb-xprint.pc +xcb-xselinux.pc +xcb-xtest.pc +xcb-xv.pc +xcb-xvmc.pc +]) + +AC_CONFIG_FILES([ +doc/xcb.doxygen +]) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index 2fd2f69..aa8b755 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -108,7 +108,7 @@ endif EXTHEADERS += res.h EXTSOURCES += res.c EXTENSION_XML += res.xml -if BUILD_RES +if BUILD_RESOURCE lib_LTLIBRARIES += libxcb-res.la libxcb_res_la_LDFLAGS = -version-info 0:0:0 libxcb_res_la_LIBADD = $(XCB_LIBS) @@ -168,7 +168,7 @@ endif EXTHEADERS += xf86dri.h EXTSOURCES += xf86dri.c EXTENSION_XML += xf86dri.xml -if BUILD_XF86DRI +if BUILD_XFREE86_DRI lib_LTLIBRARIES += libxcb-xf86dri.la libxcb_xf86dri_la_LDFLAGS = -version-info 0:0:0 libxcb_xf86dri_la_LIBADD = $(XCB_LIBS) commit 7e0674e76186ee4491a089350511fc0d22fb3af3 Author: Bart Massey Date: Sun Aug 31 00:42:23 2008 -0700 added small fix to support trailing fixed fields; also warning for non-pad fixed fields diff --git a/src/c_client.py b/src/c_client.py index 1c6ad16..db974e0 100755 --- a/src/c_client.py +++ b/src/c_client.py @@ -635,9 +635,15 @@ def _c_complex(self): struct_fields = [] maxtypelen = 0 + varfield = None for field in self.fields: if not field.type.fixed_size(): - break + varfield = field.c_field_name + continue + if varfield != None and not field.type.is_pad: + errmsg = '%s: warning: variable field %s followed by fixed field %s\n' % (self.c_type, varfield, field.c_field_name) + sys.stderr.write(errmsg) + # sys.exit(1) if field.wire: struct_fields.append(field) commit d6d44e1bf09cca8aefbf4ce9875d7f794bf19fb1 Author: Bart Massey Date: Wed Sep 3 13:52:58 2008 -0700 fixed overly aggressive warning about fixed field following variable diff --git a/src/c_client.py b/src/c_client.py index db974e0..d634c27 100755 --- a/src/c_client.py +++ b/src/c_client.py @@ -640,7 +640,7 @@ def _c_complex(self): if not field.type.fixed_size(): varfield = field.c_field_name continue - if varfield != None and not field.type.is_pad: + if varfield != None and not field.type.is_pad and field.wire: errmsg = '%s: warning: variable field %s followed by fixed field %s\n' % (self.c_type, varfield, field.c_field_name) sys.stderr.write(errmsg) # sys.exit(1) commit f3f8738436d09f7e590b76e22a7a2cc4b16abd1d Author: Julien Cristau Date: Tue Sep 9 04:42:35 2008 +0100 Fix some fd leaks in _xcb_open_*() Signed-off-by: Julien Danjou diff --git a/src/xcb_util.c b/src/xcb_util.c index c6c5189..6b80c80 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -192,8 +192,10 @@ static int _xcb_open_decnet(const char *host, const char *protocol, const unsign accessdata.acc_accl = strlen((char *)accessdata.acc_acc); setsockopt(fd, DNPROTO_NSP, SO_CONACCESS, &accessdata, sizeof(accessdata)); - if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) + if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) { + close(fd); return -1; + } return fd; } #endif @@ -238,9 +240,12 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port) for(addr = results; addr; addr = addr->ai_next) { fd = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol); - if(fd >= 0 && connect(fd, addr->ai_addr, addr->ai_addrlen) >= 0) - break; - fd = -1; + if(fd >= 0) { + if (connect(fd, addr->ai_addr, addr->ai_addrlen) >= 0) + break; + close(fd); + fd = -1; + } } freeaddrinfo(results); return fd; @@ -262,8 +267,10 @@ static int _xcb_open_unix(char *protocol, const char *file) fd = socket(AF_UNIX, SOCK_STREAM, 0); if(fd == -1) return -1; - if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) + if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) { + close(fd); return -1; + } return fd; } commit 25e59ccc0dc8baf344145d6d739229e8120330db Author: Julien Cristau Date: Tue Sep 9 04:42:36 2008 +0100 Add support for the abstract socket namespace under Linux Based on same in Xtrans. Signed-off-by: Julien Danjou diff --git a/configure.ac b/configure.ac index c9cbd0c..062c0cb 100644 --- a/configure.ac +++ b/configure.ac @@ -70,6 +70,12 @@ AC_HEADER_STDC AC_SEARCH_LIBS(getaddrinfo, socket) AC_SEARCH_LIBS(connect, socket) +case $host_os in +linux*) + AC_DEFINE([HAVE_ABSTRACT_SOCKETS], 1, [Define if your platform supports abstract sockets]) + ;; +esac + dnl check for the sockaddr_un.sun_len member AC_CHECK_MEMBER([struct sockaddr_un.sun_len], [AC_DEFINE(HAVE_SOCKADDR_SUN_LEN,1,[Have the sockaddr_un.sun_len member.])], diff --git a/src/xcb_util.c b/src/xcb_util.c index 6b80c80..7c6a4dd 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -123,6 +124,9 @@ static int _xcb_open_unix(char *protocol, const char *file); #ifdef DNETCONN static int _xcb_open_decnet(const char *host, char *protocol, const unsigned short port); #endif +#ifdef HAVE_ABSTRACT_SOCKETS +static int _xcb_open_abstract(char *protocol, const char *file); +#endif static int _xcb_open(char *host, char *protocol, const int display) { @@ -156,10 +160,13 @@ static int _xcb_open(char *host, char *protocol, const int display) /* display specifies Unix socket */ snprintf(file, sizeof(file), "%s%d", base, display); - return _xcb_open_unix(protocol, file); - +#ifdef HAVE_ABSTRACT_SOCKETS + fd = _xcb_open_abstract(protocol, file); + if (fd >= 0 || (errno != ENOENT && errno != ECONNREFUSED)) + return fd; - return fd; +#endif + return _xcb_open_unix(protocol, file); } #ifdef DNETCONN @@ -274,6 +281,33 @@ static int _xcb_open_unix(char *protocol, const char *file) return fd; } +#ifdef HAVE_ABSTRACT_SOCKETS +static int _xcb_open_abstract(char *protocol, const char *file) +{ + int fd; + struct sockaddr_un addr = {0}; + socklen_t namelen; + + if (protocol && strcmp("unix",protocol)) + return -1; + + strcpy(addr.sun_path + 1, file); + addr.sun_family = AF_UNIX; + namelen = offsetof(struct sockaddr_un, sun_path) + 1 + strlen(file); +#ifdef HAVE_SOCKADDR_SUN_LEN + addr.sun_len = 1 + strlen(file); +#endif + fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (fd == -1) + return -1; + if (connect(fd, (struct sockaddr *) &addr, namelen) == -1) { + close(fd); + return -1; + } + return fd; +} +#endif + xcb_connection_t *xcb_connect(const char *displayname, int *screenp) { int fd, display = 0; commit 9afadd2aef8af89a4f4ab70baeae0b848904c367 Author: Carsten Meier Date: Tue Sep 9 12:11:37 2008 +0200 Added generation of extern "C" for compatibility with C++ The auto-generated header files now include an extern "C" declaration for compatibility with C++. Signed-off-by: Julien Danjou diff --git a/src/c_client.py b/src/c_client.py index d634c27..99fe114 100755 --- a/src/c_client.py +++ b/src/c_client.py @@ -176,6 +176,12 @@ def c_open(self): for (n, h) in self.imports: _hc('#include "%s.h"', h) + _h('') + _h('#ifdef __cplusplus') + _h('extern "C" {') + _h('#endif') + + if _ns.is_ext: _h('') _h('#define XCB_%s_MAJOR_VERSION %s', _ns.ext_name.upper(), _ns.major_version) _h('#define XCB_%s_MINOR_VERSION %s', _ns.ext_name.upper(), _ns.minor_version) @@ -193,6 +199,12 @@ def c_close(self): _h_setlevel(2) _c_setlevel(2) _hc('') + + _h('') + _h('#ifdef __cplusplus') + _h('}') + _h('#endif') + _h('') _h('#endif') _h('') commit db332dcda989b5b021dc220c102666f695c772cf Author: Henning Sten Date: Sat Sep 20 13:08:58 2008 +0200 fix tiny memory leak in read_packet (leak only happens when malloc returns NULL so it's very rare) Signed-off-by: Julien Danjou diff --git a/src/xcb_in.c b/src/xcb_in.c index 1d029af..f613772 100644 --- a/src/xcb_in.c +++ b/src/xcb_in.c @@ -191,6 +191,7 @@ static int read_packet(xcb_connection_t *c) if(!cur) { _xcb_conn_shutdown(c); + free(buf); return 0; } cur->reply = buf; commit 625ed596cae6dd8175aeb6cb6f26784928042f22 Author: Josh Triplett Date: Wed Oct 8 16:04:25 2008 -0700 Remove duplicate XCB_EXTENSION calls for Composite extension diff --git a/configure.ac b/configure.ac index 062c0cb..c3d3595 100644 --- a/configure.ac +++ b/configure.ac @@ -131,8 +131,6 @@ XCB_EXTENSION(SELinux, "no") XCB_EXTENSION(XTest, "yes") XCB_EXTENSION(Xv, "yes") XCB_EXTENSION(XvMC, "yes") -XCB_EXTENSION(Composite, "yes") -XCB_EXTENSION(Composite, "yes") AC_CONFIG_FILES([