Import Upstream version 1.14

This commit is contained in:
openKylinBot 2022-05-14 01:27:19 +08:00
commit 7640f1359f
91 changed files with 83280 additions and 0 deletions

3
.autom4te.cfg Normal file
View File

@ -0,0 +1,3 @@
begin-language: "Autoconf-without-aclocal-m4"
args: --cache=build-aux
end-language: "Autoconf-without-aclocal-m4"

30
COPYING Normal file
View File

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

7421
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

370
INSTALL Normal file
View File

@ -0,0 +1,370 @@
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the `make install' phase executed with root
privileges.
5. Optionally, type `make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior `make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type `make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other
targets like `make install' and `make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. This
is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'. Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the `DESTDIR' variable. For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names. The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of `make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved. Use GNU `make'
instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

115
Makefile.am Normal file
View File

@ -0,0 +1,115 @@
ACLOCAL_AMFLAGS=-I m4
SUBDIRS=src tests doc man
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = xcb.pc
if BUILD_COMPOSITE
pkgconfig_DATA += xcb-composite.pc
endif
if BUILD_DAMAGE
pkgconfig_DATA += xcb-damage.pc
endif
if BUILD_DPMS
pkgconfig_DATA += xcb-dpms.pc
endif
if BUILD_DRI2
pkgconfig_DATA += xcb-dri2.pc
endif
if BUILD_DRI3
pkgconfig_DATA += xcb-dri3.pc
endif
if BUILD_GLX
pkgconfig_DATA += xcb-glx.pc
endif
if BUILD_PRESENT
pkgconfig_DATA += xcb-present.pc
endif
if BUILD_RANDR
pkgconfig_DATA += xcb-randr.pc
endif
if BUILD_RECORD
pkgconfig_DATA += xcb-record.pc
endif
if BUILD_RENDER
pkgconfig_DATA += xcb-render.pc
endif
if BUILD_RESOURCE
pkgconfig_DATA += xcb-res.pc
endif
if BUILD_SCREENSAVER
pkgconfig_DATA += xcb-screensaver.pc
endif
if BUILD_SHAPE
pkgconfig_DATA += xcb-shape.pc
endif
if BUILD_SHM
pkgconfig_DATA += xcb-shm.pc
endif
if BUILD_SYNC
pkgconfig_DATA += xcb-sync.pc
endif
if BUILD_XEVIE
pkgconfig_DATA += xcb-xevie.pc
endif
if BUILD_XFREE86_DRI
pkgconfig_DATA += xcb-xf86dri.pc
endif
if BUILD_XFIXES
pkgconfig_DATA += xcb-xfixes.pc
endif
if BUILD_XINERAMA
pkgconfig_DATA += xcb-xinerama.pc
endif
if BUILD_XINPUT
pkgconfig_DATA += xcb-xinput.pc
endif
if BUILD_XKB
pkgconfig_DATA += xcb-xkb.pc
endif
if BUILD_XPRINT
pkgconfig_DATA += xcb-xprint.pc
endif
if BUILD_SELINUX
pkgconfig_DATA += xcb-xselinux.pc
endif
if BUILD_XTEST
pkgconfig_DATA += xcb-xtest.pc
endif
if BUILD_XV
pkgconfig_DATA += xcb-xv.pc
endif
if BUILD_XVMC
pkgconfig_DATA += xcb-xvmc.pc
endif
if BUILD_GE
pkgconfig_DATA += xcb-ge.pc
endif
AM_TESTS_ENVIRONMENT = \
AM_SRCDIR=${srcdir}
TESTS=check-pc-requires
EXTRA_DIST = \
tools/README \
tools/api_conv.pl \
tools/constants \
autogen.sh \
README.md \
$(TESTS)
MAINTAINERCLEANFILES = ChangeLog INSTALL
.PHONY: ChangeLog INSTALL
INSTALL:
$(INSTALL_CMD)
ChangeLog:
$(CHANGELOG_CMD)
dist-hook: ChangeLog INSTALL

1395
Makefile.in Normal file

File diff suppressed because it is too large Load Diff

598
NEWS Normal file
View File

