Commit Graph

508 Commits

Author SHA1 Message Date
Julien Danjou 1bbdba5211 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 <julien@danjou.info>
2008-08-28 13:49:21 +02:00
Julien Danjou 6438584285 Fix htonl() arg & convert sizeof() to signed
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-08-28 13:49:21 +02:00
Julien Danjou 1ead02e88e initialize global_id to 0
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-08-28 13:49:21 +02:00
Julien Cristau cdc3479387 Make EXTHEADERS, EXTSOURCES, EXTENSION_XML unconditional of configure flags.
yay, make distcheck works now even when some extensions are disabled.

Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-16 23:25:04 +09:30
Petr Salinger a9d15a0845 fix FreeBSD support
The GNU/kFreeBSD (and BSDs in general) have a different
layout of struct sockaddr, sockaddr_in, sockaddr_un ...

The first member do not have to be "sa_family",
they also have "sa_len" field.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-07 17:57:37 +02:00
Josh Triplett 424ad131b7 Fix variable declaration formatting 2008-05-28 12:26:13 -07:00
Peter Hutterer 6532c715c3 Add xcb_ge_event_t and handling for long events.
GenericEvent can be more than 32 bytes long. Ensure that the required data is
pulled off the wire and tack it onto the event.

Due to the structure of the xcb_generic_event_t, the data is appended AFTER
the full_sequence field.
2008-05-21 21:22:13 +09:30
Oswald Buddenhagen b08a5909da Fix libxcb/src compile with srcdir != builddir. 2008-05-01 16:17:55 -04:00
Eamon Walsh 4a405feba8 Replace a stray c-client.xsl in the libxcb SOURCES. Fixes make distcheck. 2008-04-23 20:28:13 -04:00
Eamon Walsh 40566c36d5 Use the python install path from xcb-xproto.pc to locate the xcbgen package. 2008-04-23 20:25:57 -04:00
Jeremy Kolb b3832bcc46 Add mention of PYTHONPATH if xcbgen cannot be found. 2008-04-20 16:26:51 -04:00
Eamon Walsh 5ee915e12a Add Python parser C language-dependent part. 2008-04-19 04:44:29 -04:00
Eamon Walsh 947a2e26e4 Add SELinux extension support, disabled by default. 2008-01-24 16:02:34 -05:00
Eamon Walsh 0b5f684eb0 Add XInput extension support, disabled by default. 2008-01-24 15:57:35 -05:00
Eamon Walsh 7a74ba3d02 Generated the configure.ac and Makefile.am's in libxcb with the idea of
making each extension library individually selectable for build.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2007-12-07 16:22:04 -05:00
Bart Massey 9bf8329b50 make IPv6 optional 2007-11-24 14:53:54 -08:00
Eamon Walsh 46413cd85e Add comment noting the requirement to free replies when finished. 2007-11-16 19:34:42 -05:00
Jamey Sharp af50de26c1 Revert "Generate error constants as XCB_BAD_*, similar to Xlib."
Since several extensions named their errors like "BadFoo", this patch
results in names like XCB_EXT_BAD_BAD_FOO, which is really awful. Those
extensions are already kind of awful, as they produce structure names
like xcb_ext_bad_foo_error_t, which is redundant.

A patch that removes "Bad" from the XML extension descriptions, while
maintaining API and ABI compatibility in XCB, is needed before this
patch can be released.

This reverts commit 158c9b6ba1.
2007-11-04 17:26:21 -08:00
Jamey Sharp a29fbc2645 Don't hold the xlib-xcb lock while sleeping: that allows deadlock.
With this patch, `ico -threads 2` runs without deadlock.

Many thanks to Christoph Pfister <christophpfister@gmail.com> for
pointing out the problem, providing detailed analyses, explaining it to
me repeatedly until I understood what was going on, and proposing and
reviewing possible solutions.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Acked-by: Christoph Pfister <christophpfister@gmail.com>
2007-10-28 13:28:18 -07:00
Jamey Sharp f6b75d6090 Factor pthread_cond_wait(iolock) to _xcb_wait_io.
This parallels the _xcb_lock_io and _xcb_unlock_io factoring.
2007-10-28 11:56:08 -07:00
Jamey Sharp 4d828c5eba Don't abort() on locking assertions if LIBXCB_ALLOW_SLOPPY_LOCK is set.
But do still print a full backtrace, on platforms where that's
supported.

This commit follows the spirit of Novell's libxcb-sloppy-lock.diff.

I strongly opposed proposals like this one for a long time. Originally I
had a very good reason: libX11, when compiled to use XCB, would crash
soon after a locking correctness violation, so it was better to have an
informative assert failure than a mystifying crash soon after.

It took some time for me to realize that I'd changed the libX11
implementation (for unrelated reasons) so that it could survive most
invalid locking situations, as long as it wasn't actually being used
from multiple threads concurrently.

The other thing that has changed is that most of the code with incorrect
locking has now been fixed. The value of the assert is accordingly
lower.

However, remaining broken callers do need to be fixed. That's why libXCB
will still noisily print a stacktrace (if possible) on each assertion
failure, even when assert isn't actually invoked to abort() the program;
and that's why aborting is still default. This environment variable is
provided only for use as a temporary workaround for broken applications.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Acked-by: Josh Triplett <josh@freedesktop.org>
2007-10-23 11:44:20 -07:00
Egbert Eich 09045eaac3 Allow unix:<screen> style display names again.
https://bugzilla.novell.com/show_bug.cgi?id=289007
This notion is used in a lot of scripts.
2007-07-19 17:00:18 +02:00
Josh Triplett 65ffbc6cfd Send locking assertion backtraces to stderr. Improve the heading on the backtrace. 2007-06-13 23:46:37 -07:00
Christoph Pfister 605c778e69 Print backtraces in case an assert fails inside xlib/xcb.
As you know there are some nasty libs / apps doing locking
incorrectly. In order to improve the information given to the user
when he encounters such a situation (people don't run apps in gdb
normally) I created the patch attached.
It's very non-intrusive (and affects only xlib/xcb, Josh told me on
irc that it could be useful for other areas too, personally I don't
think that it's really needed at other places ...).