@ -0,0 +1,598 @@
Release 1.14 (2020-02-22)
=========================
* Add xcb_total_read() and xcb_total_written() API
* Support check >= 0.13 API (for make check)
* Bug fix to handle EINTR from recvmsg
* Only require pthread-stubs on non-Linux platforms
Release 1.13.1 (2018-09-27)
===========================
* Don't flag extra reply in xcb_take_socket
Release 1.13 (2018-02-28)
=========================
* Add support for variable-sized lists of FDs
* Poll for events when blocking waiting for special events
* xinput: Enable XInput extension by default
* ge: Add explicit support for GenericEvent extension
* Fix documentation warnings from clang
* Cosmetic cleanups
Release 1.12 (2016-05-18)
=========================
* configure: Various fixes for dri3 and FD passing support
* configure: Don't report all the warning CFLAGS
* configure: Disable Xevie and Xprint by default
* Add support for various new constructs in the XML schema
* Make some functions also accept connections in an error state
* Never return NULL from xcb_get_setup()
* Use Requires.private in .pc files to avoid overlinking
* Fix align-pads for switches which start at unaligned positions
* Use anonymous structs for some nested structs
* Also generate accessors for variable-sized events and requests
* Improved python3 compatibility
* Generate C99 initializers instead of comments
* Various simplifications to the python code
* Fix line breaks in xcb-requests manual page
* Always close FDs in xcb_send_fd()
* Fix thread-safety issues with FD passing
* Add xcb_send_request_with_fds() and xcb_send_request_with_fds64()
* Fix endless loop with too many outstanding FDs to send
* Link with winsock library on MinGW
* Disable some unfinished API for some server-side code by default
* Use align-offsets computed by xcb-proto instead of low bits of pointers
* Fix iterator interaction with align padding
* Stop serializing padding by default
* Increase unix socket send buffer to at least 64KiB
Release 1.11.1 (2015-09-06)
===========================
* Expose 64-bit sequence numbers for XLib
* Fix some hangs related to xcb_wait_for_special_event()
Release 1.11 (2014-08-01)
=========================
* Force structures with 64-bit fields to be packed
* Add support for <pad align="n">
* Use X.org's build machinery from xorg-macros
* Fix leak with xcb_disconnect() and connections in an error state
* Make xcb_disconnect(NULL) safe
* Use less #include statements in generated code
* Automatically validate the Requires lines in our .pc.in files
* Fix a race that resulted in a failed assertion
* Improve launchd secure socket support
* Improve API documentation
* Remove trailing whitespaces
* c_client.py: prefix all monkey-patched fields with c_
* c_client.py: make the man page output deterministic
* c_client.py: remove useless generated comments
* xcb.h: add 'struct' before xcb_setup_t, xcb_query_extension_reply_t
Release 1.10 (2013-12-22)
=========================
* Bump libxcb-xkb SONAME due to ABI break introduced in 1.9.2
* Enable libxcb-xkb by default
* Bump libxcb-sync SONAME
* c_client.py: Fix _sizeof() functions
* c_client.py: Do not create pointers in unions
* c_client.py: Always initialize xcb_align_to
* Re-introduce xcb_ge_event_t (deprecated, xcb_ge_generic_event_t should be
used instead)
* Fix alignment issues in FD passing code
* Fix poll() if POLLIN == ROLLRDNORM|POLLRDBAND
* Use /usr/spool/sockets/X11/ on HP-UX for UNIX sockets
* Make xsltproc optional
Release 1.9.3 (2013-11-07)
==========================
* Check if we need to define _XOPEN_SOURCE for struct msghdr.msg_control
* Add configure option to enable or disable fd passing with sendmsg
* Switch to using the CMSG_* macros for FD passing
* Initialize automake earlier (bugfix for #66413)
Release 1.9.2 (2013-11-07)
==========================
* Add Present extension
* Add DRI3 library
* Add event queue splitting
* Add support for receiving fds in replies
* Add xcb_send_fd API
* Remove xcb_ge_event_t from xcb.h
* c_client.py: Inject full_sequence into GE events
* c_client.py: Handle multiple expr. in a bitcase
Release 1.9.1 (2013-05-30)
==========================
* Fix python code to work with python-3
* Security fix for integer overflow in read_packet() [CVE-2013-2064]
Release 1.9 (2012-10-05)
========================
* Always include "config.h" at the start of all C source files.
* Add AC_USE_SYSTEM_EXTENSIONS to allow use of more system functionality
* Return connection failure if display string specifies non-existent screen
* c_client: Fix parallel-make issue creating 'man' directory
* xcb_connect: launchd: Don't fall back on tcp if $DISPLAY is a path to a launchd socket
* c_client.py: generate manpages
* Allow xcb_send_request with >MAX_IOV iovecs
* Add a .gitignore for src/man/
* Fix a multi-thread deadlock
Release 1.8.1 (2012-03-09)
==========================
- Fix a busy loop on BSD and Mac OS
- Bump xcb-proto requirement
- Fallback to TCP if no protocol is specified and the UNIX connection fails
- Update use of error_connection under WIN32 to _xcb_conn_ret_error()
- Fix build of xcb_auth.c with XDMCP on WIN32
- Revert "Fix include order with Xdmcp on WIN32"
- darwin: Use read(2) rather than recv(2)
- Add xkb_internals and xkb_issues to EXTRA_DIST.
Release 1.8 (2012-01-11)
========================
- xcb_disconnect: call shutdown() to force a disconnect
- Use special path to sockets when running under Solaris Trusted Extensions
- Remove unused DECnet code
- Add #include <sys/socket.h> to xcb_conn.c
- Make launchd code in xcb_util.c match surrounding code indent levels
- If protocol is "unix", use a Unix domain socket, not TCP
- Added more error states and removed global error_connection
- Handle XGE events with the "send event" flag
- added xcb_sumof() with restriction to uint8_t
- xkb: updated configure.ac/Makefile.am
- xkb: added pkg config file
- special case 'intermixed variable and fixed size fields': fixed reply side, needs testing
- added accessors for special cases
- Add support for building with Python 3
- Insert, not append explicit xcbgen dir python path
- xcb_request_check: Sync even if an event was read for this sequence.
- _xcb_conn_wait: Shut down the connection on unexpected poll() events.
- xcb_send_request: Send all requests using a common internal send_request.
- xcb_request_check: Hold the I/O lock while deciding to sync.
- xcb_discard_reply: Simplify by re-using poll_for_reply helper.
- xcb_in: Use 64-bit sequence numbers internally everywhere.
- Enable AM_SILENT_RULES on automake 1.11 or newer.
- Factor reader_list management out of wait_for_reply.
- Dequeue readers that can't receive any new responses.
- Delete the old c-client.xsl.
- Keep ALIGNOF definition out of the public namespace.
- darwin: Don't use poll() when expected to run on darwin10 and prior
- Add Win32
- Allow disconnecting connections that are in error state.
- Make xcb_take_socket keep flushing until idle
- Support pre-IPv6 systems (without getaddrinfo)
- Drop AI_ADDRCONFIG when resolving TCP addresses
- xcb_auth: Fix memory leak in _xcb_get_auth_info.
- Don't emit out-of-module sizeof definitions
- Clean up a couple of warnings in xprint
- Prevent reply waiters from being blocked.
- Prevent theoretical double free and leak on get_peer_sock_name.
- Introduce a variant of xcb_poll_for_event for examining event queue.
- xcb_take_socket: Document sequence wrap requirements
- Compute alignment correctly
- Fix a dead-lock due to xcb_poll_for_reply
Release 1.7 (2010-08-13)
========================
- Always wake up readers after writing
- Get rid of PATH_MAX and MAXPATHLEN
- Add ~ operator support in code generator
- xcb_open: Improve protocol/host parsing
- xcb_connect_to_display_with_auth_info: Fix memory leak
- Report which extensions are being built
Release 1.6 (2010-04-09)
========================
- darwin: xnu doesn't support poll on ttys on the master side
- Fix descriptor leak on memory error path
- Support xcb_discard_reply
- Open the X11 socket with close-on-exec flag
- Fix authentication on hpux and Hurd
Release 1.5 (2009-12-03)
========================
- setsockopt(SO_KEEPALIVE) on TCP display connections
- Add DRI2 support
- Fix check dependency
- Cygwin build fix: Add -no-undefined to libtool flags
Release 1.4 (2009-07-15)
========================
* Add majorCode, minorCode and resourceID fields to X generic error
* Fix precedence bug: wrong length for big-requests preceded by sync
* Fix libxcb-randr version info
Release 1.3 (2009-05-29)
========================
* Copy full IPv4 mapping (Bug #20665)
* Fix XID allocation
* Use poll() instead of select() when available
* Fix local socket connection on Hurd
* Fix XDM-AUTHORIZATION-1
* Disable Nagle on TCP socket
Release 1.2 (2009-02-17)
========================
* Stop packaging auto-generated C files into tarball.
Release 1.1.93 (2008-12-11)
===========================
Enhancements:
* Apple: Enable support for launchd DISPLAY socket
* Treat XIDs the same as other cardinal values.
Release 1.1.92 (2008-11-01)
===========================
Enhancements:
* Added small fix to support trailing fixed fields; also warning for non-pad fixed fields
* Fixed overly aggressive warning about fixed field following variable
* Added generation of extern "C" for compatibility with C++
* Remove libxcb-xlib and xcbxlib.h.
* Inline _xcb_lock_io, _xcb_unlock_io, and _xcb_wait_io.
* Track 64-bit sequence numbers internally.
* Use sequence number ranges in pending replies
* Remove duplicate XCB_EXTENSION calls for Composite extension
* Factorize m4 macros and add one to set X extensions
* Allow compile-time setting for XCB queue buffer size
* Support handing off socket write permission to external code.
* Add support for the abstract socket namespace under Linux
Bug fixes:
* Fix tiny memory leak in read_packet
* Fix some fd leaks in _xcb_open_*()
Release 1.1 (2007-11-04)
========================
This release requires xcb-proto 1.1, due to the addition of the
extension-multiword attribute to the XML schema.
This release contains several important bug fixes, summarized below. It
also contains a patch much like Novell's libxcb-sloppy-lock.diff.
Rationale from the commit message follows. The patch and this rationale
were authored by Jamey Sharp <jamey@minilop.net>, with agreement from
Josh Triplett <josh@freedesktop.org>.
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.
Enhancements:
* Print a backtrace, if possible, on locking assertion failures.
* Skip abort() on locking assertions if LIBXCB_ALLOW_SLOPPY_LOCK is set.
* xcb_poll_for_event: Return already-read events before reading again.
* Output a configuration summary at the end of ./configure.
Bug fixes:
* Don't hold the xlib-xcb lock while sleeping: that allows deadlock.
* Allow unix:<screen> style display names again.
* Bug #9119: test xcb_popcount
* Fix unit tests for FreeBSD
* NetBSD doesn't have AI_ADDRCONFIG: use it only if it's available.
* Require libXau >= 0.99.2; earlier versions have a broken .pc file
* Use substitition variables in xcb-xinerama.pc.in
* Update autogen.sh to one that does objdir != srcdir
* Add tools/* and autogen.sh to EXTRA_DIST.
* Doxygen can now be fully disabled if desired.
Documentation improvements:
* Many fixes and updates to the tutorial.
* Iterators, requests, and replies get partial Doxygen documentation.
Release 1.0 (2006-11-23)
========================
The "Thanksgiving" release: We feel thankful to have it released. Five years
have passed since XCB's initial commit on September 3rd, 2001:
<http://gitweb.freedesktop.org/?p=xcb.git;a=commit;h=09e54c4a3c>
* Support IPv6. XCB now supports displays with IPv6 addresses, with or without
enclosing square brackets, or with hosts which resolve to IPv6 addresses, by
using getaddrinfo instead of gethostbyname, and by including support for
authentication for such connections. This allows such displays as "::1:1.1".
* XCB now uses the libpthread-stubs, to properly support optional use of
pthreads even on platforms which do not have all the necessary pthread stubs
in libc or otherwise available by default.
* Switch from the old AM_PATH_CHECK macro to pkg-config. check 0.9.4 is now
required to build XCB's unit tests. The version that we were requiring was
not actually new enough to let our unit tests compile, and the AM_PATH_CHECK
macro is now considered deprecated. We know that versions of check using
pkg-config are new enough to work, and the check dependency was optional
anyway, so we've dropped support for older versions.
* Provide a xcb_prefetch_maximum_request_length counterpart to
xcb_get_maximum_request_length.
* Fix Bug #5958: zero out padding bytes in requests.
* 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.
* Remove --with-opt and --with-debug options from configure.ac; configure
supports the use of custom CFLAGS, so please use that instead.
* Reove support for the <localfield> tag in protocol descriptions, since they
no longer use it, and since new protocol descriptions should not need it
either.
* xcb-proto has no libraries or headers, so don't use XCBPROTO_CFLAGS or
XCBPROTO_LIBS.
* XCB builds which use xdmcp now include it in Requires.private, to support
static linking.
* Replace "long" with uint32_t when used for a 32-bit quantity
* Various enhancements to the generation of documentation with Doxygen:
* Check for doxygen in configure.ac
* Fix some Doxygen warnings.
* Install documentation.
* Handle out-of-tree builds, with srcdir != builddir. xcb.doxygen now gets
generated from xcb.doxygen.in, so that it can use top_builddir and
top_srcdir to find source and to output documentation.
* Fill in PROJECT_NUMBER from @VERSION@, now that we have it readily
available via autoconf.
Release 1.0 RC3 (2006-11-02)
============================
Note: Version 0.9.4 of the test suite tool "check" provides a broken
version of the AM_PATH_CHECK macro, which causes autoconf to fail due to
insufficient quoting on the macro names it prints in its deprecation
message. We have written a patch to fix this problem, available at:
<http://bugs.debian.org/cgi-bin/bugreport.cgi/check-m4-am-path-check-use-quadrigraphs-in-macro-names-to-unbreak-autoconf.patch?bug=395466;msg=20;att=1>
Version 0.9.4-2 of the Debian package for check includes this patch.
Users of other distributions who want to re-autotool libxcb will need to
apply this patch, use an older version of check, or wait for a fixed
upstream version. This bug does not affect users who use the distributed
tarballs and do not re-autotool.
* Add library support for xcb-xinerama, using new protocol description
from xcb-proto.
* In the generated protocol code, define and use constants for opcode
numbers rather than hard-coding them.
* In the API conversion script, match only XCB-namespaced XID generators
when converting to xcb_generate_id.
* Quit treating xproto specially in Makefile.am: handle it like all the
extensions.
* Generate Doxygen documentation comments in the protocol stubs, and
provide a Doxygen config file for building HTML documentation for XCB.
* Add note to xcbxlib.h that nothing except Xlib/XCB should use it.
* Extend test suite to test xcb_parse_display with NULL argument and
display in $DISPLAY.
Release 1.0 RC2 (2006-10-07)
============================
API changes
-----------
In our announcement of XCB 1.0 RC1, we proposed two API changes for
community feedback:
We would greatly appreciate API review in this final release
candidate period. We've had some limited feedback that our attempts
to impose static type safety on XIDs in C pose more a hindrance than
a help, so we would appreciate discussion over whether this
constitutes a "serious issue with the API". Some question also
remains of whether xcb_poll_for_event should have the out-parameter
'error', now that XCB has a more uniform mechanism for reporting
connection errors. Speak now on these points or leave us alone. ;-)
Since we've received feedback agreeing with our proposed changes, and no
objections or requests to keep the existing API, we made both changes
and bumped the soname to libxcb.so.1.0.0 in preparation for the release
of XCB 1.0.
* Remove XID wrapper structures and replace them with uint32_t typedefs.
XID union types like xcb_drawable_t and xcb_fontable_t also become
uint32_t typedefs. The API conversion script now replaces xcb_*_new
with calls directly to xcb_generate_id. This change makes
xcb_generate_id part of the client API rather than the extension API,
so move xcb_generate_id from xcbext.h to xcb.h.
* Remove the 'int *error' out-parameter for xcb_poll_for_event.
xcb_poll_for_event now shuts down the xcb_connection_t on fatal
errors; use xcb_connection_has_error to check.
The Xlib-specific API in libxcb-xlib also changed:
* Stop exposing the XCB IO lock for Xlib's benefit, by removing
xcb_get_io_lock from the Xlib-specific XCB API; instead, libxcb-xlib
now provides xcb_xlib_lock and xcb_xlib_unlock.
Code generation changes
-----------------------
* The code generator no longer implicitly imports xproto for extensions.
xcb-proto 1.0 RC2 includes the corresponding change to explicitly
import xproto in extensions that need it
* The generated protocol headers now declare "struct foo", "union foo"
or "enum foo", not just the typedef "foo" of an unnamed
struct/union/enum type.
Bug Fixes
---------
* Make Plan 7 'checked' requests work correctly.
Documentation improvements
--------------------------
* Document xcb_generate_id.
* Tutorial enhancements.
Release 1.0 RC1 (2006-09-25)
============================
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
In addition to the API renaming, the library SONAMEs have changed to
libxcb.so and libxcb-extname.so. The library major version remains at 0,
to become version 1 before 1.0 is released; the SONAME lowercasing means
that this will not conflict with XCB 0.9 libraries.
The header files have moved from /usr/include/X11/XCB/ to
/usr/include/xcb/. The XML-XCB protocol descriptions have moved to
/usr/share/xcb, with extension descriptions no longer relegated to an
extensions/ subdirectory. The API conversion script api_conv.pl will fix
references to the header files, and packages using pkg-config will
automatically use the new library names.
Error handling Plan 7
---------------------
All request functions now come in an "unchecked" and "checked" variant.
The checked variant allows callers to handle errors inline where they
obtain the reply, or by calling xcb_request_check for requests with no
reply. The unchecked variant uses the event queue for errors. Requests
with replies default to checked, because the caller must already make a
function call to retrieve the reply and can see the error at that time;
the unchecked variant uses the suffix _unchecked. Requests without
replies default to unchecked, because the caller will not necessarily
expect to handle a response, and the checked variant uses the suffix
_checked.
Connection error handling
-------------------------
Fatal connection errors now put the xcb_connection_t object into an
error state, at which point all further operations on that connection
will fail. Callers can use the new xcb_connection_has_error function to
check for this state in a connection. Functions that return a
connection, such as the xcb_connect function, may instead return an
xcb_connection_t already in an error state.
In the future we expect to add additional API for getting more
information about the error condition that caused the connection to get
into an error state.
Smaller API changes
-------------------
All functions that have been marked 'deprecated' up to now have been
removed for this release. After XCB 1.0 is released, functions marked
'deprecated' will be preserved until the end of time to maintain
compatibility.
XCB no longer provides a sync function. Most callers of this function
should use xcb_flush instead, which usually provides the intended
functionality and does not require a round-trip to the server. If you
really need this functionality, either use xcb_get_input_focus like sync
used to do, or use the xcb_aux_sync function from the xcb-aux library in
xcb-util. However, note that we do not consider the libraries in
xcb-util remotely stable yet.
XCB no longer provides xcb_[extension_name]_init functions for each
extension. These functions previously caused XCB to issue and process a
QueryExtension request. Callers should now directly call
xcb_get_extension_data on the xcb_[extension_name]_id, or use
xcb_prefetch_extension_data if they do not need to force a round-trip
immediately.
The compatibility functions in xcbxlib.h, provided solely for use by
Xlib/XCB, now exist in a separate library libxcb-xlib. We don't want to
have to change the libxcb soname if we later change or remove the Xlib
compatibility functions, and nothing except Xlib/XCB should ever use
them. (Applications which use Xlib/XCB do not need this library either;
Xlib/XCB only uses it internally.)
The descriptions of several extensions have been updated to match the
latest versions implemented in the X.org X server.
GIT Repository split
--------------------
Previously, several XCB-related projects all existed under the umbrella
of a single monolithic GIT repository with per-project subdirectories.
We have split this repository into individual per-project repositories.
Josh Triplett and Jamey Sharp wrote a tool called git-split to
accomplish this repository split. git-split reconstructs the history of
a sub-project previously stored in a subdirectory of a larger
repository. It constructs new commit objects based on the existing tree
objects for the subtree in each commit, and discards commits which do
not affect the history of the sub-project, as well as merges made
unnecessary due to these discarded commits.
We would like to acknowledge the work of the gobby team in creating a
collaborative editor which greatly aided the development of git-split
(as well as these release notes).
Build and implementation fixes
------------------------------
XCB no longer needs proto/x11 from X.org; the XCB header xproto.h
provides the definitions from X.h, named according to XCB conventions.
XCB should now build with non-GNU implementations of Make.
XCB properly handles 32-bit wrap of sequence numbers, and thus now
supports issuing more than 2**32 requests in one connection.
Fixed bugs #7001, #7261.

41
README.md Normal file
View File

@ -0,0 +1,41 @@
About libxcb
============
libxcb provides an interface to the X Window System protocol, which
replaces the traditional Xlib interface. It has several advantages over
Xlib, including:
- size: small, simple library, and lower memory footprint
- latency hiding: batch several requests and wait for the replies later
- direct protocol access: interface and protocol correspond exactly
- proven thread support: transparently access XCB from multiple threads
- easy extension implementation: interfaces auto-generated from XML-XCB
Xlib also uses XCB as a transport layer, allowing software to make
requests and receive responses with both, which eases porting to XCB.
However, client programs, libraries, and toolkits will gain the most
benefit from a native XCB port.
More information about xcb is available from our website:
https://xcb.freedesktop.org/
Please report any issues you find to the freedesktop.org bug tracker at:
https://gitlab.freedesktop.org/xorg/lib/libxcb/issues
Discussion about XCB occurs on the XCB mailing list:
https://lists.freedesktop.org/mailman/listinfo/xcb
You can obtain the latest development versions of XCB using GIT from
the libxcb code repository at:
https://gitlab.freedesktop.org/xorg/lib/libxcb
For anonymous checkouts, use:
git clone https://gitlab.freedesktop.org/xorg/lib/libxcb.git
For developers, use:
git clone git@gitlab.freedesktop.org:xorg/lib/libxcb.git

3642
aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

14
autogen.sh Executable file
View File

@ -0,0 +1,14 @@
#! /bin/sh
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
if test -z "$NOCONFIGURE"; then
$srcdir/configure "$@"
fi

348
build-aux/compile Executable file
View File

@ -0,0 +1,348 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

1676
build-aux/config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

1814
build-aux/config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

791
build-aux/depcomp Executable file
View File

@ -0,0 +1,791 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

518
build-aux/install-sh Executable file
View File

@ -0,0 +1,518 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2018-03-11.20; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
tab=' '
nl='
'
IFS=" $tab$nl"
# Set DOITPROG to "echo" to test this script.
doit=${DOITPROG-}
doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0
else
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
# Note that $RANDOM variable is not portable (e.g. dash); Use it
# here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p' feature.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
oIFS=$IFS
IFS=/
set -f
set fnord $dstdir
shift
set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=${dstdirslash}_inst.$$_
rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

11210
build-aux/ltmain.sh Normal file

File diff suppressed because it is too large Load Diff

215
build-aux/missing Executable file
View File

@ -0,0 +1,215 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
case $1 in
--is-lightweight)
# Used by our autoconf macros to check whether the available missing
# script is modern enough.
exit 0
;;
--run)
# Back-compat with the calling convention used by older automake.
shift
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo
bison yacc flex lex help2man
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
# Run the given program, remember its exit status.
"$@"; st=$?
# If it succeeded, we are done.
test $st -eq 0 && exit 0
# Also exit now if we it failed (or wasn't found), and '--version' was
# passed; such an option is passed most likely to detect whether the
# program is present and works.
case $2 in --version|--help) exit $st;; esac
# Exit code 63 means version mismatch. This often happens when the user
# tries to use an ancient version of a tool on a file that requires a
# minimum version.
if test $st -eq 63; then
msg="probably too old"
elif test $st -eq 127; then
# Program was missing.
msg="missing on your system"
else
# Program was found and executed, but failed. Give up.
exit $st
fi
perl_URL=https://www.perl.org/
flex_URL=https://github.com/westes/flex
gnu_software_URL=https://www.gnu.org/software
program_details ()
{
case $1 in
aclocal|automake)
echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/autoconf>"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
autoconf|autom4te|autoheader)
echo "The '$1' program is part of the GNU Autoconf package:"
echo "<$gnu_software_URL/autoconf/>"
echo "It also requires GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
esac
}
give_advice ()
{
# Normalize program name to check for.
normalized_program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
case $normalized_program in
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*)
echo "You should only need it if you modified 'Makefile.am' or"
echo "$configure_deps."
program_details 'automake'
;;
aclocal*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*)
echo "You should only need it if you modified a dependency" \
"of a man page."
echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>"
;;
makeinfo*)
echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual."
echo "You might want to install the Texinfo package:"
echo "<$gnu_software_URL/texinfo/>"
echo "The spurious makeinfo call might also be the consequence of"
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
echo "often tells you about the needed prerequisites for installing"
echo "this package. You may also peek at any GNU archive site, in"
echo "case some other package contains this missing '$1' program."
;;
esac
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
-e '2,$s/^/ /' >&2
# Propagate the correct exit status (expected to be 127 for a program
# not found, 63 for a program that failed due to version mismatch).
exit $st
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

148
build-aux/test-driver Executable file
View File

@ -0,0 +1,148 @@
#! /bin/sh
# test-driver - basic testsuite driver script.
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 2011-2018 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
# Make unconditional expansion of undefined variables an error. This
# helps a lot in preventing typo-related bugs.
set -u
usage_error ()
{
echo "$0: $*" >&2
print_usage >&2
exit 2
}
print_usage ()
{
cat <<END
Usage:
test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
[--expect-failure={yes|no}] [--color-tests={yes|no}]
[--enable-hard-errors={yes|no}] [--]
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
END
}
test_name= # Used for reporting.
log_file= # Where to save the output of the test script.
trs_file= # Where to save the metadata of the test run.
expect_failure=no
color_tests=no
enable_hard_errors=yes
while test $# -gt 0; do
case $1 in
--help) print_usage; exit $?;;
--version) echo "test-driver $scriptversion"; exit $?;;
--test-name) test_name=$2; shift;;
--log-file) log_file=$2; shift;;
--trs-file) trs_file=$2; shift;;
--color-tests) color_tests=$2; shift;;
--expect-failure) expect_failure=$2; shift;;
--enable-hard-errors) enable_hard_errors=$2; shift;;
--) shift; break;;
-*) usage_error "invalid option: '$1'";;
*) break;;
esac
shift
done
missing_opts=
test x"$test_name" = x && missing_opts="$missing_opts --test-name"
test x"$log_file" = x && missing_opts="$missing_opts --log-file"
test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
if test x"$missing_opts" != x; then
usage_error "the following mandatory options are missing:$missing_opts"
fi
if test $# -eq 0; then
usage_error "missing argument"
fi
if test $color_tests = yes; then
# Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
red='' # Red.
grn='' # Green.
lgn='' # Light green.
blu='' # Blue.
mgn='' # Magenta.
std='' # No color.
else
red= grn= lgn= blu= mgn= std=
fi
do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
trap "st=129; $do_exit" 1
trap "st=130; $do_exit" 2
trap "st=141; $do_exit" 13
trap "st=143; $do_exit" 15
# Test script is run here.
"$@" >$log_file 2>&1
estatus=$?
if test $enable_hard_errors = no && test $estatus -eq 99; then
tweaked_estatus=1
else
tweaked_estatus=$estatus
fi
case $tweaked_estatus:$expect_failure in
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
0:*) col=$grn res=PASS recheck=no gcopy=no;;
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
*:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
esac
# Report the test outcome and exit status in the logs, so that one can
# know whether the test passed or failed simply by looking at the '.log'
# file, without the need of also peaking into the corresponding '.trs'
# file (automake bug#11814).
echo "$res $test_name (exit status: $estatus)" >>$log_file
# Report outcome to console.
echo "${col}${res}${std}: $test_name"
# Register the test result, and other relevant metadata.
echo ":test-result: $res" > $trs_file
echo ":global-test-result: $res" >> $trs_file
echo ":recheck: $recheck" >> $trs_file
echo ":copy-in-global-log: $gcopy" >> $trs_file
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

70
check-pc-requires Executable file
View File

@ -0,0 +1,70 @@
#!/bin/sh
case "$AM_SRCDIR" in
"")
AM_SRCDIR="."
;;
*)
;;
esac
fix=n
status=0
case "$1" in
"-fix")
fix=y
;;
esac
for inc in src/*.h; do
package=xcb-`basename $inc .h`
pcin="$AM_SRCDIR"/$package.pc.in
if [ -f $pcin ]; then
included=`grep '# *include' $inc |
sed -e 's/[^<"]*[<"]//' -e 's/[>"]//' |
grep -v 'xcb.h\|xproto.h'`
requires=`grep '^Requires.private:' $pcin`
missing=""
for i in $included; do
ibase=`basename $i .h`
r="xcb-$ibase"
rpcin="$AM_SRCDIR"/$r.pc.in
if [ -f $rpcin ]; then
m="$r"
for has in $requires; do
if [ $has = $r ]; then
m=""
fi
done
case "$m" in
"")
;;
*)
case "$missing" in
"")
missing=$m
;;
*)
missing="$missing $m"
;;
esac
;;
esac
fi
done
case "$missing" in
"")
;;
*)
if [ "$fix" = "y" ]; then
echo $package adding dependency on $missing
sed -i '/^Requires.private:/s/$/ '"$missing"'/' $pcin
else
echo $package missing $missing
status=1
fi
;;
esac
fi
done
exit $status

23611
configure vendored Executable file

File diff suppressed because it is too large Load Diff

355
configure.ac Normal file
View File

@ -0,0 +1,355 @@
dnl Process this file with autoconf to produce a configure script.
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([libxcb],[1.14],
[https://gitlab.freedesktop.org/xorg/lib/libxcb/issues],
[libxcb])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([xcb.pc.in])
AC_CONFIG_HEADERS([src/config.h])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-xz])
AM_PATH_PYTHON([2.6])
# Set common system defines for POSIX extensions, such as _GNU_SOURCE
# Must be called before any macros that run the compiler (like AC_PROG_LIBTOOL)
# to avoid autoconf errors.
AC_USE_SYSTEM_EXTENSIONS
# Initialize libtool
LT_PREREQ([2.2])
LT_INIT([win32-dll])
# Require xorg-macros minimum of 1.18 - Initial version
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.18 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.18)
XORG_DEFAULT_OPTIONS
XORG_ENABLE_DEVEL_DOCS
XORG_WITH_DOXYGEN
# The dot drawing tool is checked by XORG_WITH_DOXYGEN, needed for xcb manual
if test x"$HAVE_DOT" = xno; then
AC_MSG_WARN([dot not found - doxygen targets will be skipped])
fi
PKG_CHECK_MODULES(CHECK, [check >= 0.9.4], [HAVE_CHECK=yes], [HAVE_CHECK=no])
AM_CONDITIONAL(HAVE_CHECK, test x$HAVE_CHECK = xyes)
XSLTPROC=no
HTML_CHECK_RESULT=no
if test x"$HAVE_CHECK" = xyes; then
AC_PATH_PROG(XSLTPROC, xsltproc, no)
if test x"$XSLTPROC" != xno; then
HTML_CHECK_RESULT=yes
fi
fi
AC_SUBST(HTML_CHECK_RESULT)
# Checks for pkg-config packages
PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 1.14)
NEEDED="xau >= 0.99.2"
case $host_os in
linux*) ;;
*) NEEDED="$NEEDED pthread-stubs" ;;
esac
PKG_CHECK_MODULES(NEEDED, $NEEDED)
have_xdmcp="no"
PKG_CHECK_MODULES(XDMCP, xdmcp,
AC_CHECK_LIB(Xdmcp, XdmcpWrap,
[
AC_DEFINE(HASXDMAUTH,1,[Has Wraphelp.c needed for XDM AUTH protocols])
NEEDED="$NEEDED xdmcp"
have_xdmcp="yes"
],
[
XDMCP_CFLAGS=
XDMCP_LIBS=
], [$XDMCP_LIBS]),
[AC_MSG_RESULT(no)])
AC_SUBST(NEEDED)
# Find the xcb-proto protocol descriptions
AC_MSG_CHECKING(XCBPROTO_XCBINCLUDEDIR)
XCBPROTO_XCBINCLUDEDIR=`$PKG_CONFIG --variable=xcbincludedir xcb-proto`
AC_MSG_RESULT($XCBPROTO_XCBINCLUDEDIR)
AC_SUBST(XCBPROTO_XCBINCLUDEDIR)
# Find the xcb-proto version
XCBPROTO_VERSION=`$PKG_CONFIG --modversion xcb-proto`
AC_SUBST(XCBPROTO_VERSION)
# Find the xcbgen Python package
AC_MSG_CHECKING(XCBPROTO_XCBPYTHONDIR)
XCBPROTO_XCBPYTHONDIR=`$PKG_CONFIG --variable=pythondir xcb-proto`
AC_MSG_RESULT($XCBPROTO_XCBPYTHONDIR)
AC_SUBST(XCBPROTO_XCBPYTHONDIR)
AC_HEADER_STDC
AC_SEARCH_LIBS(getaddrinfo, socket)
AC_SEARCH_LIBS(connect, socket)
# Find support for sending a message from a socket
AC_SEARCH_LIBS(sendmsg, socket, [have_sendmsg="yes"], [have_sendmsg="no"])
# XPG4v2/UNIX95 added msg_control - check to see if we need to define
# _XOPEN_SOURCE to get it (such as on Solaris)
AC_CHECK_MEMBER([struct msghdr.msg_control], [], [],
[
AC_INCLUDES_DEFAULT
#include <sys/socket.h>
])
# First try for Solaris in C99 compliant mode, which requires XPG6/UNIX03
if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then
unset ac_cv_member_struct_msghdr_msg_control
AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=600])
AC_CHECK_MEMBER([struct msghdr.msg_control],
[AC_DEFINE([_XOPEN_SOURCE], [600],
[Defined if needed to expose struct msghdr.msg_control])
], [], [
#define _XOPEN_SOURCE 600
AC_INCLUDES_DEFAULT
#include <sys/socket.h>
])
fi
# If that didn't work, fall back to XPG5/UNIX98 with C89
if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then
unset ac_cv_member_struct_msghdr_msg_control
AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=500])
AC_CHECK_MEMBER([struct msghdr.msg_control],
[AC_DEFINE([_XOPEN_SOURCE], [500],
[Defined if needed to expose struct msghdr.msg_control])
], [have_sendmsg="no"], [
#define _XOPEN_SOURCE 500
AC_INCLUDES_DEFAULT
#include <sys/socket.h>
])
fi
case x$have_sendmsg in
xyes)
AC_DEFINE([HAVE_SENDMSG],1,[Define if your platform supports sendmsg])
;;
esac
have_win32="no"
lt_enable_auto_import=""
case $host_os in
mingw*)
have_win32="yes"
lt_enable_auto_import="-Wl,--enable-auto-import"
;;
linux*)
AC_DEFINE([HAVE_ABSTRACT_SOCKETS], 1, [Define if your platform supports abstract sockets])
;;
esac
AC_SUBST(lt_enable_auto_import)
AM_CONDITIONAL([XCB_HAVE_WIN32], [test "x${have_win32}" = "xyes"])
dnl define buffer queue size
AC_ARG_WITH([queue-size],
AS_HELP_STRING([--with-queue-size=SIZE],
[Set the XCB buffer queue size (default is 16384)]),
[xcb_queue_buffer_size="$withval"],
[xcb_queue_buffer_size=16384])
AC_DEFINE_UNQUOTED(XCB_QUEUE_BUFFER_SIZE, [$xcb_queue_buffer_size],
[XCB buffer queue size])
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.])],
[],
[ #include <sys/types.h>
#include <sys/un.h>
])
dnl check for support for Solaris Trusted Extensions
AC_CHECK_HEADERS([tsol/label.h])
AC_CHECK_FUNCS([is_system_labeled])
dnl check for IOV_MAX, and fall back to UIO_MAXIOV on BSDish systems
AC_CHECK_DECL([IOV_MAX], [],
[AC_CHECK_DECL([UIO_MAXIOV], [AC_DEFINE([IOV_MAX], [UIO_MAXIOV])],
[AC_DEFINE([IOV_MAX], [16], [Define if not provided by <limits.h>])],
[[#include <sys/uio.h>]])],
[[#include <limits.h>]])
xcbincludedir='${includedir}/xcb'
AC_SUBST(xcbincludedir)
XCB_CHECK_VISIBILITY()
AC_CHECK_FUNC(getaddrinfo, [AC_DEFINE(HAVE_GETADDRINFO, 1, [getaddrinfo() function is available])], )
case $host_os in
# darwin through Snow Leopard has poll() but can't be used to poll character devices.
darwin@<:@789@:>@*|darwin10*) ;;
darwin*)
_ac_xorg_macosx_version_min=""
if echo $CPPFLAGS $CFLAGS | grep -q mmacosx-version-min ; then
_ac_xorg_macosx_version_min=`echo $CPPFLAGS $CFLAGS | sed 's/^.*-mmacosx-version-min=\(@<:@^ @:>@*\).*$/\1/'`
else
_ac_xorg_macosx_version_min=$MACOSX_DEPLOYMENT_TARGET
fi
case $_ac_xorg_macosx_version_min in
10.@<:@0123456@:>@|10.@<:@0123456@:>@.*) ;;
*)
AC_CHECK_FUNC(poll, [AC_DEFINE(USE_POLL, 1, [poll() function is available])], )
;;
esac
unset _ac_xorg_macosx_version_min
;;
*)
AC_CHECK_FUNC(poll, [AC_DEFINE(USE_POLL, 1, [poll() function is available])], )
;;
esac
dnl Link with winsock for socket functions on MinGW
case $host_os in
*mingw*)
AC_CHECK_LIB([ws2_32],[main])
;;
*)
;;
esac
XCB_EXTENSION(Composite, yes)
XCB_EXTENSION(Damage, yes)
XCB_EXTENSION(DPMS, yes)
XCB_EXTENSION(DRI2, yes)
XCB_EXTENSION(DRI3, $have_sendmsg)
XCB_EXTENSION(GE, no)
XCB_EXTENSION(GLX, yes)
XCB_EXTENSION(Present, 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, no)
XCB_EXTENSION(XFixes, yes)
XCB_EXTENSION(XFree86-DRI, yes)
XCB_EXTENSION(Xinerama, yes)
XCB_EXTENSION(XInput, yes)
XCB_EXTENSION(XKB, yes)
XCB_EXTENSION(Xprint, no)
XCB_EXTENSION(SELinux, no)
XCB_EXTENSION(XTest, yes)
XCB_EXTENSION(Xv, yes)
XCB_EXTENSION(XvMC, yes)
AC_ARG_WITH(launchd, AS_HELP_STRING([--with-launchd], [Build with support for Apple's launchd (default: auto)]), [LAUNCHD=$withval], [LAUNCHD=auto])
if test "x$LAUNCHD" = xauto; then
unset LAUNCHD
AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no], [$PATH$PATH_SEPARATOR/sbin])
fi
if test "x$LAUNCHD" = xyes ; then
AC_DEFINE(HAVE_LAUNCHD, 1, [launchd support available])
fi
AC_ARG_WITH(serverside-support, AS_HELP_STRING([--with-serverside-support], [Build with support for server-side usage of xcb. This is still EXPERIMENTAL! ABI/API may change! (default: no)]), [XCB_SERVERSIDE_SUPPORT=$withval], [XCB_SERVERSIDE_SUPPORT=no])
AM_CONDITIONAL(XCB_SERVERSIDE_SUPPORT, test "x$XCB_SERVERSIDE_SUPPORT" = "xyes")
AC_CONFIG_FILES([
Makefile
doc/Makefile
man/Makefile
src/Makefile
tests/Makefile
])
AC_CONFIG_FILES([
xcb.pc
xcb-composite.pc
xcb-damage.pc
xcb-dpms.pc
xcb-dri2.pc
xcb-dri3.pc
xcb-ge.pc
xcb-glx.pc
xcb-present.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-xkb.pc
xcb-xprint.pc
xcb-xselinux.pc
xcb-xtest.pc
xcb-xv.pc
xcb-xvmc.pc
])
AC_CONFIG_FILES([
doc/xcb.doxygen
])
AC_OUTPUT
dnl Configuration output
echo ""
echo " Package: ${PACKAGE_NAME} ${PACKAGE_VERSION}"
echo ""
echo " Configuration"
echo " XDM support.........: ${have_xdmcp}"
echo " sendmsg fd passing..: ${have_sendmsg}"
echo " Build unit tests....: ${HAVE_CHECK}"
echo " with html results.: ${HTML_CHECK_RESULT}"
echo " XCB buffer size.....: ${xcb_queue_buffer_size}"
echo ""
echo " X11 extensions"
echo " Composite...........: ${BUILD_COMPOSITE}"
echo " Damage..............: ${BUILD_DAMAGE}"
echo " Dpms................: ${BUILD_DPMS}"
echo " Dri2................: ${BUILD_DRI2}"
echo " Dri3................: ${BUILD_DRI3}"
echo " GenericEvent........: ${BUILD_GE}"
echo " Glx.................: ${BUILD_GLX}"
echo " Randr...............: ${BUILD_RANDR}"
echo " Record..............: ${BUILD_RECORD}"
echo " Render..............: ${BUILD_RENDER}"
echo " Resource............: ${BUILD_RESOURCE}"
echo " Screensaver.........: ${BUILD_SCREENSAVER}"
echo " selinux.............: ${BUILD_SELINUX}"
echo " Shape...............: ${BUILD_SHAPE}"
echo " Shm.................: ${BUILD_SHM}"
echo " Sync................: ${BUILD_SYNC}"
echo " Xevie...............: ${BUILD_XEVIE}"
echo " Xfixes..............: ${BUILD_XFIXES}"
echo " Xfree86-dri.........: ${BUILD_XFREE86_DRI}"
echo " xinerama............: ${BUILD_XINERAMA}"
echo " xinput..............: ${BUILD_XINPUT}"
echo " xkb.................: ${BUILD_XKB}"
echo " xprint..............: ${BUILD_XPRINT}"
echo " xtest...............: ${BUILD_XTEST}"
echo " xv..................: ${BUILD_XV}"
echo " xvmc................: ${BUILD_XVMC}"
echo ""
echo " Used CFLAGS:"
echo " CPPFLAGS............: ${CPPFLAGS}"
echo " CFLAGS..............: ${CFLAGS}"
echo ""
echo " Installation:"
echo " Prefix..............: ${prefix}"
echo ""

48
doc/Makefile.am Normal file
View File

@ -0,0 +1,48 @@
EXTRA_DIST = \
tutorial/index.html \
tutorial/xcb.css \
xcb.doxygen.in \
xkb_internals \
xkb_issues
docdirs = $(srcdir)/tutorial
if ENABLE_DEVEL_DOCS
if HAVE_DOXYGEN
if HAVE_DOT
docdirs += manual
# rule to build documentation and copy necessary files
manual:
doxygen xcb.doxygen
# rules to clean
clean-local:
rm -rf manual/
endif
endif
endif
all-local: $(docdirs)
# rule to install the html documentation and tutorial in $(htmldir)
install-data-local:
@if ! test -d "$(DESTDIR)$(htmldir)"; then \
echo "$(mkinstalldirs) '$(DESTDIR)$(htmldir)'"; \
$(mkinstalldirs) '$(DESTDIR)$(htmldir)'; \
fi
@for d in $(docdirs); do \
echo "cp -pR $$d '$(DESTDIR)$(htmldir)/'"; \
cp -pR $$d '$(DESTDIR)$(htmldir)/'; \
done
uninstall-local:
@for d in $(docdirs); do \
d=`basename $$d`; \
echo "test ! -d '$(DESTDIR)$(htmldir)/'$$d || { find '$(DESTDIR)$(htmldir)/'$$d -type d ! -perm -200 -exec chmod u+w '{}' ';' && rm -rf '$(DESTDIR)$(htmldir)/'$$d; }"; \
test ! -d '$(DESTDIR)$(htmldir)/'$$d || { find '$(DESTDIR)$(htmldir)/'$$d -type d ! -perm -200 -exec chmod u+w '{}' ';' && rm -rf '$(DESTDIR)$(htmldir)/'$$d; }; \
done
rmdir "$(DESTDIR)$(htmldir)/" || true

533
doc/Makefile.in Normal file
View File

@ -0,0 +1,533 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@ENABLE_DEVEL_DOCS_TRUE@@HAVE_DOT_TRUE@@HAVE_DOXYGEN_TRUE@am__append_1 = manual
subdir = doc
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/xcb.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/config.h
CONFIG_CLEAN_FILES = xcb.doxygen
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/xcb.doxygen.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
CHECK_CFLAGS = @CHECK_CFLAGS@
CHECK_LIBS = @CHECK_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOT = @DOT@
DOXYGEN = @DOXYGEN@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
HAVE_DOT = @HAVE_DOT@
HTML_CHECK_RESULT = @HTML_CHECK_RESULT@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LAUNCHD = @LAUNCHD@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MKDIR_P = @MKDIR_P@
NEEDED = @NEEDED@
NEEDED_CFLAGS = @NEEDED_CFLAGS@
NEEDED_LIBS = @NEEDED_LIBS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PYTHON = @PYTHON@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
VERSION = @VERSION@
XCBPROTO_CFLAGS = @XCBPROTO_CFLAGS@
XCBPROTO_LIBS = @XCBPROTO_LIBS@
XCBPROTO_VERSION = @XCBPROTO_VERSION@
XCBPROTO_XCBINCLUDEDIR = @XCBPROTO_XCBINCLUDEDIR@
XCBPROTO_XCBPYTHONDIR = @XCBPROTO_XCBPYTHONDIR@
XDMCP_CFLAGS = @XDMCP_CFLAGS@
XDMCP_LIBS = @XDMCP_LIBS@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
XSLTPROC = @XSLTPROC@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_enable_auto_import = @lt_enable_auto_import@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
xcbincludedir = @xcbincludedir@
EXTRA_DIST = \
tutorial/index.html \
tutorial/xcb.css \
xcb.doxygen.in \
xkb_internals \
xkb_issues
docdirs = $(srcdir)/tutorial $(am__append_1)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign doc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
xcb.doxygen: $(top_builddir)/config.status $(srcdir)/xcb.doxygen.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile all-local
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
@ENABLE_DEVEL_DOCS_FALSE@clean-local:
@HAVE_DOT_FALSE@clean-local:
@HAVE_DOXYGEN_FALSE@clean-local:
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-data-local
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-local
.MAKE: install-am install-strip
.PHONY: all all-am all-local check check-am clean clean-generic \
clean-libtool clean-local cscopelist-am ctags-am distclean \
distclean-generic distclean-libtool distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-data-local install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-local
.PRECIOUS: Makefile
# rule to build documentation and copy necessary files
@ENABLE_DEVEL_DOCS_TRUE@@HAVE_DOT_TRUE@@HAVE_DOXYGEN_TRUE@manual:
@ENABLE_DEVEL_DOCS_TRUE@@HAVE_DOT_TRUE@@HAVE_DOXYGEN_TRUE@ doxygen xcb.doxygen
# rules to clean
@ENABLE_DEVEL_DOCS_TRUE@@HAVE_DOT_TRUE@@HAVE_DOXYGEN_TRUE@clean-local:
@ENABLE_DEVEL_DOCS_TRUE@@HAVE_DOT_TRUE@@HAVE_DOXYGEN_TRUE@ rm -rf manual/
all-local: $(docdirs)
# rule to install the html documentation and tutorial in $(htmldir)
install-data-local:
@if ! test -d "$(DESTDIR)$(htmldir)"; then \
echo "$(mkinstalldirs) '$(DESTDIR)$(htmldir)'"; \
$(mkinstalldirs) '$(DESTDIR)$(htmldir)'; \
fi
@for d in $(docdirs); do \
echo "cp -pR $$d '$(DESTDIR)$(htmldir)/'"; \
cp -pR $$d '$(DESTDIR)$(htmldir)/'; \
done
uninstall-local:
@for d in $(docdirs); do \
d=`basename $$d`; \
echo "test ! -d '$(DESTDIR)$(htmldir)/'$$d || { find '$(DESTDIR)$(htmldir)/'$$d -type d ! -perm -200 -exec chmod u+w '{}' ';' && rm -rf '$(DESTDIR)$(htmldir)/'$$d; }"; \
test ! -d '$(DESTDIR)$(htmldir)/'$$d || { find '$(DESTDIR)$(htmldir)/'$$d -type d ! -perm -200 -exec chmod u+w '{}' ';' && rm -rf '$(DESTDIR)$(htmldir)/'$$d; }; \
done
rmdir "$(DESTDIR)$(htmldir)/" || true
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

4521
doc/tutorial/index.html Normal file

File diff suppressed because it is too large Load Diff

123
doc/tutorial/xcb.css Normal file
View File

@ -0,0 +1,123 @@
body
{
background-color: #dddddd;
color: #000000;
padding: 8px;
margin: 0px;
}
div.title
{
text-align: center;
font-weight: bold;
font-size: 28px;
}
div.emph
{
text-align: left;
font-weight: bold;
}
div.section li.title
{
font-weight: bold;
font-size: 22px;
}
div.section li.title p
{
font-weight: normal;
font-size: 16px;
}
div.section li.title ul
{
font-weight: normal;
font-size: 16px;
}
div.section li.title ol
{
font-weight: normal;
font-size: 16px;
}
div.section li.subtitle
{
font-weight: bold;
font-size: 18px;
}
div.section li.subsubtitle
{
font-weight: bold;
font-size: 16px;
}
div.comp
{
border: thin solid #000000;
color: #000000;
background-color: #ffffe0;
padding: 14px;
}
div.comp div.title
{
font-weight: bold;
font-size: 16px;
text-align: center;
}
div.comp div.xlib ul li
{
font-family: monospace;
font-size: 12px;
font-weight: bold;
position: absolute;
width: 49%;
margin-left: 0px;
margin-top: 10px;
}
div.comp div.xcb ul li
{
font-family: monospace;
font-size: 12px;
font-weight: bold;
position: relative;
margin-left: 51%;
margin-top: 10px;
}
pre.code
{
border: thin solid #000000;
color: #000000;
background-color: #efefef;
padding: 4px;
text-align: left;
font-size: 10px;
}
pre.text
{
border: thin solid #000000;
color: #000000;
background-color: #efefef;
padding: 4px;
text-align: left;
font-size: 10px;
}
span.code
{
font-family: monospace;
font-size: 12px;
}
pre.code .type
{
color: #44bb44;
}
pre.code .function
{
color: #449fb7;
}
pre.code .include
{
color: #7d93ae;
}
pre.code .string
{
color: #ef6e4b;
}
pre.code .keyword
{
color: #00bbbb;
}

1253
doc/xcb.doxygen.in Normal file

File diff suppressed because it is too large Load Diff

49
doc/xkb_internals Normal file
View File

@ -0,0 +1,49 @@
XKB introduces several uncommon data structures:
- switch allows conditional inclusion of fields
- several complex objects intermix variable and fixed size fields
- lists with a variable number of variable size objects
To handle these objects, a number of new functions is generated:
- _serialize() turns a structured object into a byte stream,
(re)ordering or including fields according to the protocol
- _unserialize() rewrites data from a buffer into a structured object
- _unpack() expands a buffer representing a switch object into
a special structured type, all flags needed to resolve the switch
expression have to given as parameters
- _sizeof() calculates the size of a serialized object, often by calling
_unserialize()/_unpack() internally
The new structured data type for switch is special as it contains fixed
and variable size fields. Variable size fields can be accessed via pointers.
If switch appears in a request, an additional set of request helpers is
generated with the suffix _aux or _aux_(un)checked. While the 'common'
request functions require that switch has been serialized before, the _aux
variants take the structured data type. They are especially designed to
replace certain functions in xcb-util/aux.
Accessors for switch members need two parameters, where the first is usually
a pointer to the respective request or reply structure, while the second
is a pointer to the unpacked switch data structure.
Functions from the serialize family that take a double pointer can allocate
memory on their own, which is useful if the size of a buffer has to be
calculated depending on the data within. These functions call malloc() when
the double pointer is given as the address of a pointer that has been
initialized to 0. It is the responsibility of the user to free any allocated
memory.
Intermixed variable and fixed size fields are an important special case in XKB.
The current implementation resolves the issue by reordering the fields before
sending them on the wire as well as before returning a reply. That means that
these objects look like 'common' XCB data types and they can be accessed as such
(i.e. fixed size fields directly via the structured type and variable size fields
via accessors/iterators).
In case a list with variable size elements needs to be accessed, it is necessary
to use iterators. The iterator functions take care of determining the actual
object size for each element automatically.
A small and preliminary set of auxiliary functions is available in xkb_util.c
in the check_xkb module.

38
doc/xkb_issues Normal file
View File

@ -0,0 +1,38 @@
There are a number of problematic special cases in XKB. The issues
mentioned here are at most partly resolved.
1. The are several XxxDoodad structures defined in xkb.xml. They are used
in a few lists, but in a rather special way:
The struct "CommonDoodad" is supposed to be a rather generic data type,
combining the most basic Doodad fields that are common in all these structures.
All Doodads are encapsulated in a union type simply called "Doodad".
Now this union is used in subsequent list definitions, aiming at a kind of
'polymorphism': From inspection of the protocol and Xlib, the Doodads are to
be discriminated based on their type field.
However the special meaning of the type field is not encoded in the protocol.
Furthermore the TextDoodad and the LogoDoodad are variable size types due to
some fields of type CountedString16, thereby turning the union into a
possibly variable size type as well.
However, for lists with variable size elements, special sizeof functions are
required. These cannot be autogenerated as it cannot be referred which
Doodad type to use for the union.
Therefore, the Doodad type structures are unsupported at the moment.
2. There are still some bugs in xkb.xml: Either certain fields are missing
that are required by the protocol, or Xlib simply has another understanding
of the protocol.
3. The interface for accessors should be reviewed.
4. Currently some bitcases carry 'name' attributes. These could be avoided if
the data within would consist of a singe struct field only.
5. switch could get a 'fixed_size' attribute, so when rewriting valueparam to switch,
an uint32_t * pointer could be used instead of void *.
6. The automatic inclusion of padding requires some complicated coding in the
generator. This is errorprone and could be avoided if all padding is explicitly
given in the protocol definition. For variable size fields that require padding,
the pad tag could get a 'fieldref' attribute. That way padding could be handled
a lot easier in the autogenerator.

8387
m4/libtool.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

437
m4/ltoptions.m4 vendored Normal file
View File

@ -0,0 +1,437 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 8 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
# ------------------------------------------
m4_define([_LT_MANGLE_OPTION],
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
# ---------------------------------------
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
# saved as a flag.
m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option '$2'])])[]dnl
])
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
# ------------------------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
m4_define([_LT_IF_OPTION],
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
# -------------------------------------------------------
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
# are set.
m4_define([_LT_UNLESS_OPTIONS],
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
[m4_define([$0_found])])])[]dnl
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
])[]dnl
])
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
# ----------------------------------------
# OPTION-LIST is a space-separated list of Libtool options associated
# with MACRO-NAME. If any OPTION has a matching handler declared with
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
# the unknown option and exit.
m4_defun([_LT_SET_OPTIONS],
[# Set options
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[_LT_SET_OPTION([$1], _LT_Option)])
m4_if([$1],[LT_INIT],[
dnl
dnl Simply set some default values (i.e off) if boolean options were not
dnl specified:
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
])
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
])
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
_LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
[_LT_WITH_AIX_SONAME([aix])])
])
])# _LT_SET_OPTIONS
## --------------------------------- ##
## Macros to handle LT_INIT options. ##
## --------------------------------- ##
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
# -----------------------------------------
m4_define([_LT_MANGLE_DEFUN],
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
# -----------------------------------------------
m4_define([LT_OPTION_DEFINE],
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
])# LT_OPTION_DEFINE
# dlopen
# ------
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
])
AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the 'dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
# win32-dll
# ---------
# Declare package support for building win32 dll's.
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [1], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the 'win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the 'shared' and
# 'disable-shared' LT_INIT options.
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
_LT_DECL([build_libtool_libs], [enable_shared], [0],
[Whether or not to build shared libraries])
])# _LT_ENABLE_SHARED
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
# Old names:
AC_DEFUN([AC_ENABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
])
AC_DEFUN([AC_DISABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], [disable-shared])
])
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the 'static' and
# 'disable-static' LT_INIT options.
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
_LT_DECL([build_old_libs], [enable_static], [0],
[Whether or not to build static libraries])
])# _LT_ENABLE_STATIC
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
# Old names:
AC_DEFUN([AC_ENABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
])
AC_DEFUN([AC_DISABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], [disable-static])
])
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the 'fast-install'
# and 'disable-fast-install' LT_INIT options.
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
_LT_DECL([fast_install], [enable_fast_install], [0],
[Whether or not to optimize for fast installation])dnl
])# _LT_ENABLE_FAST_INSTALL
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
# Old names:
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the 'fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the 'disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_AIX_SONAME([DEFAULT])
# ----------------------------------
# implement the --with-aix-soname flag, and support the `aix-soname=aix'
# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
m4_define([_LT_WITH_AIX_SONAME],
[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
shared_archive_member_spec=
case $host,$enable_shared in
power*-*-aix[[5-9]]*,yes)
AC_MSG_CHECKING([which variant of shared library versioning to provide])
AC_ARG_WITH([aix-soname],
[AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
[shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
[case $withval in
aix|svr4|both)
;;
*)
AC_MSG_ERROR([Unknown argument to --with-aix-soname])
;;
esac
lt_cv_with_aix_soname=$with_aix_soname],
[AC_CACHE_VAL([lt_cv_with_aix_soname],
[lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
with_aix_soname=$lt_cv_with_aix_soname])
AC_MSG_RESULT([$with_aix_soname])
if test aix != "$with_aix_soname"; then
# For the AIX way of multilib, we name the shared archive member
# based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
# and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
# Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
# the AIX toolchain works better with OBJECT_MODE set (default 32).
if test 64 = "${OBJECT_MODE-32}"; then
shared_archive_member_spec=shr_64
else
shared_archive_member_spec=shr
fi
fi
;;
*)
with_aix_soname=aix
;;
esac
_LT_DECL([], [shared_archive_member_spec], [0],
[Shared archive member basename, for filename based shared library versioning on AIX])dnl
])# _LT_WITH_AIX_SONAME
LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
# LT_INIT options.
# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[lt_p=${PACKAGE-default}
case $withval in
yes|no) pic_mode=$withval ;;
*)
pic_mode=default
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for lt_pkg in $withval; do
IFS=$lt_save_ifs
if test "X$lt_pkg" = "X$lt_p"; then
pic_mode=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[pic_mode=m4_default([$1], [default])])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
# Old name:
AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the 'pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
## ----------------- ##
## LTDL_INIT Options ##
## ----------------- ##
m4_define([_LTDL_MODE], [])
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
[m4_define([_LTDL_MODE], [nonrecursive])])
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
[m4_define([_LTDL_MODE], [recursive])])
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
[m4_define([_LTDL_MODE], [subproject])])
m4_define([_LTDL_TYPE], [])
LT_OPTION_DEFINE([LTDL_INIT], [installable],
[m4_define([_LTDL_TYPE], [installable])])
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
[m4_define([_LTDL_TYPE], [convenience])])

124
m4/ltsugar.m4 vendored Normal file
View File

@ -0,0 +1,124 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 6 ltsugar.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
# lt_join(SEP, ARG1, [ARG2...])
# -----------------------------
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
# associated separator.
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
# versions in m4sugar had bugs.
m4_define([lt_join],
[m4_if([$#], [1], [],
[$#], [2], [[$2]],
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
m4_define([_lt_join],
[m4_if([$#$2], [2], [],
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
# lt_car(LIST)
# lt_cdr(LIST)
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59, which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
[$#], 1, [],
[m4_dquote(m4_shift($@))])])
m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
# than defined and empty).
#
# This macro is needed until we can rely on Autoconf 2.62, since earlier
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
m4_define([lt_append],
[m4_define([$1],
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
# ----------------------------------------------------------
# Produce a SEP delimited list of all paired combinations of elements of
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
# has the form PREFIXmINFIXSUFFIXn.
# Needed until we can rely on m4_combine added in Autoconf 2.62.
m4_define([lt_combine],
[m4_if(m4_eval([$# > 3]), [1],
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
[[m4_foreach([_Lt_prefix], [$2],
[m4_foreach([_Lt_suffix],
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
# -----------------------------------------------------------------------
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
m4_define([lt_if_append_uniq],
[m4_ifdef([$1],
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
[lt_append([$1], [$2], [$3])$4],
[$5])],
[lt_append([$1], [$2], [$3])$4])])
# lt_dict_add(DICT, KEY, VALUE)
# -----------------------------
m4_define([lt_dict_add],
[m4_define([$1($2)], [$3])])
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
# --------------------------------------------
m4_define([lt_dict_add_subkey],
[m4_define([$1($2:$3)], [$4])])
# lt_dict_fetch(DICT, KEY, [SUBKEY])
# ----------------------------------
m4_define([lt_dict_fetch],
[m4_ifval([$3],
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------------------
m4_define([lt_if_dict_fetch],
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
[$5],
[$6])])
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
# --------------------------------------------------------------
m4_define([lt_dict_filter],
[m4_if([$5], [], [],
[lt_join(m4_quote(m4_default([$4], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
])

23
m4/ltversion.m4 vendored Normal file
View File

@ -0,0 +1,23 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# @configure_input@
# serial 4179 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.6])
m4_define([LT_PACKAGE_REVISION], [2.4.6])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.6'
macro_revision='2.4.6'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])

99
m4/lt~obsolete.m4 vendored Normal file
View File

@ -0,0 +1,99 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
# Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 5 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
# using a macro with the same name in our local m4/libtool.m4 it'll
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
# and doesn't know about Autoconf macros at all.)
#
# So we provide this file, which has a silly filename so it's always
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
# we give up compatibility with versions before 1.7, at which point
# we need to keep only those names which we still refer to.
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])

70
m4/xcb.m4 Normal file
View File

@ -0,0 +1,70 @@
dnl Detection and configuration of the visibility feature of gcc
dnl Vincent Torri 2006-02-11
dnl
dnl XCB_CHECK_VISIBILITY([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Check the visibility feature of gcc
dnl
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}
])
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],
[dnl
pushdef([UP], translit([$1], [-a-z], [_A-Z]))dnl
pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
dnl
m4_if([$2], [yes], [m4_define([xcb_defopt], [yes])],
[$2], [no], [m4_define([xcb_defopt], [no])],
m4_define([xcb_defopt], [auto]))dnl
AC_ARG_ENABLE(DOWN,
[AS_HELP_STRING([--enable-[]DOWN],
[Build XCB $1 Extension (default: ]xcb_defopt[)])],
[BUILD_[]UP=$enableval],
[BUILD_[]UP=xcb_defopt])
dnl
m4_if(xcb_defopt, [auto], [
# This extension has a default value of "auto" and depends on the value of $2
if test "x$BUILD_[]UP" = "xauto" ; then
BUILD_[]UP=$2
fi
if test "x$BUILD_[]UP" = "xyes" ; then
if test "x$2" = "xno" ; then
AC_MSG_ERROR([Extension []UP requested, but dependencies are not met])
fi
fi])
m4_undefine([xcb_defopt])dnl
AM_CONDITIONAL(BUILD_[]UP, [test "x$BUILD_[]UP" = "xyes"])
])
dnl End of acinclude.m4

18
man/Makefile.am Normal file
View File

@ -0,0 +1,18 @@
libmandir = $(LIB_MAN_DIR)
libman_PRE = \
xcb-examples.man \
xcb-requests.man
libman_DATA = $(libman_PRE:man=$(LIB_MAN_SUFFIX))
EXTRA_DIST = $(libman_PRE)
CLEANFILES = $(libman_DATA)
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
SUFFIXES = .$(LIB_MAN_SUFFIX) .man
.man.$(LIB_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@

560
man/Makefile.in Normal file
View File

@ -0,0 +1,560 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = man
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/xcb.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(libmandir)"
DATA = $(libman_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
CHECK_CFLAGS = @CHECK_CFLAGS@
CHECK_LIBS = @CHECK_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOT = @DOT@
DOXYGEN = @DOXYGEN@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
HAVE_DOT = @HAVE_DOT@
HTML_CHECK_RESULT = @HTML_CHECK_RESULT@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LAUNCHD = @LAUNCHD@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MKDIR_P = @MKDIR_P@
NEEDED = @NEEDED@
NEEDED_CFLAGS = @NEEDED_CFLAGS@
NEEDED_LIBS = @NEEDED_LIBS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PYTHON = @PYTHON@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
VERSION = @VERSION@
XCBPROTO_CFLAGS = @XCBPROTO_CFLAGS@
XCBPROTO_LIBS = @XCBPROTO_LIBS@
XCBPROTO_VERSION = @XCBPROTO_VERSION@
XCBPROTO_XCBINCLUDEDIR = @XCBPROTO_XCBINCLUDEDIR@
XCBPROTO_XCBPYTHONDIR = @XCBPROTO_XCBPYTHONDIR@
XDMCP_CFLAGS = @XDMCP_CFLAGS@
XDMCP_LIBS = @XDMCP_LIBS@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
XSLTPROC = @XSLTPROC@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_enable_auto_import = @lt_enable_auto_import@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
xcbincludedir = @xcbincludedir@
libmandir = $(LIB_MAN_DIR)
libman_PRE = \
xcb-examples.man \
xcb-requests.man
libman_DATA = $(libman_PRE:man=$(LIB_MAN_SUFFIX))
EXTRA_DIST = $(libman_PRE)
CLEANFILES = $(libman_DATA)
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
SUFFIXES = .$(LIB_MAN_SUFFIX) .man
all: all-am
.SUFFIXES:
.SUFFIXES: .$(LIB_MAN_SUFFIX) .man
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign man/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-libmanDATA: $(libman_DATA)
@$(NORMAL_INSTALL)
@list='$(libman_DATA)'; test -n "$(libmandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(libmandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(libmandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libmandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(libmandir)" || exit $$?; \
done
uninstall-libmanDATA:
@$(NORMAL_UNINSTALL)
@list='$(libman_DATA)'; test -n "$(libmandir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(libmandir)'; $(am__uninstall_files_from_dir)
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
for dir in "$(DESTDIR)$(libmandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-libmanDATA
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-libmanDATA
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am \
install-libmanDATA install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-libmanDATA
.PRECIOUS: Makefile
.man.$(LIB_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

59
man/xcb-examples.man Normal file
View File

@ -0,0 +1,59 @@
.TH xcb-examples __libmansuffix__ __xorgversion__ "XCB examples"
.ad l
.SH NAME
xcb-examples \- manpage examples
.SH DESCRIPTION
Many of the XCB manpages contain example code. These examples intend to explain
how to use one particular part of XCB. They almost never represent a standalone
(or even useful) program - X11 programs are relatively involved and
thus beyond the scope of a manpage example.
.SH ENVIRONMENT
Every example assumes you have an \fIxcb_connection\fP and possibly other
variables at hand. For illustrating how \fIxcb_get_property\fP works, you need
the window of which you want to get the property, for example. To make it clear
that these variables are your responsibility, these examples consist of a
single function which takes the necessary variables as parameters.
.SH FLUSHING
Flushing means calling \fIxcb_flush\fP to clear the XCB-internal write buffer
and send all pending requests to the X11 server. You don't explicitly need to
flush before using a reply function (like \fIxcb_query_pointer_reply\fP), but
you do need to flush before entering the event loop of your program.
There are only two cases when XCB flushes by itself. The first case is when
its write buffer becomes full, the second case is when you are asking for
the reply of a request which wasn't flushed out yet (like
\fIxcb_query_pointer_reply\fP). This last point also includes
xcb_request_check(). Please note that waiting for an event does \fBNOT\fP
flush.
Examples generally include the \fIxcb_flush\fP call where appropriate (for
example after setting a property). Therefore, including these functions and
calling them in your application should just work. However, you might get
better results when flushing outside of the function, depending on the
architecture of your program.
.SH COMPILATION
If an example does not compile (without warnings) when using \fI-std=c99\fP,
that is considered a documentation bug. Similarly, not handling errors or
leaking memory is also considered a documentation bug. Please inform us about
it on xcb@lists.freedesktop.org.
.SH CODING STYLE
Every example uses 4 spaces for indentation.
Comments are in asterisks, like /* this */.
No line is longer than 80 characters (including indentation).
.SH SEE ALSO
.BR xcb_connect (__libmansuffix__),
.BR xcb_get_property (__libmansuffix__),
.BR xcb_flush (__libmansuffix__)
.SH AUTHOR
Michael Stapelberg <michael+xcb at stapelberg dot de>

165
man/xcb-requests.man Normal file
View File

@ -0,0 +1,165 @@
.TH xcb-requests __libmansuffix__ __xorgversion__ "XCB examples"
.ad l
.SH NAME
xcb-requests \- about request manpages
.SH DESCRIPTION
Every request in X11, like \fIMapWindow\fP, corresponds to a number of
functions and data structures in XCB. For \fIMapWindow\fP, XCB provides the
function \fIxcb_map_window\fP, which fills the \fIxcb_map_window_request_t\fP
data structure and writes that to the X11 connection. Since the \fIMapWindow\fP
request does not have a reply, this is the most simple case.
.SH REPLIES
Many requests have replies. For each reply, XCB provides at least a
corresponding data structure and a function to return a pointer to a filled
data structure. Let's take the \fIInternAtom\fP request as an example: XCB
provides the \fIxcb_intern_atom_reply_t\fP data structure and
\fIxcb_intern_atom_reply\fP function. For replies which are more complex (for
example lists, such as in \fIxcb_list_fonts\fP), accessor functions are
provided.
.SH COOKIES
XCB returns a cookie for each request you send. This is an XCB-specific data
structure containing the sequence number with which the request was sent to the
X11 server. To get any reply, you have to provide that cookie (so that XCB
knows which of the waiting replies you want). Here is an example to illustrate
the use of cookies:
.nf
.sp
void my_example(xcb_connection *conn) {
xcb_intern_atom_cookie_t cookie;
xcb_intern_atom_reply_t *reply;
cookie = xcb_intern_atom(conn, 0, strlen("_NET_WM_NAME"), "_NET_WM_NAME");
/* ... do other work here if possible ... */
if ((reply = xcb_intern_atom_reply(conn, cookie, NULL))) {
printf("The _NET_WM_NAME atom has ID %u\\n", reply->atom);
}
free(reply);
}
.fi
.SH CHECKED VS. UNCHECKED
The checked and unchecked suffixes for functions determine which kind of error
handling is used for this specific request.
For requests which have no reply (for example \fIxcb_map_window\fP), errors
will be delivered to the event loop (you will receive an X11 event of type 0
when calling \fIxcb_poll_for_event\fP).
If you want to explicitly check for errors in a blocking fashion, call the
_checked version of the function (for example \fIxcb_map_window_checked\fP) and
use \fIxcb_request_check\fP.
For requests which have a reply (for example \fIxcb_intern_atom\fP), errors
will be checked when calling the reply function. To get errors in the event
loop instead, use the _unchecked version of the function (for example
\fIxcb_intern_atom_unchecked\fP).
Here is an example which illustrates the four different ways of handling errors:
.nf
.sp
/*
* Request without a reply, handling errors in the event loop (default)
*
*/
void my_example(xcb_connection *conn, xcb_window_t window) {
/* This is a request without a reply. Errors will be delivered to the event
* loop. Getting an error to xcb_map_window most likely is a bug in our
* program, so we don't need to check for that in a blocking way. */
xcb_map_window(conn, window);
/* ... of course your event loop would not be in the same function ... */
while ((event = xcb_wait_for_event(conn)) != NULL) {
if (event->response_type == 0) {
fprintf("Received X11 error %d\\n", error->error_code);
free(event);
continue;
}
/* ... handle a normal event ... */
}
}
/*
* Request without a reply, handling errors directly
*
*/
void my_example(xcb_connection *conn, xcb_window_t deco, xcb_window_t window) {
/* A reparenting window manager wants to know whether a new window was
* successfully reparented. If not (because the window got destroyed
* already, for example), it does not make sense to map an empty window
* decoration at all, so we need to know this right now. */
xcb_void_cookie_t cookie = xcb_reparent_window_checked(conn, window,
deco, 0, 0);
xcb_generic_error_t *error;
if ((error = xcb_request_check(conn, cookie))) {
fprintf(stderr, "Could not reparent the window\\n");
free(error);
return;
}
/* ... do window manager stuff here ... */
}
/*
* Request with a reply, handling errors directly (default)
*
*/
void my_example(xcb_connection *conn, xcb_window_t window) {
xcb_intern_atom_cookie_t cookie;
xcb_intern_atom_reply_t *reply;
xcb_generic_error_t *error;
cookie = xcb_intern_atom(c, 0, strlen("_NET_WM_NAME"), "_NET_WM_NAME");
/* ... do other work here if possible ... */
if ((reply = xcb_intern_atom_reply(c, cookie, &error))) {
printf("The _NET_WM_NAME atom has ID %u\\n", reply->atom);
free(reply);
} else {
fprintf(stderr, "X11 Error %d\\n", error->error_code);
free(error);
}
}
/*
* Request with a reply, handling errors in the event loop
*
*/
void my_example(xcb_connection *conn, xcb_window_t window) {
xcb_intern_atom_cookie_t cookie;
xcb_intern_atom_reply_t *reply;
cookie = xcb_intern_atom_unchecked(c, 0, strlen("_NET_WM_NAME"),
"_NET_WM_NAME");
/* ... do other work here if possible ... */
if ((reply = xcb_intern_atom_reply(c, cookie, NULL))) {
printf("The _NET_WM_NAME atom has ID %u\\n", reply->atom);
free(reply);
}
/* ... of course your event loop would not be in the same function ... */
while ((event = xcb_wait_for_event(conn)) != NULL) {
if (event->response_type == 0) {
fprintf("Received X11 error %d\\n", error->error_code);
free(event);
continue;
}
/* ... handle a normal event ... */
}
}
.fi
.SH SEE ALSO
.BR xcb_map_window (__libmansuffix__),
.BR xcb_intern_atom (__libmansuffix__),
.BR xcb_list_fonts (__libmansuffix__),
.BR xcb_poll_for_event (__libmansuffix__),
.BR xcb_request_check (__libmansuffix__)
.SH AUTHOR
Michael Stapelberg <michael+xcb at stapelberg dot de>

269
src/Makefile.am Normal file
View File

@ -0,0 +1,269 @@
lib_LTLIBRARIES = libxcb.la
EXTSOURCES = xproto.c \
bigreq.c \
xc_misc.c
AM_CFLAGS = $(BASE_CFLAGS) $(NEEDED_CFLAGS) $(XDMCP_CFLAGS)
libxcb_la_LIBADD = $(NEEDED_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_auth.c c_client.py
nodist_libxcb_la_SOURCES = xproto.c bigreq.c xc_misc.c
# Explanation for -version-info:
# -version-info current:revision:age
# The library supports interface (current-age) to interface current.
# * If you changed the source code at all, increment revision.
# * If you add an interface, increment current and age and set revision to 0.
# * If you change or remove an interface, increment current and set revision
# and age to 0.
libxcb_la_LDFLAGS = -version-info 2:0:1 -no-undefined @lt_enable_auto_import@
XCB_LIBS = libxcb.la
# FIXME: find a way to autogenerate this from the XML files.
EXTSOURCES += composite.c
if BUILD_COMPOSITE
lib_LTLIBRARIES += libxcb-composite.la
libxcb_composite_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_composite_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_composite_la_SOURCES = composite.c composite.h
endif
EXTSOURCES += damage.c
if BUILD_DAMAGE
lib_LTLIBRARIES += libxcb-damage.la
libxcb_damage_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_damage_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_damage_la_SOURCES = damage.c damage.h
endif
EXTSOURCES += dpms.c
if BUILD_DPMS
lib_LTLIBRARIES += libxcb-dpms.la
libxcb_dpms_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_dpms_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_dpms_la_SOURCES = dpms.c dpms.h
endif
EXTSOURCES += dri2.c
if BUILD_DRI2
lib_LTLIBRARIES += libxcb-dri2.la
libxcb_dri2_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_dri2_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_dri2_la_SOURCES = dri2.c dri2.h
endif
EXTSOURCES += dri3.c
if BUILD_DRI3
lib_LTLIBRARIES += libxcb-dri3.la
libxcb_dri3_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_dri3_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_dri3_la_SOURCES = dri3.c dri3.h
endif
EXTSOURCES += present.c
if BUILD_PRESENT
lib_LTLIBRARIES += libxcb-present.la
libxcb_present_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_present_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_present_la_SOURCES = present.c present.h
endif
EXTSOURCES += glx.c
if BUILD_GLX
lib_LTLIBRARIES += libxcb-glx.la
libxcb_glx_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_glx_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_glx_la_SOURCES = glx.c glx.h
endif
EXTSOURCES += randr.c
if BUILD_RANDR
lib_LTLIBRARIES += libxcb-randr.la
libxcb_randr_la_LDFLAGS = -version-info 1:0:1 -no-undefined @lt_enable_auto_import@
libxcb_randr_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_randr_la_SOURCES = randr.c randr.h
endif
EXTSOURCES += record.c
if BUILD_RECORD
lib_LTLIBRARIES += libxcb-record.la
libxcb_record_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_record_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_record_la_SOURCES = record.c record.h
endif
EXTSOURCES += render.c
if BUILD_RENDER
lib_LTLIBRARIES += libxcb-render.la
libxcb_render_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_render_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_render_la_SOURCES = render.c render.h
endif
EXTSOURCES += res.c
if BUILD_RESOURCE
lib_LTLIBRARIES += libxcb-res.la
libxcb_res_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_res_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_res_la_SOURCES = res.c res.h
endif
EXTSOURCES += screensaver.c
if BUILD_SCREENSAVER
lib_LTLIBRARIES += libxcb-screensaver.la
libxcb_screensaver_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_screensaver_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_screensaver_la_SOURCES = screensaver.c screensaver.h
endif
EXTSOURCES += shape.c
if BUILD_SHAPE
lib_LTLIBRARIES += libxcb-shape.la
libxcb_shape_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_shape_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_shape_la_SOURCES = shape.c shape.h
endif
EXTSOURCES += shm.c
if BUILD_SHM
lib_LTLIBRARIES += libxcb-shm.la
libxcb_shm_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_shm_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_shm_la_SOURCES = shm.c shm.h
endif
EXTSOURCES += sync.c
if BUILD_SYNC
lib_LTLIBRARIES += libxcb-sync.la
libxcb_sync_la_LDFLAGS = -version-info 1:0:0 -no-undefined @lt_enable_auto_import@
libxcb_sync_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_sync_la_SOURCES = sync.c sync.h
endif
EXTSOURCES += xevie.c
if BUILD_XEVIE
lib_LTLIBRARIES += libxcb-xevie.la
libxcb_xevie_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_xevie_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_xevie_la_SOURCES = xevie.c xevie.h
endif
EXTSOURCES += xf86dri.c
if BUILD_XFREE86_DRI
lib_LTLIBRARIES += libxcb-xf86dri.la
libxcb_xf86dri_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_xf86dri_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_xf86dri_la_SOURCES = xf86dri.c xf86dri.h
endif
EXTSOURCES += xfixes.c
if BUILD_XFIXES
lib_LTLIBRARIES += libxcb-xfixes.la
libxcb_xfixes_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_xfixes_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_xfixes_la_SOURCES = xfixes.c xfixes.h
endif
EXTSOURCES += xinerama.c
if BUILD_XINERAMA
lib_LTLIBRARIES += libxcb-xinerama.la
libxcb_xinerama_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_xinerama_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_xinerama_la_SOURCES = xinerama.c xinerama.h
endif
EXTSOURCES += xinput.c
if BUILD_XINPUT
lib_LTLIBRARIES += libxcb-xinput.la
libxcb_xinput_la_LDFLAGS = -version-info 1:0:1 -no-undefined @lt_enable_auto_import@
libxcb_xinput_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_xinput_la_SOURCES = xinput.c xinput.h
endif
EXTSOURCES += xkb.c
if BUILD_XKB
lib_LTLIBRARIES += libxcb-xkb.la
libxcb_xkb_la_LDFLAGS = -version-info 1:0:0 -no-undefined
libxcb_xkb_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_xkb_la_SOURCES = xkb.c xkb.h
endif
EXTSOURCES += xprint.c
if BUILD_XPRINT
lib_LTLIBRARIES += libxcb-xprint.la
libxcb_xprint_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_xprint_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_xprint_la_SOURCES = xprint.c xprint.h
endif
EXTSOURCES += xselinux.c
if BUILD_SELINUX
lib_LTLIBRARIES += libxcb-xselinux.la
libxcb_xselinux_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_xselinux_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_xselinux_la_SOURCES = xselinux.c xselinux.h
endif
EXTSOURCES += xtest.c
if BUILD_XTEST
lib_LTLIBRARIES += libxcb-xtest.la
libxcb_xtest_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_xtest_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_xtest_la_SOURCES = xtest.c xtest.h
endif
EXTSOURCES += xv.c
if BUILD_XV
lib_LTLIBRARIES += libxcb-xv.la
libxcb_xv_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_xv_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_xv_la_SOURCES = xv.c xv.h
endif
EXTSOURCES += xvmc.c
if BUILD_XVMC
lib_LTLIBRARIES += libxcb-xvmc.la
libxcb_xvmc_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_xvmc_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_xvmc_la_SOURCES = xvmc.c xvmc.h
endif
EXTSOURCES += ge.c
if BUILD_GE
lib_LTLIBRARIES += libxcb-ge.la
libxcb_ge_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@
libxcb_ge_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_ge_la_SOURCES = ge.c ge.h
endif
EXTHEADERS=$(EXTSOURCES:.c=.h)
xcbinclude_HEADERS = xcb.h xcbext.h
if XCB_HAVE_WIN32
xcbinclude_HEADERS += xcb_windefs.h
endif
nodist_xcbinclude_HEADERS = $(EXTHEADERS)
noinst_HEADERS = xcbint.h
BUILT_MAN_PAGES = man/xcb_*
libmandir = $(LIB_MAN_DIR)
libman_DATA = $(BUILT_MAN_PAGES)
BUILT_SOURCES = $(EXTSOURCES) $(BUILT_MAN_PAGES)
CLEANFILES = $(EXTSOURCES) $(EXTHEADERS) $(BUILT_MAN_PAGES)
C_CLIENT_PY_EXTRA_ARGS =
if XCB_SERVERSIDE_SUPPORT
C_CLIENT_PY_EXTRA_ARGS += --server-side
endif
$(EXTSOURCES): c_client.py $(XCBPROTO_XCBINCLUDEDIR)/$(@:.c=.xml)
$(AM_V_GEN)$(PYTHON) $(srcdir)/c_client.py -c "$(PACKAGE_STRING)" -l "$(XORG_MAN_PAGE)" \
-s "$(LIB_MAN_SUFFIX)" -p $(XCBPROTO_XCBPYTHONDIR) \
$(C_CLIENT_PY_EXTRA_ARGS) \
$(XCBPROTO_XCBINCLUDEDIR)/$(@:.c=.xml)
$(BUILT_MAN_PAGES): $(EXTSOURCES)

1415
src/Makefile.in Normal file

File diff suppressed because it is too large Load Diff

3368
src/c_client.py Normal file

File diff suppressed because it is too large Load Diff

144
src/config.h.in Normal file
View File

@ -0,0 +1,144 @@
/* src/config.h.in. Generated from configure.ac by autoheader. */
/* Defined if GCC supports the visibility feature */
#undef GCC_HAS_VISIBILITY
/* Has Wraphelp.c needed for XDM AUTH protocols */
#undef HASXDMAUTH
/* Define if your platform supports abstract sockets */
#undef HAVE_ABSTRACT_SOCKETS
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* getaddrinfo() function is available */
#undef HAVE_GETADDRINFO
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `is_system_labeled' function. */
#undef HAVE_IS_SYSTEM_LABELED
/* launchd support available */
#undef HAVE_LAUNCHD
/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
#undef HAVE_LIBWS2_32
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define if your platform supports sendmsg */
#undef HAVE_SENDMSG
/* Have the sockaddr_un.sun_len member. */
#undef HAVE_SOCKADDR_SUN_LEN
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <tsol/label.h> header file. */
#undef HAVE_TSOL_LABEL_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if not provided by <limits.h> */
#undef IOV_MAX
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Major version of this package */
#undef PACKAGE_VERSION_MAJOR
/* Minor version of this package */
#undef PACKAGE_VERSION_MINOR
/* Patch version of this package */
#undef PACKAGE_VERSION_PATCHLEVEL
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* poll() function is available */
#undef USE_POLL
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* Version number of package */
#undef VERSION
/* XCB buffer queue size */
#undef XCB_QUEUE_BUFFER_SIZE
/* Define to 1 if on MINIX. */
#undef _MINIX
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#undef _POSIX_1_SOURCE
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE
/* Defined if needed to expose struct msghdr.msg_control */
#undef _XOPEN_SOURCE

640
src/xcb.h Normal file
View File

@ -0,0 +1,640 @@
/*
* Copyright (C) 2001-2006 Bart Massey, Jamey Sharp, and Josh Triplett.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors or their
* institutions shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization from the authors.
*/
#ifndef __XCB_H__
#define __XCB_H__
#include <sys/types.h>
#if defined(__solaris__)
#include <inttypes.h>
#else
#include <stdint.h>
#endif
#ifndef _WIN32
#include <sys/uio.h>
#else
#include "xcb_windefs.h"
#endif
#include <pthread.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @file xcb.h
*/
#define XCB_PACKED __attribute__((__packed__))
/**
* @defgroup XCB_Core_API XCB Core API
* @brief Core API of the XCB library.
*
* @{
*/
/* Pre-defined constants */
/** Current protocol version */
#define X_PROTOCOL 11
/** Current minor version */
#define X_PROTOCOL_REVISION 0
/** X_TCP_PORT + display number = server port for TCP transport */
#define X_TCP_PORT 6000
/** xcb connection errors because of socket, pipe and other stream errors. */
#define XCB_CONN_ERROR 1
/** xcb connection shutdown because of extension not supported */
#define XCB_CONN_CLOSED_EXT_NOTSUPPORTED 2
/** malloc(), calloc() and realloc() error upon failure, for eg ENOMEM */
#define XCB_CONN_CLOSED_MEM_INSUFFICIENT 3
/** Connection closed, exceeding request length that server accepts. */
#define XCB_CONN_CLOSED_REQ_LEN_EXCEED 4
/** Connection closed, error during parsing display string. */
#define XCB_CONN_CLOSED_PARSE_ERR 5
/** Connection closed because the server does not have a screen matching the display. */
#define XCB_CONN_CLOSED_INVALID_SCREEN 6
/** Connection closed because some FD passing operation failed */
#define XCB_CONN_CLOSED_FDPASSING_FAILED 7
#define XCB_TYPE_PAD(T,I) (-(I) & (sizeof(T) > 4 ? 3 : sizeof(T) - 1))
/* Opaque structures */
/**
* @brief XCB Connection structure.
*
* A structure that contain all data that XCB needs to communicate with an X server.
*/
typedef struct xcb_connection_t xcb_connection_t; /**< Opaque structure containing all data that XCB needs to communicate with an X server. */
/* Other types */
/**
* @brief Generic iterator.
*
* A generic iterator structure.
*/
typedef struct {
void *data; /**< Data of the current iterator */
int rem; /**< remaining elements */
int index; /**< index of the current iterator */
} xcb_generic_iterator_t;
/**
* @brief Generic reply.
*
* A generic reply structure.
*/
typedef struct {
uint8_t response_type; /**< Type of the response */
uint8_t pad0; /**< Padding */
uint16_t sequence; /**< Sequence number */
uint32_t length; /**< Length of the response */
} xcb_generic_reply_t;
/**
* @brief Generic event.
*
* A generic event structure.
*/
typedef struct {
uint8_t response_type; /**< Type of the response */
uint8_t pad0; /**< Padding */
uint16_t sequence; /**< Sequence number */
uint32_t pad[7]; /**< Padding */
uint32_t full_sequence; /**< full sequence */
} xcb_generic_event_t;
/**
* @brief Raw Generic event.
*
* A generic event structure as used on the wire, i.e., without the full_sequence field
*/
typedef struct {
uint8_t response_type; /**< Type of the response */
uint8_t pad0; /**< Padding */
uint16_t sequence; /**< Sequence number */
uint32_t pad[7]; /**< Padding */
} xcb_raw_generic_event_t;
/**
* @brief GE event
*
* An event as sent by the XGE extension. The length field specifies the
* number of 4-byte blocks trailing the struct.
*
* @deprecated Since some fields in this struct have unfortunate names, it is
* recommended to use xcb_ge_generic_event_t instead.
*/
typedef struct {
uint8_t response_type; /**< Type of the response */
uint8_t pad0; /**< Padding */
uint16_t sequence; /**< Sequence number */
uint32_t length;
uint16_t event_type;
uint16_t pad1;
uint32_t pad[5]; /**< Padding */
uint32_t full_sequence; /**< full sequence */
} xcb_ge_event_t;
/**
* @brief Generic error.
*
* A generic error structure.
*/
typedef struct {
uint8_t response_type; /**< Type of the response */
uint8_t error_code; /**< Error code */
uint16_t sequence; /**< Sequence number */
uint32_t resource_id; /** < Resource ID for requests with side effects only */
uint16_t minor_code; /** < Minor opcode of the failed request */
uint8_t major_code; /** < Major opcode of the failed request */
uint8_t pad0;
uint32_t pad[5]; /**< Padding */
uint32_t full_sequence; /**< full sequence */
} xcb_generic_error_t;
/**
* @brief Generic cookie.
*
* A generic cookie structure.
*/
typedef struct {
unsigned int sequence; /**< Sequence number */
} xcb_void_cookie_t;
/* Include the generated xproto header. */
#include "xproto.h"
/** XCB_NONE is the universal null resource or null atom parameter value for many core X requests */
#define XCB_NONE 0L
/** XCB_COPY_FROM_PARENT can be used for many xcb_create_window parameters */
#define XCB_COPY_FROM_PARENT 0L
/** XCB_CURRENT_TIME can be used in most requests that take an xcb_timestamp_t */
#define XCB_CURRENT_TIME 0L
/** XCB_NO_SYMBOL fills in unused entries in xcb_keysym_t tables */
#define XCB_NO_SYMBOL 0L
/* xcb_auth.c */
/**
* @brief Container for authorization information.
*
* A container for authorization information to be sent to the X server.
*/
typedef struct xcb_auth_info_t {
int namelen; /**< Length of the string name (as returned by strlen). */
char *name; /**< String containing the authentication protocol name, such as "MIT-MAGIC-COOKIE-1" or "XDM-AUTHORIZATION-1". */
int datalen; /**< Length of the data member. */
char *data; /**< Data interpreted in a protocol-specific manner. */
} xcb_auth_info_t;
/* xcb_out.c */
/**
* @brief Forces any buffered output to be written to the server.
* @param c The connection to the X server.
* @return > @c 0 on success, <= @c 0 otherwise.
*
* Forces any buffered output to be written to the server. Blocks
* until the write is complete.
*/
int xcb_flush(xcb_connection_t *c);
/**
* @brief Returns the maximum request length that this server accepts.
* @param c The connection to the X server.
* @return The maximum request length field.
*
* In the absence of the BIG-REQUESTS extension, returns the
* maximum request length field from the connection setup data, which
* may be as much as 65535. If the server supports BIG-REQUESTS, then
* the maximum request length field from the reply to the
* BigRequestsEnable request will be returned instead.
*
* Note that this length is measured in four-byte units, making the
* theoretical maximum lengths roughly 256kB without BIG-REQUESTS and
* 16GB with.
*/
uint32_t xcb_get_maximum_request_length(xcb_connection_t *c);
/**
* @brief Prefetch the maximum request length without blocking.
* @param c The connection to the X server.
*
* Without blocking, does as much work as possible toward computing
* the maximum request length accepted by the X server.
*
* Invoking this function may cause a call to xcb_big_requests_enable,
* but will not block waiting for the reply.
* xcb_get_maximum_request_length will return the prefetched data
* after possibly blocking while the reply is retrieved.
*
* Note that in order for this function to be fully non-blocking, the
* application must previously have called
* xcb_prefetch_extension_data(c, &xcb_big_requests_id) and the reply
* must have already arrived.
*/
void xcb_prefetch_maximum_request_length(xcb_connection_t *c);
/* xcb_in.c */
/**
* @brief Returns the next event or error from the server.
* @param c The connection to the X server.
* @return The next event from the server.
*
* Returns the next event or error from the server, or returns null in
* the event of an I/O error. Blocks until either an event or error
* arrive, or an I/O error occurs.
*/
xcb_generic_event_t *xcb_wait_for_event(xcb_connection_t *c);
/**
* @brief Returns the next event or error from the server.
* @param c The connection to the X server.
* @return The next event from the server.
*
* Returns the next event or error from the server, if one is
* available, or returns @c NULL otherwise. If no event is available, that
* might be because an I/O error like connection close occurred while
* attempting to read the next event, in which case the connection is
* shut down when this function returns.
*/
xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c);
/**
* @brief Returns the next event without reading from the connection.
* @param c The connection to the X server.
* @return The next already queued event from the server.
*
* This is a version of xcb_poll_for_event that only examines the
* event queue for new events. The function doesn't try to read new
* events from the connection if no queued events are found.
*
* This function is useful for callers that know in advance that all
* interesting events have already been read from the connection. For
* example, callers might use xcb_wait_for_reply and be interested
* only of events that preceded a specific reply.
*/
xcb_generic_event_t *xcb_poll_for_queued_event(xcb_connection_t *c);
typedef struct xcb_special_event xcb_special_event_t;
/**
* @brief Returns the next event from a special queue
*/
xcb_generic_event_t *xcb_poll_for_special_event(xcb_connection_t *c,
xcb_special_event_t *se);
/**
* @brief Returns the next event from a special queue, blocking until one arrives
*/
xcb_generic_event_t *xcb_wait_for_special_event(xcb_connection_t *c,
xcb_special_event_t *se);
/**
* @typedef typedef struct xcb_extension_t xcb_extension_t
*/
typedef struct xcb_extension_t xcb_extension_t; /**< Opaque structure used as key for xcb_get_extension_data_t. */
/**
* @brief Listen for a special event
*/
xcb_special_event_t *xcb_register_for_special_xge(xcb_connection_t *c,
xcb_extension_t *ext,
uint32_t eid,
uint32_t *stamp);
/**
* @brief Stop listening for a special event
*/
void xcb_unregister_for_special_event(xcb_connection_t *c,
xcb_special_event_t *se);
/**
* @brief Return the error for a request, or NULL if none can ever arrive.
* @param c The connection to the X server.
* @param cookie The request cookie.
* @return The error for the request, or NULL if none can ever arrive.
*
* The xcb_void_cookie_t cookie supplied to this function must have resulted
* from a call to xcb_[request_name]_checked(). This function will block
* until one of two conditions happens. If an error is received, it will be
* returned. If a reply to a subsequent request has already arrived, no error
* can arrive for this request, so this function will return NULL.
*
* Note that this function will perform a sync if needed to ensure that the
* sequence number will advance beyond that provided in cookie; this is a
* convenience to avoid races in determining whether the sync is needed.
*/
xcb_generic_error_t *xcb_request_check(xcb_connection_t *c, xcb_void_cookie_t cookie);
/**
* @brief Discards the reply for a request.
* @param c The connection to the X server.
* @param sequence The request sequence number from a cookie.
*
* Discards the reply for a request. Additionally, any error generated
* by the request is also discarded (unless it was an _unchecked request
* and the error has already arrived).
*
* This function will not block even if the reply is not yet available.
*
* Note that the sequence really does have to come from an xcb cookie;
* this function is not designed to operate on socket-handoff replies.
*/
void xcb_discard_reply(xcb_connection_t *c, unsigned int sequence);
/**
* @brief Discards the reply for a request, given by a 64bit sequence number
* @param c The connection to the X server.
* @param sequence 64-bit sequence number as returned by xcb_send_request64().
*
* Discards the reply for a request. Additionally, any error generated
* by the request is also discarded (unless it was an _unchecked request
* and the error has already arrived).
*
* This function will not block even if the reply is not yet available.
*
* Note that the sequence really does have to come from xcb_send_request64();
* the cookie sequence number is defined as "unsigned" int and therefore
* not 64-bit on all platforms.
* This function is not designed to operate on socket-handoff replies.
*
* Unlike its xcb_discard_reply() counterpart, the given sequence number is not
* automatically "widened" to 64-bit.
*/
void xcb_discard_reply64(xcb_connection_t *c, uint64_t sequence);
/* xcb_ext.c */
/**
* @brief Caches reply information from QueryExtension requests.
* @param c The connection.
* @param ext The extension data.
* @return A pointer to the xcb_query_extension_reply_t for the extension.
*
* This function is the primary interface to the "extension cache",
* which caches reply information from QueryExtension
* requests. Invoking this function may cause a call to
* xcb_query_extension to retrieve extension information from the
* server, and may block until extension data is received from the
* server.
*
* The result must not be freed. This storage is managed by the cache
* itself.
*/
const struct xcb_query_extension_reply_t *xcb_get_extension_data(xcb_connection_t *c, xcb_extension_t *ext);
/**
* @brief Prefetch of extension data into the extension cache
* @param c The connection.
* @param ext The extension data.
*
* This function allows a "prefetch" of extension data into the
* extension cache. Invoking the function may cause a call to
* xcb_query_extension, but will not block waiting for the
* reply. xcb_get_extension_data will return the prefetched data after
* possibly blocking while it is retrieved.
*/
void xcb_prefetch_extension_data(xcb_connection_t *c, xcb_extension_t *ext);
/* xcb_conn.c */
/**
* @brief Access the data returned by the server.
* @param c The connection.
* @return A pointer to an xcb_setup_t structure.
*
* Accessor for the data returned by the server when the xcb_connection_t
* was initialized. This data includes
* - the server's required format for images,
* - a list of available visuals,
* - a list of available screens,
* - the server's maximum request length (in the absence of the
* BIG-REQUESTS extension),
* - and other assorted information.
*
* See the X protocol specification for more details.
*
* The result must not be freed.
*/
const struct xcb_setup_t *xcb_get_setup(xcb_connection_t *c);
/**
* @brief Access the file descriptor of the connection.
* @param c The connection.
* @return The file descriptor.
*
* Accessor for the file descriptor that was passed to the
* xcb_connect_to_fd call that returned @p c.
*/
int xcb_get_file_descriptor(xcb_connection_t *c);
/**
* @brief Test whether the connection has shut down due to a fatal error.
* @param c The connection.
* @return > 0 if the connection is in an error state; 0 otherwise.
*
* Some errors that occur in the context of an xcb_connection_t
* are unrecoverable. When such an error occurs, the
* connection is shut down and further operations on the
* xcb_connection_t have no effect, but memory will not be freed until
* xcb_disconnect() is called on the xcb_connection_t.
*
* @return XCB_CONN_ERROR, because of socket errors, pipe errors or other stream errors.
* @return XCB_CONN_CLOSED_EXT_NOTSUPPORTED, when extension not supported.
* @return XCB_CONN_CLOSED_MEM_INSUFFICIENT, when memory not available.
* @return XCB_CONN_CLOSED_REQ_LEN_EXCEED, exceeding request length that server accepts.
* @return XCB_CONN_CLOSED_PARSE_ERR, error during parsing display string.
* @return XCB_CONN_CLOSED_INVALID_SCREEN, because the server does not have a screen matching the display.
*/
int xcb_connection_has_error(xcb_connection_t *c);
/**
* @brief Connects to the X server.
* @param fd The file descriptor.
* @param auth_info Authentication data.
* @return A newly allocated xcb_connection_t structure.
*
* Connects to an X server, given the open socket @p fd and the
* xcb_auth_info_t @p auth_info. The file descriptor @p fd is
* bidirectionally connected to an X server. If the connection
* should be unauthenticated, @p auth_info must be @c
* NULL.
*
* Always returns a non-NULL pointer to a xcb_connection_t, even on failure.
* Callers need to use xcb_connection_has_error() to check for failure.
* When finished, use xcb_disconnect() to close the connection and free
* the structure.
*/
xcb_connection_t *xcb_connect_to_fd(int fd, xcb_auth_info_t *auth_info);
/**
* @brief Closes the connection.
* @param c The connection.
*
* Closes the file descriptor and frees all memory associated with the
* connection @c c. If @p c is @c NULL, nothing is done.
*/
void xcb_disconnect(xcb_connection_t *c);
/* xcb_util.c */
/**
* @brief Parses a display string name in the form documented by X(7x).
* @param name The name of the display.
* @param host A pointer to a malloc'd copy of the hostname.
* @param display A pointer to the display number.
* @param screen A pointer to the screen number.
* @return 0 on failure, non 0 otherwise.
*
* Parses the display string name @p display_name in the form
* documented by X(7x). Has no side effects on failure. If
* @p displayname is @c NULL or empty, it uses the environment
* variable DISPLAY. @p hostp is a pointer to a newly allocated string
* that contain the host name. @p displayp is set to the display
* number and @p screenp to the preferred screen number. @p screenp
* can be @c NULL. If @p displayname does not contain a screen number,
* it is set to @c 0.
*/
int xcb_parse_display(const char *name, char **host, int *display, int *screen);
/**
* @brief Connects to the X server.
* @param displayname The name of the display.
* @param screenp A pointer to a preferred screen number.
* @return A newly allocated xcb_connection_t structure.
*
* Connects to the X server specified by @p displayname. If @p
* displayname is @c NULL, uses the value of the DISPLAY environment
* variable. If a particular screen on that server is preferred, the
* int pointed to by @p screenp (if not @c NULL) will be set to that
* screen; otherwise the screen will be set to 0.
*
* Always returns a non-NULL pointer to a xcb_connection_t, even on failure.
* Callers need to use xcb_connection_has_error() to check for failure.
* When finished, use xcb_disconnect() to close the connection and free
* the structure.
*/
xcb_connection_t *xcb_connect(const char *displayname, int *screenp);
/**
* @brief Connects to the X server, using an authorization information.
* @param display The name of the display.
* @param auth The authorization information.
* @param screen A pointer to a preferred screen number.
* @return A newly allocated xcb_connection_t structure.
*
* Connects to the X server specified by @p displayname, using the
* authorization @p auth. If a particular screen on that server is
* preferred, the int pointed to by @p screenp (if not @c NULL) will
* be set to that screen; otherwise @p screenp will be set to 0.
*
* Always returns a non-NULL pointer to a xcb_connection_t, even on failure.
* Callers need to use xcb_connection_has_error() to check for failure.
* When finished, use xcb_disconnect() to close the connection and free
* the structure.
*/
xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *display, xcb_auth_info_t *auth, int *screen);
/* xcb_xid.c */
/**
* @brief Allocates an XID for a new object.
* @param c The connection.
* @return A newly allocated XID.
*
* Allocates an XID for a new object. Typically used just prior to
* various object creation functions, such as xcb_create_window.
*/
uint32_t xcb_generate_id(xcb_connection_t *c);
/**
* @brief Obtain number of bytes read from the connection.
* @param c The connection
* @return Number of bytes read from the server.
*
* Returns cumulative number of bytes received from the connection.
*
* This retrieves the total number of bytes read from this connection,
* to be used for diagnostic/monitoring/informative purposes.
*/
uint64_t
xcb_total_read(xcb_connection_t *c);
/**
*
* @brief Obtain number of bytes written to the connection.
* @param c The connection
* @return Number of bytes written to the server.
*
* Returns cumulative number of bytes sent to the connection.
*
* This retrieves the total number of bytes written to this connection,
* to be used for diagnostic/monitoring/informative purposes.
*/
uint64_t
xcb_total_written(xcb_connection_t *c);
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __XCB_H__ */

380
src/xcb_auth.c Normal file
View File

@ -0,0 +1,380 @@
/* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors or their
* institutions shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization from the authors.
*/
/* Authorization systems for the X protocol. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h>
#include <X11/Xauth.h>
#include <sys/param.h>
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
#ifdef __INTERIX
/* _don't_ ask. interix has INADDR_LOOPBACK in here. */
#include <rpc/types.h>
#endif
#ifdef _WIN32
#ifdef HASXDMAUTH
/* We must include the wrapped windows.h before any system header which includes
it unwrapped, to avoid conflicts with types defined in X headers */
#include <X11/Xwindows.h>
#endif
#include "xcb_windefs.h"
#else
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/un.h>
#endif /* _WIN32 */
#include "xcb.h"
#include "xcbint.h"
#ifdef HASXDMAUTH
#include <X11/Xdmcp.h>
#endif
enum auth_protos {
#ifdef HASXDMAUTH
AUTH_XA1,
#endif
AUTH_MC1,
N_AUTH_PROTOS
};
#define AUTH_PROTO_XDM_AUTHORIZATION "XDM-AUTHORIZATION-1"
#define AUTH_PROTO_MIT_MAGIC_COOKIE "MIT-MAGIC-COOKIE-1"
static char *authnames[N_AUTH_PROTOS] = {
#ifdef HASXDMAUTH
AUTH_PROTO_XDM_AUTHORIZATION,
#endif
AUTH_PROTO_MIT_MAGIC_COOKIE,
};
static int authnameslen[N_AUTH_PROTOS] = {
#ifdef HASXDMAUTH
sizeof(AUTH_PROTO_XDM_AUTHORIZATION) - 1,
#endif
sizeof(AUTH_PROTO_MIT_MAGIC_COOKIE) - 1,
};
static size_t memdup(char **dst, void *src, size_t len)
{
if(len)
*dst = malloc(len);
else
*dst = 0;
if(!*dst)
return 0;
memcpy(*dst, src, len);
return len;
}
static int authname_match(enum auth_protos kind, char *name, size_t namelen)
{
if(authnameslen[kind] != namelen)
return 0;
if(memcmp(authnames[kind], name, namelen))
return 0;
return 1;
}
#define SIN6_ADDR(s) (&((struct sockaddr_in6 *)s)->sin6_addr)
static Xauth *get_authptr(struct sockaddr *sockname, int display)
{
char *addr = 0;
int addrlen = 0;
unsigned short family;
char hostnamebuf[256]; /* big enough for max hostname */
char dispbuf[40]; /* big enough to hold more than 2^64 base 10 */
int dispbuflen;
family = FamilyLocal; /* 256 */
switch(sockname->sa_family)
{
#ifdef AF_INET6
case AF_INET6:
addr = (char *) SIN6_ADDR(sockname);
addrlen = sizeof(*SIN6_ADDR(sockname));
if(!IN6_IS_ADDR_V4MAPPED(SIN6_ADDR(sockname)))
{
if(!IN6_IS_ADDR_LOOPBACK(SIN6_ADDR(sockname)))
family = XCB_FAMILY_INTERNET_6;
break;
}
addr += 12;
/* if v4-mapped, fall through. */
#endif
case AF_INET:
if(!addr)
addr = (char *) &((struct sockaddr_in *)sockname)->sin_addr;
addrlen = sizeof(((struct sockaddr_in *)sockname)->sin_addr);
if(*(in_addr_t *) addr != htonl(INADDR_LOOPBACK))
family = XCB_FAMILY_INTERNET;
break;
case AF_UNIX:
break;
default:
return 0; /* cannot authenticate this family */
}
dispbuflen = snprintf(dispbuf, sizeof(dispbuf), "%d", display);
if(dispbuflen < 0)
return 0;
/* snprintf may have truncate our text */
dispbuflen = MIN(dispbuflen, sizeof(dispbuf) - 1);
if (family == FamilyLocal) {
if (gethostname(hostnamebuf, sizeof(hostnamebuf)) == -1)
return 0; /* do not know own hostname */
addr = hostnamebuf;
addrlen = strlen(addr);
}
return XauGetBestAuthByAddr (family,
(unsigned short) addrlen, addr,
(unsigned short) dispbuflen, dispbuf,
N_AUTH_PROTOS, authnames, authnameslen);
}
#ifdef HASXDMAUTH
static int next_nonce(void)
{
static int nonce = 0;
static pthread_mutex_t nonce_mutex = PTHREAD_MUTEX_INITIALIZER;
int ret;
pthread_mutex_lock(&nonce_mutex);
ret = nonce++;
pthread_mutex_unlock(&nonce_mutex);
return ret;
}
static void do_append(char *buf, int *idxp, void *val, size_t valsize) {
memcpy(buf + *idxp, val, valsize);
*idxp += valsize;
}
#endif
static int compute_auth(xcb_auth_info_t *info, Xauth *authptr, struct sockaddr *sockname)
{
if (authname_match(AUTH_MC1, authptr->name, authptr->name_length)) {
info->datalen = memdup(&info->data, authptr->data, authptr->data_length);
if(!info->datalen)
return 0;
return 1;
}
#ifdef HASXDMAUTH
#define APPEND(buf,idx,val) do_append((buf),&(idx),&(val),sizeof(val))
if (authname_match(AUTH_XA1, authptr->name, authptr->name_length)) {
int j;
info->data = malloc(192 / 8);
if(!info->data)
return 0;
for (j = 0; j < 8; j++)
info->data[j] = authptr->data[j];
switch(sockname->sa_family) {
case AF_INET:
/*block*/ {
struct sockaddr_in *si = (struct sockaddr_in *) sockname;
APPEND(info->data, j, si->sin_addr.s_addr);
APPEND(info->data, j, si->sin_port);
}
break;
#ifdef AF_INET6
case AF_INET6:
/*block*/ {
struct sockaddr_in6 *si6 = (struct sockaddr_in6 *) sockname;
if(IN6_IS_ADDR_V4MAPPED(SIN6_ADDR(sockname)))
{
do_append(info->data, &j, &si6->sin6_addr.s6_addr[12], 4);
APPEND(info->data, j, si6->sin6_port);
}
else
{
/* XDM-AUTHORIZATION-1 does not handle IPv6 correctly. Do the
same thing Xlib does: use all zeroes for the 4-byte address
and 2-byte port number. */
uint32_t fakeaddr = 0;
uint16_t fakeport = 0;
APPEND(info->data, j, fakeaddr);
APPEND(info->data, j, fakeport);
}
}
break;
#endif
case AF_UNIX:
/*block*/ {
uint32_t fakeaddr = htonl(0xffffffff - next_nonce());
uint16_t fakeport = htons(getpid());
APPEND(info->data, j, fakeaddr);
APPEND(info->data, j, fakeport);
}
break;
default:
free(info->data);
return 0; /* do not know how to build this */
}
{
uint32_t now = htonl(time(0));
APPEND(info->data, j, now);
}
assert(j <= 192 / 8);
while (j < 192 / 8)
info->data[j++] = 0;
info->datalen = j;
XdmcpWrap ((unsigned char *) info->data, (unsigned char *) authptr->data + 8, (unsigned char *) info->data, info->datalen);
return 1;
}
#undef APPEND
#endif
return 0; /* Unknown authorization type */
}
/* `sockaddr_un.sun_path' typical size usually ranges between 92 and 108 */
#define INITIAL_SOCKNAME_SLACK 108
/* Return a dynamically allocated socket address structure according
to the value returned by either getpeername() or getsockname()
(according to POSIX, applications should not assume a particular
length for `sockaddr_un.sun_path') */
static struct sockaddr *get_peer_sock_name(int (*socket_func)(int,
struct sockaddr *,
socklen_t *),
int fd)
{
socklen_t socknamelen = sizeof(struct sockaddr) + INITIAL_SOCKNAME_SLACK;
socklen_t actual_socknamelen = socknamelen;
struct sockaddr *sockname = malloc(socknamelen);
if (sockname == NULL)
return NULL;
/* Both getpeername() and getsockname() truncates sockname if
there is not enough space and set the required length in
actual_socknamelen */
if (socket_func(fd, sockname, &actual_socknamelen) == -1)
goto sock_or_realloc_error;
if (actual_socknamelen > socknamelen)
{
struct sockaddr *new_sockname = NULL;
socknamelen = actual_socknamelen;
if ((new_sockname = realloc(sockname, actual_socknamelen)) == NULL)
goto sock_or_realloc_error;
sockname = new_sockname;
if (socket_func(fd, sockname, &actual_socknamelen) == -1 ||
actual_socknamelen > socknamelen)
goto sock_or_realloc_error;
}
return sockname;
sock_or_realloc_error:
free(sockname);
return NULL;
}
int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display)
{
/* code adapted from Xlib/ConnDis.c, xtrans/Xtranssocket.c,
xtrans/Xtransutils.c */
struct sockaddr *sockname = NULL;
int gotsockname = 0;
Xauth *authptr = 0;
int ret = 1;
/* Some systems like hpux or Hurd do not expose peer names
* for UNIX Domain Sockets, but this is irrelevant,
* since compute_auth() ignores the peer name in this
* case anyway.*/
if ((sockname = get_peer_sock_name(getpeername, fd)) == NULL)
{
if ((sockname = get_peer_sock_name(getsockname, fd)) == NULL)
return 0; /* can only authenticate sockets */
if (sockname->sa_family != AF_UNIX)
{
free(sockname);
return 0; /* except for AF_UNIX, sockets should have peernames */
}
gotsockname = 1;
}
authptr = get_authptr(sockname, display);
if (authptr == 0)
{
free(sockname);
return 0; /* cannot find good auth data */
}
info->namelen = memdup(&info->name, authptr->name, authptr->name_length);
if (!info->namelen)
goto no_auth; /* out of memory */
if (!gotsockname)
{
free(sockname);
if ((sockname = get_peer_sock_name(getsockname, fd)) == NULL)
{
free(info->name);
goto no_auth; /* can only authenticate sockets */
}
}
ret = compute_auth(info, authptr, sockname);
if(!ret)
{
free(info->name);
goto no_auth; /* cannot build auth record */
}
free(sockname);
sockname = NULL;
XauDisposeAuth(authptr);
return ret;
no_auth:
free(sockname);
info->name = 0;
info->namelen = 0;
XauDisposeAuth(authptr);
return 0;
}

558
src/xcb_conn.c Normal file
View File

@ -0,0 +1,558 @@
/* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors or their
* institutions shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization from the authors.
*/
/* Connection management: the core of XCB. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <limits.h>
#include "xcb.h"
#include "xcbint.h"
#if USE_POLL
#include <poll.h>
#elif !defined _WIN32
#include <sys/select.h>
#endif
#ifdef _WIN32
#include "xcb_windefs.h"
#else
#include <sys/socket.h>
#include <netinet/in.h>
#endif /* _WIN32 */
/* SHUT_RDWR is fairly recent and is not available on all platforms */
#if !defined(SHUT_RDWR)
#define SHUT_RDWR 2
#endif
typedef struct {
uint8_t status;
uint8_t pad0[5];
uint16_t length;
} xcb_setup_generic_t;
static const xcb_setup_t xcb_error_setup = {
0, /* status: failed (but we wouldn't have a xcb_setup_t in this case) */
0, /* pad0 */
0, 0, /* protocol version, should be 11.0, but isn't */
0, /* length, invalid value */
0, /* release_number */
0, 0, /* resource_id_{base,mask} */
0, /* motion_buffer_size */
0, /* vendor_len */
0, /* maximum_request_length */
0, /* roots_len */
0, /* pixmap_formats_len */
0, /* image_byte_order */
0, /* bitmap_format_bit_order */
0, /* bitmap_format_scanline_unit */
0, /* bitmap_format_scanline_pad */
0, 0, /* {min,max}_keycode */
{ 0, 0, 0, 0 } /* pad1 */
};
/* Keep this list in sync with is_static_error_conn()! */
static const int xcb_con_error = XCB_CONN_ERROR;
static const int xcb_con_closed_mem_er = XCB_CONN_CLOSED_MEM_INSUFFICIENT;
static const int xcb_con_closed_parse_er = XCB_CONN_CLOSED_PARSE_ERR;
static const int xcb_con_closed_screen_er = XCB_CONN_CLOSED_INVALID_SCREEN;
static int is_static_error_conn(xcb_connection_t *c)
{
return c == (xcb_connection_t *) &xcb_con_error ||
c == (xcb_connection_t *) &xcb_con_closed_mem_er ||
c == (xcb_connection_t *) &xcb_con_closed_parse_er ||
c == (xcb_connection_t *) &xcb_con_closed_screen_er;
}
static int set_fd_flags(const int fd)
{
/* Win32 doesn't have file descriptors and the fcntl function. This block sets the socket in non-blocking mode */
#ifdef _WIN32
u_long iMode = 1; /* non-zero puts it in non-blocking mode, 0 in blocking mode */
int ret = 0;
ret = ioctlsocket(fd, FIONBIO, &iMode);
if(ret != 0)
return 0;
return 1;
#else
int flags = fcntl(fd, F_GETFL, 0);
if(flags == -1)
return 0;
flags |= O_NONBLOCK;
if(fcntl(fd, F_SETFL, flags) == -1)
return 0;
if(fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
return 0;
return 1;
#endif /* _WIN32 */
}
static int write_setup(xcb_connection_t *c, xcb_auth_info_t *auth_info)
{
static const char pad[3];
xcb_setup_request_t out;
struct iovec parts[6];
int count = 0;
static const uint32_t endian = 0x01020304;
int ret;
memset(&out, 0, sizeof(out));
/* B = 0x42 = MSB first, l = 0x6c = LSB first */
if(htonl(endian) == endian)
out.byte_order = 0x42;
else
out.byte_order = 0x6c;
out.protocol_major_version = X_PROTOCOL;
out.protocol_minor_version = X_PROTOCOL_REVISION;
out.authorization_protocol_name_len = 0;
out.authorization_protocol_data_len = 0;
parts[count].iov_len = sizeof(xcb_setup_request_t);
parts[count++].iov_base = &out;
parts[count].iov_len = XCB_PAD(sizeof(xcb_setup_request_t));
parts[count++].iov_base = (char *) pad;
if(auth_info)
{
parts[count].iov_len = out.authorization_protocol_name_len = auth_info->namelen;
parts[count++].iov_base = auth_info->name;
parts[count].iov_len = XCB_PAD(out.authorization_protocol_name_len);
parts[count++].iov_base = (char *) pad;
parts[count].iov_len = out.authorization_protocol_data_len = auth_info->datalen;
parts[count++].iov_base = auth_info->data;
parts[count].iov_len = XCB_PAD(out.authorization_protocol_data_len);
parts[count++].iov_base = (char *) pad;
}
assert(count <= (int) (sizeof(parts) / sizeof(*parts)));
pthread_mutex_lock(&c->iolock);
ret = _xcb_out_send(c, parts, count);
pthread_mutex_unlock(&c->iolock);
return ret;
}
static int read_setup(xcb_connection_t *c)
{
/* Read the server response */
c->setup = malloc(sizeof(xcb_setup_generic_t));
if(!c->setup)
return 0;
if(_xcb_in_read_block(c, c->setup, sizeof(xcb_setup_generic_t)) != sizeof(xcb_setup_generic_t))
return 0;
{
void *tmp = realloc(c->setup, c->setup->length * 4 + sizeof(xcb_setup_generic_t));
if(!tmp)
return 0;
c->setup = tmp;
}
if(_xcb_in_read_block(c, (char *) c->setup + sizeof(xcb_setup_generic_t), c->setup->length * 4) <= 0)
return 0;
/* 0 = failed, 2 = authenticate, 1 = success */
switch(c->setup->status)
{
case 0: /* failed */
{
xcb_setup_failed_t *setup = (xcb_setup_failed_t *) c->setup;
write(STDERR_FILENO, xcb_setup_failed_reason(setup), xcb_setup_failed_reason_length(setup));
return 0;
}
case 2: /* authenticate */
{
xcb_setup_authenticate_t *setup = (xcb_setup_authenticate_t *) c->setup;
write(STDERR_FILENO, xcb_setup_authenticate_reason(setup), xcb_setup_authenticate_reason_length(setup));
return 0;
}
}
return 1;
}
/* precondition: there must be something for us to write. */
static int write_vec(xcb_connection_t *c, struct iovec **vector, int *count)
{
int n;
assert(!c->out.queue_len);
#ifdef _WIN32
int i = 0;
int ret = 0,err = 0;
struct iovec *vec;
n = 0;
/* Could use the WSASend win32 function for scatter/gather i/o but setting up the WSABUF struct from
an iovec would require more work and I'm not sure of the benefit....works for now */
vec = *vector;
while(i < *count)
{
ret = send(c->fd,vec->iov_base,vec->iov_len,0);
if(ret == SOCKET_ERROR)
{
err = WSAGetLastError();
if(err == WSAEWOULDBLOCK)
{
return 1;
}
}
n += ret;
*vec++;
i++;
}
#else
n = *count;
if (n > IOV_MAX)
n = IOV_MAX;
#if HAVE_SENDMSG
if (c->out.out_fd.nfd) {
union {
struct cmsghdr cmsghdr;
char buf[CMSG_SPACE(XCB_MAX_PASS_FD * sizeof(int))];
} cmsgbuf;
struct msghdr msg = {
.msg_name = NULL,
.msg_namelen = 0,
.msg_iov = *vector,
.msg_iovlen = n,
.msg_control = cmsgbuf.buf,
.msg_controllen = CMSG_LEN(c->out.out_fd.nfd * sizeof (int)),
};
int i;
struct cmsghdr *hdr = CMSG_FIRSTHDR(&msg);
hdr->cmsg_len = msg.msg_controllen;
hdr->cmsg_level = SOL_SOCKET;
hdr->cmsg_type = SCM_RIGHTS;
memcpy(CMSG_DATA(hdr), c->out.out_fd.fd, c->out.out_fd.nfd * sizeof (int));
n = sendmsg(c->fd, &msg, 0);
if(n < 0 && errno == EAGAIN)
return 1;
for (i = 0; i < c->out.out_fd.nfd; i++)
close(c->out.out_fd.fd[i]);
c->out.out_fd.nfd = 0;
} else
#endif
{
n = writev(c->fd, *vector, n);
if(n < 0 && errno == EAGAIN)
return 1;
}
#endif /* _WIN32 */
if(n <= 0)
{
_xcb_conn_shutdown(c, XCB_CONN_ERROR);
return 0;
}
c->out.total_written += n;
for(; *count; --*count, ++*vector)
{
int cur = (*vector)->iov_len;
if(cur > n)
cur = n;
(*vector)->iov_len -= cur;
(*vector)->iov_base = (char *) (*vector)->iov_base + cur;
n -= cur;
if((*vector)->iov_len)
break;
}
if(!*count)
*vector = 0;
assert(n == 0);
return 1;
}
/* Public interface */
const xcb_setup_t *xcb_get_setup(xcb_connection_t *c)
{
if(is_static_error_conn(c))
return &xcb_error_setup;
/* doesn't need locking because it's never written to. */
return c->setup;
}
int xcb_get_file_descriptor(xcb_connection_t *c)
{
if(is_static_error_conn(c))
return -1;
/* doesn't need locking because it's never written to. */
return c->fd;
}
int xcb_connection_has_error(xcb_connection_t *c)
{
/* doesn't need locking because it's read and written atomically. */
return c->has_error;
}
xcb_connection_t *xcb_connect_to_fd(int fd, xcb_auth_info_t *auth_info)
{
xcb_connection_t* c;
#ifndef _WIN32
#ifndef USE_POLL
if(fd >= FD_SETSIZE) /* would overflow in FD_SET */
{
close(fd);
return _xcb_conn_ret_error(XCB_CONN_ERROR);
}
#endif
#endif /* !_WIN32*/
c = calloc(1, sizeof(xcb_connection_t));
if(!c) {
close(fd);
return _xcb_conn_ret_error(XCB_CONN_CLOSED_MEM_INSUFFICIENT) ;
}
c->fd = fd;
if(!(
set_fd_flags(fd) &&
pthread_mutex_init(&c->iolock, 0) == 0 &&
_xcb_in_init(&c->in) &&
_xcb_out_init(&c->out) &&
write_setup(c, auth_info) &&
read_setup(c) &&
_xcb_ext_init(c) &&
_xcb_xid_init(c)
))
{
xcb_disconnect(c);
return _xcb_conn_ret_error(XCB_CONN_ERROR);
}
return c;
}
void xcb_disconnect(xcb_connection_t *c)
{
if(c == NULL || is_static_error_conn(c))
return;
free(c->setup);
/* disallow further sends and receives */
shutdown(c->fd, SHUT_RDWR);
close(c->fd);
pthread_mutex_destroy(&c->iolock);
_xcb_in_destroy(&c->in);
_xcb_out_destroy(&c->out);
_xcb_ext_destroy(c);
_xcb_xid_destroy(c);
free(c);
#ifdef _WIN32
WSACleanup();
#endif
}
/* Private interface */
void _xcb_conn_shutdown(xcb_connection_t *c, int err)
{
c->has_error = err;
}
/* Return connection error state.
* To make thread-safe, I need a seperate static
* variable for every possible error.
* has_error is the first field in xcb_connection_t, so just
* return a casted int here; checking has_error (and only
* has_error) will be safe.
*/
xcb_connection_t *_xcb_conn_ret_error(int err)
{
switch(err)
{
case XCB_CONN_CLOSED_MEM_INSUFFICIENT:
{
return (xcb_connection_t *) &xcb_con_closed_mem_er;
}
case XCB_CONN_CLOSED_PARSE_ERR:
{
return (xcb_connection_t *) &xcb_con_closed_parse_er;
}
case XCB_CONN_CLOSED_INVALID_SCREEN:
{
return (xcb_connection_t *) &xcb_con_closed_screen_er;
}
case XCB_CONN_ERROR:
default:
{
return (xcb_connection_t *) &xcb_con_error;
}
}
}
int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t *cond, struct iovec **vector, int *count)
{
int ret;
#if USE_POLL
struct pollfd fd;
#else
fd_set rfds, wfds;
#endif
/* If the thing I should be doing is already being done, wait for it. */
if(count ? c->out.writing : c->in.reading)
{
pthread_cond_wait(cond, &c->iolock);
return 1;
}
#if USE_POLL
memset(&fd, 0, sizeof(fd));
fd.fd = c->fd;
fd.events = POLLIN;
#else
FD_ZERO(&rfds);
FD_SET(c->fd, &rfds);
#endif
++c->in.reading;
#if USE_POLL
if(count)
{
fd.events |= POLLOUT;
++c->out.writing;
}
#else
FD_ZERO(&wfds);
if(count)
{
FD_SET(c->fd, &wfds);
++c->out.writing;
}
#endif
pthread_mutex_unlock(&c->iolock);
do {
#if USE_POLL
ret = poll(&fd, 1, -1);
/* If poll() returns an event we didn't expect, such as POLLNVAL, treat
* it as if it failed. */
if(ret >= 0 && (fd.revents & ~fd.events))
{
ret = -1;
break;
}
#else
ret = select(c->fd + 1, &rfds, &wfds, 0, 0);
#endif
} while (ret == -1 && errno == EINTR);
if(ret < 0)
{
_xcb_conn_shutdown(c, XCB_CONN_ERROR);
ret = 0;
}
pthread_mutex_lock(&c->iolock);
if(ret)
{
/* The code allows two threads to call select()/poll() at the same time.
* First thread just wants to read, a second thread wants to write, too.
* We have to make sure that we don't steal the reading thread's reply
* and let it get stuck in select()/poll().
* So a thread may read if either:
* - There is no other thread that wants to read (the above situation
* did not occur).
* - It is the reading thread (above situation occurred).
*/
int may_read = c->in.reading == 1 || !count;
#if USE_POLL
if(may_read && (fd.revents & POLLIN) != 0)
#else
if(may_read && FD_ISSET(c->fd, &rfds))
#endif
ret = ret && _xcb_in_read(c);
#if USE_POLL
if((fd.revents & POLLOUT) != 0)
#else
if(FD_ISSET(c->fd, &wfds))
#endif
ret = ret && write_vec(c, vector, count);
}
if(count)
--c->out.writing;
--c->in.reading;
return ret;
}
uint64_t xcb_total_read(xcb_connection_t *c)
{
uint64_t n;
if (xcb_connection_has_error(c))
return 0;
pthread_mutex_lock(&c->iolock);
n = c->in.total_read;
pthread_mutex_unlock(&c->iolock);
return n;
}
uint64_t xcb_total_written(xcb_connection_t *c)
{
uint64_t n;
if (xcb_connection_has_error(c))
return 0;
pthread_mutex_lock(&c->iolock);
n = c->out.total_written;
pthread_mutex_unlock(&c->iolock);
return n;
}

131
src/xcb_ext.c Normal file
View File

@ -0,0 +1,131 @@
/* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors or their
* institutions shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization from the authors.
*/
/* A cache for QueryExtension results. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "xcb.h"
#include "xcbext.h"
#include "xcbint.h"
typedef struct lazyreply {
enum lazy_reply_tag tag;
union {
xcb_query_extension_cookie_t cookie;
xcb_query_extension_reply_t *reply;
} value;
} lazyreply;
static lazyreply *get_index(xcb_connection_t *c, int idx)
{
if(idx > c->ext.extensions_size)
{
int new_size = idx << 1;
lazyreply *new_extensions = realloc(c->ext.extensions, sizeof(lazyreply) * new_size);
if(!new_extensions)
return 0;
memset(new_extensions + c->ext.extensions_size, 0, sizeof(lazyreply) * (new_size - c->ext.extensions_size));
c->ext.extensions = new_extensions;
c->ext.extensions_size = new_size;
}
return c->ext.extensions + idx - 1;
}
static lazyreply *get_lazyreply(xcb_connection_t *c, xcb_extension_t *ext)
{
static pthread_mutex_t global_lock = PTHREAD_MUTEX_INITIALIZER;
static int next_global_id;
lazyreply *data;
pthread_mutex_lock(&global_lock);
if(!ext->global_id)
ext->global_id = ++next_global_id;
pthread_mutex_unlock(&global_lock);
data = get_index(c, ext->global_id);
if(data && data->tag == LAZY_NONE)
{
/* cache miss: query the server */
data->tag = LAZY_COOKIE;
data->value.cookie = xcb_query_extension(c, strlen(ext->name), ext->name);
}
return data;
}
/* Public interface */
/* Do not free the returned xcb_query_extension_reply_t - on return, it's aliased
* from the cache. */
const xcb_query_extension_reply_t *xcb_get_extension_data(xcb_connection_t *c, xcb_extension_t *ext)
{
lazyreply *data;
if(c->has_error)
return 0;
pthread_mutex_lock(&c->ext.lock);
data = get_lazyreply(c, ext);
if(data && data->tag == LAZY_COOKIE)
{
data->tag = LAZY_FORCED;
data->value.reply = xcb_query_extension_reply(c, data->value.cookie, 0);
}
pthread_mutex_unlock(&c->ext.lock);
return data ? data->value.reply : 0;
}
void xcb_prefetch_extension_data(xcb_connection_t *c, xcb_extension_t *ext)
{
if(c->has_error)
return;
pthread_mutex_lock(&c->ext.lock);
get_lazyreply(c, ext);
pthread_mutex_unlock(&c->ext.lock);
}
/* Private interface */
int _xcb_ext_init(xcb_connection_t *c)
{
if(pthread_mutex_init(&c->ext.lock, 0))
return 0;
return 1;
}
void _xcb_ext_destroy(xcb_connection_t *c)
{
pthread_mutex_destroy(&c->ext.lock);
while(c->ext.extensions_size-- > 0)
if(c->ext.extensions[c->ext.extensions_size].tag == LAZY_FORCED)
free(c->ext.extensions[c->ext.extensions_size].value.reply);
free(c->ext.extensions);
}

1085
src/xcb_in.c Normal file

File diff suppressed because it is too large Load Diff

105
src/xcb_list.c Normal file
View File

@ -0,0 +1,105 @@
/* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors or their
* institutions shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization from the authors.
*/
/* A generic implementation of a list of void-pointers. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "xcb.h"
#include "xcbint.h"
typedef struct node {
struct node *next;
unsigned int key;
void *data;
} node;
struct _xcb_map {
node *head;
node **tail;
};
/* Private interface */
_xcb_map *_xcb_map_new(void)
{
_xcb_map *list;
list = malloc(sizeof(_xcb_map));
if(!list)
return 0;
list->head = 0;
list->tail = &list->head;
return list;
}
void _xcb_map_delete(_xcb_map *list, xcb_list_free_func_t do_free)
{
if(!list)
return;
while(list->head)
{
node *cur = list->head;
if(do_free)
do_free(cur->data);
list->head = cur->next;
free(cur);
}
free(list);
}
int _xcb_map_put(_xcb_map *list, unsigned int key, void *data)
{
node *cur = malloc(sizeof(node));
if(!cur)
return 0;
cur->key = key;
cur->data = data;
cur->next = 0;
*list->tail = cur;
list->tail = &cur->next;
return 1;
}
void *_xcb_map_remove(_xcb_map *list, unsigned int key)
{
node **cur;
for(cur = &list->head; *cur; cur = &(*cur)->next)
if((*cur)->key == key)
{
node *tmp = *cur;
void *ret = (*cur)->data;
*cur = (*cur)->next;
if(!*cur)
list->tail = cur;
free(tmp);
return ret;
}
return 0;
}