Some same outputs and the discussion of them:

    lxuser@pdln:/tmp$ ./main
    Got a backtrace:
    #0 /tmp/usr/lib/libxcb-xlib.so.0 [0xb7f9d728]
    #1 /tmp/usr/lib/libxcb-xlib.so.0(xcb_xlib_unlock+0x31) [0xb7f9d861]
    #2 ./test.so(function_a+0x11) [0xb7f9f3fd]
    #3 ./test.so(function_b+0x11) [0xb7f9f410]
    #4 ./main [0x80484a7]
    #5 /lib/libc.so.6(__libc_start_main+0xdc) [0xb7e60ebc]
    #6 ./main [0x80483f1]
    main: xcb_xlib.c:82: xcb_xlib_unlock: Assertion `c->xlib.lock' failed.
    Aborted

That's kinda the normal situation.

    lxuser@pdln:/tmp$ ./main
    Got a backtrace:
    #0 /tmp/usr/lib/libxcb-xlib.so.0 [0xb7f90728]
    #1 /tmp/usr/lib/libxcb-xlib.so.0(xcb_xlib_unlock+0x31) [0xb7f90861]
    #2 /tmp/test.so [0xb7f923cd]
    #3 /tmp/test.so(function_b+0x11) [0xb7f923e0]
    #4 ./main [0x80484ab]
    #5 /lib/libc.so.6(__libc_start_main+0xdc) [0xb7e53ebc]
    #6 ./main [0x80483f1]
    main: xcb_xlib.c:82: xcb_xlib_unlock: Assertion `c->xlib.lock' failed.
    Aborted

There are two possible reasons that the name doesn't appear in #2:
a) a hidden symbol or a symbol with statical linkage in a library
b) a symbol in an app not compiled with -rdynamic.
But in both cases you still know _where_ the caller is.

Note that in this example test.so was compiled with
-fomit-frame-pointer; this isn't an issue as _one_ (= the caller)
stack trace is still valid (as long as you don't have the insane idea
to compile xcb with -fo-f-p).

Another issue that may appear is "tail call elimination" (some entries
are mysteriously missing; this is quite ugly, but you still get enough
information so that you can do something useful with the issue e.g. by
disassembling the relevant parts with gdb).

Signed-off-by: Jamey Sharp <jamey@minilop.net>
2007-06-06 15:54:11 -07:00
Jamey Sharp e20a31d72b xcb_poll_for_event: Return already-read events before read(2)ing again. 2007-06-02 18:29:37 -07:00
Ian Osgood 158c9b6ba1 Generate error constants as XCB_BAD_*, similar to Xlib.
The previous constants remain for compatibility, but should be deprecated.
2007-04-13 15:14:12 -07:00
Eamon Walsh eaa380efef Modify new attribute from previous patch so that it is necessary only on
extensions with split names.  Tested with diff and found no difference with
previous stylesheet header-file output.
2007-04-10 11:56:06 -04:00
Eamon Walsh 91be36f845 Replaces special-casing in c-client stylesheet with support
for new attribute.  Tested with diff and found no difference with
previous stylesheet header-file output.
2007-03-29 12:28:07 -07:00
TORRI Vincent 4a60950b74 add the first step toward the documentation of the request/reply functions. The arguments of the requests are not found yet. Josh, can you look at it ? 2007-02-27 13:35:02 +01:00
TORRI Vincent ab22a4d616 add doxygen doc for the *_end functions 2007-01-22 11:40:15 +01:00
TORRI Vincent 67af2d24e4 add doc tag for the _next functions. It creates doxygen doc in the header files for these functions 2006-11-28 20:26:54 +01:00
Jamey Sharp 3360d0c79e NetBSD doesn't have AI_ADDRCONFIG: use it only if it's available. 2006-11-24 13:24:05 -08:00
Diego 'Flameeyes' Pettenò 11738b2af0 Avoid race condition when using multiple make jobs
Avoid race condition when symlinking XML files.
When declaring a rule with many files as target, the rule is called
when any of them is requested, resulting in multiple for loops happening
during a make process using more than one job.
Also, use '$(LN_S) -f' rather than removing and recreating a file,
that one should be as supported as 'rm -f' and requires one less command.
2006-11-23 07:32:18 -08:00
Josh Triplett 608058ec80 Remove --with-opt and --with-debug options from configure.ac; use CFLAGS instead
configure supports using custom CFLAGS, so remove the --with-opt and
--with-debug options from configure.ac, and the corresponding usage of
COPTFLAGS and CDEBUGFLAGS in src/Makefile.am.
2006-11-22 22:47:15 -08:00
Jamey Sharp 183c2ba4cc xcb-proto has no libraries or headers, so don't use XCBPROTO_CFLAGS or XCBPROTO_LIBS. 2006-11-22 21:27:41 -08:00
Jamey Sharp e54dfd73a9 Use pthread-stubs as needed, and list xdmcp in Requires.private when XCB is built to use it. 2006-11-22 20:29:04 -08:00
Josh Triplett 3de6ab7b78 Replace uses of "long" with uint32_t, and similar; fixes 64-bit bugs 2006-11-21 20:29:34 -08:00
Ian Osgood 7fbfebaa3f Fix IP6 work for FreeBSD/Mac. 2006-11-21 09:04:37 -08:00
Josh Triplett 684b8271a4 Support XDM-AUTHORIZATION-1 on IPv6
Commit by Jamey Sharp and Josh Triplett.
2006-11-21 00:57:49 -08:00
Josh Triplett d6abe93b06 Refactor auth code to get display number from xcb_connect
Change xcb_connect to pass the display number to _xcb_get_auth_info, which
passes it to get_authptr.  This allows get_authptr to stop hacking the display
number out of the sockaddrs of various address families, such as
port - X_TCP_PORT, or the number after the last X in the UNIX socket path. This
also removes a portability bug introduced during the IPv6 changes: relying on
'\0'-termination of the UNIX socket path in a sockaddr_un.

Commit by Jamey Sharp and Josh Triplett.
2006-11-20 23:28:03 -08:00
Josh Triplett 4a928de402 Only use AI_NUMERICSERV if defined. 2006-11-20 22:26:40 -08:00
Josh Triplett 907f8c8c49 Support authentication for IPv6 connections
Support AF_INET6 in get_authptr, and refactor to use common code for IPv4 and
v4-mapped IPv6 addresses.

Commit by Jamey Sharp and Josh Triplett.
2006-11-20 22:16:24 -08:00
Josh Triplett 48776ce233 Support displays with IPv6 addresses or hosts which resolve to IPv6 addresses
xcb_parse_display already correctly handled IPv6 displays.  Now, _xcb_open_tcp
uses getaddrinfo, and correctly connects to IPv6 displays.  Displays can use
bare IPv6 addresses, square-bracketed IPv6 addresses, or hostnames which
resolve to IPv6 addresses.

Since IPv6 addresses may include colons, including at the end, revise the
DECnet display parsing code to avoid triggering on IPv6 addresses.

Authorization may not work with IPv6 connections yet.

This commit brought to you by the (display) number ::1:1.1, the letter X,
the Gobby collaborative editor, Josh Triplett, and Jamey Sharp.
2006-11-20 17:54:34 -08:00
Jamey Sharp 3d9bb02012 Bug #5958: Also zero out the implicit pad byte in empty requests. 2006-11-19 23:59:25 -08:00
Jamey Sharp 3fa50020d2 Remove support for the <localfield> tag: nothing needs it.
Only one use of <localfield> remained, for a list length expression in
xv.xml. List length parameters that don't actually appear in the
protocol should be left implicit: if no length expression is given, then
a localfield will be automatically created by c-client.xsl.
2006-11-19 20:59:10 -08:00
Jamey Sharp 16e7328b4a Bug #5958: zero out padding bytes in requests. 2006-11-19 17:56:32 -08:00
Jamey Sharp da4d56ef5a Provide xcb_prefetch_maximum_request_length counterpart to xcb_get_maximum_request_length. 2006-11-18 22:38:42 -08:00
Jamey Sharp aedfa1fe1d Fix Doxygen warnings.
Specifically, fixes these two warnings which were emitted for every
generated source file:

* Warning: end of file while inside a group
* Warning: group XCB_BigRequests_API already documented. Skipping documentation.
2006-11-18 22:35:53 -08:00
Jeremy Kolb jkolb@brandeis.edu 9d15516054 Added initial doxygen generation stuff. This should probably be cleaned up later.
Added support for major/minor-version attributes in the xcb tag.  This is just to give some reference and help people when using *query_version.
2006-10-29 19:31:09 -05:00
TORRI Vincent 8eba8690ad fix doxy doc 2006-10-20 07:00:15 +02:00
Jamey Sharp 094248405f Quit treating xproto specially: handle it like all the extensions. 2006-10-19 00:12:31 -07:00
Jamey Sharp 6bc0b37303 Ignore generated xinerama files. 2006-10-19 00:12:31 -07:00
Zephaniah E. Hull 5ec55dc9c0 Define and use constants for opcode numbers.
Hard coding the opcode numbers in the function just makes it harder to figure
out what's going on, but much more to the point, not defining the opcodes in
the header makes it impossible to use the generated headers instead of the
x11proto headers in the server.

The name I settled on is very simple, for an extension by the name of xconf,
and a request by the name of list_devices, we get XCB_XCONF_LIST_DEVICES.  If
this somehow causes problems, we can probably add a _OP somewhere in there,
but.