494
src/xcb_out.c Normal file
View File

@ -0,0 +1,494 @@
/* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors or their
* institutions shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization from the authors.
*/
/* Stuff that sends stuff to the server. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "xcb.h"
#include "xcbext.h"
#include "xcbint.h"
#include "bigreq.h"
static inline void send_request(xcb_connection_t *c, int isvoid, enum workarounds workaround, int flags, struct iovec *vector, int count)
{
if(c->has_error)
return;
++c->out.request;
if(!isvoid)
c->in.request_expected = c->out.request;
if(workaround != WORKAROUND_NONE || flags != 0)
_xcb_in_expect_reply(c, c->out.request, workaround, flags);
while(count && c->out.queue_len + vector[0].iov_len <= sizeof(c->out.queue))
{
memcpy(c->out.queue + c->out.queue_len, vector[0].iov_base, vector[0].iov_len);
c->out.queue_len += vector[0].iov_len;
vector[0].iov_base = (char *) vector[0].iov_base + vector[0].iov_len;
vector[0].iov_len = 0;
++vector, --count;
}
if(!count)
return;
--vector, ++count;
vector[0].iov_base = c->out.queue;
vector[0].iov_len = c->out.queue_len;
c->out.queue_len = 0;
_xcb_out_send(c, vector, count);
}
static void send_sync(xcb_connection_t *c)
{
static const union {
struct {
uint8_t major;
uint8_t pad;
uint16_t len;
} fields;
uint32_t packet;
} sync_req = { { /* GetInputFocus */ 43, 0, 1 } };
struct iovec vector[2];
vector[1].iov_base = (char *) &sync_req;
vector[1].iov_len = sizeof(sync_req);
send_request(c, 0, WORKAROUND_NONE, XCB_REQUEST_DISCARD_REPLY, vector + 1, 1);
}
static void get_socket_back(xcb_connection_t *c)
{
while(c->out.return_socket && c->out.socket_moving)
pthread_cond_wait(&c->out.socket_cond, &c->iolock);
if(!c->out.return_socket)
return;
c->out.socket_moving = 1;
pthread_mutex_unlock(&c->iolock);
c->out.return_socket(c->out.socket_closure);
pthread_mutex_lock(&c->iolock);
c->out.socket_moving = 0;
pthread_cond_broadcast(&c->out.socket_cond);
c->out.return_socket = 0;
c->out.socket_closure = 0;
_xcb_in_replies_done(c);
}
static void prepare_socket_request(xcb_connection_t *c)
{
/* We're about to append data to out.queue, so we need to
* atomically test for an external socket owner *and* some other
* thread currently writing.
*
* If we have an external socket owner, we have to get the socket back
* before we can use it again.
*
* If some other thread is writing to the socket, we assume it's
* writing from out.queue, and so we can't stick data there.
*
* We satisfy this condition by first calling get_socket_back
* (which may drop the lock, but will return when XCB owns the
* socket again) and then checking for another writing thread and
* escaping the loop if we're ready to go.
*/
for (;;) {
if(c->has_error)
return;
get_socket_back(c);
if (!c->out.writing)
break;
pthread_cond_wait(&c->out.cond, &c->iolock);
}
}
/* Public interface */
void xcb_prefetch_maximum_request_length(xcb_connection_t *c)
{
if(c->has_error)
return;
pthread_mutex_lock(&c->out.reqlenlock);
if(c->out.maximum_request_length_tag == LAZY_NONE)
{
const xcb_query_extension_reply_t *ext;
ext = xcb_get_extension_data(c, &xcb_big_requests_id);
if(ext && ext->present)
{
c->out.maximum_request_length_tag = LAZY_COOKIE;
c->out.maximum_request_length.cookie = xcb_big_requests_enable(c);
}
else
{
c->out.maximum_request_length_tag = LAZY_FORCED;
c->out.maximum_request_length.value = c->setup->maximum_request_length;
}
}
pthread_mutex_unlock(&c->out.reqlenlock);
}
uint32_t xcb_get_maximum_request_length(xcb_connection_t *c)
{
if(c->has_error)
return 0;
xcb_prefetch_maximum_request_length(c);
pthread_mutex_lock(&c->out.reqlenlock);
if(c->out.maximum_request_length_tag == LAZY_COOKIE)
{
xcb_big_requests_enable_reply_t *r = xcb_big_requests_enable_reply(c, c->out.maximum_request_length.cookie, 0);
c->out.maximum_request_length_tag = LAZY_FORCED;
if(r)
{
c->out.maximum_request_length.value = r->maximum_request_length;
free(r);
}
else
c->out.maximum_request_length.value = c->setup->maximum_request_length;
}
pthread_mutex_unlock(&c->out.reqlenlock);
return c->out.maximum_request_length.value;
}
static void close_fds(int *fds, unsigned int num_fds)
{
for (unsigned int index = 0; index < num_fds; index++)
close(fds[index]);
}
static void send_fds(xcb_connection_t *c, int *fds, unsigned int num_fds)
{
#if HAVE_SENDMSG
/* Calling _xcb_out_flush_to() can drop the iolock and wait on a condition
* variable if another thread is currently writing (c->out.writing > 0).
* This call waits for writers to be done and thus _xcb_out_flush_to() will
* do the work itself (in which case we are a writer and
* prepare_socket_request() will wait for us to be done if another threads
* tries to send fds, too). Thanks to this, we can atomically write out FDs.
*/
prepare_socket_request(c);
while (num_fds > 0) {
while (c->out.out_fd.nfd == XCB_MAX_PASS_FD && !c->has_error) {
/* XXX: if c->out.writing > 0, this releases the iolock and
* potentially allows other threads to interfere with their own fds.
*/
_xcb_out_flush_to(c, c->out.request);
if (c->out.out_fd.nfd == XCB_MAX_PASS_FD) {
/* We need some request to send FDs with */
_xcb_out_send_sync(c);
}
}
if (c->has_error)
break;
c->out.out_fd.fd[c->out.out_fd.nfd++] = fds[0];
fds++;
num_fds--;
}
#endif
close_fds(fds, num_fds);
}
uint64_t xcb_send_request_with_fds64(xcb_connection_t *c, int flags, struct iovec *vector,
const xcb_protocol_request_t *req, unsigned int num_fds, int *fds)
{
uint64_t request;
uint32_t prefix[2];
int veclen = req->count;
enum workarounds workaround = WORKAROUND_NONE;
if(c->has_error) {
close_fds(fds, num_fds);
return 0;
}
assert(c != 0);
assert(vector != 0);
assert(req->count > 0);
if(!(flags & XCB_REQUEST_RAW))
{
static const char pad[3];
unsigned int i;
uint16_t shortlen = 0;
size_t longlen = 0;
assert(vector[0].iov_len >= 4);
/* set the major opcode, and the minor opcode for extensions */
if(req->ext)
{
const xcb_query_extension_reply_t *extension = xcb_get_extension_data(c, req->ext);
if(!(extension && extension->present))
{
close_fds(fds, num_fds);
_xcb_conn_shutdown(c, XCB_CONN_CLOSED_EXT_NOTSUPPORTED);
return 0;
}
((uint8_t *) vector[0].iov_base)[0] = extension->major_opcode;
((uint8_t *) vector[0].iov_base)[1] = req->opcode;
}
else
((uint8_t *) vector[0].iov_base)[0] = req->opcode;
/* put together the length field, possibly using BIGREQUESTS */
for(i = 0; i < req->count; ++i)
{
longlen += vector[i].iov_len;
if(!vector[i].iov_base)
{
vector[i].iov_base = (char *) pad;
assert(vector[i].iov_len <= sizeof(pad));
}
}
assert((longlen & 3) == 0);
longlen >>= 2;
if(longlen <= c->setup->maximum_request_length)
{
/* we don't need BIGREQUESTS. */
shortlen = longlen;
longlen = 0;
}
else if(longlen > xcb_get_maximum_request_length(c))
{
close_fds(fds, num_fds);
_xcb_conn_shutdown(c, XCB_CONN_CLOSED_REQ_LEN_EXCEED);
return 0; /* server can't take this; maybe need BIGREQUESTS? */
}
/* set the length field. */
((uint16_t *) vector[0].iov_base)[1] = shortlen;
if(!shortlen)
{
prefix[0] = ((uint32_t *) vector[0].iov_base)[0];
prefix[1] = ++longlen;
vector[0].iov_base = (uint32_t *) vector[0].iov_base + 1;
vector[0].iov_len -= sizeof(uint32_t);
--vector, ++veclen;
vector[0].iov_base = prefix;
vector[0].iov_len = sizeof(prefix);
}
}
flags &= ~XCB_REQUEST_RAW;
/* do we need to work around the X server bug described in glx.xml? */
/* XXX: GetFBConfigs won't use BIG-REQUESTS in any sane
* configuration, but that should be handled here anyway. */
if(req->ext && !req->isvoid && !strcmp(req->ext->name, "GLX") &&
((req->opcode == 17 && ((uint32_t *) vector[0].iov_base)[1] == 0x10004) ||
req->opcode == 21))
workaround = WORKAROUND_GLX_GET_FB_CONFIGS_BUG;
/* get a sequence number and arrange for delivery. */
pthread_mutex_lock(&c->iolock);
/* send FDs before establishing a good request number, because this might
* call send_sync(), too
*/
send_fds(c, fds, num_fds);
prepare_socket_request(c);
/* send GetInputFocus (sync_req) when 64k-2 requests have been sent without
* a reply.
* 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) - 2) ||
(unsigned int) (c->out.request + 1) == 0)
{
send_sync(c);
prepare_socket_request(c);
}
send_request(c, req->isvoid, workaround, flags, vector, veclen);
request = c->has_error ? 0 : c->out.request;
pthread_mutex_unlock(&c->iolock);
return request;
}
/* request number are actually uint64_t internally but keep API compat with unsigned int */
unsigned int xcb_send_request_with_fds(xcb_connection_t *c, int flags, struct iovec *vector,
const xcb_protocol_request_t *req, unsigned int num_fds, int *fds)
{
return xcb_send_request_with_fds64(c, flags, vector, req, num_fds, fds);
}
uint64_t xcb_send_request64(xcb_connection_t *c, int flags, struct iovec *vector, const xcb_protocol_request_t *req)
{
return xcb_send_request_with_fds64(c, flags, vector, req, 0, NULL);
}
/* request number are actually uint64_t internally but keep API compat with unsigned int */
unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vector, const xcb_protocol_request_t *req)
{
return xcb_send_request64(c, flags, vector, req);
}
void
xcb_send_fd(xcb_connection_t *c, int fd)
{
int fds[1] = { fd };
if (c->has_error) {
close(fd);
return;
}
pthread_mutex_lock(&c->iolock);
send_fds(c, &fds[0], 1);
pthread_mutex_unlock(&c->iolock);
}
int xcb_take_socket(xcb_connection_t *c, void (*return_socket)(void *closure), void *closure, int flags, uint64_t *sent)
{
int ret;
if(c->has_error)
return 0;
pthread_mutex_lock(&c->iolock);
get_socket_back(c);
/* _xcb_out_flush may drop the iolock allowing other threads to
* write requests, so keep flushing until we're done
*/
do
ret = _xcb_out_flush_to(c, c->out.request);
while (ret && c->out.request != c->out.request_written);
if(ret)
{
c->out.return_socket = return_socket;
c->out.socket_closure = closure;
if(flags) {
/* c->out.request + 1 will be the first request sent by the external
* socket owner. If the socket is returned before this request is sent
* it will be detected in _xcb_in_replies_done and this pending_reply
* will be discarded.
*/
_xcb_in_expect_reply(c, c->out.request + 1, WORKAROUND_EXTERNAL_SOCKET_OWNER, flags);
}
assert(c->out.request == c->out.request_written);
*sent = c->out.request;
}
pthread_mutex_unlock(&c->iolock);
return ret;
}
int xcb_writev(xcb_connection_t *c, struct iovec *vector, int count, uint64_t requests)
{
int ret;
if(c->has_error)
return 0;
pthread_mutex_lock(&c->iolock);
c->out.request += requests;
ret = _xcb_out_send(c, vector, count);
pthread_mutex_unlock(&c->iolock);
return ret;
}
int xcb_flush(xcb_connection_t *c)
{
int ret;
if(c->has_error)
return 0;
pthread_mutex_lock(&c->iolock);
ret = _xcb_out_flush_to(c, c->out.request);
pthread_mutex_unlock(&c->iolock);
return ret;
}
/* Private interface */
int _xcb_out_init(_xcb_out *out)
{
if(pthread_cond_init(&out->socket_cond, 0))
return 0;
out->return_socket = 0;
out->socket_closure = 0;
out->socket_moving = 0;
if(pthread_cond_init(&out->cond, 0))
return 0;
out->writing = 0;
out->queue_len = 0;
out->request = 0;
out->request_written = 0;
if(pthread_mutex_init(&out->reqlenlock, 0))
return 0;
out->maximum_request_length_tag = LAZY_NONE;
return 1;
}
void _xcb_out_destroy(_xcb_out *out)
{
pthread_cond_destroy(&out->cond);
pthread_mutex_destroy(&out->reqlenlock);
}
int _xcb_out_send(xcb_connection_t *c, struct iovec *vector, int count)
{
int ret = 1;
while(ret && count)
ret = _xcb_conn_wait(c, &c->out.cond, &vector, &count);
c->out.request_written = c->out.request;
pthread_cond_broadcast(&c->out.cond);
_xcb_in_wake_up_next_reader(c);
return ret;
}
void _xcb_out_send_sync(xcb_connection_t *c)
{
prepare_socket_request(c);
send_sync(c);
}
int _xcb_out_flush_to(xcb_connection_t *c, uint64_t request)
{
assert(XCB_SEQUENCE_COMPARE(request, <=, c->out.request));
if(XCB_SEQUENCE_COMPARE(c->out.request_written, >=, request))
return 1;
if(c->out.queue_len)
{
struct iovec vec;
vec.iov_base = c->out.queue;
vec.iov_len = c->out.queue_len;
c->out.queue_len = 0;
return _xcb_out_send(c, &vec, 1);
}
while(c->out.writing)
pthread_cond_wait(&c->out.cond, &c->iolock);
assert(XCB_SEQUENCE_COMPARE(c->out.request_written, >=, request));
return 1;
}