Acked-by: Jamey Sharp <jamey@minilop.net>
Closes: #8641
2006-10-14 19:52:23 -07:00
Jeremy Kolb c1504691ec Add library support for xcb-xinerama.
This is version 1.1 of the Xinerama (PanoramiX) extension.
2006-10-12 23:52:59 -04:00
Josh Triplett 7f74dd6b64 Add note to xcbxlib.h that nothing except Xlib/XCB should use it. 2006-10-08 18:16:14 -07:00
Jamey Sharp 431f210bbb Release libxcb 1.0 RC2 (0.9.92). 2006-10-07 19:50:55 -07:00
Jamey Sharp e0fac22caa Bugfix: make Plan 7 'checked' requests work correctly.
The initial implementation of Plan 7 dumped all X errors into the event
queue, because the record of a pending reply was pruned too early if an
error occurred in place of the expected reply.
2006-10-07 18:35:53 -07:00
Ian Osgood 7b84d8b650 Document xcb_generate_id. 2006-10-07 14:09:29 -07:00
Josh Triplett 9e10819a67 Move xcb_generate_id from xcbext.h to xcb.h
Since extensions no longer provide type-specific XID-generation functions,
xcb_generate_id now forms part of the xcb client API, rather than the
extension API; move it from xcbext.h to xcb.h accordingly.
2006-10-07 13:16:52 -07:00
Josh Triplett b9e49b2a47 Stop implicitly importing xproto; goes with proto change to explicitly import it 2006-10-07 01:27:36 -07:00
Jamey Sharp dd5ece6065 Declare "struct foo" or "enum foo" as well as the typedef'd name "foo". 2006-10-07 01:27:03 -07:00
Josh Triplett 16ec51397e Handle "xidunion" instead of "union" for XID unions like DRAWABLE and FONTABLE 2006-10-07 00:15:24 -07:00
Josh Triplett c73ff37b90 Refer to the "xlib lock" rather than the "IOLock" in xcbxlib.h 2006-10-06 20:14:48 -07:00
Josh Triplett 90eeb461be Remove XID wrapper structures and replace them with uint32_t typedefs
After positive feedback from several people, we have decided to remove the XID
wrapper structures that attempted to provide C type safety, and replace them
with uint32_t typedefs.  Feedback has indicated that these type-safety hacks
generated more trouble than help.

We will bump the libxcb soname at the next release.
2006-10-06 17:44:53 -07:00
Jamey Sharp 9bd2c0c58f Remove xcb_get_io_lock from the Xlib-specific API: it is no longer used. 2006-10-06 16:47:50 -07:00
Jamey Sharp 34168ab549 Remove the 'int *error' out-parameter for xcb_poll_for_event. 2006-10-06 16:35:36 -07:00
Jamey Sharp 40589db812 Add xcb_xlib_lock and xcb_xlib_unlock, a special-purpose two-level recursive lock just for libX11. 2006-10-04 15:01:00 -07:00
Jamey Sharp 57b0cd8fea Factor out pthread_mutex_lock and unlock calls for the iolock. 2006-10-04 14:52:49 -07:00
Josh Triplett f7cd80142f Stop installing the protocol descriptions for extensions to an extensions/
subdirectory
2006-09-25 05:10:37 -07:00
Josh Triplett 9100981d35 Split the Xlib compatibility functions into a separate library libxcb-xlib
We don't want to have to change the libxcb soname if we later manage to remove
the Xlib compatibility functions, and nothing except Xlib should ever use
them, so split them into a separate library.
2006-09-25 02:57:19 -07:00
Jamey Sharp 46b7dbdd93 We no longer need xproto: do not list it as a dependency. 2006-09-25 02:00:23 -07:00
Jamey Sharp cf80bab8e6 Lowercase library names to correspond with the new API. 2006-09-25 01:42:12 -07:00
Josh Triplett 16516a5e94 Remove the xcb_[extension]_init functions; use xcb_get_extension_data directly 2006-09-23 14:44:15 -07:00
Josh Triplett 9691890529 More fixups for incorrect API conversions by api_conv.pl 2006-09-23 14:17:52 -07:00
Josh Triplett 86a4c0cc28 We do not conflict with Xmd.h anymore; remove the include hack from xcb_auth.c 2006-09-23 13:33:43 -07:00
Josh Triplett 4ff12a1a94 Fix some mis-conversions by api_conv.pl, and remove the now-unused Xmd types 2006-09-23 13:31:13 -07:00
Josh Triplett a3bd6f4760 The Great XCB Renaming
Rename API to follow a new naming convention:
* XCB_CONSTANTS_UPPERCASE_WITH_UNDERSCORES
* xcb_functions_lowercase_with_underscores
* xcb_types_lowercase_with_underscores_and_suffix_t
* expand all abbreviations like "req", "rep", and "iter"

Word boundaries for the names in the protocol descriptions fall:
* Wherever the protocol descriptions already have an underscore
* Between a lowercase letter and a subsequent uppercase letter
* Before the last uppercase letter in a string of uppercase letters followed
  by a lowercase letter (such as in LSBFirst between LSB and First)
* Before and after a string of digits (with exceptions for sized types like
  xcb_char2b_t and xcb_glx_float32_t to match the stdint.h convention)

Also fix up some particular naming issues:
* Rename shape_op and shape_kind to drop the "shape_" prefix, since otherwise
  these types end up as xcb_shape_shape_{op,kind}_t.
* Remove leading underscores from enums in the GLX protocol description,
  previously needed to ensure a word separator, but now redundant.

This renaming breaks code written for the previous API naming convention.  The
scripts in XCB's tools directory will convert code written for the old API to
use the new API; they work well enough that we used them to convert the
non-program-generated code in XCB, and when run on the old program-generated
code, they almost exactly reproduce the new program-generated code (modulo
whitespace and bugs in the old code generator).

Authors: Vincent Torri, Thomas Hunger, Josh Triplett
2006-09-23 12:22:22 -07:00
Jamey Sharp 91568d7070 Make xcb_conn.c agree that XCBSetupReq is now XCBSetupRequest. 2006-09-22 15:37:49 -07:00
Alan Coopersmith 2538acd8c8 List xproto.xml path explicitly instead of relying on GNU Make $< expansion
(Some non-gnu makes, such as Solaris make, only recognize $< in implicit
 suffix rules, not explicit ones like this.)