553
src/xcb_util.c Normal file
View File

@ -0,0 +1,553 @@
/* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors or their
* institutions shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization from the authors.
*/
/* Utility functions implementable using only public APIs. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h>
#include <sys/types.h>
#include <limits.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h>
#include <string.h>
#ifdef _WIN32
#include "xcb_windefs.h"
#else
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <fcntl.h>
#include <netdb.h>
#endif /* _WIN32 */
#include "xcb.h"
#include "xcbext.h"
#include "xcbint.h"
#if defined(HAVE_TSOL_LABEL_H) && defined(HAVE_IS_SYSTEM_LABELED)
# include <tsol/label.h>
# include <sys/stat.h>
#endif
#ifdef HAVE_LAUNCHD
#include <sys/stat.h>
#endif
int xcb_popcount(uint32_t mask)
{
uint32_t y;
y = (mask >> 1) & 033333333333;
y = mask - y - ((y >> 1) & 033333333333);
return ((y + (y >> 3)) & 030707070707) % 077;
}
int xcb_sumof(uint8_t *list, int len)
{
int i, s = 0;
for(i=0; i<len; i++) {
s += *list;
list++;
}
return s;
}
#ifdef HAVE_LAUNCHD
/* Return true and parse if name matches <path to socket>[.<screen>]
* Upon success:
* host = <path to socket>
* protocol = "unix"
* display = 0
* screen = <screen>
*/
static int _xcb_parse_display_path_to_socket(const char *name, char **host, char **protocol,
int *displayp, int *screenp)
{
struct stat sbuf;
char path[PATH_MAX];
int _screen = 0;
strlcpy(path, name, sizeof(path));
if (0 != stat(path, &sbuf)) {
char *dot = strrchr(path, '.');
if (!dot)
return 0;
*dot = '\0';
if (0 != stat(path, &sbuf))
return 0;
_screen = atoi(dot + 1);
}
if (host) {
*host = strdup(path);
if (!*host)
return 0;
}
if (protocol) {
*protocol = strdup("unix");
if (!*protocol) {
if (host)
free(*host);
return 0;
}
}
if (displayp)
*displayp = 0;
if (screenp)
*screenp = _screen;
return 1;
}
#endif
static int _xcb_parse_display(const char *name, char **host, char **protocol,
int *displayp, int *screenp)
{
int len, display, screen;
char *slash, *colon, *dot, *end;
if(!name || !*name)
name = getenv("DISPLAY");
if(!name)
return 0;
#ifdef HAVE_LAUNCHD
/* First check for <path to socket>[.<screen>] */
if (_xcb_parse_display_path_to_socket(name, host, protocol, displayp, screenp))
return 1;
#endif
slash = strrchr(name, '/');
if (slash) {
len = slash - name;
if (protocol) {
*protocol = malloc(len + 1);
if(!*protocol)
return 0;
memcpy(*protocol, name, len);
(*protocol)[len] = '\0';
}
name = slash + 1;
} else
if (protocol)
*protocol = NULL;
colon = strrchr(name, ':');
if(!colon)
goto error_out;
len = colon - name;
++colon;
display = strtoul(colon, &dot, 10);
if(dot == colon)
goto error_out;
if(*dot == '\0')
screen = 0;
else
{
if(*dot != '.')
goto error_out;
++dot;
screen = strtoul(dot, &end, 10);
if(end == dot || *end != '\0')
goto error_out;
}
/* At this point, the display string is fully parsed and valid, but
* the caller's memory is untouched. */
*host = malloc(len + 1);
if(!*host)
goto error_out;
memcpy(*host, name, len);
(*host)[len] = '\0';
*displayp = display;
if(screenp)
*screenp = screen;
return 1;
error_out:
if (protocol) {
free(*protocol);
*protocol = NULL;
}
return 0;
}
int xcb_parse_display(const char *name, char **host, int *displayp,
int *screenp)
{
return _xcb_parse_display(name, host, NULL, displayp, screenp);
}
static int _xcb_open_tcp(const char *host, char *protocol, const unsigned short port);
#ifndef _WIN32
static int _xcb_open_unix(char *protocol, const char *file);
#endif /* !WIN32 */
#ifdef HAVE_ABSTRACT_SOCKETS
static int _xcb_open_abstract(char *protocol, const char *file, size_t filelen);
#endif
static int _xcb_open(const char *host, char *protocol, const int display)
{
int fd;
#ifdef __hpux
static const char unix_base[] = "/usr/spool/sockets/X11/";
#else
static const char unix_base[] = "/tmp/.X11-unix/X";
#endif
const char *base = unix_base;
size_t filelen;
char *file = NULL;
int actual_filelen;
/* If protocol or host is "unix", fall through to Unix socket code below */
if ((!protocol || (strcmp("unix",protocol) != 0)) &&
(*host != '\0') && (strcmp("unix",host) != 0))
{
/* display specifies TCP */
unsigned short port = X_TCP_PORT + display;
return _xcb_open_tcp(host, protocol, port);
}
#ifndef _WIN32
#if defined(HAVE_TSOL_LABEL_H) && defined(HAVE_IS_SYSTEM_LABELED)
/* Check special path for Unix sockets under Solaris Trusted Extensions */
if (is_system_labeled())
{
struct stat sbuf;
const char *tsol_base = "/var/tsol/doors/.X11-unix/X";
char tsol_socket[PATH_MAX];
snprintf(tsol_socket, sizeof(tsol_socket), "%s%d", tsol_base, display);
if (stat(tsol_socket, &sbuf) == 0)
base = tsol_base;
}
#endif
#ifdef HAVE_LAUNCHD
struct stat sbuf;
if (0 == stat(host, &sbuf)) {
file = strdup(host);
if(file == NULL)
return -1;
filelen = actual_filelen = strlen(file);
} else
#endif
{
filelen = strlen(base) + 1 + sizeof(display) * 3 + 1;
file = malloc(filelen);
if(file == NULL)
return -1;
/* display specifies Unix socket */
actual_filelen = snprintf(file, filelen, "%s%d", base, display);
}
if(actual_filelen < 0)
{
free(file);
return -1;
}
/* snprintf may truncate the file */
filelen = MIN(actual_filelen, filelen - 1);
#ifdef HAVE_ABSTRACT_SOCKETS
fd = _xcb_open_abstract(protocol, file, filelen);
if (fd >= 0 || (errno != ENOENT && errno != ECONNREFUSED))
{
free(file);
return fd;
}
#endif
fd = _xcb_open_unix(protocol, file);
free(file);
if (fd < 0 && !protocol && *host == '\0') {
unsigned short port = X_TCP_PORT + display;
fd = _xcb_open_tcp(host, protocol, port);
}
return fd;
#endif /* !_WIN32 */
return -1; /* if control reaches here then something has gone wrong */
}
static int _xcb_socket(int family, int type, int proto)
{
int fd;
#ifdef SOCK_CLOEXEC
fd = socket(family, type | SOCK_CLOEXEC, proto);
if (fd == -1 && errno == EINVAL)
#endif
{
fd = socket(family, type, proto);
#ifndef _WIN32
if (fd >= 0)
fcntl(fd, F_SETFD, FD_CLOEXEC);
#endif
}
return fd;
}
static int _xcb_do_connect(int fd, const struct sockaddr* addr, int addrlen) {
int on = 1;
if(fd < 0)
return -1;
setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on));
return connect(fd, addr, addrlen);
}
static int _xcb_open_tcp(const char *host, char *protocol, const unsigned short port)
{
int fd = -1;
#if HAVE_GETADDRINFO
struct addrinfo hints;
char service[6]; /* "65535" with the trailing '\0' */
struct addrinfo *results, *addr;
char *bracket;
#endif
if (protocol && strcmp("tcp",protocol) && strcmp("inet",protocol)
#ifdef AF_INET6
&& strcmp("inet6",protocol)
#endif
)
return -1;
if (*host == '\0')
host = "localhost";
#if HAVE_GETADDRINFO
memset(&hints, 0, sizeof(hints));
#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')
{
*bracket = '\0';
++host;
hints.ai_flags |= AI_NUMERICHOST;
hints.ai_family = AF_INET6;
}
#endif
snprintf(service, sizeof(service), "%hu", port);
if(getaddrinfo(host, service, &hints, &results))
/* FIXME: use gai_strerror, and fill in error connection */
return -1;
for(addr = results; addr; addr = addr->ai_next)
{
fd = _xcb_socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
if (_xcb_do_connect(fd, addr->ai_addr, addr->ai_addrlen) >= 0)
break;
close(fd);
fd = -1;
}
freeaddrinfo(results);
return fd;
#else
{
struct hostent* _h;
struct sockaddr_in _s;
struct in_addr ** _c;
if((_h = gethostbyname(host)) == NULL)
return -1;
_c = (struct in_addr**)_h->h_addr_list;
fd = -1;
while(*_c) {
_s.sin_family = AF_INET;
_s.sin_port = htons(port);
_s.sin_addr = *(*_c);
fd = _xcb_socket(_s.sin_family, SOCK_STREAM, 0);
if(_xcb_do_connect(fd, (struct sockaddr*)&_s, sizeof(_s)) >= 0)
break;
close(fd);
fd = -1;
++_c;
}
return fd;
}
#endif
}
#ifndef _WIN32
static int _xcb_open_unix(char *protocol, const char *file)
{
int fd;
struct sockaddr_un addr;
socklen_t len = sizeof(int);
int val;
if (protocol && strcmp("unix",protocol))
return -1;
strcpy(addr.sun_path, file);
addr.sun_family = AF_UNIX;
#ifdef HAVE_SOCKADDR_SUN_LEN
addr.sun_len = SUN_LEN(&addr);
#endif
fd = _xcb_socket(AF_UNIX, SOCK_STREAM, 0);
if(fd == -1)
return -1;
if(getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) == 0 && val < 64 * 1024)
{
val = 64 * 1024;
setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, sizeof(int));
}
if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) {
close(fd);
return -1;
}
return fd;
}
#endif /* !_WIN32 */
#ifdef HAVE_ABSTRACT_SOCKETS
static int _xcb_open_abstract(char *protocol, const char *file, size_t filelen)
{
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 + filelen;
#ifdef HAVE_SOCKADDR_SUN_LEN
addr.sun_len = 1 + filelen;
#endif
fd = _xcb_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)
{
return xcb_connect_to_display_with_auth_info(displayname, NULL, screenp);
}
xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname, xcb_auth_info_t *auth, int *screenp)
{
int fd, display = 0;
char *host = NULL;
char *protocol = NULL;
xcb_auth_info_t ourauth;
xcb_connection_t *c;
int parsed = _xcb_parse_display(displayname, &host, &protocol, &display, screenp);
if(!parsed) {
c = _xcb_conn_ret_error(XCB_CONN_CLOSED_PARSE_ERR);
goto out;
}
#ifdef _WIN32
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
c = _xcb_conn_ret_error(XCB_CONN_ERROR);
goto out;
}
#endif
fd = _xcb_open(host, protocol, display);
if(fd == -1) {
c = _xcb_conn_ret_error(XCB_CONN_ERROR);
#ifdef _WIN32
WSACleanup();
#endif
goto out;
}
if(auth) {
c = xcb_connect_to_fd(fd, auth);
goto out;
}
if(_xcb_get_auth_info(fd, &ourauth, display))
{
c = xcb_connect_to_fd(fd, &ourauth);
free(ourauth.name);
free(ourauth.data);
}
else
c = xcb_connect_to_fd(fd, 0);
if(c->has_error)
goto out;
/* Make sure requested screen number is in bounds for this server */
if((screenp != NULL) && (*screenp >= (int) c->setup->roots_len)) {
xcb_disconnect(c);
c = _xcb_conn_ret_error(XCB_CONN_CLOSED_INVALID_SCREEN);
goto out;
}
out:
free(host);
free(protocol);
return c;
}

45
src/xcb_windefs.h Normal file
View File

@ -0,0 +1,45 @@
/* Copyright (C) 2009 Jatin Golani.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors or their
* institutions shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization from the authors.
*/
#ifndef _XCB_WINDEFS_H
#define _XCB_WINDEFS_H
#ifndef WINVER
#define WINVER 0x0501 /* required for getaddrinfo/freeaddrinfo defined only for WinXP and above */
#endif
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windef.h>
struct iovec {
void *iov_base; /* Pointer to data. */
int iov_len; /* Length of data. */
};
typedef unsigned int in_addr_t;
#endif /* xcb_windefs.h */

101
src/xcb_xid.c Normal file
View File

@ -0,0 +1,101 @@
/* Copyright (C) 2001-2008 Bart Massey and Jamey Sharp.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors or their
* institutions shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization from the authors.
*/
/* XID allocators. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h>
#include <stdlib.h>
#include "xcb.h"
#include "xcbext.h"
#include "xcbint.h"
#include "xc_misc.h"
/* Public interface */
uint32_t xcb_generate_id(xcb_connection_t *c)
{
uint32_t ret;
if(c->has_error)
return -1;
pthread_mutex_lock(&c->xid.lock);
if(c->xid.last >= c->xid.max - c->xid.inc + 1)
{
xcb_xc_misc_get_xid_range_reply_t *range;
assert(c->xid.last == c->xid.max);
if (c->xid.last == 0) {
/* finish setting up initial range */
c->xid.max = c->setup->resource_id_mask;
} else {
/* check for extension */
const xcb_query_extension_reply_t *xc_misc_reply =
xcb_get_extension_data(c, &xcb_xc_misc_id);
if (!xc_misc_reply) {
pthread_mutex_unlock(&c->xid.lock);
return -1;
}
/* get new range */
range = xcb_xc_misc_get_xid_range_reply(c,
xcb_xc_misc_get_xid_range(c), 0);
/* XXX The latter disjunct is what the server returns
when it is out of XIDs. Sweet. */
if(!range || (range->start_id == 0 && range->count == 1))
{
pthread_mutex_unlock(&c->xid.lock);
return -1;
}
assert(range->count > 0 && range->start_id > 0);
c->xid.last = range->start_id;
c->xid.max = range->start_id + (range->count - 1) * c->xid.inc;
free(range);
}
} else {
c->xid.last += c->xid.inc;
}
ret = c->xid.last | c->xid.base;
pthread_mutex_unlock(&c->xid.lock);
return ret;
}
/* Private interface */
int _xcb_xid_init(xcb_connection_t *c)
{
if(pthread_mutex_init(&c->xid.lock, 0))
return 0;
c->xid.last = 0;
c->xid.max = 0;
c->xid.base = c->setup->resource_id_base;
c->xid.inc = c->setup->resource_id_mask & -(c->setup->resource_id_mask);
return 1;
}
void _xcb_xid_destroy(xcb_connection_t *c)
{
pthread_mutex_destroy(&c->xid.lock);
}

322
src/xcbext.h Normal file
View File