2006-09-22 15:11:39 -07:00
Jamey Sharp 2c8b5994b3 Shut down the connection in all "fatal" error cases. 2006-09-21 15:35:01 -07:00
Jamey Sharp 79e3227022 Add a private connection shutdown method for error cases. 2006-09-21 15:31:14 -07:00
Jamey Sharp 7f71bf9c0f Make all public functions do nothing on an error connection. 2006-09-21 15:18:57 -07:00
Jamey Sharp 0aa96bfc7a Convert connection functions to return error objects. 2006-09-21 15:17:18 -07:00
Jamey Sharp ac17ae62fe Provide a "has error" property for XCBConnection. 2006-09-21 15:17:18 -07:00
Jamey Sharp df7fb77d6e Refactor XCBPollForEvent with a shorter critical section.
This simplifies the patch for bug #8208 later.
2006-09-21 15:05:01 -07:00
Jamey Sharp 3cc0ddf0e6 Fix bug #7261: events do not signal the end of replies for that sequence number. 2006-09-18 14:49:22 -07:00
Jamey Sharp a92716f1da Finish removing deprecated functions. Fixes build failure (oops). 2006-09-13 12:15:23 -07:00
Jamey Sharp 476ccc1ba3 Ignore xproto.xml that now gets copied in while building. 2006-09-12 13:43:17 -07:00
Jamey Sharp 0d7fb3afdd Remove deprecated public API functions in preparation for 1.0 release. Xlib-specific deprecation remains. 2006-09-12 13:25:49 -07:00
Bart Massey d4e768fc32 Cleaned up previous fix for GNU Make stuff.
Got "make distcheck" to work (whatever that does).
2006-09-12 00:42:11 -07:00
Bart Massey 0c3e528563 Removed GNU make dependency.
Made extensions directory persist.
2006-09-11 23:29:10 -07:00
Jamey Sharp 81d6fd64c0 Handle XC-MISC request failure when allocating new XIDs. (fixes #7001) 2006-09-09 15:52:37 -07:00
Josh Triplett dbd2d96893 Implement error handling plan 7.
Needs improvement: should not duplicate the code of every request function.
2006-07-30 22:03:50 -07:00
Josh Triplett 65ed274f05 Parameterize context in cookie-type and request-matching template. 2006-07-30 22:03:46 -07:00
Jamey Sharp f74487e34f Fix Keith's 32-bit wrap fix.
Issue 0, 1, or 2 syncs as needed and do not handle 16-bit wrap until
absolutely necessary.
2006-07-30 17:03:27 -07:00
Josh Triplett 13896d8f65 Fix typo: s/request/sequence/ 2006-07-30 15:09:03 -07:00
Josh Triplett 685d8c76c2 Add XCBRequestCheck function needed for Plan 7. 2006-07-30 14:42:55 -07:00
Eric Anholt b3a2f83f1e Restore netinet/in.h include that was removed in the DECnet commit. 2006-07-28 15:29:05 -07:00
Eric Anholt b7c96681b2 Replace HAVE_* tests with just checking for (__solaris__)
The installed headers can't be relying on the presence of the internal
config.h defines, and it was breaking the xcb build for me as well due to
config.h not being included early enough.
2006-07-25 09:13:59 -07:00
Ian Osgood 8ba93ebb75 Fix build on Solaris (use inttypes.h) 2006-07-07 07:18:41 -07:00
Ian Osgood e0574a617b Finally remove X.h from xcb.h, fix broken image tests. 2006-07-01 00:55:08 -07:00
Keith Packard db2504130b Switch sequence comparisons to handle 32-bit sequence number wrap.
Create a macro, XCB_SEQUENCE_COMPARE, that accepts two sequence numbers and
a comparison operator and correctly handles 32-bit wrap around.
Rewrite all ordered sequence number comparisons to use this macro.
Also, caught one error where a sequence was stored in a signed int variable.
Push out a GetInputFocus request when the sequence number does wrap at 32
bits so that applications cannot see sequence 0 (as that is an error
indicator).
2006-07-01 00:16:07 -07:00
Josh Triplett 75fead5b86 Remove arbitrary division between xcb_types and xproto by merging
xcb_types.xml into xproto.xml.
2006-06-15 03:03:13 -07:00
TORRI Vincent 62749d54fd fix compilation with c++ compilers. Remove some trailing spaces 2006-06-08 06:59:47 +02:00
Ian Osgood 829188cdd6 Deprecate XCBSync, move to XCBAuxSync. 2006-05-30 11:54:25 -07:00
Jamey Sharp 936077cbc8 Use correct word offset when testing for GetFBConfigsSGIX VendorPrivate. 2006-05-14 22:49:18 -07:00
Josh Triplett 442730a9a2 In the GLX workaround, use !strcmp to check for equality with "GLX", not strcmp. 2006-05-14 22:37:55 -07:00
Josh Triplett 2e49f58e4c Stop overwriting CFLAGS in xcb/src/Makefile.am. 2006-05-10 14:22:27 -07:00
Donnie Berkholz 92456577db Fix dependencies on libXCB.la to not walk down from $(top_builddir); this fixes parallel builds. 2006-05-07 15:44:37 -07:00
Ian Osgood e6132aff2f Move the remainder of the constants in X.h into XML enumerations.
Fix xcb_auth to use one of the new enumerations.
2006-04-28 15:27:09 -07:00
Josh Triplett 5c35ea63db Add an explanation of libtool -version-info to src/Makefile.am, and add an explicit -version-info 0:0:0 for all libraries. 2006-04-27 17:20:52 -07:00
Josh Triplett 135cda6e9d Fix a comment for the renaming of XCBConnSetupSuccessRep to XCBSetup, and fix another comment which had a copy-paste error. 2006-04-27 13:47:21 -07:00
Jamey Sharp 3e213a1bec Declare arguments const in the various structure accessors, so XCBGetSetup is not so painful to use. 2006-04-27 10:34:22 -07:00
Jamey Sharp dd932e025b Rename ConnSetup* to Setup*, Setup*Rep to Setup*, and SetupSuccess* to Setup*. Provide deprecated backwards-compatability functions and typedefs for the old names, to be removed before 1.0. 2006-04-26 23:19:16 -07:00
Ian Osgood 1476dcecfd Changes to makefile to build libXCBxtest 2006-04-26 10:50:31 -07:00
Patrick Caulfield bb8cf58015 Add support for DECnet. Still needs configure-script options to enable. 2006-04-24 08:29:18 -07:00
Jamey Sharp 771761ccaa Minor performance improvement: do not call _xcb_in_expect_reply unless it is needed. It is not often needed. 2006-04-20 11:51:01 -07:00
Jamey Sharp 8953a14f2b Add <sys/select.h> to xcb_in.c to fix bug #6122. 2006-04-19 22:48:10 -07:00
Alan Coopersmith 05a66af895 Bugfix: xcb_conn.c included <sys/fcntl.h> instead of the POSIX-standard <fcntl.h>. 2006-04-19 21:51:33 -07:00
Jamey Sharp f090da98f3 Remove the last goto in XCB: XCBWaitForReply now permits multiple threads to force the same cookie. 2006-04-19 20:31:20 -07:00
Jamey Sharp d5347485a5 Restructure XCBWaitForReply to eliminate two gotos. 2006-04-19 20:23:37 -07:00
Jamey Sharp d5ab03b4b7 Fixed poll_for_reply, added comments, and refactored XCBWaitForReply to call poll_for_reply. 2006-04-19 20:15:15 -07:00
Jamey Sharp 7667adbc63 Add XCBPollForReply and deprecate XCBGetRequestRead and XCBGetQueuedRequestRead. 2006-04-19 16:49:32 -07:00
Josh Triplett 53971ea183 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xcb 2006-04-16 11:23:52 -07:00
Josh Triplett cc075990f4 Add xcbint.h to noinst_HEADERS, so it gets distributed. 2006-04-15 20:21:22 -07:00
Josh Triplett cb6e1849b6 Use screensaver.xml 2006-04-15 14:17:52 -07:00
Josh Triplett 91aeea2a3e Put EXTHEADERS and EXTSOURCES in order. 2006-04-15 12:52:05 -07:00
Josh Triplett ff38c17c48 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.
2006-04-15 12:26:03 -07:00
Eric Anholt 8275ac3a4a Retry a select() if it returns with EINTR. Fixes IO errors in Xephyr, which is
often interrupted by timers.
2006-04-09 19:51:10 -07:00
Eric Anholt 66a88ed0e5 Remove unnecessary include. Noticed by jamey. 2006-04-09 19:19:12 -07:00
Jamey Sharp df5d8adc1f The typedefs replacing Xmd.h conflict with Xmd.h. Here is a hacky workaround: FIXME! 2006-03-16 11:27:06 -08:00
Ian Osgood 5ccf7216d2 Change <bit> syntax to <bit>n</bit> as Jamey and Josh suggested
and add more button, key, and graphics enumerations.
2006-03-15 22:41:08 -08:00
Ian Osgood 35ecaf45be Remove proto/X11 dependencies from xcb-demo. 2006-03-15 10:09:47 -08:00
Ian Osgood 4142e34695 Remove xcb-util dependency on proto/X11
by moving many defs from X.h to <enum>s in xproto.xml
2006-03-14 18:23:37 -08:00
Ian Osgood f5c4956a81 Fix XCBGetSetup to match prototype. 2006-03-14 11:53:01 -08:00
Ian Osgood 9472c251ae Merge branch 'master' of git+ssh://iano@git.freedesktop.org/git/xcb 2006-03-14 11:44:43 -08:00
Ian Osgood 71ddf29d00 Add an expression construct <bit bit="n"/>
for mask enumerations such as CW flags.
Replaces the C-specific use of 1<<n in xproto.xml
2006-03-14 10:18:22 -08:00
TORRI Vincent 0d648ac0ab doxygen documentation of the API 2006-03-14 07:40:39 +01:00
Ian Osgood a810d1ffe4 Remove dependencies on Xmd.h and X.h
(Still including X.h until defs are moved to xproto.xml
 and xcb-util and xcb-demo are fixed to use them.)
2006-03-13 17:49:17 -08:00
Ian Osgood be1302b6ef Remove last deprecation warning. 2006-03-13 10:36:13 -08:00
Ian Osgood d8de2c7c2a Merge branch 'master' of git+ssh://iano@git.freedesktop.org/git/xcb 2006-03-12 23:03:24 -08:00
Ian Osgood e7576738c3 Restructure to remove most deprecation warnings. 2006-03-12 23:02:45 -08:00
Jamey Sharp 5e0cfa84be Use libXdmcp, if available with XdmcpWrap, for XDM-AUTHORIZATION-1. Closes bug #6106. 2006-03-12 17:15:50 -08:00
Jamey Sharp d69c403cba Merge branch 'master' of git+ssh://git.freedesktop.org/git/xcb 2006-03-12 13:36:33 -08:00
Jamey Sharp b83f18a4cc Only _xcb_conn_wait calls _xcb_out_write now, so move it to xcb_conn.c and make it static. 2006-03-12 13:20:29 -08:00
Jamey Sharp fb61c94d68 Remove c->out.vec. Pass iovecs directly down the call tree. Add _xcb_out_flush_to, refactor other functions, make write_block static. 2006-03-12 12:40:34 -08:00
Jamey Sharp 5cdc02e344 Portability fixes. Should help DragonFly and Solaris, and should not hurt anything else. Tested only on linux so far though. 2006-03-11 20:32:04 -08:00
Jamey Sharp 83e652f566 Move c->out.vec refs out of _xcb_conn_wait up to _xcb_out_flush. 2006-03-09 00:02:42 -08:00
Jamey Sharp 5b0ae3421d Merge branch 'master' of git+ssh://git.freedesktop.org/git/xcb 2006-03-08 22:50:48 -08:00
Jamey Sharp fd1f9cb13f Unify autofoo .gitignore bits into one top-level file, and remove resulting redundancies. 2006-03-08 22:49:59 -08:00
Ian Osgood 1261a4150c Add symbols for error and reply response_types,
and use XCBKeymapNotify from xcb-proto.
2006-03-08 22:26:20 -08:00
Ian Osgood 6fb661f3ff Bugfix: null-terminate the path in sockaddr_un before using it.
This may fix itermittant connect failures.
2006-03-08 21:56:57 -08:00
Jamey Sharp 621f891c49 Move c->out.vec refs out of _xcb_out_write up to _xcb_conn_wait. 2006-03-08 14:21:16 -08:00
Jamey Sharp c491eeb9a9 Fix off-by-one error that kept the last byte(s) of the output queue from being used. 2006-03-07 21:19:58 -08:00
TORRI Vincent 522a6e0eac Use the GCC 4 visibility extension to mark everything in xcbint.h hidden. 2006-03-07 10:25:23 -08:00
Jamey Sharp d1cfd4d0a2 Off-by-one error in the sequence-wrapping proof, and therefore in the corresponding code. 2006-03-06 01:10:20 -08:00
Jamey Sharp e5458e477d Implement provably-correct sequence wrap handling. Add flag XCB_REQUEST_DISCARD_REPLY. 2006-03-05 00:20:50 -08:00
Jamey Sharp 29f9fe0fc8 API/ABI change: XCBSendRequest returns the sequence number instead of using an out-parameter. Now 0 is a special sequence number indicating failure. 2006-03-03 11:08:10 -08:00
Jamey Sharp 255c21b17f Add 32-bit full_sequence fields to generic errors and events, so callers can always correlate events and errors with requests correctly. 2006-03-03 01:45:00 -08:00
Jamey Sharp 622b599c8f Tweak to previous API change: Require that spare iovecs fall before vector[0]. Leave vector in well-defined state. 2006-03-02 23:39:38 -08:00
Jamey Sharp 87905f0579 assert() that XCBSendRequest was handed enough space to set opcodes and short length fields. 2006-03-02 23:31:35 -08:00
Jamey Sharp 45e1cc0935 Bugfix: The fixed-length part needs two iovecs reserved, just like all the other parts. 2006-03-02 23:12:21 -08:00
Jamey Sharp b46953f46c Use XPath position() function instead of xsl:number, to evaluate array indices while generating code for easier readability. 2006-03-02 23:05:08 -08:00
Jamey Sharp 5e115e2441 API/ABI change: XCBSendRequest callers must pad to 4-byte boundaries now. When not in RAW mode, a null pointer for iov_base is replaced by up to 3 padding bytes. 2006-03-02 15:35:31 -08:00
Jamey Sharp ed823bf651 Separate notion of request-completed from current-request, and mark requests completed more aggressively. Detects some usage errors that are otherwise undetectable. 2006-03-02 13:49:00 -08:00
Jamey Sharp c05ae15b66 Buffer a couple CARD32s on the stack instead of using an extra iovec. Also a bugfix: do not hold a reference to longlen after it goes out of scope. 2006-02-27 12:12:33 -08:00
Jamey Sharp 8f991bdd38 Add XCB_REQUEST_RAW flag for XCBSendRequest. 2006-02-27 11:03:13 -08:00
Jamey Sharp 5e350126a7 Bugfix: how about *not* leaking all pending_replies when no reply matches, as often happens with Xlib? 2006-02-27 10:53:08 -08:00
Jamey Sharp 731c85762d Move test for other writing threads *before* allocating a sequence number. 2006-02-27 02:57:36 -08:00
Jamey Sharp 8ab4dcde9d _xcb_list is no longer used, so remove it. Simplify _xcb_map. 2006-02-27 02:14:48 -08:00
Jamey Sharp 76ad79a7ad Replace readers generic list with hand-written typesafe version. 2006-02-27 01:43:07 -08:00
Jamey Sharp fa71b9b835 Rename struct XCBReplyData to reader_list to follow my naming conventions and better reflect its purpose. 2006-02-27 01:06:15 -08:00
Jamey Sharp ff665b5726 In struct XCBReplyData, change void *data to pthread_cond_t *data. That was dumb. 2006-02-27 00:54:59 -08:00
Jamey Sharp 50acfeae36 Delete unused xcb_list functions and refactor others. 2006-02-26 23:43:44 -08:00
Jamey Sharp 86ce18c22c Replace current_reply generic queue with hand-written version. No generic queues remain so delete their implementation. 2006-02-26 22:58:17 -08:00
Jamey Sharp 0f130b4d94 Replace events generic queue with hand-written typesafe version. 2006-02-26 18:28:50 -08:00
Jamey Sharp ff7b6c9124 API/ABI break: Add flags to XCBSendRequest, first for error-checked requests.
There's no more race condition between event and reply handling.
The *RequestBlind and *RequestChecked functions are not yet implemented.
2006-02-26 15:45:08 -08:00
Jamey Sharp 7875040fa1 Replace pending_replies generic queue with a hand-implemented typesafe version. 2006-02-26 02:00:03 -08:00
Jamey Sharp a1eff0c49a Replace my old generic map ADT with a growable array for the extension cache. 2006-02-26 01:27:01 -08:00
Jamey Sharp 46a7549981 XCB has not had tracing features for a long time: remove the remnants. 2006-02-25 23:27:47 -08:00
Jamey Sharp b6cbe83774 Rearrange an if statement that's been bothering me. 2006-02-25 23:26:55 -08:00
Jamey Sharp f27166f49b Coalesce _xcb_writev into _xcb_out_write and simplify. 2006-02-24 02:17:36 -08:00
Jamey Sharp bae98d3604 Move _xcb_set_fd_flags to xcb_conn.c and make it static. xcb_util.c now has only public functions. 2006-02-24 01:50:48 -08:00
Jamey Sharp 67b2649dc4 Move _xcb_read_block to xcb_in.c and make it static. Change calls in xcb_conn.c to _xcb_in_read_block instead. 2006-02-24 01:40:45 -08:00
Jamey Sharp 838317f4d3 Remove XCB_CEIL and use a simpler definition for XCB_PAD. 2006-02-24 01:17:03 -08:00
Jamey Sharp 1b50d2ee1e Quit using "-include config.h": use #ifdef HAVE_CONFIG_H etc. like everyone else. 2006-02-24 01:04:48 -08:00
Jamey Sharp e1c2777aba Coalesce readn into _xcb_in_read and simplify. 2006-02-24 00:59:08 -08:00
Jamey Sharp 3f8d0bd532 Move _xcb_readn to xcb_in.c and make it static. Minor change to _xcb_read_block to not depend on _xcb_readn. 2006-02-24 00:48:18 -08:00
Jamey Sharp cdf362f33a Bugfix: protect the output queue from being written while another thread is flushing it. 2006-02-24 00:25:34 -08:00
Jamey Sharp 4e91ae275e Simplify: Always use writev. (In _xcb_out_flush, convert the output queue to a single iovec if needed.) 2006-02-24 00:02:43 -08:00
Jamey Sharp 7f0bc778c8 Factor padding out of _xcb_out_write_block and into its callers, XCBSendRequest and write_setup.
This requires dynamically allocating memory in XCBSendRequest, but this
malloc/free pair turns out to cause a 30% speed hit for the 'x11perf -noop'
test -- so for the moment I use alloca where available and fall back to malloc
on other platforms. Later I think I'll change the contract of XCBSendRequest
so the caller is responsible for memory allocation, because the caller ought
to always be able to stack-allocate here.
2006-02-23 22:41:59 -08:00
Jamey Sharp 6e29e5f2ee Add XCBGetQueuedRequestRead for Xlib that does no syscalls, just returns whatever XCB already knows about. 2006-02-23 17:50:53 -08:00
Jamey Sharp 26ac6292ba Minor performance fix: Change the contract on XCBGetRequestSent so that it does not waste time re-locking. This is for Xlib, and Xlib has already locked. 2006-02-23 15:29:40 -08:00
Jamey Sharp a736674943 Minor performance fix: Only rearrange buffers for BIG-REQUESTs. 2006-02-23 14:57:46 -08:00
Jamey Sharp e866bed934 Move request_written update back where it was for now: doing it early can cause XCBWaitForReply to wrongly believe that the request has been flushed. Eventually, we should fix bug #6021. 2006-02-23 14:32:11 -08:00
Jamey Sharp 1b83f8f8f3 Remove _xcb_assert_valid_sequence. One test is trivially true, and the other may be temporarily violated without anything bad happening. 2006-02-23 14:30:08 -08:00
Jamey Sharp 55c1842686 Move _xcb_write and _xcb_writev to xcb_out.c and make them static, since only _xcb_out_write calls them. 2006-02-23 12:48:27 -08:00
Jamey Sharp 6149c7a6b5 More return value changes, and make _xcb_in_read_packet static since it is not called from outside xcb_in.c. 2006-02-23 12:15:09 -08:00
Jamey Sharp 5b1d39e27b More return value changes. 2006-02-23 11:50:12 -08:00
Jamey Sharp 662479760c Make the return value of _xcb_conn_wait boolean, instead of syscall-like. 2006-02-23 10:17:40 -08:00
Jamey Sharp f8a8b465e0 Bugfix: move request_written update *before* _xcb_conn_wait in _xcb_out_flush. Otherwise a reply may be read before we record that we have sent the request, and then XCB gets... confused. 2006-02-22 23:38:16 -08:00
Jamey Sharp e0a3578383 Remove USE_THREAD_ASSERT compile option. _xcb_conn_wait can no longer be re-entered, since we have no callback hooks now. 2006-02-22 23:11:36 -08:00
Jamey Sharp a7d749ec3f Remove vestiges of adjacent request combining implementation. It is very dead. 2006-02-22 23:09:29 -08:00
Jamey Sharp 06c788932b Control debugging, optimization, and warning flags all independently. 2006-02-20 00:41:39 -08:00
Eric Anholt f825a32135 Add missing entries to .gitignore files. 2006-02-18 23:05:32 -08:00
Eric Anholt d16efb5191 Move .cvsignore to .gitignore. 2006-02-18 22:56:03 -08:00
Jamey Sharp 5b7182c659 Workaround X server bug, fd.o #3210: if a GLXGetFBConfigs request is sent, fix the length field in the reply. 2006-02-18 18:12:40 -08:00
Josh Triplett 47ceed7861 Remove xcl and CVSROOT. 2006-02-18 16:49:41 -08:00