@ -0,0 +1,322 @@
/*
* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors or their
* institutions shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization from the authors.
*/
#ifndef __XCBEXT_H
#define __XCBEXT_H
#include "xcb.h"
#ifdef __cplusplus
extern "C" {
#endif
/* xcb_ext.c */
struct xcb_extension_t {
const char *name;
int global_id;
};
/* xcb_out.c */
typedef struct {
size_t count;
xcb_extension_t *ext;
uint8_t opcode;
uint8_t isvoid;
} xcb_protocol_request_t;
enum xcb_send_request_flags_t {
XCB_REQUEST_CHECKED = 1 << 0,
XCB_REQUEST_RAW = 1 << 1,
XCB_REQUEST_DISCARD_REPLY = 1 << 2,
XCB_REQUEST_REPLY_FDS = 1 << 3
};
/**
* @brief Send a request to the server.
* @param c The connection to the X server.
* @param flags A combination of flags from the xcb_send_request_flags_t enumeration.
* @param vector Data to send; must have two iovecs before start for internal use.
* @param request Information about the request to be sent.
* @return The request's sequence number on success, 0 otherwise.
*
* This function sends a new request to the X server. The data of the request is
* given as an array of @c iovecs in the @p vector argument. The length of that
* array and the necessary management information are given in the @p request
* argument.
*
* When this function returns, the request might or might not be sent already.
* Use xcb_flush() to make sure that it really was sent.
*
* Please note that this function is not the preferred way for sending requests.
* It's better to use the generated wrapper functions.
*
* Please note that xcb might use index -1 and -2 of the @p vector array internally,
* so they must be valid!
*/
unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vector, const xcb_protocol_request_t *request);
/**
* @brief Send a request to the server.
* @param c The connection to the X server.
* @param flags A combination of flags from the xcb_send_request_flags_t enumeration.
* @param vector Data to send; must have two iovecs before start for internal use.
* @param request Information about the request to be sent.
* @param num_fds Number of additional file descriptors to send to the server
* @param fds Additional file descriptors that should be send to the server.
* @return The request's sequence number on success, 0 otherwise.
*
* This function sends a new request to the X server. The data of the request is
* given as an array of @c iovecs in the @p vector argument. The length of that
* array and the necessary management information are given in the @p request
* argument.
*
* If @p num_fds is non-zero, @p fds points to an array of file descriptors that
* will be sent to the X server along with this request. After this function
* returns, all file descriptors sent are owned by xcb and will be closed
* eventually.
*
* When this function returns, the request might or might not be sent already.
* Use xcb_flush() to make sure that it really was sent.
*
* Please note that this function is not the preferred way for sending requests.
*
* Please note that xcb might use index -1 and -2 of the @p vector array internally,
* so they must be valid!
*/
unsigned int xcb_send_request_with_fds(xcb_connection_t *c, int flags, struct iovec *vector,
const xcb_protocol_request_t *request, unsigned int num_fds, int *fds);
/**
* @brief Send a request to the server, with 64-bit sequence number returned.
* @param c The connection to the X server.
* @param flags A combination of flags from the xcb_send_request_flags_t enumeration.
* @param vector Data to send; must have two iovecs before start for internal use.
* @param request Information about the request to be sent.
* @return The request's sequence number on success, 0 otherwise.
*
* This function sends a new request to the X server. The data of the request is
* given as an array of @c iovecs in the @p vector argument. The length of that
* array and the necessary management information are given in the @p request
* argument.
*
* When this function returns, the request might or might not be sent already.
* Use xcb_flush() to make sure that it really was sent.
*
* Please note that this function is not the preferred way for sending requests.
* It's better to use the generated wrapper functions.
*
* Please note that xcb might use index -1 and -2 of the @p vector array internally,
* so they must be valid!
*/
uint64_t xcb_send_request64(xcb_connection_t *c, int flags, struct iovec *vector, const xcb_protocol_request_t *request);
/**
* @brief Send a request to the server, with 64-bit sequence number returned.
* @param c The connection to the X server.
* @param flags A combination of flags from the xcb_send_request_flags_t enumeration.
* @param vector Data to send; must have two iovecs before start for internal use.
* @param request Information about the request to be sent.
* @param num_fds Number of additional file descriptors to send to the server
* @param fds Additional file descriptors that should be send to the server.
* @return The request's sequence number on success, 0 otherwise.
*
* This function sends a new request to the X server. The data of the request is
* given as an array of @c iovecs in the @p vector argument. The length of that
* array and the necessary management information are given in the @p request
* argument.
*
* If @p num_fds is non-zero, @p fds points to an array of file descriptors that
* will be sent to the X server along with this request. After this function
* returns, all file descriptors sent are owned by xcb and will be closed
* eventually.
*
* When this function returns, the request might or might not be sent already.
* Use xcb_flush() to make sure that it really was sent.
*
* Please note that this function is not the preferred way for sending requests.
* It's better to use the generated wrapper functions.
*
* Please note that xcb might use index -1 and -2 of the @p vector array internally,
* so they must be valid!
*/
uint64_t xcb_send_request_with_fds64(xcb_connection_t *c, int flags, struct iovec *vector,
const xcb_protocol_request_t *request, unsigned int num_fds, int *fds);
/**
* @brief Send a file descriptor to the server in the next call to xcb_send_request.
* @param c The connection to the X server.
* @param fd The file descriptor to send.
*
* After this function returns, the file descriptor given is owned by xcb and
* will be closed eventually.
*
* @deprecated This function cannot be used in a thread-safe way. Two threads
* that run xcb_send_fd(); xcb_send_request(); could mix up their file
* descriptors. Instead, xcb_send_request_with_fds() should be used.
*/
void xcb_send_fd(xcb_connection_t *c, int fd);
/**
* @brief Take over the write side of the socket
* @param c The connection to the X server.
* @param return_socket Callback function that will be called when xcb wants
* to use the socket again.
* @param closure Argument to the callback function.
* @param flags A combination of flags from the xcb_send_request_flags_t enumeration.
* @param sent Location to the sequence number of the last sequence request.
* Must not be NULL.
* @return 1 on success, else 0.
*
* xcb_take_socket allows external code to ask XCB for permission to
* take over the write side of the socket and send raw data with
* xcb_writev. xcb_take_socket provides the sequence number of the last
* request XCB sent. The caller of xcb_take_socket must supply a
* callback which XCB can call when it wants the write side of the
* socket back to make a request. This callback synchronizes with the
* external socket owner and flushes any output queues if appropriate.
* If you are sending requests which won't cause a reply, please note the
* comment for xcb_writev which explains some sequence number wrap issues.
*
* All replies that are generated while the socket is owned externally have
* @p flags applied to them. For example, use XCB_REQUEST_CHECK if you don't
* want errors to go to xcb's normal error handling, but instead having to be
* picked up via xcb_wait_for_reply(), xcb_poll_for_reply() or
* xcb_request_check().
*/
int xcb_take_socket(xcb_connection_t *c, void (*return_socket)(void *closure), void *closure, int flags, uint64_t *sent);
/**
* @brief Send raw data to the X server.
* @param c The connection to the X server.
* @param vector Array of data to be sent.
* @param count Number of entries in @p vector.
* @param requests Number of requests that are being sent.
* @return 1 on success, else 0.
*
* You must own the write-side of the socket (you've called
* xcb_take_socket, and haven't returned from return_socket yet) to call
* xcb_writev. Also, the iovec must have at least 1 byte of data in it.
* You have to make sure that xcb can detect sequence number wraps correctly.
* This means that the first request you send after xcb_take_socket must cause a
* reply (e.g. just insert a GetInputFocus request). After every (1 << 16) - 1
* requests without a reply, you have to insert a request which will cause a
* reply. You can again use GetInputFocus for this. You do not have to wait for
* any of the GetInputFocus replies, but can instead handle them via
* xcb_discard_reply().
*/
int xcb_writev(xcb_connection_t *c, struct iovec *vector, int count, uint64_t requests);
/* xcb_in.c */
/**
* @brief Wait for the reply of a given request.
* @param c The connection to the X server.
* @param request Sequence number of the request as returned by xcb_send_request().
* @param e Location to store errors in, or NULL. Ignored for unchecked requests.
*
* Returns the reply to the given request or returns null in the event of
* errors. Blocks until the reply or error for the request arrives, or an I/O
* error occurs.
*/
void *xcb_wait_for_reply(xcb_connection_t *c, unsigned int request, xcb_generic_error_t **e);
/**
* @brief Wait for the reply of a given request, with 64-bit sequence number
* @param c The connection to the X server.
* @param request 64-bit sequence number of the request as returned by xcb_send_request64().
* @param e Location to store errors in, or NULL. Ignored for unchecked requests.
*
* Returns the reply to the given request or returns null in the event of
* errors. Blocks until the reply or error for the request arrives, or an I/O
* error occurs.
*
* Unlike its xcb_wait_for_reply() counterpart, the given sequence number is not
* automatically "widened" to 64-bit.
*/
void *xcb_wait_for_reply64(xcb_connection_t *c, uint64_t request, xcb_generic_error_t **e);
/**
* @brief Poll for the reply of a given request.
* @param c The connection to the X server.
* @param request Sequence number of the request as returned by xcb_send_request().
* @param reply Location to store the reply in, must not be NULL.
* @param error Location to store errors in, or NULL. Ignored for unchecked requests.
* @return 1 when the reply to the request was returned, else 0.
*
* Checks if the reply to the given request already received. Does not block.
*/
int xcb_poll_for_reply(xcb_connection_t *c, unsigned int request, void **reply, xcb_generic_error_t **error);
/**
* @brief Poll for the reply of a given request, with 64-bit sequence number.
* @param c The connection to the X server.
* @param request 64-bit sequence number of the request as returned by xcb_send_request().
* @param reply Location to store the reply in, must not be NULL.
* @param error Location to store errors in, or NULL. Ignored for unchecked requests.
* @return 1 when the reply to the request was returned, else 0.
*
* Checks if the reply to the given request already received. Does not block.
*
* Unlike its xcb_poll_for_reply() counterpart, the given sequence number is not
* automatically "widened" to 64-bit.
*/
int xcb_poll_for_reply64(xcb_connection_t *c, uint64_t request, void **reply, xcb_generic_error_t **error);
/**
* @brief Don't use this, only needed by the generated code.
* @param c The connection to the X server.
* @param reply A reply that was received from the server
* @param replylen The size of the reply.
* @return Pointer to the location where received file descriptors are stored.
*/
int *xcb_get_reply_fds(xcb_connection_t *c, void *reply, size_t replylen);
/* xcb_util.c */
/**
* @param mask The mask to check
* @return The number of set bits in the mask
*/
int xcb_popcount(uint32_t mask);
/**
* @param list The base of an array
* @param len The length of the array
* @return The sum of all entries in the array.
*/
int xcb_sumof(uint8_t *list, int len);
#ifdef __cplusplus
}
#endif
#endif

230
src/xcbint.h Normal file
View File

@ -0,0 +1,230 @@
/*
* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors or their
* institutions shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization from the authors.
*/
#ifndef __XCBINT_H
#define __XCBINT_H
#include "bigreq.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef GCC_HAS_VISIBILITY
#pragma GCC visibility push(hidden)
#endif
enum workarounds {
WORKAROUND_NONE,
WORKAROUND_GLX_GET_FB_CONFIGS_BUG,
WORKAROUND_EXTERNAL_SOCKET_OWNER
};
enum lazy_reply_tag
{
LAZY_NONE = 0,
LAZY_COOKIE,
LAZY_FORCED
};
#define XCB_PAD(i) (-(i) & 3)
#define XCB_SEQUENCE_COMPARE(a,op,b) ((int64_t) ((a) - (b)) op 0)
#ifndef offsetof
#define offsetof(type,member) ((size_t) &((type *)0)->member)
#endif
#ifndef MIN
#define MIN(x,y) ((x) < (y) ? (x) : (y))
#endif
#define container_of(pointer,type,member) ((type *)(((char *)(pointer)) - offsetof(type, member)))
/* xcb_list.c */
typedef void (*xcb_list_free_func_t)(void *);
typedef struct _xcb_map _xcb_map;
_xcb_map *_xcb_map_new(void);
void _xcb_map_delete(_xcb_map *q, xcb_list_free_func_t do_free);
int _xcb_map_put(_xcb_map *q, unsigned int key, void *data);
void *_xcb_map_remove(_xcb_map *q, unsigned int key);
/* xcb_out.c */
#if HAVE_SENDMSG
#define XCB_MAX_PASS_FD 16
typedef struct _xcb_fd {
int fd[XCB_MAX_PASS_FD];
int nfd;
int ifd;
} _xcb_fd;
#endif
typedef struct _xcb_out {
pthread_cond_t cond;
int writing;
pthread_cond_t socket_cond;
void (*return_socket)(void *closure);
void *socket_closure;
int socket_moving;
char queue[XCB_QUEUE_BUFFER_SIZE];
int queue_len;
uint64_t request;
uint64_t request_written;
uint64_t total_written;
pthread_mutex_t reqlenlock;
enum lazy_reply_tag maximum_request_length_tag;
union {
xcb_big_requests_enable_cookie_t cookie;
uint32_t value;
} maximum_request_length;
#if HAVE_SENDMSG
_xcb_fd out_fd;
#endif
} _xcb_out;
int _xcb_out_init(_xcb_out *out);
void _xcb_out_destroy(_xcb_out *out);
int _xcb_out_send(xcb_connection_t *c, struct iovec *vector, int count);
void _xcb_out_send_sync(xcb_connection_t *c);
int _xcb_out_flush_to(xcb_connection_t *c, uint64_t request);
/* xcb_in.c */
typedef struct _xcb_in {
pthread_cond_t event_cond;
int reading;
char queue[4096];
int queue_len;
uint64_t request_expected;
uint64_t request_read;
uint64_t request_completed;
uint64_t total_read;
struct reply_list *current_reply;
struct reply_list **current_reply_tail;
_xcb_map *replies;
struct event_list *events;
struct event_list **events_tail;
struct reader_list *readers;
struct special_list *special_waiters;
struct pending_reply *pending_replies;
struct pending_reply **pending_replies_tail;
#if HAVE_SENDMSG
_xcb_fd in_fd;
#endif
struct xcb_special_event *special_events;
} _xcb_in;
int _xcb_in_init(_xcb_in *in);
void _xcb_in_destroy(_xcb_in *in);
void _xcb_in_wake_up_next_reader(xcb_connection_t *c);
int _xcb_in_expect_reply(xcb_connection_t *c, uint64_t request, enum workarounds workaround, int flags);
void _xcb_in_replies_done(xcb_connection_t *c);
int _xcb_in_read(xcb_connection_t *c);
int _xcb_in_read_block(xcb_connection_t *c, void *buf, int nread);
/* xcb_xid.c */
typedef struct _xcb_xid {
pthread_mutex_t lock;
uint32_t last;
uint32_t base;
uint32_t max;
uint32_t inc;
} _xcb_xid;
int _xcb_xid_init(xcb_connection_t *c);
void _xcb_xid_destroy(xcb_connection_t *c);
/* xcb_ext.c */
typedef struct _xcb_ext {
pthread_mutex_t lock;
struct lazyreply *extensions;
int extensions_size;
} _xcb_ext;
int _xcb_ext_init(xcb_connection_t *c);
void _xcb_ext_destroy(xcb_connection_t *c);
/* xcb_conn.c */
struct xcb_connection_t {
/* This must be the first field; see _xcb_conn_ret_error(). */
int has_error;
/* constant data */
xcb_setup_t *setup;
int fd;
/* I/O data */
pthread_mutex_t iolock;
_xcb_in in;
_xcb_out out;
/* misc data */
_xcb_ext ext;
_xcb_xid xid;
};
void _xcb_conn_shutdown(xcb_connection_t *c, int err);
xcb_connection_t *_xcb_conn_ret_error(int err);
int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t *cond, struct iovec **vector, int *count);
/* xcb_auth.c */
int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display);
#ifdef GCC_HAS_VISIBILITY
#pragma GCC visibility pop
#endif
#endif

104
tests/CheckLog.xsl Normal file
View File

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:check="http://check.sourceforge.net/ns"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/REC-html40">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head>
<title>Test Suite Results</title>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="datetime">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="duration">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="check:suite">
<xsl:apply-templates select="check:title"/>
<center>
<table width="80%" border="1">
<thead>
<tr>
<td>Test Path</td>
<td>Test Function Location</td>
<td>C Identifier</td>
<td>Test Case</td>
<td>Result</td>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="check:test"/>
</tbody>
</table>
</center>
</xsl:template>
<xsl:template match="check:testsuites">
<xsl:apply-templates select="check:suite"/>
<h3>Unit Test Statistics</h3>
<ul>
<li>date/time: <xsl:apply-templates select="check:datetime"/></li>
<li>duration: <xsl:apply-templates select="check:duration"/></li>
</ul>
<hr></hr>
</xsl:template>
<xsl:template match="check:title">
<h2>Test Suite: <xsl:apply-templates/></h2>
</xsl:template>
<xsl:template match="check:test[@result='success']">
<tr bgcolor="lime">
<xsl:apply-templates/>
</tr>
</xsl:template>
<xsl:template match="check:test[@result='failure']">
<tr bgcolor="red">
<xsl:apply-templates/>
</tr>
</xsl:template>
<xsl:template match="check:test[@result='error']">
<tr bgcolor="yellow">
<xsl:apply-templates/>
</tr>
</xsl:template>
<xsl:template match="check:path">
<td><xsl:apply-templates/></td>
</xsl:template>
<xsl:template match="check:fn">
<td><xsl:apply-templates/></td>
</xsl:template>
<xsl:template match="check:id">
<td><xsl:apply-templates/></td>
</xsl:template>
<xsl:template match="check:description">
<td><xsl:apply-templates/></td>
</xsl:template>
<xsl:template match="check:message">
<td><xsl:apply-templates/></td>
</xsl:template>
</xsl:stylesheet>

29
tests/Makefile.am Normal file
View File

@ -0,0 +1,29 @@
########################
## tests/Makefile.am
########################
SUBDIRS =
EXTRA_DIST = CheckLog.xsl
AM_MAKEFLAGS = -k
AM_CFLAGS = -Wall -Werror @CHECK_CFLAGS@ -I$(top_srcdir)/src
LDADD = @CHECK_LIBS@ $(top_builddir)/src/libxcb.la
if HAVE_CHECK
TESTS = check_all
check_PROGRAMS = check_all
check_all_SOURCES = check_all.c check_suites.h check_public.c
check-local: check-TESTS
$(RM) CheckLog.html
if test x$(HTML_CHECK_RESULT) = xyes; then \
$(XSLTPROC) $(srcdir)/CheckLog.xsl CheckLog*.xml > CheckLog.html; \
else \
touch CheckLog.html; \
fi
CheckLog.html: $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check;
endif
clean-local::
$(RM) CheckLog.html CheckLog*.txt CheckLog*.xml

1162
tests/Makefile.in Normal file

File diff suppressed because it is too large Load Diff

29
tests/check_all.c Normal file
View File

@ -0,0 +1,29 @@
#include <stdlib.h>
#include "check_suites.h"
#if CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION < 13
void suite_add_test(Suite *s, TFun tf, const char *name)
#else
void suite_add_test(Suite *s, const TTest *tt, const char *name)
#endif
{
TCase *tc = tcase_create(name);
#if CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION < 13
tcase_add_test(tc, tf);
#else
tcase_add_test(tc, tt);
#endif
suite_add_tcase(s, tc);
}
int main(void)
{
int nf;
SRunner *sr = srunner_create(public_suite());
srunner_set_xml(sr, "CheckLog_xcb.xml");
srunner_run_all(sr, CK_NORMAL);
nf = srunner_ntests_failed(sr);
srunner_free(sr);
return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}

218
tests/check_public.c Normal file
View File

@ -0,0 +1,218 @@
#include <check.h>
#include <string.h>
#include <stdlib.h>
#include "check_suites.h"
#include "xcb.h"
#include "xcbext.h"
/* xcb_parse_display tests {{{ */
typedef enum test_type_t {
TEST_ARGUMENT, TEST_ENVIRONMENT, TEST_END
} test_type_t;
static const char *const test_string[] = { "", "via $DISPLAY " };
static void parse_display_pass(const char *name, const char *host, const int display, const int screen)
{
int success;
char *got_host;
int got_display, got_screen;
const char *argument = 0;
test_type_t test_type;
for(test_type = TEST_ARGUMENT; test_type != TEST_END; test_type++)
{
if(test_type == TEST_ARGUMENT)
{
argument = name;
putenv("DISPLAY=");
}
else if(test_type == TEST_ENVIRONMENT)
{
argument = 0;
setenv("DISPLAY", name, 1);
}
got_host = (char *) -1;
got_display = got_screen = -42;
mark_point();
success = xcb_parse_display(argument, &got_host, &got_display, &got_screen);
fail_unless(success, "unexpected parse failure %sfor '%s'", test_string[test_type], name);
fail_unless(strcmp(host, got_host) == 0, "parse %sproduced unexpected hostname '%s' for '%s': expected '%s'", test_string[test_type], got_host, name, host);
fail_unless(display == got_display, "parse %sproduced unexpected display '%d' for '%s': expected '%d'", test_string[test_type], got_display, name, display);
fail_unless(screen == got_screen, "parse %sproduced unexpected screen '%d' for '%s': expected '%d'", test_string[test_type], got_screen, name, screen);
got_host = (char *) -1;
got_display = got_screen = -42;
mark_point();
success = xcb_parse_display(argument, &got_host, &got_display, 0);
fail_unless(success, "unexpected screenless parse failure %sfor '%s'", test_string[test_type], name);
fail_unless(strcmp(host, got_host) == 0, "screenless parse %sproduced unexpected hostname '%s' for '%s': expected '%s'", test_string[test_type], got_host, name, host);
fail_unless(display == got_display, "screenless parse %sproduced unexpected display '%d' for '%s': expected '%d'", test_string[test_type], got_display, name, display);
}
putenv("DISPLAY=");
}
static void parse_display_fail(const char *name)
{
int success;
char *got_host;
int got_display, got_screen;
const char *argument = 0;
test_type_t test_type;
for(test_type = TEST_ARGUMENT; test_type != TEST_END; test_type++)
{
if(test_type == TEST_ARGUMENT)
{
argument = name;
putenv("DISPLAY=");
}
else if(test_type == TEST_ENVIRONMENT)
{
if (!name) break;
argument = 0;
setenv("DISPLAY", name, 1);
}
got_host = (char *) -1;
got_display = got_screen = -42;
mark_point();
success = xcb_parse_display(argument, &got_host, &got_display, &got_screen);
fail_unless(!success, "unexpected parse success %sfor '%s'", test_string[test_type], name);
fail_unless(got_host == (char *) -1, "host changed on parse failure %sfor '%s': got %p", test_string[test_type], name, got_host);
fail_unless(got_display == -42, "display changed on parse failure %sfor '%s': got %d", test_string[test_type], name, got_display);
fail_unless(got_screen == -42, "screen changed on parse failure %sfor '%s': got %d", test_string[test_type], name, got_screen);
got_host = (char *) -1;
got_display = got_screen = -42;
mark_point();
success = xcb_parse_display(argument, &got_host, &got_display, 0);
fail_unless(!success, "unexpected screenless parse success %sfor '%s'", test_string[test_type], name);
fail_unless(got_host == (char *) -1, "host changed on parse failure %sfor '%s': got %p", test_string[test_type], name, got_host);
fail_unless(got_display == -42, "display changed on parse failure %sfor '%s': got %d", test_string[test_type], name, got_display);
}
putenv("DISPLAY=");
}
START_TEST(parse_display_unix)
{
parse_display_pass(":0", "", 0, 0);
parse_display_pass(":1", "", 1, 0);
parse_display_pass(":0.1", "", 0, 1);
}
END_TEST
START_TEST(parse_display_ip)
{
parse_display_pass("x.org:0", "x.org", 0, 0);
parse_display_pass("expo:0", "expo", 0, 0);
parse_display_pass("bigmachine:1", "bigmachine", 1, 0);
parse_display_pass("hydra:0.1", "hydra", 0, 1);
}
END_TEST
START_TEST(parse_display_ipv4)
{
parse_display_pass("198.112.45.11:0", "198.112.45.11", 0, 0);
parse_display_pass("198.112.45.11:0.1", "198.112.45.11", 0, 1);
}
END_TEST
START_TEST(parse_display_ipv6)
{
parse_display_pass(":::0", "::", 0, 0);
parse_display_pass("1:::0", "1::", 0, 0);
parse_display_pass("::1:0", "::1", 0, 0);
parse_display_pass("::1:0.1", "::1", 0, 1);
parse_display_pass("::127.0.0.1:0", "::127.0.0.1", 0, 0);
parse_display_pass("::ffff:127.0.0.1:0", "::ffff:127.0.0.1", 0, 0);
parse_display_pass("2002:83fc:d052::1:0", "2002:83fc:d052::1", 0, 0);
parse_display_pass("2002:83fc:d052::1:0.1", "2002:83fc:d052::1", 0, 1);
parse_display_pass("[::]:0", "[::]", 0, 0);
parse_display_pass("[1::]:0", "[1::]", 0, 0);
parse_display_pass("[::1]:0", "[::1]", 0, 0);
parse_display_pass("[::1]:0.1", "[::1]", 0, 1);
parse_display_pass("[::127.0.0.1]:0", "[::127.0.0.1]", 0, 0);
parse_display_pass("[::ffff:127.0.0.1]:0", "[::ffff:127.0.0.1]", 0, 0);
parse_display_pass("[2002:83fc:d052::1]:0", "[2002:83fc:d052::1]", 0, 0);
parse_display_pass("[2002:83fc:d052::1]:0.1", "[2002:83fc:d052::1]", 0, 1);
}
END_TEST
START_TEST(parse_display_decnet)
{
parse_display_pass("myws::0", "myws:", 0, 0);
parse_display_pass("big::1", "big:", 1, 0);
parse_display_pass("hydra::0.1", "hydra:", 0, 1);
}
END_TEST
START_TEST(parse_display_negative)
{
parse_display_fail(0);
parse_display_fail("");
parse_display_fail(":");
parse_display_fail("::");
parse_display_fail(":::");
parse_display_fail(":.");
parse_display_fail(":a");
parse_display_fail(":a.");
parse_display_fail(":0.");
parse_display_fail(":.a");
parse_display_fail(":.0");
parse_display_fail(":0.a");
parse_display_fail(":0.0.");
parse_display_fail("127.0.0.1");
parse_display_fail("127.0.0.1:");
parse_display_fail("127.0.0.1::");
parse_display_fail("::127.0.0.1");
parse_display_fail("::127.0.0.1:");
parse_display_fail("::127.0.0.1::");
parse_display_fail("::ffff:127.0.0.1");
parse_display_fail("::ffff:127.0.0.1:");
parse_display_fail("::ffff:127.0.0.1::");
parse_display_fail("localhost");
parse_display_fail("localhost:");
parse_display_fail("localhost::");
}
END_TEST
/* }}} */
static void popcount_eq(uint32_t bits, int count)
{
fail_unless(xcb_popcount(bits) == count, "unexpected popcount(%08x) != %d", bits, count);
}
START_TEST(popcount)
{
uint32_t mask;
int count;
for (mask = 0xffffffff, count = 32; count >= 0; mask >>= 1, --count) {
popcount_eq(mask, count);
}
for (mask = 0x80000000; mask; mask >>= 1) {
popcount_eq(mask, 1);
}
for (mask = 0x80000000; mask > 1; mask >>= 1) {
popcount_eq(mask | 1, 2);
}
}
END_TEST
Suite *public_suite(void)
{
Suite *s = suite_create("Public API");
putenv("DISPLAY=");
suite_add_test(s, parse_display_unix, "xcb_parse_display unix");
suite_add_test(s, parse_display_ip, "xcb_parse_display ip");
suite_add_test(s, parse_display_ipv4, "xcb_parse_display ipv4");
suite_add_test(s, parse_display_ipv6, "xcb_parse_display ipv6");
suite_add_test(s, parse_display_decnet, "xcb_parse_display decnet");
suite_add_test(s, parse_display_negative, "xcb_parse_display negative");
suite_add_test(s, popcount, "xcb_popcount");
return s;
}

8
tests/check_suites.h Normal file
View File

@ -0,0 +1,8 @@
#include <check.h>
#if CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION < 13
void suite_add_test(Suite *s, TFun tf, const char *name);
#else
void suite_add_test(Suite *s, const TTest *tt, const char *name);
#endif
Suite *public_suite(void);

17
tools/README Normal file
View File

@ -0,0 +1,17 @@
api_conv.pl:
------------
Description: used to convert old XCB names in camel case to lower
case names.
Usage:
* for several files:
perl -i xcb/tools/api_conv.pl xcb/tools/constants <file1> <file2> ...
* for a directory:
find dir -name '*.[ch]' -exec perl -i xcb/tools/api_conv.pl xcb/tools/constants {} +

98
tools/api_conv.pl Executable file
View File

@ -0,0 +1,98 @@
#!/usr/bin/perl -plw
use strict;
BEGIN {
%::const = map { $_ => 1 } (
# constants in xcb.h
"XCBNone",
"XCBCopyFromParent",
"XCBCurrentTime",
"XCBNoSymbol",
"XCBError",
"XCBReply",
# renamed constants
"XCBButtonAny",
"XCBButton1",
"XCBButton2",
"XCBButton3",
"XCBButton4",
"XCBButton5",
"XCBHostInsert",
"XCBHostDelete",
"XCBGlxGC_GL_CURRENT_BIT",
"XCBGlxGC_GL_POINT_BIT",
"XCBGlxGC_GL_LINE_BIT",
"XCBGlxGC_GL_POLYGON_BIT",
"XCBGlxGC_GL_POLYGON_STIPPLE_BIT",
"XCBGlxGC_GL_PIXEL_MODE_BIT",
"XCBGlxGC_GL_LIGHTING_BIT",
"XCBGlxGC_GL_FOG_BIT",
"XCBGlxGC_GL_DEPTH_BUFFER_BIT",
"XCBGlxGC_GL_ACCUM_BUFFER_BIT",
"XCBGlxGC_GL_STENCIL_BUFFER_BIT",
"XCBGlxGC_GL_VIEWPORT_BIT",
"XCBGlxGC_GL_TRANSFORM_BIT",
"XCBGlxGC_GL_ENABLE_BIT",
"XCBGlxGC_GL_COLOR_BUFFER_BIT",
"XCBGlxGC_GL_HINT_BIT",
"XCBGlxGC_GL_EVAL_BIT",
"XCBGlxGC_GL_LIST_BIT",
"XCBGlxGC_GL_TEXTURE_BIT",
"XCBGlxGC_GL_SCISSOR_BIT",
"XCBGlxGC_GL_ALL_ATTRIB_BITS",
"XCBGlxRM_GL_RENDER",
"XCBGlxRM_GL_FEEDBACK",
"XCBGlxRM_GL_SELECT",
);
open(CONST, shift) or die "failed to open constants list: $!";
while(<CONST>)
{
chomp;
die "invalid constant name: \"$_\"" unless /^XCB[A-Za-z0-9_]*$/;
$::const{$_} = 1;
}
close(CONST);
}
sub convert($$)
{
local $_ = shift;
my ($fun) = @_;
return "xcb_generate_id" if /^xcb_[a-z0-9_]+_new$/ or /^XCB[A-Z0-9]+New$/;
return "uint$1_t" if /^CARD(8|16|32)$/;
return "int$1_t" if /^INT(8|16|32)$/;
return "uint8_t" if $_ eq 'BOOL' or $_ eq 'BYTE';
return $_ if /^[A-Z0-9]*_[A-Z0-9_]*$/ or !/^XCB(.+)/;
my $const = defined $::const{$_};
$_ = $1;
s/^(GX|RandR|XFixes|XP|XvMC|ScreenSaver)(.)/uc($1) . "_" . $2/e unless /^ScreenSaver(?:Reset|Active)$/;
my %abbr = (
"Iter" => "iterator",
"Req" => "request",
"Rep" => "reply",
);
my $word;
if(/CHAR2B|INT64|FLOAT32|FLOAT64|BOOL32|STRING8/)
{
$word = qr/[A-Z](?:[A-Z0-9]*|[a-z]*)/;
} else {
$word = qr/[0-9]+|[A-Z](?:[A-Z]*|[a-z]*)/;
}
s/($word)_?(?=[0-9A-Z]|$)/"_" . ($abbr{$1} or lc($1))/eg;
s/^_shape_shape_/_shape_/;
s/^_xf_?86_dri/_xf86dri/;
$_ = "_family_decnet" if $_ eq "_family_de_cnet";
return "XCB" . uc($_) if $const;
$_ .= "_t" unless $fun or /_id$/;
return "xcb" . $_;
}
s/^(\s*#\s*include\s*<)X11\/XCB\//$1xcb\//;
s/([_A-Za-z][_A-Za-z0-9]*)([ \t]*\()?/convert($1, defined $2) . ($2 or "")/eg;

573
tools/constants Normal file
View File

@ -0,0 +1,573 @@
XCBCompositeRedirectAutomatic
XCBCompositeRedirectManual
XCBDamageReportLevelRawRectangles
XCBDamageReportLevelDeltaRectangles
XCBDamageReportLevelBoundingBox
XCBDamageReportLevelNonEmpty
XCBDamageBadDamage
XCBDamageNotify
XCBGlxGeneric
XCBGlxBadContext
XCBGlxBadContextState
XCBGlxBadDrawable
XCBGlxBadPixmap
XCBGlxBadContextTag
XCBGlxBadCurrentWindow
XCBGlxBadRenderRequest
XCBGlxBadLargeRequest
XCBGlxUnsupportedPrivateRequest
XCBGlxBadFBConfig
XCBGlxBadPbuffer
XCBGlxBadCurrentDrawable
XCBGlxBadWindow
XCBGlxPbufferClobber
XCBGlxPBCETDamaged
XCBGlxPBCETSaved
XCBGlxPBCDTWindow
XCBGlxPBCDTPbuffer
XCBGlxGC_GL_CURRENT_BIT
XCBGlxGC_GL_POINT_BIT
XCBGlxGC_GL_LINE_BIT
XCBGlxGC_GL_POLYGON_BIT
XCBGlxGC_GL_POLYGON_STIPPLE_BIT
XCBGlxGC_GL_PIXEL_MODE_BIT
XCBGlxGC_GL_LIGHTING_BIT
XCBGlxGC_GL_FOG_BIT
XCBGlxGC_GL_DEPTH_BUFFER_BIT
XCBGlxGC_GL_ACCUM_BUFFER_BIT
XCBGlxGC_GL_STENCIL_BUFFER_BIT
XCBGlxGC_GL_VIEWPORT_BIT
XCBGlxGC_GL_TRANSFORM_BIT
XCBGlxGC_GL_ENABLE_BIT
XCBGlxGC_GL_COLOR_BUFFER_BIT
XCBGlxGC_GL_HINT_BIT
XCBGlxGC_GL_EVAL_BIT
XCBGlxGC_GL_LIST_BIT
XCBGlxGC_GL_TEXTURE_BIT
XCBGlxGC_GL_SCISSOR_BIT
XCBGlxGC_GL_ALL_ATTRIB_BITS
XCBGlxRM_GL_RENDER
XCBGlxRM_GL_FEEDBACK
XCBGlxRM_GL_SELECT
XCBRandRRotationRotate_0
XCBRandRRotationRotate_90
XCBRandRRotationRotate_180
XCBRandRRotationRotate_270
XCBRandRRotationReflect_X
XCBRandRRotationReflect_Y
XCBRandRSetConfigSuccess
XCBRandRSetConfigInvalidConfigTime
XCBRandRSetConfigInvalidTime
XCBRandRSetConfigFailed
XCBRandRSMScreenChangeNotify
XCBRandRScreenChangeNotify
XCBRecordHTypeFromServerTime
XCBRecordHTypeFromClientTime
XCBRecordHTypeFromClientSequence
XCBRecordCSCurrentClients
XCBRecordCSFutureClients
XCBRecordCSAllClients
XCBRecordBadContext
XCBRenderPictTypeIndexed
XCBRenderPictTypeDirect
XCBRenderPictOpClear
XCBRenderPictOpSrc
XCBRenderPictOpDst
XCBRenderPictOpOver
XCBRenderPictOpOverReverse
XCBRenderPictOpIn
XCBRenderPictOpInReverse
XCBRenderPictOpOut
XCBRenderPictOpOutReverse
XCBRenderPictOpAtop
XCBRenderPictOpAtopReverse
XCBRenderPictOpXor
XCBRenderPictOpAdd
XCBRenderPictOpSaturate
XCBRenderPictOpDisjointClear
XCBRenderPictOpDisjointSrc
XCBRenderPictOpDisjointDst
XCBRenderPictOpDisjointOver
XCBRenderPictOpDisjointOverReverse
XCBRenderPictOpDisjointIn
XCBRenderPictOpDisjointInReverse
XCBRenderPictOpDisjointOut
XCBRenderPictOpDisjointOutReverse
XCBRenderPictOpDisjointAtop
XCBRenderPictOpDisjointAtopReverse
XCBRenderPictOpDisjointXor
XCBRenderPictOpConjointClear
XCBRenderPictOpConjointSrc
XCBRenderPictOpConjointDst
XCBRenderPictOpConjointOver
XCBRenderPictOpConjointOverReverse
XCBRenderPictOpConjointIn
XCBRenderPictOpConjointInReverse
XCBRenderPictOpConjointOut
XCBRenderPictOpConjointOutReverse
XCBRenderPictOpConjointAtop
XCBRenderPictOpConjointAtopReverse
XCBRenderPictOpConjointXor
XCBRenderPolyEdgeSharp
XCBRenderPolyEdgeSmooth
XCBRenderPolyModePrecise
XCBRenderPolyModeImprecise
XCBRenderCPRepeat
XCBRenderCPAlphaMap
XCBRenderCPAlphaXOrigin
XCBRenderCPAlphaYOrigin
XCBRenderCPClipXOrigin
XCBRenderCPClipYOrigin
XCBRenderCPClipMask
XCBRenderCPGraphicsExposure
XCBRenderCPSubwindowMode
XCBRenderCPPolyEdge
XCBRenderCPPolyMode
XCBRenderCPDither
XCBRenderCPComponentAlpha
XCBRenderSubPixelUnknown
XCBRenderSubPixelHorizontalRGB
XCBRenderSubPixelHorizontalBGR
XCBRenderSubPixelVerticalRGB
XCBRenderSubPixelVerticalBGR
XCBRenderSubPixelNone
XCBRenderPictFormat
XCBRenderPicture
XCBRenderPictOp
XCBRenderGlyphSet
XCBRenderGlyph
XCBScreenSaverKindBlanked
XCBScreenSaverKindInternal
XCBScreenSaverKindExternal
XCBScreenSaverEventNotifyMask
XCBScreenSaverEventCycleMask
XCBScreenSaverStateOff
XCBScreenSaverStateOn
XCBScreenSaverStateCycle
XCBScreenSaverStateDisabled
XCBScreenSaverNotify
XCBShapeSOSet
XCBShapeSOUnion
XCBShapeSOIntersect
XCBShapeSOSubtract
XCBShapeSOInvert
XCBShapeSKBounding
XCBShapeSKClip
XCBShapeSKInput
XCBShapeNotify
XCBShmCompletion
XCBShmBadSeg
XCBSyncALARMSTATEActive
XCBSyncALARMSTATEInactive
XCBSyncALARMSTATEDestroyed
XCBSyncTESTTYPEPositiveTransition
XCBSyncTESTTYPENegativeTransition
XCBSyncTESTTYPEPositiveComparison
XCBSyncTESTTYPENegativeComparison
XCBSyncVALUETYPEAbsolute
XCBSyncVALUETYPERelative
XCBSyncCACounter
XCBSyncCAValueType
XCBSyncCAValue
XCBSyncCATestType
XCBSyncCADelta
XCBSyncCAEvents
XCBSyncCounter
XCBSyncAlarm
XCBSyncCounterNotify
XCBSyncAlarmNotify
XCBXevieDatatypeUnmodified
XCBXevieDatatypeModified
XCBXFixesSaveSetModeInsert
XCBXFixesSaveSetModeDelete
XCBXFixesSaveSetTargetNearest
XCBXFixesSaveSetTargetRoot
XCBXFixesSaveSetMappingMap
XCBXFixesSaveSetMappingUnmap
XCBXFixesSelectionEventSetSelectionOwner
XCBXFixesSelectionEventSelectionWindowDestroy
XCBXFixesSelectionEventSelectionClientClose
XCBXFixesSelectionEventMaskSetSelectionOwner
XCBXFixesSelectionEventMaskSelectionWindowDestroy
XCBXFixesSelectionEventMaskSelectionClientClose
XCBXFixesSelectionNotify
XCBXFixesCursorNotifyDisplayCursor
XCBXFixesCursorNotifyMaskDisplayCursor
XCBXFixesCursorNotify
XCBXFixesBadRegion
XCBXPGetDocFinished
XCBXPGetDocSecondConsumer
XCBXPEvMaskNoEventMask
XCBXPEvMaskPrintMask
XCBXPEvMaskAttributeMask
XCBXPDetailStartJobNotify
XCBXPDetailEndJobNotify
XCBXPDetailStartDocNotify
XCBXPDetailEndDocNotify
XCBXPDetailStartPageNotify
XCBXPDetailEndPageNotify
XCBXPAttrJobAttr
XCBXPAttrDocAttr
XCBXPAttrPageAttr
XCBXPAttrPrinterAttr
XCBXPAttrServerAttr
XCBXPAttrMediumAttr
XCBXPAttrSpoolerAttr
XCBXPNotify
XCBXPAttributNotify
XCBXPBadContext
XCBXPBadSequence
XCBXvTypeInputMask
XCBXvTypeOutputMask
XCBXvTypeVideoMask
XCBXvTypeStillMask
XCBXvTypeImageMask
XCBXvImageFormatInfoTypeRGB
XCBXvImageFormatInfoTypeYUV
XCBXvImageFormatInfoFormatPacked
XCBXvImageFormatInfoFormatPlanar
XCBXvAttributeFlagGettable
XCBXvAttributeFlagSettable
XCBXvBadPort
XCBXvBadEncoding
XCBXvBadControl
XCBXvVideoNotify
XCBXvPortNotify
XCBTestCursorNone
XCBTestCursorCurrent
XCBVisualClassStaticGray
XCBVisualClassGrayScale
XCBVisualClassStaticColor
XCBVisualClassPseudoColor
XCBVisualClassTrueColor
XCBVisualClassDirectColor
XCBImageOrderLSBFirst
XCBImageOrderMSBFirst
XCBModMaskShift
XCBModMaskLock
XCBModMaskControl
XCBModMask1
XCBModMask2
XCBModMask3
XCBModMask4
XCBModMask5
XCBKeyPress
XCBKeyRelease
XCBButtonMask1
XCBButtonMask2
XCBButtonMask3
XCBButtonMask4
XCBButtonMask5
XCBButtonMaskAny
XCBButtonPress
XCBButtonRelease
XCBMotionNormal
XCBMotionHint
XCBMotionNotify
XCBNotifyDetailAncestor
XCBNotifyDetailVirtual
XCBNotifyDetailInferior
XCBNotifyDetailNonlinear
XCBNotifyDetailNonlinearVirtual
XCBNotifyDetailPointer
XCBNotifyDetailPointerRoot
XCBNotifyDetailNone
XCBNotifyModeNormal
XCBNotifyModeGrab
XCBNotifyModeUngrab
XCBNotifyModeWhileGrabbed
XCBEnterNotify
XCBLeaveNotify
XCBFocusIn
XCBFocusOut
XCBKeymapNotify
XCBExpose
XCBGraphicsExposure
XCBNoExposure
XCBVisibilityUnobscured
XCBVisibilityPartiallyObscured
XCBVisibilityFullyObscured
XCBVisibilityNotify
XCBCreateNotify
XCBDestroyNotify
XCBUnmapNotify
XCBMapNotify
XCBMapRequest
XCBReparentNotify
XCBConfigureNotify
XCBConfigureRequest
XCBGravityNotify
XCBResizeRequest
XCBPlaceOnTop
XCBPlaceOnBottom
XCBCirculateNotify
XCBCirculateRequest
XCBPropertyNewValue
XCBPropertyDelete
XCBPropertyNotify
XCBSelectionClear
XCBSelectionRequest
XCBSelectionNotify
XCBColormapStateUninstalled
XCBColormapStateInstalled
XCBColormapNotify
XCBClientMessage
XCBMappingModifier
XCBMappingKeyboard
XCBMappingPointer
XCBMappingNotify
XCBRequest
XCBValue
XCBWindow
XCBPixmap
XCBAtom
XCBCursor
XCBFont
XCBMatch
XCBDrawable
XCBAccess
XCBAlloc
XCBColormap
XCBGContext
XCBIDChoice
XCBName
XCBLength
XCBImplementation
XCBWindowClassCopyFromParent
XCBWindowClassInputOutput
XCBWindowClassInputOnly
XCBCWBackPixmap
XCBCWBackPixel
XCBCWBorderPixmap
XCBCWBorderPixel
XCBCWBitGravity
XCBCWWinGravity
XCBCWBackingStore
XCBCWBackingPlanes
XCBCWBackingPixel
XCBCWOverrideRedirect
XCBCWSaveUnder
XCBCWEventMask
XCBCWDontPropagate
XCBCWColormap
XCBCWCursor
XCBBackPixmapNone
XCBBackPixmapParentRelative
XCBGravityBitForget
XCBGravityWinUnmap
XCBGravityNorthWest
XCBGravityNorth
XCBGravityNorthEast
XCBGravityWest
XCBGravityCenter
XCBGravityEast
XCBGravitySouthWest
XCBGravitySouth
XCBGravitySouthEast
XCBGravityStatic
XCBBackingStoreNotUseful
XCBBackingStoreWhenMapped
XCBBackingStoreAlways
XCBEventMaskNoEvent
XCBEventMaskKeyPress
XCBEventMaskKeyRelease
XCBEventMaskButtonPress
XCBEventMaskButtonRelease
XCBEventMaskEnterWindow
XCBEventMaskLeaveWindow
XCBEventMaskPointerMotion
XCBEventMaskPointerMotionHint
XCBEventMaskButton1Motion
XCBEventMaskButton2Motion
XCBEventMaskButton3Motion
XCBEventMaskButton4Motion
XCBEventMaskButton5Motion
XCBEventMaskButtonMotion
XCBEventMaskKeymapState
XCBEventMaskExposure
XCBEventMaskVisibilityChange
XCBEventMaskStructureNotify
XCBEventMaskResizeRedirect
XCBEventMaskSubstructureNotify
XCBEventMaskSubstructureRedirect
XCBEventMaskFocusChange
XCBEventMaskPropertyChange
XCBEventMaskColorMapChange
XCBEventMaskOwnerGrabButton
XCBMapStateUnmapped
XCBMapStateUnviewable
XCBMapStateViewable
XCBSetModeInsert
XCBSetModeDelete
XCBConfigWindowX
XCBConfigWindowY
XCBConfigWindowWidth
XCBConfigWindowHeight
XCBConfigWindowBorderWidth
XCBConfigWindowSibling
XCBConfigWindowStackMode
XCBStackModeAbove
XCBStackModeBelow
XCBStackModeTopIf
XCBStackModeBottomIf
XCBStackModeOpposite
XCBCirculateRaiseLowest
XCBCirculateLowerHighest
XCBPropModeReplace
XCBPropModePrepend
XCBPropModeAppend
XCBGetPropertyTypeAny
XCBSendEventDestPointerWindow
XCBSendEventDestItemFocus
XCBGrabModeAsync
XCBGrabModeSync
XCBGrabStatusSuccess
XCBGrabStatusAlreadyGrabbed
XCBGrabStatusInvalidTime
XCBGrabStatusNotViewable
XCBGrabStatusFrozen
XCBButtonAny
XCBButton1
XCBButton2
XCBButton3
XCBButton4
XCBButton5
XCBGrabAny
XCBAllowAsyncPointer
XCBAllowSyncPointer
XCBAllowReplayPointer
XCBAllowAsyncKeyboard
XCBAllowSyncKeyboard
XCBAllowReplayKeyboard
XCBAllowAsyncBoth
XCBAllowSyncBoth
XCBInputFocusNone
XCBInputFocusPointerRoot
XCBInputFocusParent
XCBFontDrawLeftToRight
XCBFontDrawRightToLeft
XCBGCFunction
XCBGCPlaneMask
XCBGCForeground
XCBGCBackground
XCBGCLineWidth
XCBGCLineStyle
XCBGCCapStyle
XCBGCJoinStyle
XCBGCFillStyle
XCBGCFillRule
XCBGCTile
XCBGCStipple
XCBGCTileStippleOriginX
XCBGCTileStippleOriginY
XCBGCFont
XCBGCSubwindowMode
XCBGCGraphicsExposures
XCBGCClipOriginX
XCBGCClipOriginY
XCBGCClipMask
XCBGCDashOffset
XCBGCDashList
XCBGCArcMode
XCBGXclear
XCBGXand
XCBGXandReverse
XCBGXcopy
XCBGXandInverted
XCBGXnoop
XCBGXxor
XCBGXor
XCBGXnor
XCBGXequiv
XCBGXinvert
XCBGXorReverse
XCBGXcopyInverted
XCBGXorInverted
XCBGXnand
XCBGXset
XCBLineStyleSolid
XCBLineStyleOnOffDash
XCBLineStyleDoubleDash
XCBCapStyleNotLast
XCBCapStyleCap
XCBCapStyleButt
XCBCapStyleProjecting
XCBJoinStyleMitre
XCBJoinStyleRound
XCBJoinStyleBevel
XCBFillStyleSolid
XCBFillStyleTiled
XCBFillStyleStippled
XCBFillStyleOpaqueStippled
XCBFillRuleEvenOdd
XCBFillRuleWinding
XCBSubwindowModeClipByChildren
XCBSubwindowModeIncludeInferiors
XCBArcModeChord
XCBArcModePieSlice
XCBClipOrderingUnsorted
XCBClipOrderingYSorted
XCBClipOrderingYXSorted
XCBClipOrderingYXBanded
XCBCoordModeOrigin
XCBCoordModePrevious
XCBPolyShapeComplex
XCBPolyShapeNonconvex
XCBPolyShapeConvex
XCBImageFormatXYBitmap
XCBImageFormatXYPixmap
XCBImageFormatZPixmap
XCBColormapAllocNone
XCBColormapAllocAll
XCBColorFlagRed
XCBColorFlagGreen
XCBColorFlagBlue
XCBQueryShapeOfLargestCursor
XCBQueryShapeOfFastestTile
XCBQueryShapeOfFastestStipple
XCBKBKeyClickPercent
XCBKBBellPercent
XCBKBBellPitch
XCBKBBellDuration
XCBKBLed
XCBKBLedMode
XCBKBKey
XCBKBAutoRepeatMode
XCBLedModeOff
XCBLedModeOn
XCBAutoRepeatModeOff
XCBAutoRepeatModeOn
XCBAutoRepeatModeDefault
XCBBlankingNotPreferred
XCBBlankingPreferred
XCBBlankingDefault
XCBExposuresNotAllowed
XCBExposuresAllowed
XCBExposuresDefault
XCBHostInsert
XCBHostDelete
XCBFamilyInternet
XCBFamilyDECnet
XCBFamilyChaos
XCBFamilyServerInterpreted
XCBFamilyInternet6
XCBAccessControlDisable
XCBAccessControlEnable
XCBCloseDownDestroyAll
XCBCloseDownRetainPermanent
XCBCloseDownRetainTemporary
XCBKillAllTemporary
XCBScreenSaverReset
XCBScreenSaverActive
XCBMappingStatusSuccess
XCBMappingStatusBusy
XCBMappingStatusFailure
XCBMapIndexShift
XCBMapIndexLock
XCBMapIndexControl
XCBMapIndex1
XCBMapIndex2
XCBMapIndex3
XCBMapIndex4
XCBMapIndex5
XCBAllPlanes

11
xcb-composite.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB Composite
Description: XCB Composite Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb xcb-xfixes
Libs: -L${libdir} -lxcb-composite
Cflags: -I${includedir}

11
xcb-damage.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB Damage
Description: XCB Damage Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb xcb-xfixes
Libs: -L${libdir} -lxcb-damage
Cflags: -I${includedir}

11
xcb-dpms.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB DPMS
Description: XCB DPMS Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-dpms
Cflags: -I${includedir}

11
xcb-dri2.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB DRI2
Description: XCB DRI2 Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-dri2
Cflags: -I${includedir}

11
xcb-dri3.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB DRI3
Description: XCB DRI3 Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-dri3
Cflags: -I${includedir}

11
xcb-ge.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB GenericEvent
Description: XCB GenericEvent Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-ge
Cflags: -I${includedir}

11
xcb-glx.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB GLX
Description: XCB GLX Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-glx
Cflags: -I${includedir}

11
xcb-present.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB Present
Description: XCB Present Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb xcb-randr xcb-xfixes xcb-sync
Libs: -L${libdir} -lxcb-present
Cflags: -I${includedir}

11
xcb-randr.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB RandR
Description: XCB RandR Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb xcb-render
Libs: -L${libdir} -lxcb-randr
Cflags: -I${includedir}

11
xcb-record.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB Record
Description: XCB Record Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-record
Cflags: -I${includedir}

11
xcb-render.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB Render
Description: XCB Render Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-render
Cflags: -I${includedir}

11
xcb-res.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB Res
Description: XCB X-Resource Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-res
Cflags: -I${includedir}

11
xcb-screensaver.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB Screensaver
Description: XCB Screensaver Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-screensaver
Cflags: -I${includedir}

11
xcb-shape.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB Shape
Description: XCB Shape Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-shape
Cflags: -I${includedir}

11
xcb-shm.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB Shm
Description: XCB Shm Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-shm
Cflags: -I${includedir}

11
xcb-sync.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB Sync
Description: XCB Sync Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-sync
Cflags: -I${includedir}

11
xcb-xevie.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB Xevie
Description: XCB Xevie Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-xevie
Cflags: -I${includedir}

11
xcb-xf86dri.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB XFree86-DRI
Description: XCB XFree86-DRI Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-xf86dri
Cflags: -I${includedir}

11
xcb-xfixes.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB XFixes
Description: XCB XFixes Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb xcb-render xcb-shape
Libs: -L${libdir} -lxcb-xfixes
Cflags: -I${includedir}

11
xcb-xinerama.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB Xinerama
Description: XCB Xinerama Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-xinerama
Cflags: -I${includedir}

11
xcb-xinput.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB XInput
Description: XCB XInput Extension (EXPERIMENTAL)
Version: @PACKAGE_VERSION@
Requires.private: xcb xcb-xfixes
Libs: -L${libdir} -lxcb-xinput
Cflags: -I${includedir}

11
xcb-xkb.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB XKB
Description: XCB Keyboard Extension (EXPERIMENTAL)
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-xkb
Cflags: -I${includedir}

11
xcb-xprint.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB Xprint
Description: XCB Xprint Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-xprint
Cflags: -I${includedir}

11
xcb-xselinux.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB SELinux
Description: XCB SELinux Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-xselinux
Cflags: -I${includedir}

11
xcb-xtest.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB XTEST
Description: XCB XTEST Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb
Libs: -L${libdir} -lxcb-xtest
Cflags: -I${includedir}

11
xcb-xv.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB Xv
Description: XCB Xv Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb xcb-shm
Libs: -L${libdir} -lxcb-xv
Cflags: -I${includedir}

11
xcb-xvmc.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: XCB XvMC
Description: XCB XvMC Extension
Version: @PACKAGE_VERSION@
Requires.private: xcb xcb-xv
Libs: -L${libdir} -lxcb-xvmc
Cflags: -I${includedir}

13
xcb.pc.in Normal file
View File

@ -0,0 +1,13 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
xcbproto_version=@XCBPROTO_VERSION@
Name: XCB
Description: X-protocol C Binding
Version: @PACKAGE_VERSION@
Requires.private: @NEEDED@
Libs: -L${libdir} -lxcb
Libs.private: @LIBS@
Cflags: -I${includedir}