mirror of
https://github.com/openbsd/xenocara.git
synced 2025-12-10 03:08:56 +00:00
import from X.Org 7.2RC2
This commit is contained in:
6
lib/libICE/AUTHORS
Normal file
6
lib/libICE/AUTHORS
Normal file
@@ -0,0 +1,6 @@
|
||||
Ralph Mor, of the X Consortium is the original author.
|
||||
|
||||
OS/2 support, Holger Veit, bug fixes by Keith Packard, Petter Reinholdtsen,
|
||||
others.
|
||||
|
||||
Our apologies if we've overlooked a contributor.
|
||||
23
lib/libICE/COPYING
Normal file
23
lib/libICE/COPYING
Normal file
@@ -0,0 +1,23 @@
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
257
lib/libICE/ChangeLog
Normal file
257
lib/libICE/ChangeLog
Normal file
@@ -0,0 +1,257 @@
|
||||
commit 445661cd714685009ee9ba2358a274351381eabf
|
||||
Author: Adam Jackson <ajax@benzedrine.nwnk.net>
|
||||
Date: Thu Oct 12 18:37:57 2006 -0400
|
||||
|
||||
Fix ChangeLog hook to distcheck.
|
||||
|
||||
commit 5cba1c763ac9f79062523227b49a29f72e6069cf
|
||||
Author: Matthieu Herrb <matthieu.herrb@laas.fr>
|
||||
Date: Sun Jul 16 10:52:30 2006 +0200
|
||||
|
||||
set GIT_DIR=${srcdir}/.git for git-log
|
||||
|
||||
commit 86e0a93714a6ccdb8555fc2c48231d958cba383d
|
||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||
Date: Thu Jul 13 14:58:44 2006 -0700
|
||||
|
||||
renamed: .cvsignore -> .gitignore
|
||||
|
||||
commit c87cb98979356fc55607c05a2b23207afc9beeb1
|
||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||
Date: Tue Jul 11 13:48:08 2006 -0700
|
||||
|
||||
Replace static ChangeLog with rule copied from libX11 to generate from git log
|
||||
|
||||
commit 6066ab9b9914ec0cca3b8f36fa3f5ba323414621
|
||||
Author: Derek Wang <derek.wang@sun.com>
|
||||
Date: Tue Nov 23 12:00:32 2004 -0800
|
||||
|
||||
Sun bug #6193975: kde session manager core dumps in _IceWrite()
|
||||
|
||||
commit be25425ca38d23655a5a854c053e750e1cbd3dea
|
||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||
Date: Tue Jul 11 13:42:07 2006 -0700
|
||||
|
||||
renamed: .cvsignore -> .gitignore
|
||||
|
||||
commit 9b1bb5ab99bd386cc030cd456a576b37406da91c
|
||||
Author: Adam Jackson <ajax@nwnk.net>
|
||||
Date: Wed Apr 26 23:57:50 2006 +0000
|
||||
|
||||
Bump to 1.0.1
|
||||
|
||||
commit 96d7763487da6624ed85bee10b081e7138d2060d
|
||||
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
|
||||
Date: Mon Apr 10 16:44:40 2006 +0000
|
||||
|
||||
Coverity #664: Free memory allocated by EXTRACT_STRING in
|
||||
_IceDefaultErrorHandler after we're done fprintf()'ing it.
|
||||
|
||||
commit 2a30ec82f3bd2aa1f2566e97fee70403a8448de8
|
||||
Author: Kevin E Martin <kem@kem.org>
|
||||
Date: Thu Dec 15 00:24:27 2005 +0000
|
||||
|
||||
Update package version number for final X11R7 release candidate.
|
||||
|
||||
commit 881573d429c0a9ecfa2d6286d4eaece36ee50675
|
||||
Author: Kevin E Martin <kem@kem.org>
|
||||
Date: Sat Dec 3 05:49:42 2005 +0000
|
||||
|
||||
Update package version number for X11R7 RC3 release.
|
||||
|
||||
commit a15b179f2e8e359161d9133bac58dde57b7e78ae
|
||||
Author: Kevin E Martin <kem@kem.org>
|
||||
Date: Sat Nov 19 07:15:39 2005 +0000
|
||||
|
||||
Update pkgconfig files to separate library build-time dependencies from
|
||||
application build-time dependencies, and update package deps to work
|
||||
with separate build roots.
|
||||
|
||||
commit c386a08047582240adefafd3afc062e52fccae6f
|
||||
Author: Kevin E Martin <kem@kem.org>
|
||||
Date: Wed Nov 9 21:19:12 2005 +0000
|
||||
|
||||
Update package version number for X11R7 RC2 release.
|
||||
|
||||
commit c361e3919f2de3f4742904b04e73178edc76bf95
|
||||
Author: Adam Jackson <ajax@nwnk.net>
|
||||
Date: Sun Oct 23 20:12:19 2005 +0000
|
||||
|
||||
Bug #1893: Fix replies when peers use different major opcodes for the same
|
||||
subprotocol. (016_ICE_subprotocol_reply_fix.diff from Debian, by Jochen
|
||||
Voss)
|
||||
|
||||
commit 0b8ff6fbd8cd7f47ab9e6ccb6d4917564a2d13ee
|
||||
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
|
||||
Date: Sat Jul 30 19:15:15 2005 +0000
|
||||
|
||||
Add -D flags to clear various warnings (Stefan Dirsch)
|
||||
|
||||
commit 260d470a128c7eaa6d7484bb143aab353c4e98ec
|
||||
Author: Kevin E Martin <kem@kem.org>
|
||||
Date: Fri Jul 29 21:22:50 2005 +0000
|
||||
|
||||
Various changes preparing packages for RC0:
|
||||
- Verify and update package version numbers as needed
|
||||
- Implement versioning scheme
|
||||
- Change bug address to point to bugzilla bug entry form
|
||||
- Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to
|
||||
reenable it)
|
||||
- Fix makedepend to use pkgconfig and pass distcheck
|
||||
- Update build script to build macros first
|
||||
- Update modular Xorg version
|
||||
|
||||
commit cf687b775f580a84a4a8e962814abe7bc47a3c52
|
||||
Author: Daniel Stone <daniel@fooishbar.org>
|
||||
Date: Sat Jul 16 06:22:34 2005 +0000
|
||||
|
||||
Set soversion to 6.3.0.
|
||||
|
||||
commit 6d1704defa0e57715bd22d30d6e789b36233dcf8
|
||||
Author: Keith Packard <keithp@keithp.com>
|
||||
Date: Sat Jul 9 05:59:01 2005 +0000
|
||||
|
||||
Add .cvsignore files
|
||||
|
||||
commit 2b6b8e40a63dd69a13f87c19dcf8dc2f477c304d
|
||||
Author: Daniel Stone <daniel@fooishbar.org>
|
||||
Date: Sun Jul 3 07:00:55 2005 +0000
|
||||
|
||||
Add Xtrans definitions (FONT_t, TRANS_CLIENT) to clean up warnings.
|
||||
Add XSERV_t, TRANS_SERVER, TRANS_REOPEN to quash warnings.
|
||||
Add #include <dix-config.h> or <xorg-config.h>, as appropriate, to all
|
||||
source files in the xserver/xorg tree, predicated on defines of
|
||||
HAVE_{DIX,XORG}_CONFIG_H. Change all Xfont includes to
|
||||
<X11/fonts/foo.h>.
|
||||
|
||||
commit 608ad35f102b188f554daf8c160a5edcf4e8031c
|
||||
Author: Daniel Stone <daniel@fooishbar.org>
|
||||
Date: Fri Jun 10 14:11:36 2005 +0000
|
||||
|
||||
Remove pointless include of Xlib.h.
|
||||
Fix #include path to bigreqstr.h.
|
||||
|
||||
commit 795460992b0dcd4aa2591be462a94942415c6028
|
||||
Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>
|
||||
Date: Thu Jun 9 15:54:47 2005 +0000
|
||||
|
||||
Replace <X11/transport.c> with <X11/Xtrans/transport.c>
|
||||
|
||||
commit ae7b4cca6bd5c1f4edea8cde80d7a3dfaaf2c4d3
|
||||
Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>
|
||||
Date: Thu Jun 9 15:52:02 2005 +0000
|
||||
|
||||
Replace <X11/Xtrans.h> with <X11/Xtrans/Xtrans.h>
|
||||
Copy Xtrans.h to exports/include/X11/Xtrans only
|
||||
|
||||
commit a0637be926e6da5db8d131e7914f1300f484c626
|
||||
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
|
||||
Date: Sat May 21 23:07:47 2005 +0000
|
||||
|
||||
xtrans:
|
||||
Create autoconf macro XTRANS_CONNECTION_FLAGS to provide standard set of
|
||||
--enable flags for which transports to support and common place to
|
||||
update for required libraries for platforms that need certain libs for
|
||||
certain transports
|
||||
ICE:
|
||||
Add ICE_t #define required by Xtrans headers. Replace static defines of
|
||||
LOCALCONN & UNIXCONN with new XTRANS_CONNECTION_FLAGS macro.
|
||||
X11:
|
||||
Moved transport type checks to new macro XTRANS_CONNECTION_FLAGS in
|
||||
xtrans.m4 in xtrans module so they can be shared by all modules using
|
||||
xtrans.
|
||||
|
||||
commit efdb2468119be0c62a379d91088a708ca8d37e1b
|
||||
Author: Adam Jackson <ajax@nwnk.net>
|
||||
Date: Thu May 19 00:22:32 2005 +0000
|
||||
|
||||
revert last change, didn't do right thing at all, sorry for the noise
|
||||
|
||||
commit ccf4efa5e204d4569b9b590f72baae807ec19903
|
||||
Author: Adam Jackson <ajax@nwnk.net>
|
||||
Date: Thu May 19 00:10:02 2005 +0000
|
||||
|
||||
Require automake 1.7 in AM_INIT_AUTOMAKE
|
||||
|
||||
commit 3458da101c943530861485c798538ce014eee6b0
|
||||
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
|
||||
Date: Tue May 17 21:25:15 2005 +0000
|
||||
|
||||
- Conditionally include config.h in xc/lib/SM
|
||||
- Add libSM to symlink.sh
|
||||
- Add SM build system
|
||||
|
||||
commit cae06ca0ce523eeb9a667ce3ae5bff066cf6ecd7
|
||||
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
|
||||
Date: Tue May 17 20:53:58 2005 +0000
|
||||
|
||||
- Conditionally include config.h in the ICE source.
|
||||
- Add ICE to symlink.sh
|
||||
|
||||
commit 9dd90f8f8e29bb1dd6fe84b4b1d2d75ef91bc336
|
||||
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
|
||||
Date: Tue May 17 20:52:35 2005 +0000
|
||||
|
||||
Add ICE directory + build system.
|
||||
|
||||
commit d1cfe2a6d4a392f64b6b9d9255ec329fb2a6a39a
|
||||
Author: Daniel Stone <daniel@fooishbar.org>
|
||||
Date: Fri Jan 28 19:15:39 2005 +0000
|
||||
|
||||
Move _IceGetPeerName into the ICE public API as IceGetPeerName; bump ICE
|
||||
soversion to 6.4 accordingly. Change SM's use to the public version.
|
||||
The old version will be retained for compatibility.
|
||||
|
||||
commit 8f0babf8450aa8097e063e13c95b1581843b2dd8
|
||||
Author: Egbert Eich <eich@suse.de>
|
||||
Date: Fri Apr 23 18:43:22 2004 +0000
|
||||
|
||||
Merging XORG-CURRENT into trunk
|
||||
|
||||
commit 111949a4a1d5b62e26016b555e12f8862c90ae44
|
||||
Author: Egbert Eich <eich@suse.de>
|
||||
Date: Sun Mar 14 08:31:52 2004 +0000
|
||||
|
||||
Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
|
||||
|
||||
commit d4054eea34b2f4d345796ecadec8a96af93c4d0d
|
||||
Author: Egbert Eich <eich@suse.de>
|
||||
Date: Wed Mar 3 12:11:10 2004 +0000
|
||||
|
||||
Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
|
||||
|
||||
commit 569bf16d182b043e7ab914202d4195baf4a8413a
|
||||
Author: Egbert Eich <eich@suse.de>
|
||||
Date: Thu Feb 26 13:35:18 2004 +0000
|
||||
|
||||
readding XFree86's cvs IDs
|
||||
|
||||
commit 14c9e41e551ab1b3a00807dbb8f2f215b96bcc81
|
||||
Author: Egbert Eich <eich@suse.de>
|
||||
Date: Thu Feb 26 09:22:34 2004 +0000
|
||||
|
||||
Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
|
||||
|
||||
commit 45b73c360dc68b023194758bbb1cc59c021742a6
|
||||
Author: Kaleb Keithley <kaleb@freedesktop.org>
|
||||
Date: Thu Dec 4 22:02:52 2003 +0000
|
||||
|
||||
XFree86 4.3.99.901 (RC 1)
|
||||
|
||||
commit c919c3d0b355ef67dfa0b511eb1da488e5786d1b
|
||||
Author: Kaleb Keithley <kaleb@freedesktop.org>
|
||||
Date: Tue Nov 25 19:28:07 2003 +0000
|
||||
|
||||
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
|
||||
|
||||
commit 72e353567f8927996a26e72848d86f692c3f0737
|
||||
Author: Kaleb Keithley <kaleb@freedesktop.org>
|
||||
Date: Fri Nov 14 16:48:46 2003 +0000
|
||||
|
||||
XFree86 4.3.0.1
|
||||
|
||||
commit ee452992357329f7af846eba8f5bbe61c5d27bfa
|
||||
Author: Kaleb Keithley <kaleb@freedesktop.org>
|
||||
Date: Fri Nov 14 15:54:36 2003 +0000
|
||||
|
||||
R6.6 is the Xorg base-line
|
||||
229
lib/libICE/INSTALL
Normal file
229
lib/libICE/INSTALL
Normal file
@@ -0,0 +1,229 @@
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is free documentation; the Free Software Foundation gives
|
||||
unlimited permission to copy, distribute and modify it.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
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 only 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. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. 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.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. 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.
|
||||
|
||||
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=c89 CFLAGS=-O2 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 must use a version of `make' that
|
||||
supports the `VPATH' variable, such as 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 `..'.
|
||||
|
||||
If you have to use a `make' that does not support the `VPATH'
|
||||
variable, you have 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.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' 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.
|
||||
|
||||
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'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
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.
|
||||
|
||||
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 `--target=TYPE' option 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
|
||||
|
||||
will cause the specified gcc to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--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.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
||||
11
lib/libICE/Makefile.am
Normal file
11
lib/libICE/Makefile.am
Normal file
@@ -0,0 +1,11 @@
|
||||
SUBDIRS = src
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = ice.pc
|
||||
|
||||
EXTRA_DIST=ice.pc.in ChangeLog
|
||||
CLEANFILES = ChangeLog
|
||||
|
||||
ChangeLog: FORCE
|
||||
git-log > ChangeLog
|
||||
FORCE: ChangeLog
|
||||
662
lib/libICE/Makefile.in
Normal file
662
lib/libICE/Makefile.in
Normal file
@@ -0,0 +1,662 @@
|
||||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 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@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = .
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
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@
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(srcdir)/ice.pc.in $(top_srcdir)/configure AUTHORS COPYING \
|
||||
ChangeLog INSTALL NEWS config.guess config.sub depcomp \
|
||||
install-sh ltmain.sh missing
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno configure.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = ice.pc
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-exec-recursive install-info-recursive \
|
||||
install-recursive installcheck-recursive installdirs-recursive \
|
||||
pdf-recursive ps-recursive uninstall-info-recursive \
|
||||
uninstall-recursive
|
||||
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 = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
|
||||
pkgconfigDATA_INSTALL = $(INSTALL_DATA)
|
||||
DATA = $(pkgconfig_DATA)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
ICE_CFLAGS = @ICE_CFLAGS@
|
||||
ICE_LIBS = @ICE_LIBS@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XTRANS_CFLAGS = @XTRANS_CFLAGS@
|
||||
XTRANS_LIBS = @XTRANS_LIBS@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
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@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
SUBDIRS = src
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = ice.pc
|
||||
EXTRA_DIST = ice.pc.in ChangeLog
|
||||
CLEANFILES = ChangeLog
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh:
|
||||
@:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
|
||||
cd $(srcdir) && $(AUTOMAKE) --gnu \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) stamp-h1; \
|
||||
else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
ice.pc: $(top_builddir)/config.status $(srcdir)/ice.pc.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
install-pkgconfigDATA: $(pkgconfig_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(pkgconfigdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfigdir)"
|
||||
@list='$(pkgconfig_DATA)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
|
||||
$(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-pkgconfigDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkgconfig_DATA)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
|
||||
done
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
mkdir $(distdir)
|
||||
$(mkdir_p) $(distdir)/.
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(mkdir_p) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
|
||||
distuninstallcheck:
|
||||
@cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile $(DATA) config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgconfigDATA
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-pkgconfigDATA
|
||||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
|
||||
check-am clean clean-generic clean-libtool clean-recursive \
|
||||
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
|
||||
dist-shar dist-tarZ dist-zip distcheck distclean \
|
||||
distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-recursive distclean-tags distcleancheck distdir \
|
||||
distuninstallcheck dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am install-man \
|
||||
install-pkgconfigDATA install-strip installcheck \
|
||||
installcheck-am installdirs installdirs-am maintainer-clean \
|
||||
maintainer-clean-generic maintainer-clean-recursive \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool \
|
||||
mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
|
||||
uninstall uninstall-am uninstall-info-am \
|
||||
uninstall-pkgconfigDATA
|
||||
|
||||
|
||||
ChangeLog: FORCE
|
||||
git-log > ChangeLog
|
||||
FORCE: ChangeLog
|
||||
# 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:
|
||||
0
lib/libICE/NEWS
Normal file
0
lib/libICE/NEWS
Normal file
0
lib/libICE/README
Normal file
0
lib/libICE/README
Normal file
7607
lib/libICE/aclocal.m4
vendored
Normal file
7607
lib/libICE/aclocal.m4
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1411
lib/libICE/config.guess
vendored
Normal file
1411
lib/libICE/config.guess
vendored
Normal file
File diff suppressed because it is too large
Load Diff
73
lib/libICE/config.h.in
Normal file
73
lib/libICE/config.h.in
Normal file
@@ -0,0 +1,73 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if `struct sockaddr_in' has a `sin_len' member */
|
||||
#undef BSD44SOCKETS
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* 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 <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Xtrans transport type */
|
||||
#undef ICE_t
|
||||
|
||||
/* Support IPv6 for TCP connections */
|
||||
#undef IPv6
|
||||
|
||||
/* 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 version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Support TCP socket connections */
|
||||
#undef TCPCONN
|
||||
|
||||
/* Support UNIX socket connections */
|
||||
#undef UNIXCONN
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
1500
lib/libICE/config.sub
vendored
Normal file
1500
lib/libICE/config.sub
vendored
Normal file
File diff suppressed because it is too large
Load Diff
22102
lib/libICE/configure
vendored
Normal file
22102
lib/libICE/configure
vendored
Normal file
File diff suppressed because it is too large
Load Diff
50
lib/libICE/configure.ac
Normal file
50
lib/libICE/configure.ac
Normal file
@@ -0,0 +1,50 @@
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT([libICE],
|
||||
1.0.2,
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
||||
libICE)
|
||||
|
||||
AC_CONFIG_SRCDIR([Makefile.am])
|
||||
AM_INIT_AUTOMAKE([dist-bzip2])
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AM_CONFIG_HEADER([config.h])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_CC
|
||||
|
||||
# Checks for pkg-config packages
|
||||
PKG_CHECK_MODULES(ICE, xproto)
|
||||
AC_SUBST(ICE_CFLAGS)
|
||||
AC_SUBST(ICE_LIBS)
|
||||
|
||||
PKG_CHECK_MODULES(XTRANS, xtrans)
|
||||
AC_SUBST(XTRANS_CFLAGS)
|
||||
AC_SUBST(XTRANS_LIBS)
|
||||
|
||||
# Transport selection macro from xtrans.m4
|
||||
XTRANS_CONNECTION_FLAGS
|
||||
AC_DEFINE(ICE_t, 1, [Xtrans transport type])
|
||||
|
||||
# Checks for libraries.
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
||||
if test "x$GCC" = "xyes"; then
|
||||
GCC_WARNINGS="-Wall -Wpointer-arith -Wstrict-prototypes \
|
||||
-Wmissing-prototypes -Wmissing-declarations \
|
||||
-Wnested-externs -fno-strict-aliasing"
|
||||
CFLAGS="$GCC_WARNINGS $CFLAGS"
|
||||
fi
|
||||
|
||||
XORG_RELEASE_VERSION
|
||||
|
||||
AC_OUTPUT([Makefile
|
||||
src/Makefile
|
||||
ice.pc])
|
||||
530
lib/libICE/depcomp
Normal file
530
lib/libICE/depcomp
Normal file
@@ -0,0 +1,530 @@
|
||||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2005-07-09.11
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# 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 outputing dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
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"
|
||||
|
||||
# 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
|
||||
|
||||
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.
|
||||
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## 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).
|
||||
## - 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 -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## 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.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" |
|
||||
## 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.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -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 -eq 0; then :
|
||||
else
|
||||
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 ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> $depfile
|
||||
echo >> $depfile
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> $depfile
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
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.
|
||||
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test -f "$tmpdepfile"; then :
|
||||
else
|
||||
stripped=`echo "$stripped" | sed 's,^.*/,,'`
|
||||
tmpdepfile="$stripped.u"
|
||||
fi
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
outname="$stripped.o"
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
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"
|
||||
;;
|
||||
|
||||
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.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# With Tru64 cc, shared objects can also be used to make a
|
||||
# static library. This mecanism is used in libtool 1.4 series to
|
||||
# handle both shared and static libraries in a single compilation.
|
||||
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||
#
|
||||
# With libtool 1.5 this exception was removed, and libtool now
|
||||
# generates 2 separate objects for the 2 libraries. These two
|
||||
# compilations output dependencies in 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.libs/$base.lo.d # libtool 1.4
|
||||
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.o.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
tmpdepfile4=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
#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 $1 != '--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:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
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 $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
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.
|
||||
-*|$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"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
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 $1 != '--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, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
11
lib/libICE/ice.pc.in
Normal file
11
lib/libICE/ice.pc.in
Normal file
@@ -0,0 +1,11 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: ICE
|
||||
Description: X Inter Client Exchange Library
|
||||
Version: @PACKAGE_VERSION@
|
||||
Requires: xproto
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lICE
|
||||
102
lib/libICE/include/X11/ICE/ICE.h
Normal file
102
lib/libICE/include/X11/ICE/ICE.h
Normal file
@@ -0,0 +1,102 @@
|
||||
/* $Xorg: ICE.h,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef _ICE_H_
|
||||
#define _ICE_H_
|
||||
|
||||
/*
|
||||
* Protocol Version
|
||||
*/
|
||||
|
||||
#define IceProtoMajor 1
|
||||
#define IceProtoMinor 0
|
||||
|
||||
|
||||
/*
|
||||
* Byte Order
|
||||
*/
|
||||
|
||||
#define IceLSBfirst 0
|
||||
#define IceMSBfirst 1
|
||||
|
||||
|
||||
/*
|
||||
* ICE minor opcodes
|
||||
*/
|
||||
|
||||
#define ICE_Error 0
|
||||
#define ICE_ByteOrder 1
|
||||
#define ICE_ConnectionSetup 2
|
||||
#define ICE_AuthRequired 3
|
||||
#define ICE_AuthReply 4
|
||||
#define ICE_AuthNextPhase 5
|
||||
#define ICE_ConnectionReply 6
|
||||
#define ICE_ProtocolSetup 7
|
||||
#define ICE_ProtocolReply 8
|
||||
#define ICE_Ping 9
|
||||
#define ICE_PingReply 10
|
||||
#define ICE_WantToClose 11
|
||||
#define ICE_NoClose 12
|
||||
|
||||
|
||||
/*
|
||||
* Error severity
|
||||
*/
|
||||
|
||||
#define IceCanContinue 0
|
||||
#define IceFatalToProtocol 1
|
||||
#define IceFatalToConnection 2
|
||||
|
||||
|
||||
/*
|
||||
* ICE error classes that are common to all protocols
|
||||
*/
|
||||
|
||||
#define IceBadMinor 0x8000
|
||||
#define IceBadState 0x8001
|
||||
#define IceBadLength 0x8002
|
||||
#define IceBadValue 0x8003
|
||||
|
||||
|
||||
/*
|
||||
* ICE error classes that are specific to the ICE protocol
|
||||
*/
|
||||
|
||||
#define IceBadMajor 0
|
||||
#define IceNoAuth 1
|
||||
#define IceNoVersion 2
|
||||
#define IceSetupFailed 3
|
||||
#define IceAuthRejected 4
|
||||
#define IceAuthFailed 5
|
||||
#define IceProtocolDuplicate 6
|
||||
#define IceMajorOpcodeDuplicate 7
|
||||
#define IceUnknownProtocol 8
|
||||
|
||||
#endif /* _ICE_H_ */
|
||||
251
lib/libICE/include/X11/ICE/ICEconn.h
Normal file
251
lib/libICE/include/X11/ICE/ICEconn.h
Normal file
@@ -0,0 +1,251 @@
|
||||
/* $Xorg: ICEconn.h,v 1.5 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef _ICECONN_H_
|
||||
#define _ICECONN_H_
|
||||
|
||||
#include <X11/ICE/ICElib.h>
|
||||
|
||||
/*
|
||||
* Data structures for ICE connection object
|
||||
*/
|
||||
|
||||
typedef struct _IceSavedReplyWait {
|
||||
IceReplyWaitInfo *reply_wait;
|
||||
Bool reply_ready;
|
||||
struct _IceSavedReplyWait *next;
|
||||
} _IceSavedReplyWait;
|
||||
|
||||
typedef struct _IcePingWait {
|
||||
IcePingReplyProc ping_reply_proc;
|
||||
IcePointer client_data;
|
||||
struct _IcePingWait *next;
|
||||
} _IcePingWait;
|
||||
|
||||
typedef struct {
|
||||
char *vendor;
|
||||
char *release;
|
||||
int version_count;
|
||||
IcePoVersionRec *version_recs;
|
||||
int auth_count;
|
||||
char **auth_names;
|
||||
IcePoAuthProc *auth_procs;
|
||||
IceIOErrorProc io_error_proc;
|
||||
} _IcePoProtocol;
|
||||
|
||||
typedef struct {
|
||||
char *vendor;
|
||||
char *release;
|
||||
int version_count;
|
||||
IcePaVersionRec *version_recs;
|
||||
IceProtocolSetupProc protocol_setup_proc;
|
||||
IceProtocolActivateProc protocol_activate_proc;
|
||||
int auth_count;
|
||||
char **auth_names;
|
||||
IcePaAuthProc *auth_procs;
|
||||
IceHostBasedAuthProc host_based_auth_proc;
|
||||
IceIOErrorProc io_error_proc;
|
||||
} _IcePaProtocol;
|
||||
|
||||
typedef struct {
|
||||
char *protocol_name;
|
||||
_IcePoProtocol *orig_client;
|
||||
_IcePaProtocol *accept_client;
|
||||
} _IceProtocol;
|
||||
|
||||
typedef struct {
|
||||
Bool in_use;
|
||||
int my_opcode;
|
||||
_IceProtocol *protocol;
|
||||
IcePointer client_data;
|
||||
Bool accept_flag;
|
||||
union {
|
||||
IcePaProcessMsgProc accept_client;
|
||||
IcePoProcessMsgProc orig_client;
|
||||
} process_msg_proc;
|
||||
} _IceProcessMsgInfo;
|
||||
|
||||
typedef struct {
|
||||
int his_version_index;
|
||||
int my_version_index;
|
||||
char *his_vendor;
|
||||
char *his_release;
|
||||
char my_auth_index;
|
||||
IcePointer my_auth_state;
|
||||
Bool must_authenticate;
|
||||
} _IceConnectToMeInfo;
|
||||
|
||||
typedef struct {
|
||||
int his_opcode;
|
||||
int my_opcode;
|
||||
int his_version_index;
|
||||
int my_version_index;
|
||||
char *his_vendor;
|
||||
char *his_release;
|
||||
char my_auth_index;
|
||||
IcePointer my_auth_state;
|
||||
Bool must_authenticate;
|
||||
} _IceProtoSetupToMeInfo;
|
||||
|
||||
typedef struct {
|
||||
Bool auth_active;
|
||||
char my_auth_index;
|
||||
IcePointer my_auth_state;
|
||||
} _IceConnectToYouInfo;
|
||||
|
||||
typedef struct {
|
||||
int my_opcode;
|
||||
int my_auth_count;
|
||||
int *my_auth_indices;
|
||||
Bool auth_active;
|
||||
char my_auth_index;
|
||||
IcePointer my_auth_state;
|
||||
} _IceProtoSetupToYouInfo;
|
||||
|
||||
|
||||
struct _IceConn {
|
||||
|
||||
unsigned int io_ok : 1; /* did an IO error occur? */
|
||||
unsigned int swap : 1; /* do we need to swap on reads? */
|
||||
unsigned int waiting_for_byteorder : 1; /* waiting for a ByteOrder msg? */
|
||||
unsigned int skip_want_to_close : 1; /* avoid shutdown negotiation? */
|
||||
unsigned int want_to_close : 1; /* did we send a WantToClose? */
|
||||
unsigned int free_asap : 1; /* free as soon as possible */
|
||||
unsigned int unused1 : 2; /* future use */
|
||||
unsigned int unused2 : 8; /* future use */
|
||||
|
||||
IceConnectStatus connection_status; /* pending, accepted, rejected */
|
||||
|
||||
unsigned char my_ice_version_index; /* which version are we using? */
|
||||
|
||||
struct _XtransConnInfo *trans_conn; /* transport connection object */
|
||||
unsigned long send_sequence; /* Sequence # of last msg sent */
|
||||
unsigned long receive_sequence; /* Sequence # of last msg received */
|
||||
|
||||
char *connection_string; /* network connection string */
|
||||
char *vendor; /* other client's vendor */
|
||||
char *release; /* other client's release */
|
||||
|
||||
char *inbuf; /* Input buffer starting address */
|
||||
char *inbufptr; /* Input buffer index pointer */
|
||||
char *inbufmax; /* Input buffer maximum+1 address */
|
||||
|
||||
char *outbuf; /* Output buffer starting address */
|
||||
char *outbufptr; /* Output buffer index pointer */
|
||||
char *outbufmax; /* Output buffer maximum+1 address */
|
||||
|
||||
char *scratch; /* scratch buffer */
|
||||
unsigned long scratch_size; /* scratch size */
|
||||
|
||||
int dispatch_level; /* IceProcessMessages dispatch level */
|
||||
|
||||
IcePointer context; /* context associated with caller
|
||||
of IceOpenConnection */
|
||||
|
||||
/*
|
||||
* Before we read a message, the major opcode of the message must be
|
||||
* mapped to our corresponding major opcode (the two clients can use
|
||||
* different opcodes for the same protocol). In order to save space,
|
||||
* we keep track of the mininum and maximum major opcodes used by the
|
||||
* other client. To get the information on how to process this message,
|
||||
* we do the following...
|
||||
*
|
||||
* processMsgInfo = iceConn->process_msg_info[
|
||||
* message->majorOpcode - iceConn->his_min_opcode]
|
||||
*
|
||||
* Note that the number of elements in the iceConn->process_msg_info
|
||||
* array is always (iceConn->his_max_opcode - iceConn->his_min_opcode + 1).
|
||||
* We check process_msg_info->in_use to see if the opcode is being used.
|
||||
*/
|
||||
|
||||
_IceProcessMsgInfo *process_msg_info;
|
||||
char his_min_opcode; /* [1..255] */
|
||||
char his_max_opcode; /* [1..255] */
|
||||
|
||||
|
||||
/*
|
||||
* Number of times this iceConn was returned in IceOpenConnection
|
||||
* or IceAcceptConnection.
|
||||
*/
|
||||
|
||||
unsigned char open_ref_count;
|
||||
|
||||
|
||||
/*
|
||||
* Number of active protocols.
|
||||
*/
|
||||
|
||||
unsigned char proto_ref_count;
|
||||
|
||||
|
||||
/*
|
||||
* If this ICE connection was created with IceAcceptConnection,
|
||||
* the listen_obj field is set to the listen object. Otherwise,
|
||||
* the listen_obj field is NULL.
|
||||
*/
|
||||
|
||||
IceListenObj listen_obj;
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* We need to keep track of all the replies we're waiting for.
|
||||
* Check the comments in process.c for how this works.
|
||||
*/
|
||||
|
||||
_IceSavedReplyWait *saved_reply_waits;
|
||||
|
||||
|
||||
/*
|
||||
* We keep track of all Pings sent from the client. When the Ping reply
|
||||
* arrives, we remove it from the list.
|
||||
*/
|
||||
|
||||
_IcePingWait *ping_waits;
|
||||
|
||||
|
||||
/*
|
||||
* Some state for a client doing a Connection/Protocol Setup
|
||||
*/
|
||||
|
||||
_IceConnectToYouInfo *connect_to_you;
|
||||
_IceProtoSetupToYouInfo *protosetup_to_you;
|
||||
|
||||
|
||||
/*
|
||||
* Some state for a client receiving a Connection/Protocol Setup
|
||||
*/
|
||||
|
||||
_IceConnectToMeInfo *connect_to_me;
|
||||
_IceProtoSetupToMeInfo *protosetup_to_me;
|
||||
|
||||
};
|
||||
|
||||
#endif /* _ICECONN_H_ */
|
||||
433
lib/libICE/include/X11/ICE/ICElib.h
Normal file
433
lib/libICE/include/X11/ICE/ICElib.h
Normal file
@@ -0,0 +1,433 @@
|
||||
/* $Xorg: ICElib.h,v 1.5 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
/* $XFree86: xc/lib/ICE/ICElib.h,v 3.4 2001/12/14 19:53:35 dawes Exp $ */
|
||||
|
||||
#ifndef _ICELIB_H_
|
||||
#define _ICELIB_H_
|
||||
|
||||
#include <X11/ICE/ICE.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
#define Bool int
|
||||
#define Status int
|
||||
#define True 1
|
||||
#define False 0
|
||||
|
||||
typedef void *IcePointer;
|
||||
|
||||
typedef enum {
|
||||
IcePoAuthHaveReply,
|
||||
IcePoAuthRejected,
|
||||
IcePoAuthFailed,
|
||||
IcePoAuthDoneCleanup
|
||||
} IcePoAuthStatus;
|
||||
|
||||
typedef enum {
|
||||
IcePaAuthContinue,
|
||||
IcePaAuthAccepted,
|
||||
IcePaAuthRejected,
|
||||
IcePaAuthFailed
|
||||
} IcePaAuthStatus;
|
||||
|
||||
typedef enum {
|
||||
IceConnectPending,
|
||||
IceConnectAccepted,
|
||||
IceConnectRejected,
|
||||
IceConnectIOError
|
||||
} IceConnectStatus;
|
||||
|
||||
typedef enum {
|
||||
IceProtocolSetupSuccess,
|
||||
IceProtocolSetupFailure,
|
||||
IceProtocolSetupIOError,
|
||||
IceProtocolAlreadyActive
|
||||
} IceProtocolSetupStatus;
|
||||
|
||||
typedef enum {
|
||||
IceAcceptSuccess,
|
||||
IceAcceptFailure,
|
||||
IceAcceptBadMalloc
|
||||
} IceAcceptStatus;
|
||||
|
||||
typedef enum {
|
||||
IceClosedNow,
|
||||
IceClosedASAP,
|
||||
IceConnectionInUse,
|
||||
IceStartedShutdownNegotiation
|
||||
} IceCloseStatus;
|
||||
|
||||
typedef enum {
|
||||
IceProcessMessagesSuccess,
|
||||
IceProcessMessagesIOError,
|
||||
IceProcessMessagesConnectionClosed
|
||||
} IceProcessMessagesStatus;
|
||||
|
||||
typedef struct {
|
||||
unsigned long sequence_of_request;
|
||||
int major_opcode_of_request;
|
||||
int minor_opcode_of_request;
|
||||
IcePointer reply;
|
||||
} IceReplyWaitInfo;
|
||||
|
||||
typedef struct _IceConn *IceConn;
|
||||
typedef struct _IceListenObj *IceListenObj;
|
||||
|
||||
typedef void (*IceWatchProc) (
|
||||
IceConn /* iceConn */,
|
||||
IcePointer /* clientData */,
|
||||
Bool /* opening */,
|
||||
IcePointer * /* watchData */
|
||||
);
|
||||
|
||||
typedef void (*IcePoProcessMsgProc) (
|
||||
IceConn /* iceConn */,
|
||||
IcePointer /* clientData */,
|
||||
int /* opcode */,
|
||||
unsigned long /* length */,
|
||||
Bool /* swap */,
|
||||
IceReplyWaitInfo * /* replyWait */,
|
||||
Bool * /* replyReadyRet */
|
||||
);
|
||||
|
||||
typedef void (*IcePaProcessMsgProc) (
|
||||
IceConn /* iceConn */,
|
||||
IcePointer /* clientData */,
|
||||
int /* opcode */,
|
||||
unsigned long /* length */,
|
||||
Bool /* swap */
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
int major_version;
|
||||
int minor_version;
|
||||
IcePoProcessMsgProc process_msg_proc;
|
||||
} IcePoVersionRec;
|
||||
|
||||
typedef struct {
|
||||
int major_version;
|
||||
int minor_version;
|
||||
IcePaProcessMsgProc process_msg_proc;
|
||||
} IcePaVersionRec;
|
||||
|
||||
typedef IcePoAuthStatus (*IcePoAuthProc) (
|
||||
IceConn /* iceConn */,
|
||||
IcePointer * /* authStatePtr */,
|
||||
Bool /* cleanUp */,
|
||||
Bool /* swap */,
|
||||
int /* authDataLen */,
|
||||
IcePointer /* authData */,
|
||||
int * /* replyDataLenRet */,
|
||||
IcePointer * /* replyDataRet */,
|
||||
char ** /* errorStringRet */
|
||||
);
|
||||
|
||||
typedef IcePaAuthStatus (*IcePaAuthProc) (
|
||||
IceConn /* iceConn */,
|
||||
IcePointer * /* authStatePtr */,
|
||||
Bool /* swap */,
|
||||
int /* authDataLen */,
|
||||
IcePointer /* authData */,
|
||||
int * /* replyDataLenRet */,
|
||||
IcePointer * /* replyDataRet */,
|
||||
char ** /* errorStringRet */
|
||||
);
|
||||
|
||||
typedef Bool (*IceHostBasedAuthProc) (
|
||||
char * /* hostName */
|
||||
);
|
||||
|
||||
typedef Status (*IceProtocolSetupProc) (
|
||||
IceConn /* iceConn */,
|
||||
int /* majorVersion */,
|
||||
int /* minorVersion */,
|
||||
char * /* vendor */,
|
||||
char * /* release */,
|
||||
IcePointer * /* clientDataRet */,
|
||||
char ** /* failureReasonRet */
|
||||
);
|
||||
|
||||
typedef void (*IceProtocolActivateProc) (
|
||||
IceConn /* iceConn */,
|
||||
IcePointer /* clientData */
|
||||
);
|
||||
|
||||
typedef void (*IceIOErrorProc) (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
typedef void (*IcePingReplyProc) (
|
||||
IceConn /* iceConn */,
|
||||
IcePointer /* clientData */
|
||||
);
|
||||
|
||||
typedef void (*IceErrorHandler) (
|
||||
IceConn /* iceConn */,
|
||||
Bool /* swap */,
|
||||
int /* offendingMinorOpcode */,
|
||||
unsigned long /* offendingSequence */,
|
||||
int /* errorClass */,
|
||||
int /* severity */,
|
||||
IcePointer /* values */
|
||||
);
|
||||
|
||||
typedef void (*IceIOErrorHandler) (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* Function prototypes
|
||||
*/
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern int IceRegisterForProtocolSetup (
|
||||
char * /* protocolName */,
|
||||
char * /* vendor */,
|
||||
char * /* release */,
|
||||
int /* versionCount */,
|
||||
IcePoVersionRec * /* versionRecs */,
|
||||
int /* authCount */,
|
||||
char ** /* authNames */,
|
||||
IcePoAuthProc * /* authProcs */,
|
||||
IceIOErrorProc /* IOErrorProc */
|
||||
);
|
||||
|
||||
extern int IceRegisterForProtocolReply (
|
||||
char * /* protocolName */,
|
||||
char * /* vendor */,
|
||||
char * /* release */,
|
||||
int /* versionCount */,
|
||||
IcePaVersionRec * /* versionRecs */,
|
||||
int /* authCount */,
|
||||
char ** /* authNames */,
|
||||
IcePaAuthProc * /* authProcs */,
|
||||
IceHostBasedAuthProc /* hostBasedAuthProc */,
|
||||
IceProtocolSetupProc /* protocolSetupProc */,
|
||||
IceProtocolActivateProc /* protocolActivateProc */,
|
||||
IceIOErrorProc /* IOErrorProc */
|
||||
);
|
||||
|
||||
extern IceConn IceOpenConnection (
|
||||
char * /* networkIdsList */,
|
||||
IcePointer /* context */,
|
||||
Bool /* mustAuthenticate */,
|
||||
int /* majorOpcodeCheck */,
|
||||
int /* errorLength */,
|
||||
char * /* errorStringRet */
|
||||
);
|
||||
|
||||
extern IcePointer IceGetConnectionContext (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern Status IceListenForConnections (
|
||||
int * /* countRet */,
|
||||
IceListenObj ** /* listenObjsRet */,
|
||||
int /* errorLength */,
|
||||
char * /* errorStringRet */
|
||||
);
|
||||
|
||||
extern Status IceListenForWellKnownConnections (
|
||||
char * /* port */,
|
||||
int * /* countRet */,
|
||||
IceListenObj ** /* listenObjsRet */,
|
||||
int /* errorLength */,
|
||||
char * /* errorStringRet */
|
||||
);
|
||||
|
||||
extern int IceGetListenConnectionNumber (
|
||||
IceListenObj /* listenObj */
|
||||
);
|
||||
|
||||
extern char *IceGetListenConnectionString (
|
||||
IceListenObj /* listenObj */
|
||||
);
|
||||
|
||||
extern char *IceComposeNetworkIdList (
|
||||
int /* count */,
|
||||
IceListenObj * /* listenObjs */
|
||||
);
|
||||
|
||||
extern void IceFreeListenObjs (
|
||||
int /* count */,
|
||||
IceListenObj * /* listenObjs */
|
||||
);
|
||||
|
||||
extern void IceSetHostBasedAuthProc (
|
||||
IceListenObj /* listenObj */,
|
||||
IceHostBasedAuthProc /* hostBasedAuthProc */
|
||||
);
|
||||
|
||||
extern IceConn IceAcceptConnection (
|
||||
IceListenObj /* listenObj */,
|
||||
IceAcceptStatus * /* statusRet */
|
||||
);
|
||||
|
||||
extern void IceSetShutdownNegotiation (
|
||||
IceConn /* iceConn */,
|
||||
Bool /* negotiate */
|
||||
);
|
||||
|
||||
extern Bool IceCheckShutdownNegotiation (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern IceCloseStatus IceCloseConnection (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern Status IceAddConnectionWatch (
|
||||
IceWatchProc /* watchProc */,
|
||||
IcePointer /* clientData */
|
||||
);
|
||||
|
||||
extern void IceRemoveConnectionWatch (
|
||||
IceWatchProc /* watchProc */,
|
||||
IcePointer /* clientData */
|
||||
);
|
||||
|
||||
extern IceProtocolSetupStatus IceProtocolSetup (
|
||||
IceConn /* iceConn */,
|
||||
int /* myOpcode */,
|
||||
IcePointer /* clientData */,
|
||||
Bool /* mustAuthenticate */,
|
||||
int * /* majorVersionRet */,
|
||||
int * /* minorVersionRet */,
|
||||
char ** /* vendorRet */,
|
||||
char ** /* releaseRet */,
|
||||
int /* errorLength */,
|
||||
char * /* errorStringRet */
|
||||
);
|
||||
|
||||
extern Status IceProtocolShutdown (
|
||||
IceConn /* iceConn */,
|
||||
int /* majorOpcode */
|
||||
);
|
||||
|
||||
extern IceProcessMessagesStatus IceProcessMessages (
|
||||
IceConn /* iceConn */,
|
||||
IceReplyWaitInfo * /* replyWait */,
|
||||
Bool * /* replyReadyRet */
|
||||
);
|
||||
|
||||
extern Status IcePing (
|
||||
IceConn /* iceConn */,
|
||||
IcePingReplyProc /* pingReplyProc */,
|
||||
IcePointer /* clientData */
|
||||
);
|
||||
|
||||
extern char *IceAllocScratch (
|
||||
IceConn /* iceConn */,
|
||||
unsigned long /* size */
|
||||
);
|
||||
|
||||
extern int IceFlush (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern int IceGetOutBufSize (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern int IceGetInBufSize (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern IceConnectStatus IceConnectionStatus (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern char *IceVendor (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern char *IceRelease (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern int IceProtocolVersion (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern int IceProtocolRevision (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern int IceConnectionNumber (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern char *IceConnectionString (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern unsigned long IceLastSentSequenceNumber (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern unsigned long IceLastReceivedSequenceNumber (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern Bool IceSwapping (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern IceErrorHandler IceSetErrorHandler (
|
||||
IceErrorHandler /* handler */
|
||||
);
|
||||
|
||||
extern IceIOErrorHandler IceSetIOErrorHandler (
|
||||
IceIOErrorHandler /* handler */
|
||||
);
|
||||
|
||||
extern char *IceGetPeerName (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
/*
|
||||
* Multithread Routines
|
||||
*/
|
||||
|
||||
extern Status IceInitThreads (
|
||||
void
|
||||
);
|
||||
|
||||
extern void IceAppLockConn (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern void IceAppUnlockConn (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _ICELIB_H_ */
|
||||
295
lib/libICE/include/X11/ICE/ICEmsg.h
Normal file
295
lib/libICE/include/X11/ICE/ICEmsg.h
Normal file
@@ -0,0 +1,295 @@
|
||||
/* $Xorg: ICEmsg.h,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
/* $XFree86: xc/lib/ICE/ICEmsg.h,v 1.4 2001/12/20 19:40:59 tsi Exp $ */
|
||||
|
||||
#ifndef _ICEMSG_H_
|
||||
#define _ICEMSG_H_
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
#include <X11/ICE/ICEconn.h>
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
/*
|
||||
* Function prototypes for internal ICElib functions
|
||||
*/
|
||||
|
||||
extern Status _IceRead (
|
||||
IceConn /* iceConn */,
|
||||
unsigned long /* nbytes */,
|
||||
char * /* ptr */
|
||||
);
|
||||
|
||||
extern void _IceReadSkip (
|
||||
IceConn /* iceConn */,
|
||||
unsigned long /* nbytes */
|
||||
);
|
||||
|
||||
extern void _IceWrite (
|
||||
IceConn /* iceConn */,
|
||||
unsigned long /* nbytes */,
|
||||
char * /* ptr */
|
||||
);
|
||||
|
||||
|
||||
extern void _IceErrorBadMinor (
|
||||
IceConn /* iceConn */,
|
||||
int /* majorOpcode */,
|
||||
int /* offendingMinor */,
|
||||
int /* severity */
|
||||
);
|
||||
|
||||
extern void _IceErrorBadState (
|
||||
IceConn /* iceConn */,
|
||||
int /* majorOpcode */,
|
||||
int /* offendingMinor */,
|
||||
int /* severity */
|
||||
);
|
||||
|
||||
extern void _IceErrorBadLength (
|
||||
IceConn /* iceConn */,
|
||||
int /* majorOpcode */,
|
||||
int /* offendingMinor */,
|
||||
int /* severity */
|
||||
);
|
||||
|
||||
extern void _IceErrorBadValue (
|
||||
IceConn /* iceConn */,
|
||||
int /* majorOpcode */,
|
||||
int /* offendingMinor */,
|
||||
int /* offset */,
|
||||
int /* length */,
|
||||
IcePointer /* value */
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* Macro to check if IO operations are valid on an ICE connection.
|
||||
*/
|
||||
|
||||
#define IceValidIO(_iceConn) _iceConn->io_ok
|
||||
|
||||
|
||||
/*
|
||||
* Macros for writing messages.
|
||||
*/
|
||||
|
||||
#define IceGetHeader(_iceConn, _major, _minor, _headerSize, _msgType, _pMsg) \
|
||||
if ((_iceConn->outbufptr + _headerSize) > _iceConn->outbufmax) \
|
||||
IceFlush (_iceConn); \
|
||||
_pMsg = (_msgType *) _iceConn->outbufptr; \
|
||||
_pMsg->majorOpcode = _major; \
|
||||
_pMsg->minorOpcode = _minor; \
|
||||
_pMsg->length = (_headerSize - SIZEOF (iceMsg)) >> 3; \
|
||||
_iceConn->outbufptr += _headerSize; \
|
||||
_iceConn->send_sequence++
|
||||
|
||||
#define IceGetHeaderExtra(_iceConn, _major, _minor, _headerSize, _extra, _msgType, _pMsg, _pData) \
|
||||
if ((_iceConn->outbufptr + \
|
||||
_headerSize + ((_extra) << 3)) > _iceConn->outbufmax) \
|
||||
IceFlush (_iceConn); \
|
||||
_pMsg = (_msgType *) _iceConn->outbufptr; \
|
||||
if ((_iceConn->outbufptr + \
|
||||
_headerSize + ((_extra) << 3)) <= _iceConn->outbufmax) \
|
||||
_pData = (char *) _pMsg + _headerSize; \
|
||||
else \
|
||||
_pData = NULL; \
|
||||
_pMsg->majorOpcode = _major; \
|
||||
_pMsg->minorOpcode = _minor; \
|
||||
_pMsg->length = ((_headerSize - SIZEOF (iceMsg)) >> 3) + (_extra); \
|
||||
_iceConn->outbufptr += (_headerSize + ((_extra) << 3)); \
|
||||
_iceConn->send_sequence++
|
||||
|
||||
#define IceSimpleMessage(_iceConn, _major, _minor) \
|
||||
{ \
|
||||
iceMsg *_pMsg; \
|
||||
IceGetHeader (_iceConn, _major, _minor, SIZEOF (iceMsg), iceMsg, _pMsg); \
|
||||
}
|
||||
|
||||
#define IceErrorHeader(_iceConn, _offendingMajorOpcode, _offendingMinorOpcode, _offendingSequenceNum, _severity, _errorClass, _dataLength) \
|
||||
{ \
|
||||
iceErrorMsg *_pMsg; \
|
||||
\
|
||||
IceGetHeader (_iceConn, _offendingMajorOpcode, ICE_Error, \
|
||||
SIZEOF (iceErrorMsg), iceErrorMsg, _pMsg); \
|
||||
_pMsg->length += (_dataLength); \
|
||||
_pMsg->offendingMinorOpcode = _offendingMinorOpcode; \
|
||||
_pMsg->severity = _severity; \
|
||||
_pMsg->offendingSequenceNum = _offendingSequenceNum; \
|
||||
_pMsg->errorClass = _errorClass; \
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Write data into the ICE output buffer.
|
||||
*/
|
||||
|
||||
#define IceWriteData(_iceConn, _bytes, _data) \
|
||||
{ \
|
||||
if ((_iceConn->outbufptr + (_bytes)) > _iceConn->outbufmax) \
|
||||
{ \
|
||||
IceFlush (_iceConn); \
|
||||
_IceWrite (_iceConn, (unsigned long) (_bytes), _data); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
memcpy (_iceConn->outbufptr, _data, _bytes); \
|
||||
_iceConn->outbufptr += (_bytes); \
|
||||
} \
|
||||
}
|
||||
|
||||
#ifndef WORD64
|
||||
|
||||
#define IceWriteData16(_iceConn, _bytes, _data) \
|
||||
IceWriteData (_iceConn, _bytes, (char *) _data)
|
||||
|
||||
#define IceWriteData32(_iceConn, _bytes, _data) \
|
||||
IceWriteData (_iceConn, _bytes, (char *) _data)
|
||||
|
||||
#else /* WORD64 */
|
||||
|
||||
/* IceWriteData16 and IceWriteData32 defined in misc.c for WORD64 */
|
||||
|
||||
#endif /* WORD64 */
|
||||
|
||||
|
||||
/*
|
||||
* The IceSendData macro bypasses copying the data to the
|
||||
* ICE connection buffer and sends the data directly. If necessary,
|
||||
* the ICE connection buffer is first flushed.
|
||||
*/
|
||||
|
||||
#define IceSendData(_iceConn, _bytes, _data) \
|
||||
{ \
|
||||
if (_iceConn->outbufptr > _iceConn->outbuf) \
|
||||
IceFlush (_iceConn); \
|
||||
_IceWrite (_iceConn, (unsigned long) (_bytes), _data); \
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Write pad bytes. Used to force 32 or 64 bit alignment.
|
||||
* A maxium of 7 pad bytes can be specified.
|
||||
*/
|
||||
|
||||
#define IceWritePad(_iceConn, _bytes) \
|
||||
{ \
|
||||
if ((_iceConn->outbufptr + (_bytes)) > _iceConn->outbufmax) \
|
||||
{ \
|
||||
char _dummy[7]; \
|
||||
IceFlush (_iceConn); \
|
||||
_IceWrite (_iceConn, (unsigned long) (_bytes), _dummy); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
_iceConn->outbufptr += (_bytes); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Macros for reading messages.
|
||||
*/
|
||||
|
||||
#define IceReadCompleteMessage(_iceConn, _headerSize, _msgType, _pMsg, _pData)\
|
||||
{ \
|
||||
unsigned long _bytes; \
|
||||
IceReadMessageHeader (_iceConn, _headerSize, _msgType, _pMsg); \
|
||||
_bytes = (_pMsg->length << 3) - (_headerSize - SIZEOF (iceMsg)); \
|
||||
if ((_iceConn->inbufmax - _iceConn->inbufptr) >= _bytes) \
|
||||
{ \
|
||||
_IceRead (_iceConn, _bytes, _iceConn->inbufptr); \
|
||||
_pData = _iceConn->inbufptr; \
|
||||
_iceConn->inbufptr += _bytes; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
_pData = (char *) malloc ((unsigned) _bytes); \
|
||||
if (_pData) \
|
||||
_IceRead (_iceConn, _bytes, _pData); \
|
||||
else \
|
||||
_IceReadSkip (_iceConn, _bytes); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define IceDisposeCompleteMessage(_iceConn, _pData) \
|
||||
if ((char *) _pData < _iceConn->inbuf || \
|
||||
(char *) _pData >= _iceConn->inbufmax) \
|
||||
free ((char *) _pData);
|
||||
|
||||
|
||||
#define IceReadSimpleMessage(_iceConn, _msgType, _pMsg) \
|
||||
_pMsg = (_msgType *) (_iceConn->inbuf);
|
||||
|
||||
#define IceReadMessageHeader(_iceConn, _headerSize, _msgType, _pMsg) \
|
||||
{ \
|
||||
_IceRead (_iceConn, \
|
||||
(unsigned long) (_headerSize - SIZEOF (iceMsg)), \
|
||||
_iceConn->inbufptr); \
|
||||
_pMsg = (_msgType *) (_iceConn->inbuf); \
|
||||
_iceConn->inbufptr += (_headerSize - SIZEOF (iceMsg)); \
|
||||
}
|
||||
|
||||
#define IceReadData(_iceConn, _bytes, _pData) \
|
||||
_IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData); \
|
||||
|
||||
#ifndef WORD64
|
||||
|
||||
#define IceReadData16(_iceConn, _swap, _bytes, _pData) \
|
||||
{ \
|
||||
_IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData); \
|
||||
}
|
||||
|
||||
#define IceReadData32(_iceConn, _swap, _bytes, _pData) \
|
||||
{ \
|
||||
_IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData); \
|
||||
}
|
||||
|
||||
#else /* WORD64 */
|
||||
|
||||
/* IceReadData16 and IceReadData32 defined in misc.c for WORD64 */
|
||||
|
||||
#endif /* WORD64 */
|
||||
|
||||
|
||||
/*
|
||||
* Read pad bytes (for 32 or 64 bit alignment).
|
||||
* A maxium of 7 pad bytes can be specified.
|
||||
*/
|
||||
|
||||
#define IceReadPad(_iceConn, _bytes) \
|
||||
{ \
|
||||
char _dummy[7]; \
|
||||
_IceRead (_iceConn, (unsigned long) (_bytes), _dummy); \
|
||||
}
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _ICEMSG_H_ */
|
||||
176
lib/libICE/include/X11/ICE/ICEproto.h
Normal file
176
lib/libICE/include/X11/ICE/ICEproto.h
Normal file
@@ -0,0 +1,176 @@
|
||||
/* $Xorg: ICEproto.h,v 1.5 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef _ICEPROTO_H_
|
||||
#define _ICEPROTO_H_
|
||||
|
||||
#include <X11/Xmd.h>
|
||||
|
||||
typedef struct {
|
||||
CARD8 majorOpcode;
|
||||
CARD8 minorOpcode;
|
||||
CARD8 data[2];
|
||||
CARD32 length B32;
|
||||
} iceMsg;
|
||||
|
||||
typedef struct {
|
||||
CARD8 majorOpcode;
|
||||
CARD8 minorOpcode;
|
||||
CARD16 errorClass B16;
|
||||
CARD32 length B32;
|
||||
CARD8 offendingMinorOpcode;
|
||||
CARD8 severity;
|
||||
CARD16 unused B16;
|
||||
CARD32 offendingSequenceNum B32;
|
||||
/* n varying values */
|
||||
/* p p = pad (n, 8) */
|
||||
} iceErrorMsg;
|
||||
|
||||
typedef struct {
|
||||
CARD8 majorOpcode;
|
||||
CARD8 minorOpcode;
|
||||
CARD8 byteOrder;
|
||||
CARD8 unused;
|
||||
CARD32 length B32;
|
||||
} iceByteOrderMsg;
|
||||
|
||||
typedef struct {
|
||||
CARD8 majorOpcode;
|
||||
CARD8 minorOpcode;
|
||||
CARD8 versionCount;
|
||||
CARD8 authCount;
|
||||
CARD32 length B32;
|
||||
CARD8 mustAuthenticate;
|
||||
CARD8 unused[7];
|
||||
/* i STRING vendor */
|
||||
/* j STRING release */
|
||||
/* k LIST of STRING authentication-protocol-names */
|
||||
/* m LIST of VERSION version-list */
|
||||
/* p p = pad (i+j+k+m, 8) */
|
||||
} iceConnectionSetupMsg;
|
||||
|
||||
typedef struct {
|
||||
CARD8 majorOpcode;
|
||||
CARD8 minorOpcode;
|
||||
CARD8 authIndex;
|
||||
CARD8 unused1;
|
||||
CARD32 length B32;
|
||||
CARD16 authDataLength B16;
|
||||
CARD8 unused2[6];
|
||||
/* n varying data */
|
||||
/* p p = pad (n, 8) */
|
||||
} iceAuthRequiredMsg;
|
||||
|
||||
typedef struct {
|
||||
CARD8 majorOpcode;
|
||||
CARD8 minorOpcode;
|
||||
CARD8 unused1[2];
|
||||
CARD32 length B32;
|
||||
CARD16 authDataLength B16;
|
||||
CARD8 unused2[6];
|
||||
/* n varying data */
|
||||
/* p p = pad (n, 8) */
|
||||
} iceAuthReplyMsg;
|
||||
|
||||
typedef struct {
|
||||
CARD8 majorOpcode;
|
||||
CARD8 minorOpcode;
|
||||
CARD8 unused1[2];
|
||||
CARD32 length B32;
|
||||
CARD16 authDataLength B16;
|
||||
CARD8 unused2[6];
|
||||
/* n varying data */
|
||||
/* p p = pad (n, 8) */
|
||||
} iceAuthNextPhaseMsg;
|
||||
|
||||
typedef struct {
|
||||
CARD8 majorOpcode;
|
||||
CARD8 minorOpcode;
|
||||
CARD8 versionIndex;
|
||||
CARD8 unused;
|
||||
CARD32 length B32;
|
||||
/* i STRING vendor */
|
||||
/* j STRING release */
|
||||
/* p p = pad (i+j, 8) */
|
||||
} iceConnectionReplyMsg;
|
||||
|
||||
typedef struct {
|
||||
CARD8 majorOpcode;
|
||||
CARD8 minorOpcode;
|
||||
CARD8 protocolOpcode;
|
||||
CARD8 mustAuthenticate;
|
||||
CARD32 length B32;
|
||||
CARD8 versionCount;
|
||||
CARD8 authCount;
|
||||
CARD8 unused[6];
|
||||
/* i STRING protocol-name */
|
||||
/* j STRING vendor */
|
||||
/* k STRING release */
|
||||
/* m LIST of STRING authentication-protocol-names */
|
||||
/* n LIST of VERSION version-list */
|
||||
/* p p = pad (i+j+k+m+n, 8) */
|
||||
} iceProtocolSetupMsg;
|
||||
|
||||
typedef struct {
|
||||
CARD8 majorOpcode;
|
||||
CARD8 minorOpcode;
|
||||
CARD8 versionIndex;
|
||||
CARD8 protocolOpcode;
|
||||
CARD32 length B32;
|
||||
/* i STRING vendor */
|
||||
/* j STRING release */
|
||||
/* p p = pad (i+j, 8) */
|
||||
} iceProtocolReplyMsg;
|
||||
|
||||
typedef iceMsg icePingMsg;
|
||||
typedef iceMsg icePingReplyMsg;
|
||||
typedef iceMsg iceWantToCloseMsg;
|
||||
typedef iceMsg iceNoCloseMsg;
|
||||
|
||||
|
||||
/*
|
||||
* SIZEOF values. These better be multiples of 8.
|
||||
*/
|
||||
|
||||
#define sz_iceMsg 8
|
||||
#define sz_iceErrorMsg 16
|
||||
#define sz_iceByteOrderMsg 8
|
||||
#define sz_iceConnectionSetupMsg 16
|
||||
#define sz_iceAuthRequiredMsg 16
|
||||
#define sz_iceAuthReplyMsg 16
|
||||
#define sz_iceAuthNextPhaseMsg 16
|
||||
#define sz_iceConnectionReplyMsg 8
|
||||
#define sz_iceProtocolSetupMsg 16
|
||||
#define sz_iceProtocolReplyMsg 8
|
||||
#define sz_icePingMsg 8
|
||||
#define sz_icePingReplyMsg 8
|
||||
#define sz_iceWantToCloseMsg 8
|
||||
#define sz_iceNoCloseMsg 8
|
||||
|
||||
#endif /* _ICEPROTO_H_ */
|
||||
126
lib/libICE/include/X11/ICE/ICEutil.h
Normal file
126
lib/libICE/include/X11/ICE/ICEutil.h
Normal file
@@ -0,0 +1,126 @@
|
||||
/* $Xorg: ICEutil.h,v 1.5 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
/* $XFree86: xc/lib/ICE/ICEutil.h,v 1.4 2001/12/20 19:40:59 tsi Exp $ */
|
||||
|
||||
#ifndef _ICEUTIL_H_
|
||||
#define _ICEUTIL_H_
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
/*
|
||||
* Data structure for entry in ICE authority file
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
char *protocol_name;
|
||||
unsigned short protocol_data_length;
|
||||
char *protocol_data;
|
||||
char *network_id;
|
||||
char *auth_name;
|
||||
unsigned short auth_data_length;
|
||||
char *auth_data;
|
||||
} IceAuthFileEntry;
|
||||
|
||||
|
||||
/*
|
||||
* Authentication data maintained in memory.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
char *protocol_name;
|
||||
char *network_id;
|
||||
char *auth_name;
|
||||
unsigned short auth_data_length;
|
||||
char *auth_data;
|
||||
} IceAuthDataEntry;
|
||||
|
||||
|
||||
/*
|
||||
* Return values from IceLockAuthFile
|
||||
*/
|
||||
|
||||
#define IceAuthLockSuccess 0 /* lock succeeded */
|
||||
#define IceAuthLockError 1 /* lock unexpectely failed, check errno */
|
||||
#define IceAuthLockTimeout 2 /* lock failed, timeouts expired */
|
||||
|
||||
|
||||
/*
|
||||
* Function Prototypes
|
||||
*/
|
||||
|
||||
extern char *IceAuthFileName (
|
||||
void
|
||||
);
|
||||
|
||||
extern int IceLockAuthFile (
|
||||
char * /* file_name */,
|
||||
int /* retries */,
|
||||
int /* timeout */,
|
||||
long /* dead */
|
||||
);
|
||||
|
||||
extern void IceUnlockAuthFile (
|
||||
char * /* file_name */
|
||||
);
|
||||
|
||||
extern IceAuthFileEntry *IceReadAuthFileEntry (
|
||||
FILE * /* auth_file */
|
||||
);
|
||||
|
||||
extern void IceFreeAuthFileEntry (
|
||||
IceAuthFileEntry * /* auth */
|
||||
);
|
||||
|
||||
extern Status IceWriteAuthFileEntry (
|
||||
FILE * /* auth_file */,
|
||||
IceAuthFileEntry * /* auth */
|
||||
);
|
||||
|
||||
extern IceAuthFileEntry *IceGetAuthFileEntry (
|
||||
char * /* protocol_name */,
|
||||
char * /* network_id */,
|
||||
char * /* auth_name */
|
||||
);
|
||||
|
||||
extern char *IceGenerateMagicCookie (
|
||||
int /* len */
|
||||
);
|
||||
|
||||
extern void IceSetPaAuthData (
|
||||
int /* numEntries */,
|
||||
IceAuthDataEntry * /* entries */
|
||||
);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _ICEUTIL_H_ */
|
||||
323
lib/libICE/install-sh
Normal file
323
lib/libICE/install-sh
Normal file
@@ -0,0 +1,323 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2005-05-14.22
|
||||
|
||||
# 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. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=
|
||||
chgrpcmd=
|
||||
stripcmd=
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dstarg=
|
||||
no_target_directory=
|
||||
|
||||
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:
|
||||
-c (ignored)
|
||||
-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.
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test -n "$1"; do
|
||||
case $1 in
|
||||
-c) shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd=$stripprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t) dstarg=$2
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-T) no_target_directory=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
*) # When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
test -n "$dir_arg$dstarg" && break
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dstarg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dstarg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dstarg=$arg
|
||||
done
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test -z "$1"; 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
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
case $src in
|
||||
-*) src=./$src ;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
src=
|
||||
|
||||
if test -d "$dst"; then
|
||||
mkdircmd=:
|
||||
chmodcmd=
|
||||
else
|
||||
mkdircmd=$mkdirprog
|
||||
fi
|
||||
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 "$dstarg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dstarg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst ;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dstarg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dst=$dst/`basename "$src"`
|
||||
fi
|
||||
fi
|
||||
|
||||
# This sed command emulates the dirname command.
|
||||
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if test ! -d "$dstdir"; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-$defaultIFS}"
|
||||
|
||||
oIFS=$IFS
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
shift
|
||||
IFS=$oIFS
|
||||
|
||||
pathcomp=
|
||||
|
||||
while test $# -ne 0 ; do
|
||||
pathcomp=$pathcomp$1
|
||||
shift
|
||||
if test ! -d "$pathcomp"; then
|
||||
$mkdirprog "$pathcomp"
|
||||
# mkdir can fail with a `File exist' error in case several
|
||||
# install-sh are creating the directory concurrently. This
|
||||
# is OK.
|
||||
test -d "$pathcomp" || exit
|
||||
fi
|
||||
pathcomp=$pathcomp/
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
$doit $mkdircmd "$dst" \
|
||||
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
|
||||
|
||||
else
|
||||
dstfile=`basename "$dst"`
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
$doit $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 "$dsttmp"; } &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 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.
|
||||
{
|
||||
if test -f "$dstdir/$dstfile"; then
|
||||
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|
||||
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|
||||
|| {
|
||||
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
|
||||
}
|
||||
}
|
||||
fi || { (exit 1); exit 1; }
|
||||
done
|
||||
|
||||
# The final little trick to "correctly" pass the exit status to the exit trap.
|
||||
{
|
||||
(exit 0); exit 0
|
||||
}
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
6911
lib/libICE/ltmain.sh
Normal file
6911
lib/libICE/ltmain.sh
Normal file
File diff suppressed because it is too large
Load Diff
360
lib/libICE/missing
Normal file
360
lib/libICE/missing
Normal file
@@ -0,0 +1,360 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
|
||||
scriptversion=2005-06-08.21
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
# Originally 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# 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
|
||||
|
||||
run=:
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case "$1" in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
|
||||
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
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program).
|
||||
case "$1" in
|
||||
lex|yacc)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
tar)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case "$1" in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case "$f" in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
|
||||
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f y.tab.h ]; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if [ ! -f y.tab.c ]; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f lex.yy.c ]; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
|
||||
fi
|
||||
if [ -f "$file" ]; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
# If the file does not exist, the user really needs makeinfo;
|
||||
# let's fail without touching anything.
|
||||
test -f $file || exit 1
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar "$@" && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar "$@" && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case "$firstarg" in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
case "$firstarg" in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
537
lib/libICE/src/ICElibint.h
Normal file
537
lib/libICE/src/ICElibint.h
Normal file
@@ -0,0 +1,537 @@
|
||||
/* $Xorg: ICElibint.h,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
/* $XFree86: xc/lib/ICE/ICElibint.h,v 1.6 2001/12/14 19:53:35 dawes Exp $ */
|
||||
|
||||
#ifndef _ICELIBINT_H_
|
||||
#define _ICELIBINT_H_
|
||||
|
||||
#include <X11/Xos.h>
|
||||
#include <X11/Xfuncs.h>
|
||||
#include <X11/Xmd.h>
|
||||
#include <X11/ICE/ICEproto.h>
|
||||
#include <X11/ICE/ICEconn.h>
|
||||
#include <X11/ICE/ICEmsg.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
/*
|
||||
* Vendor & Release
|
||||
*/
|
||||
|
||||
#define IceVendorString "MIT"
|
||||
#define IceReleaseString "1.0"
|
||||
|
||||
|
||||
/*
|
||||
* Pad to a 64 bit boundary
|
||||
*/
|
||||
|
||||
#define PAD64(_bytes) ((8 - ((unsigned int) (_bytes) % 8)) % 8)
|
||||
|
||||
#define PADDED_BYTES64(_bytes) (_bytes + PAD64 (_bytes))
|
||||
|
||||
|
||||
/*
|
||||
* Pad to 32 bit boundary
|
||||
*/
|
||||
|
||||
#define PAD32(_bytes) ((4 - ((unsigned int) (_bytes) % 4)) % 4)
|
||||
|
||||
#define PADDED_BYTES32(_bytes) (_bytes + PAD32 (_bytes))
|
||||
|
||||
|
||||
/*
|
||||
* Number of 8 byte units in _bytes.
|
||||
*/
|
||||
|
||||
#define WORD64COUNT(_bytes) (((unsigned int) ((_bytes) + 7)) >> 3)
|
||||
|
||||
|
||||
/*
|
||||
* Number of 4 byte units in _bytes.
|
||||
*/
|
||||
|
||||
#define WORD32COUNT(_bytes) (((unsigned int) ((_bytes) + 3)) >> 2)
|
||||
|
||||
|
||||
/*
|
||||
* Given a string, compute the number of bytes for the STRING representation
|
||||
*/
|
||||
|
||||
#define STRING_BYTES(_string) \
|
||||
(2 + strlen (_string) + PAD32 (2 + strlen (_string)))
|
||||
|
||||
|
||||
/*
|
||||
* Size of ICE input/output buffers
|
||||
*/
|
||||
|
||||
#define ICE_INBUFSIZE 1024
|
||||
|
||||
#define ICE_OUTBUFSIZE 1024
|
||||
|
||||
|
||||
/*
|
||||
* Maxium number of ICE authentication methods allowed, and maxiumum
|
||||
* number of authentication data entries allowed to be set in the
|
||||
* IceSetPaAuthData function.
|
||||
*
|
||||
* We should use linked lists, but this is easier and should suffice.
|
||||
*/
|
||||
|
||||
#define MAX_ICE_AUTH_NAMES 32
|
||||
#define ICE_MAX_AUTH_DATA_ENTRIES 100
|
||||
|
||||
|
||||
/*
|
||||
* ICE listen object
|
||||
*/
|
||||
|
||||
struct _IceListenObj {
|
||||
struct _XtransConnInfo *trans_conn; /* transport connection object */
|
||||
char *network_id;
|
||||
IceHostBasedAuthProc host_based_auth_proc;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Some internal data structures for processing ICE messages.
|
||||
*/
|
||||
|
||||
typedef void (*_IceProcessCoreMsgProc) (
|
||||
IceConn /* iceConn */,
|
||||
int /* opcode */,
|
||||
unsigned long /* length */,
|
||||
Bool /* swap */,
|
||||
IceReplyWaitInfo * /* replyWait */,
|
||||
Bool * /* replyReadyRet */,
|
||||
Bool * /* connectionClosedRet */
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
int major_version;
|
||||
int minor_version;
|
||||
_IceProcessCoreMsgProc process_core_msg_proc;
|
||||
} _IceVersion;
|
||||
|
||||
|
||||
/*
|
||||
* STORE FOO
|
||||
*/
|
||||
|
||||
#define STORE_CARD8(_pBuf, _val) \
|
||||
{ \
|
||||
*((CARD8 *) _pBuf) = _val; \
|
||||
_pBuf += 1; \
|
||||
}
|
||||
|
||||
#ifndef WORD64
|
||||
|
||||
#define STORE_CARD16(_pBuf, _val) \
|
||||
{ \
|
||||
*((CARD16 *) _pBuf) = _val; \
|
||||
_pBuf += 2; \
|
||||
}
|
||||
|
||||
#define STORE_CARD32(_pBuf, _val) \
|
||||
{ \
|
||||
*((CARD32 *) _pBuf) = _val; \
|
||||
_pBuf += 4; \
|
||||
}
|
||||
|
||||
#else /* WORD64 */
|
||||
|
||||
#define STORE_CARD16(_pBuf, _val) \
|
||||
{ \
|
||||
struct { \
|
||||
int value :16; \
|
||||
int pad :16; \
|
||||
} _d; \
|
||||
_d.value = _val; \
|
||||
memcpy (_pBuf, &_d, 2); \
|
||||
_pBuf += 2; \
|
||||
}
|
||||
|
||||
#define STORE_CARD32(_pBuf, _val) \
|
||||
{ \
|
||||
struct { \
|
||||
int value :32; \
|
||||
} _d; \
|
||||
_d.value = _val; \
|
||||
memcpy (_pBuf, &_d, 4); \
|
||||
_pBuf += 4; \
|
||||
}
|
||||
|
||||
#endif /* WORD64 */
|
||||
|
||||
#define STORE_STRING(_pBuf, _string) \
|
||||
{ \
|
||||
CARD16 _len = strlen (_string); \
|
||||
STORE_CARD16 (_pBuf, _len); \
|
||||
memcpy (_pBuf, _string, _len); \
|
||||
_pBuf += _len; \
|
||||
if (PAD32 (2 + _len)) \
|
||||
_pBuf += PAD32 (2 + _len); \
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* EXTRACT FOO
|
||||
*/
|
||||
|
||||
#define EXTRACT_CARD8(_pBuf, _val) \
|
||||
{ \
|
||||
_val = *((CARD8 *) _pBuf); \
|
||||
_pBuf += 1; \
|
||||
}
|
||||
|
||||
#ifndef WORD64
|
||||
|
||||
#define EXTRACT_CARD16(_pBuf, _swap, _val) \
|
||||
{ \
|
||||
_val = *((CARD16 *) _pBuf); \
|
||||
_pBuf += 2; \
|
||||
if (_swap) \
|
||||
_val = lswaps (_val); \
|
||||
}
|
||||
|
||||
#define EXTRACT_CARD32(_pBuf, _swap, _val) \
|
||||
{ \
|
||||
_val = *((CARD32 *) _pBuf); \
|
||||
_pBuf += 4; \
|
||||
if (_swap) \
|
||||
_val = lswapl (_val); \
|
||||
}
|
||||
|
||||
#else /* WORD64 */
|
||||
|
||||
#define EXTRACT_CARD16(_pBuf, _swap, _val) \
|
||||
{ \
|
||||
_val = *(_pBuf + 0) & 0xff; /* 0xff incase _pBuf is signed */ \
|
||||
_val <<= 8; \
|
||||
_val |= *(_pBuf + 1) & 0xff;\
|
||||
_pBuf += 2; \
|
||||
if (_swap) \
|
||||
_val = lswaps (_val); \
|
||||
}
|
||||
|
||||
#define EXTRACT_CARD32(_pBuf, _swap, _val) \
|
||||
{ \
|
||||
_val = *(_pBuf + 0) & 0xff; /* 0xff incase _pBuf is signed */ \
|
||||
_val <<= 8; \
|
||||
_val |= *(_pBuf + 1) & 0xff;\
|
||||
_val <<= 8; \
|
||||
_val |= *(_pBuf + 2) & 0xff;\
|
||||
_val <<= 8; \
|
||||
_val |= *(_pBuf + 3) & 0xff;\
|
||||
_pBuf += 4; \
|
||||
if (_swap) \
|
||||
_val = lswapl (_val); \
|
||||
}
|
||||
|
||||
#endif /* WORD64 */
|
||||
|
||||
#define EXTRACT_STRING(_pBuf, _swap, _string) \
|
||||
{ \
|
||||
CARD16 _len; \
|
||||
EXTRACT_CARD16 (_pBuf, _swap, _len); \
|
||||
_string = (char *) malloc (_len + 1); \
|
||||
memcpy (_string, _pBuf, _len); \
|
||||
_pBuf += _len; \
|
||||
_string[_len] = '\0'; \
|
||||
if (PAD32 (2 + _len)) \
|
||||
_pBuf += PAD32 (2 + _len); \
|
||||
}
|
||||
|
||||
#define EXTRACT_LISTOF_STRING(_pBuf, _swap, _count, _strings) \
|
||||
{ \
|
||||
int _i; \
|
||||
for (_i = 0; _i < _count; _i++) \
|
||||
EXTRACT_STRING (_pBuf, _swap, _strings[_i]); \
|
||||
}
|
||||
|
||||
|
||||
#define SKIP_STRING(_pBuf, _swap, _end, _bail) \
|
||||
{ \
|
||||
CARD16 _len; \
|
||||
EXTRACT_CARD16 (_pBuf, _swap, _len); \
|
||||
_pBuf += _len + PAD32(2+_len); \
|
||||
if (_pBuf > _end) { \
|
||||
_bail; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define SKIP_LISTOF_STRING(_pBuf, _swap, _count, _end, _bail) \
|
||||
{ \
|
||||
int _i; \
|
||||
for (_i = 0; _i < _count; _i++) \
|
||||
SKIP_STRING (_pBuf, _swap, _end, _bail); \
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Byte swapping
|
||||
*/
|
||||
|
||||
/* byte swap a long literal */
|
||||
#define lswapl(_val) ((((_val) & 0xff) << 24) |\
|
||||
(((_val) & 0xff00) << 8) |\
|
||||
(((_val) & 0xff0000) >> 8) |\
|
||||
(((_val) >> 24) & 0xff))
|
||||
|
||||
/* byte swap a short literal */
|
||||
#define lswaps(_val) ((((_val) & 0xff) << 8) | (((_val) >> 8) & 0xff))
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ICE replies (not processed via callbacks because we block)
|
||||
*/
|
||||
|
||||
#define ICE_CONNECTION_REPLY 1
|
||||
#define ICE_CONNECTION_ERROR 2
|
||||
#define ICE_PROTOCOL_REPLY 3
|
||||
#define ICE_PROTOCOL_ERROR 4
|
||||
|
||||
typedef struct {
|
||||
int type;
|
||||
int version_index;
|
||||
char *vendor;
|
||||
char *release;
|
||||
} _IceConnectionReply;
|
||||
|
||||
typedef struct {
|
||||
int type;
|
||||
char *error_message;
|
||||
} _IceConnectionError;
|
||||
|
||||
typedef struct {
|
||||
int type;
|
||||
int major_opcode;
|
||||
int version_index;
|
||||
char *vendor;
|
||||
char *release;
|
||||
} _IceProtocolReply;
|
||||
|
||||
typedef struct {
|
||||
int type;
|
||||
char *error_message;
|
||||
} _IceProtocolError;
|
||||
|
||||
|
||||
typedef union {
|
||||
int type;
|
||||
_IceConnectionReply connection_reply;
|
||||
_IceConnectionError connection_error;
|
||||
_IceProtocolReply protocol_reply;
|
||||
_IceProtocolError protocol_error;
|
||||
} _IceReply;
|
||||
|
||||
|
||||
/*
|
||||
* Watch for ICE connection create/destroy.
|
||||
*/
|
||||
|
||||
typedef struct _IceWatchedConnection {
|
||||
IceConn iceConn;
|
||||
IcePointer watch_data;
|
||||
struct _IceWatchedConnection *next;
|
||||
} _IceWatchedConnection;
|
||||
|
||||
typedef struct _IceWatchProc {
|
||||
IceWatchProc watch_proc;
|
||||
IcePointer client_data;
|
||||
_IceWatchedConnection *watched_connections;
|
||||
struct _IceWatchProc *next;
|
||||
} _IceWatchProc;
|
||||
|
||||
|
||||
/*
|
||||
* Locking
|
||||
*/
|
||||
|
||||
#define IceLockConn(_iceConn)
|
||||
#define IceUnlockConn(_iceConn)
|
||||
|
||||
|
||||
/*
|
||||
* Extern declarations
|
||||
*/
|
||||
|
||||
extern IceConn _IceConnectionObjs[];
|
||||
extern char *_IceConnectionStrings[];
|
||||
extern int _IceConnectionCount;
|
||||
|
||||
extern _IceProtocol _IceProtocols[];
|
||||
extern int _IceLastMajorOpcode;
|
||||
|
||||
extern int _IceAuthCount;
|
||||
extern char *_IceAuthNames[];
|
||||
extern IcePoAuthProc _IcePoAuthProcs[];
|
||||
extern IcePaAuthProc _IcePaAuthProcs[];
|
||||
|
||||
extern int _IceVersionCount;
|
||||
extern _IceVersion _IceVersions[];
|
||||
|
||||
extern _IceWatchProc *_IceWatchProcs;
|
||||
|
||||
extern IceErrorHandler _IceErrorHandler;
|
||||
extern IceIOErrorHandler _IceIOErrorHandler;
|
||||
|
||||
|
||||
extern void _IceErrorBadMajor (
|
||||
IceConn /* iceConn */,
|
||||
int /* offendingMajor */,
|
||||
int /* offendingMinor */,
|
||||
int /* severity */
|
||||
);
|
||||
|
||||
extern void _IceErrorNoAuthentication (
|
||||
IceConn /* iceConn */,
|
||||
int /* offendingMinor */
|
||||
);
|
||||
|
||||
extern void _IceErrorNoVersion (
|
||||
IceConn /* iceConn */,
|
||||
int /* offendingMinor */
|
||||
);
|
||||
|
||||
extern void _IceErrorSetupFailed (
|
||||
IceConn /* iceConn */,
|
||||
int /* offendingMinor */,
|
||||
char * /* reason */
|
||||
);
|
||||
|
||||
extern void _IceErrorAuthenticationRejected (
|
||||
IceConn /* iceConn */,
|
||||
int /* offendingMinor */,
|
||||
char * /* reason */
|
||||
);
|
||||
|
||||
extern void _IceErrorAuthenticationFailed (
|
||||
IceConn /* iceConn */,
|
||||
int /* offendingMinor */,
|
||||
char * /* reason */
|
||||
);
|
||||
|
||||
extern void _IceErrorProtocolDuplicate (
|
||||
IceConn /* iceConn */,
|
||||
char * /* protocolName */
|
||||
);
|
||||
|
||||
extern void _IceErrorMajorOpcodeDuplicate (
|
||||
IceConn /* iceConn */,
|
||||
int /* majorOpcode */
|
||||
);
|
||||
|
||||
extern void _IceErrorUnknownProtocol (
|
||||
IceConn /* iceConn */,
|
||||
char * /* protocolName */
|
||||
);
|
||||
|
||||
extern void _IceAddOpcodeMapping (
|
||||
IceConn /* iceConn */,
|
||||
int /* hisOpcode */,
|
||||
int /* myOpcode */
|
||||
);
|
||||
|
||||
extern char *_IceGetPeerName (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern void _IceFreeConnection (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern void _IceAddReplyWait (
|
||||
IceConn /* iceConn */,
|
||||
IceReplyWaitInfo * /* replyWait */
|
||||
);
|
||||
|
||||
extern IceReplyWaitInfo *_IceSearchReplyWaits (
|
||||
IceConn /* iceConn */,
|
||||
int /* majorOpcode */
|
||||
);
|
||||
|
||||
extern void _IceSetReplyReady (
|
||||
IceConn /* iceConn */,
|
||||
IceReplyWaitInfo * /* replyWait */
|
||||
);
|
||||
|
||||
extern Bool _IceCheckReplyReady (
|
||||
IceConn /* iceConn */,
|
||||
IceReplyWaitInfo * /* replyWait */
|
||||
);
|
||||
|
||||
extern void _IceConnectionOpened (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern void _IceConnectionClosed (
|
||||
IceConn /* iceConn */
|
||||
);
|
||||
|
||||
extern void _IceGetPoAuthData (
|
||||
char * /* protocol_name */,
|
||||
char * /* address */,
|
||||
char * /* auth_name */,
|
||||
unsigned short * /* auth_data_length_ret */,
|
||||
char ** /* auth_data_ret */
|
||||
);
|
||||
|
||||
extern void _IceGetPaAuthData (
|
||||
char * /* protocol_name */,
|
||||
char * /* address */,
|
||||
char * /* auth_name */,
|
||||
unsigned short * /* auth_data_length_ret */,
|
||||
char ** /* auth_data_ret */
|
||||
);
|
||||
|
||||
extern void _IceGetPoValidAuthIndices (
|
||||
char * /* protocol_name */,
|
||||
char * /* address */,
|
||||
int /* num_auth_names */,
|
||||
char ** /* auth_names */,
|
||||
int * /* num_indices_ret */,
|
||||
int * /* indices_ret */
|
||||
);
|
||||
|
||||
extern void _IceGetPaValidAuthIndices (
|
||||
char * /* protocol_name */,
|
||||
char * /* address */,
|
||||
int /* num_auth_names */,
|
||||
char ** /* auth_names */,
|
||||
int * /* num_indices_ret */,
|
||||
int * /* indices_ret */
|
||||
);
|
||||
|
||||
#endif /* _ICELIBINT_H_ */
|
||||
40
lib/libICE/src/Makefile.am
Normal file
40
lib/libICE/src/Makefile.am
Normal file
@@ -0,0 +1,40 @@
|
||||
lib_LTLIBRARIES=libICE.la
|
||||
|
||||
AM_CFLAGS= -I${top_srcdir}/include $(ICE_CFLAGS) $(XTRANS_CFLAGS) \
|
||||
-DICE_t -DTRANS_CLIENT -DTRANS_SERVER
|
||||
|
||||
libICE_la_LDFLAGS = -version-number 6:3:0 -no-undefined
|
||||
|
||||
libICE_la_LIBADD = $(ICE_LIBS) $(XTRANS_LIBS)
|
||||
|
||||
libICE_la_SOURCES = \
|
||||
ICElibint.h \
|
||||
accept.c \
|
||||
authutil.c \
|
||||
connect.c \
|
||||
error.c \
|
||||
getauth.c \
|
||||
globals.h \
|
||||
iceauth.c \
|
||||
icetrans.c \
|
||||
listen.c \
|
||||
listenwk.c \
|
||||
locking.c \
|
||||
misc.c \
|
||||
ping.c \
|
||||
process.c \
|
||||
protosetup.c \
|
||||
register.c \
|
||||
replywait.c \
|
||||
setauth.c \
|
||||
shutdown.c \
|
||||
watch.c
|
||||
|
||||
iceincludedir=$(includedir)/X11/ICE
|
||||
iceinclude_HEADERS=\
|
||||
$(top_srcdir)/include/X11/ICE/ICE.h \
|
||||
$(top_srcdir)/include/X11/ICE/ICEconn.h \
|
||||
$(top_srcdir)/include/X11/ICE/ICElib.h \
|
||||
$(top_srcdir)/include/X11/ICE/ICEmsg.h \
|
||||
$(top_srcdir)/include/X11/ICE/ICEproto.h \
|
||||
$(top_srcdir)/include/X11/ICE/ICEutil.h
|
||||
540
lib/libICE/src/Makefile.in
Normal file
540
lib/libICE/src/Makefile.in
Normal file
@@ -0,0 +1,540 @@
|
||||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 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@
|
||||
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
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 = src
|
||||
DIST_COMMON = $(iceinclude_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
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 = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(iceincludedir)"
|
||||
libLTLIBRARIES_INSTALL = $(INSTALL)
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
am__DEPENDENCIES_1 =
|
||||
libICE_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
am_libICE_la_OBJECTS = accept.lo authutil.lo connect.lo error.lo \
|
||||
getauth.lo iceauth.lo icetrans.lo listen.lo listenwk.lo \
|
||||
locking.lo misc.lo ping.lo process.lo protosetup.lo \
|
||||
register.lo replywait.lo setauth.lo shutdown.lo watch.lo
|
||||
libICE_la_OBJECTS = $(am_libICE_la_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(libICE_la_SOURCES)
|
||||
DIST_SOURCES = $(libICE_la_SOURCES)
|
||||
iceincludeHEADERS_INSTALL = $(INSTALL_HEADER)
|
||||
HEADERS = $(iceinclude_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
ICE_CFLAGS = @ICE_CFLAGS@
|
||||
ICE_LIBS = @ICE_LIBS@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XTRANS_CFLAGS = @XTRANS_CFLAGS@
|
||||
XTRANS_LIBS = @XTRANS_LIBS@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
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@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
lib_LTLIBRARIES = libICE.la
|
||||
AM_CFLAGS = -I${top_srcdir}/include $(ICE_CFLAGS) $(XTRANS_CFLAGS) \
|
||||
-DICE_t -DTRANS_CLIENT -DTRANS_SERVER
|
||||
|
||||
libICE_la_LDFLAGS = -version-number 6:3:0 -no-undefined
|
||||
libICE_la_LIBADD = $(ICE_LIBS) $(XTRANS_LIBS)
|
||||
libICE_la_SOURCES = \
|
||||
ICElibint.h \
|
||||
accept.c \
|
||||
authutil.c \
|
||||
connect.c \
|
||||
error.c \
|
||||
getauth.c \
|
||||
globals.h \
|
||||
iceauth.c \
|
||||
icetrans.c \
|
||||
listen.c \
|
||||
listenwk.c \
|
||||
locking.c \
|
||||
misc.c \
|
||||
ping.c \
|
||||
process.c \
|
||||
protosetup.c \
|
||||
register.c \
|
||||
replywait.c \
|
||||
setauth.c \
|
||||
shutdown.c \
|
||||
watch.c
|
||||
|
||||
iceincludedir = $(includedir)/X11/ICE
|
||||
iceinclude_HEADERS = \
|
||||
$(top_srcdir)/include/X11/ICE/ICE.h \
|
||||
$(top_srcdir)/include/X11/ICE/ICEconn.h \
|
||||
$(top_srcdir)/include/X11/ICE/ICElib.h \
|
||||
$(top_srcdir)/include/X11/ICE/ICEmsg.h \
|
||||
$(top_srcdir)/include/X11/ICE/ICEproto.h \
|
||||
$(top_srcdir)/include/X11/ICE/ICEutil.h
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu src/Makefile
|
||||
.PRECIOUS: 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__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
p=$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
|
||||
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
libICE.la: $(libICE_la_OBJECTS) $(libICE_la_DEPENDENCIES)
|
||||
$(LINK) -rpath $(libdir) $(libICE_la_LDFLAGS) $(libICE_la_OBJECTS) $(libICE_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authutil.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connect.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getauth.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iceauth.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icetrans.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listen.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listenwk.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locking.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ping.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protosetup.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/register.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/replywait.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setauth.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shutdown.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/watch.Plo@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
install-iceincludeHEADERS: $(iceinclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(iceincludedir)" || $(mkdir_p) "$(DESTDIR)$(iceincludedir)"
|
||||
@list='$(iceinclude_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(iceincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(iceincludedir)/$$f'"; \
|
||||
$(iceincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(iceincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-iceincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(iceinclude_HEADERS)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(iceincludedir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(iceincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(mkdir_p) $(distdir)/../include/X11/ICE
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$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 $(LTLIBRARIES) $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(iceincludedir)"; 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:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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-libLTLIBRARIES clean-libtool \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-iceincludeHEADERS
|
||||
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-iceincludeHEADERS uninstall-info-am \
|
||||
uninstall-libLTLIBRARIES
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-exec \
|
||||
install-exec-am install-iceincludeHEADERS install-info \
|
||||
install-info-am install-libLTLIBRARIES install-man \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am \
|
||||
uninstall-iceincludeHEADERS uninstall-info-am \
|
||||
uninstall-libLTLIBRARIES
|
||||
|
||||
# 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:
|
||||
188
lib/libICE/src/accept.c
Normal file
188
lib/libICE/src/accept.c
Normal file
@@ -0,0 +1,188 @@
|
||||
/* $Xorg: accept.c,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
#include <X11/Xtrans/Xtrans.h>
|
||||
|
||||
|
||||
IceConn
|
||||
IceAcceptConnection (listenObj, statusRet)
|
||||
|
||||
IceListenObj listenObj;
|
||||
IceAcceptStatus *statusRet;
|
||||
|
||||
{
|
||||
IceConn iceConn;
|
||||
XtransConnInfo newconn;
|
||||
iceByteOrderMsg *pMsg;
|
||||
int endian, status;
|
||||
|
||||
/*
|
||||
* Accept the connection.
|
||||
*/
|
||||
|
||||
if ((newconn = _IceTransAccept (listenObj->trans_conn, &status)) == 0)
|
||||
{
|
||||
if (status == TRANS_ACCEPT_BAD_MALLOC)
|
||||
*statusRet = IceAcceptBadMalloc;
|
||||
else
|
||||
*statusRet = IceAcceptFailure;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set close-on-exec so that programs that fork() don't get confused.
|
||||
*/
|
||||
|
||||
_IceTransSetOption (newconn, TRANS_CLOSEONEXEC, 1);
|
||||
|
||||
|
||||
/*
|
||||
* Create an ICE object for this connection.
|
||||
*/
|
||||
|
||||
if ((iceConn = (IceConn) malloc (sizeof (struct _IceConn))) == NULL)
|
||||
{
|
||||
_IceTransClose (newconn);
|
||||
*statusRet = IceAcceptBadMalloc;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
iceConn->listen_obj = listenObj;
|
||||
|
||||
iceConn->waiting_for_byteorder = True;
|
||||
iceConn->connection_status = IceConnectPending;
|
||||
iceConn->io_ok = True;
|
||||
iceConn->dispatch_level = 0;
|
||||
iceConn->context = NULL;
|
||||
iceConn->my_ice_version_index = 0;
|
||||
|
||||
iceConn->trans_conn = newconn;
|
||||
iceConn->send_sequence = 0;
|
||||
iceConn->receive_sequence = 0;
|
||||
|
||||
iceConn->connection_string = (char *) malloc (
|
||||
strlen (listenObj->network_id) + 1);
|
||||
|
||||
if (iceConn->connection_string == NULL)
|
||||
{
|
||||
_IceTransClose (newconn);
|
||||
free ((char *) iceConn);
|
||||
*statusRet = IceAcceptBadMalloc;
|
||||
return (NULL);
|
||||
}
|
||||
else
|
||||
strcpy (iceConn->connection_string, listenObj->network_id);
|
||||
|
||||
iceConn->vendor = NULL;
|
||||
iceConn->release = NULL;
|
||||
|
||||
if ((iceConn->inbuf = iceConn->inbufptr =
|
||||
(char *) malloc (ICE_INBUFSIZE)) != NULL)
|
||||
{
|
||||
iceConn->inbufmax = iceConn->inbuf + ICE_INBUFSIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
_IceTransClose (newconn);
|
||||
free ((char *) iceConn);
|
||||
*statusRet = IceAcceptBadMalloc;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if ((iceConn->outbuf = iceConn->outbufptr =
|
||||
(char *) malloc (ICE_OUTBUFSIZE)) != NULL)
|
||||
{
|
||||
iceConn->outbufmax = iceConn->outbuf + ICE_OUTBUFSIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
_IceTransClose (newconn);
|
||||
free (iceConn->inbuf);
|
||||
free ((char *) iceConn);
|
||||
*statusRet = IceAcceptBadMalloc;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
iceConn->scratch = NULL;
|
||||
iceConn->scratch_size = 0;
|
||||
|
||||
iceConn->open_ref_count = 1;
|
||||
iceConn->proto_ref_count = 0;
|
||||
|
||||
iceConn->skip_want_to_close = False;
|
||||
iceConn->want_to_close = False;
|
||||
iceConn->free_asap = False;
|
||||
|
||||
iceConn->saved_reply_waits = NULL;
|
||||
iceConn->ping_waits = NULL;
|
||||
|
||||
iceConn->process_msg_info = NULL;
|
||||
|
||||
iceConn->connect_to_you = NULL;
|
||||
iceConn->protosetup_to_you = NULL;
|
||||
|
||||
iceConn->connect_to_me = NULL;
|
||||
iceConn->protosetup_to_me = NULL;
|
||||
|
||||
|
||||
/*
|
||||
* Send our byte order.
|
||||
*/
|
||||
|
||||
IceGetHeader (iceConn, 0, ICE_ByteOrder,
|
||||
SIZEOF (iceByteOrderMsg), iceByteOrderMsg, pMsg);
|
||||
|
||||
endian = 1;
|
||||
if (*(char *) &endian)
|
||||
pMsg->byteOrder = IceLSBfirst;
|
||||
else
|
||||
pMsg->byteOrder = IceMSBfirst;
|
||||
|
||||
IceFlush (iceConn);
|
||||
|
||||
|
||||
if (_IceWatchProcs)
|
||||
{
|
||||
/*
|
||||
* Notify the watch procedures that an iceConn was opened.
|
||||
*/
|
||||
|
||||
_IceConnectionOpened (iceConn);
|
||||
}
|
||||
|
||||
*statusRet = IceAcceptSuccess;
|
||||
|
||||
return (iceConn);
|
||||
}
|
||||
539
lib/libICE/src/authutil.c
Normal file
539
lib/libICE/src/authutil.c
Normal file
@@ -0,0 +1,539 @@
|
||||
/* $Xorg: authutil.c,v 1.5 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/* $XdotOrg: xc/lib/ICE/authutil.c,v 1.3 2005/05/17 20:53:55 sandmann Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
/* $XFree86: authutil.c,v 3.9 2002/05/31 18:45:41 dawes Exp $ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
#include <X11/ICE/ICEutil.h>
|
||||
#include <X11/Xos.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <time.h>
|
||||
#define Time_t time_t
|
||||
#ifdef __UNIXOS2__
|
||||
extern char* getenv(const char*);
|
||||
#define link rename
|
||||
#endif
|
||||
#ifndef X_NOT_POSIX
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#ifndef WIN32
|
||||
extern unsigned sleep ();
|
||||
#else
|
||||
#define link rename
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static Status read_short ();
|
||||
static Status read_string ();
|
||||
static Status read_counted_string ();
|
||||
static Status write_short ();
|
||||
static Status write_string ();
|
||||
static Status write_counted_string ();
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* The following routines are for manipulating the .ICEauthority file
|
||||
* These are utility functions - they are not part of the standard
|
||||
* ICE library specification.
|
||||
*/
|
||||
|
||||
char *
|
||||
IceAuthFileName ()
|
||||
|
||||
{
|
||||
static char slashDotICEauthority[] = "/.ICEauthority";
|
||||
char *name;
|
||||
static char *buf;
|
||||
static int bsize;
|
||||
int size;
|
||||
#if defined(WIN32) || defined(__UNIXOS2__)
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 512
|
||||
#endif
|
||||
char dir[PATH_MAX];
|
||||
#endif
|
||||
|
||||
if ((name = getenv ("ICEAUTHORITY")))
|
||||
return (name);
|
||||
|
||||
name = getenv ("HOME");
|
||||
|
||||
if (!name)
|
||||
{
|
||||
#ifdef WIN32
|
||||
register char *ptr1;
|
||||
register char *ptr2;
|
||||
int len1 = 0, len2 = 0;
|
||||
|
||||
if ((ptr1 = getenv("HOMEDRIVE")) && (ptr2 = getenv("HOMEDIR"))) {
|
||||
len1 = strlen (ptr1);
|
||||
len2 = strlen (ptr2);
|
||||
} else if (ptr2 = getenv("USERNAME")) {
|
||||
len1 = strlen (ptr1 = "/users/");
|
||||
len2 = strlen (ptr2);
|
||||
}
|
||||
if ((len1 + len2 + 1) < PATH_MAX) {
|
||||
sprintf (dir, "%s%s", ptr1, (ptr2) ? ptr2 : "");
|
||||
name = dir;
|
||||
}
|
||||
if (!name)
|
||||
#endif
|
||||
#ifdef __UNIXOS2__
|
||||
strcpy (dir,"c:");
|
||||
name = dir;
|
||||
if (!name)
|
||||
#endif
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
size = strlen (name) + strlen (&slashDotICEauthority[1]) + 2;
|
||||
|
||||
if (size > bsize)
|
||||
{
|
||||
if (buf)
|
||||
free (buf);
|
||||
buf = malloc ((unsigned) size);
|
||||
if (!buf)
|
||||
return (NULL);
|
||||
bsize = size;
|
||||
}
|
||||
|
||||
strcpy (buf, name);
|
||||
strcat (buf, slashDotICEauthority + (name[1] == '\0' ? 1 : 0));
|
||||
|
||||
return (buf);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
IceLockAuthFile (file_name, retries, timeout, dead)
|
||||
|
||||
char *file_name;
|
||||
int retries;
|
||||
int timeout;
|
||||
long dead;
|
||||
|
||||
{
|
||||
char creat_name[1025], link_name[1025];
|
||||
struct stat statb;
|
||||
Time_t now;
|
||||
int creat_fd = -1;
|
||||
|
||||
if ((int) strlen (file_name) > 1022)
|
||||
return (IceAuthLockError);
|
||||
|
||||
strcpy (creat_name, file_name);
|
||||
strcat (creat_name, "-c");
|
||||
strcpy (link_name, file_name);
|
||||
strcat (link_name, "-l");
|
||||
|
||||
if (stat (creat_name, &statb) != -1)
|
||||
{
|
||||
now = time ((Time_t *) 0);
|
||||
|
||||
/*
|
||||
* NFS may cause ctime to be before now, special
|
||||
* case a 0 deadtime to force lock removal
|
||||
*/
|
||||
|
||||
if (dead == 0 || now - statb.st_ctime > dead)
|
||||
{
|
||||
unlink (creat_name);
|
||||
unlink (link_name);
|
||||
}
|
||||
}
|
||||
|
||||
while (retries > 0)
|
||||
{
|
||||
if (creat_fd == -1)
|
||||
{
|
||||
creat_fd = creat (creat_name, 0666);
|
||||
|
||||
if (creat_fd == -1)
|
||||
{
|
||||
if (errno != EACCES)
|
||||
return (IceAuthLockError);
|
||||
}
|
||||
else
|
||||
close (creat_fd);
|
||||
}
|
||||
|
||||
if (creat_fd != -1)
|
||||
{
|
||||
if (link (creat_name, link_name) != -1)
|
||||
return (IceAuthLockSuccess);
|
||||
|
||||
if (errno == ENOENT)
|
||||
{
|
||||
creat_fd = -1; /* force re-creat next time around */
|
||||
continue;
|
||||
}
|
||||
|
||||
if (errno != EEXIST)
|
||||
return (IceAuthLockError);
|
||||
}
|
||||
|
||||
sleep ((unsigned) timeout);
|
||||
--retries;
|
||||
}
|
||||
|
||||
return (IceAuthLockTimeout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
IceUnlockAuthFile (file_name)
|
||||
|
||||
char *file_name;
|
||||
|
||||
{
|
||||
#ifndef WIN32
|
||||
char creat_name[1025];
|
||||
#endif
|
||||
char link_name[1025];
|
||||
|
||||
if ((int) strlen (file_name) > 1022)
|
||||
return;
|
||||
|
||||
#ifndef WIN32
|
||||
strcpy (creat_name, file_name);
|
||||
strcat (creat_name, "-c");
|
||||
#endif
|
||||
strcpy (link_name, file_name);
|
||||
strcat (link_name, "-l");
|
||||
|
||||
#ifndef WIN32
|
||||
unlink (creat_name);
|
||||
#endif
|
||||
unlink (link_name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
IceAuthFileEntry *
|
||||
IceReadAuthFileEntry (auth_file)
|
||||
|
||||
FILE *auth_file;
|
||||
|
||||
{
|
||||
IceAuthFileEntry local;
|
||||
IceAuthFileEntry *ret;
|
||||
|
||||
local.protocol_name = NULL;
|
||||
local.protocol_data = NULL;
|
||||
local.network_id = NULL;
|
||||
local.auth_name = NULL;
|
||||
local.auth_data = NULL;
|
||||
|
||||
if (!read_string (auth_file, &local.protocol_name))
|
||||
return (NULL);
|
||||
|
||||
if (!read_counted_string (auth_file,
|
||||
&local.protocol_data_length, &local.protocol_data))
|
||||
goto bad;
|
||||
|
||||
if (!read_string (auth_file, &local.network_id))
|
||||
goto bad;
|
||||
|
||||
if (!read_string (auth_file, &local.auth_name))
|
||||
goto bad;
|
||||
|
||||
if (!read_counted_string (auth_file,
|
||||
&local.auth_data_length, &local.auth_data))
|
||||
goto bad;
|
||||
|
||||
if (!(ret = (IceAuthFileEntry *) malloc (sizeof (IceAuthFileEntry))))
|
||||
goto bad;
|
||||
|
||||
*ret = local;
|
||||
|
||||
return (ret);
|
||||
|
||||
bad:
|
||||
|
||||
if (local.protocol_name) free (local.protocol_name);
|
||||
if (local.protocol_data) free (local.protocol_data);
|
||||
if (local.network_id) free (local.network_id);
|
||||
if (local.auth_name) free (local.auth_name);
|
||||
if (local.auth_data) free (local.auth_data);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
IceFreeAuthFileEntry (auth)
|
||||
|
||||
IceAuthFileEntry *auth;
|
||||
|
||||
{
|
||||
if (auth)
|
||||
{
|
||||
if (auth->protocol_name) free (auth->protocol_name);
|
||||
if (auth->protocol_data) free (auth->protocol_data);
|
||||
if (auth->network_id) free (auth->network_id);
|
||||
if (auth->auth_name) free (auth->auth_name);
|
||||
if (auth->auth_data) free (auth->auth_data);
|
||||
free ((char *) auth);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Status
|
||||
IceWriteAuthFileEntry (auth_file, auth)
|
||||
|
||||
FILE *auth_file;
|
||||
IceAuthFileEntry *auth;
|
||||
|
||||
{
|
||||
if (!write_string (auth_file, auth->protocol_name))
|
||||
return (0);
|
||||
|
||||
if (!write_counted_string (auth_file,
|
||||
auth->protocol_data_length, auth->protocol_data))
|
||||
return (0);
|
||||
|
||||
if (!write_string (auth_file, auth->network_id))
|
||||
return (0);
|
||||
|
||||
if (!write_string (auth_file, auth->auth_name))
|
||||
return (0);
|
||||
|
||||
if (!write_counted_string (auth_file,
|
||||
auth->auth_data_length, auth->auth_data))
|
||||
return (0);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
IceAuthFileEntry *
|
||||
IceGetAuthFileEntry (protocol_name, network_id, auth_name)
|
||||
|
||||
char *protocol_name;
|
||||
char *network_id;
|
||||
char *auth_name;
|
||||
|
||||
{
|
||||
FILE *auth_file;
|
||||
char *filename;
|
||||
IceAuthFileEntry *entry;
|
||||
|
||||
if (!(filename = IceAuthFileName ()))
|
||||
return (NULL);
|
||||
|
||||
if (access (filename, R_OK) != 0) /* checks REAL id */
|
||||
return (NULL);
|
||||
|
||||
if (!(auth_file = fopen (filename, "rb")))
|
||||
return (NULL);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (!(entry = IceReadAuthFileEntry (auth_file)))
|
||||
break;
|
||||
|
||||
if (strcmp (protocol_name, entry->protocol_name) == 0 &&
|
||||
strcmp (network_id, entry->network_id) == 0 &&
|
||||
strcmp (auth_name, entry->auth_name) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
IceFreeAuthFileEntry (entry);
|
||||
}
|
||||
|
||||
fclose (auth_file);
|
||||
|
||||
return (entry);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* local routines
|
||||
*/
|
||||
|
||||
static Status
|
||||
read_short (file, shortp)
|
||||
|
||||
FILE *file;
|
||||
unsigned short *shortp;
|
||||
|
||||
{
|
||||
unsigned char file_short[2];
|
||||
|
||||
if (fread ((char *) file_short, (int) sizeof (file_short), 1, file) != 1)
|
||||
return (0);
|
||||
|
||||
*shortp = file_short[0] * 256 + file_short[1];
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
static Status
|
||||
read_string (file, stringp)
|
||||
|
||||
FILE *file;
|
||||
char **stringp;
|
||||
|
||||
{
|
||||
unsigned short len;
|
||||
char *data;
|
||||
|
||||
if (!read_short (file, &len))
|
||||
return (0);
|
||||
|
||||
data = malloc ((unsigned) len + 1);
|
||||
|
||||
if (!data)
|
||||
return (0);
|
||||
|
||||
if (len != 0)
|
||||
{
|
||||
if (fread (data, (int) sizeof (char), (int) len, file) != len)
|
||||
{
|
||||
free (data);
|
||||
return (0);
|
||||
}
|
||||
|
||||
}
|
||||
data[len] = '\0';
|
||||
|
||||
*stringp = data;
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
static Status
|
||||
read_counted_string (file, countp, stringp)
|
||||
|
||||
FILE *file;
|
||||
unsigned short *countp;
|
||||
char **stringp;
|
||||
|
||||
{
|
||||
unsigned short len;
|
||||
char *data;
|
||||
|
||||
if (!read_short (file, &len))
|
||||
return (0);
|
||||
|
||||
if (len == 0)
|
||||
{
|
||||
data = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
data = malloc ((unsigned) len);
|
||||
|
||||
if (!data)
|
||||
return (0);
|
||||
|
||||
if (fread (data, (int) sizeof (char), (int) len, file) != len)
|
||||
{
|
||||
free (data);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
*stringp = data;
|
||||
*countp = len;
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
static Status
|
||||
write_short (file, s)
|
||||
|
||||
FILE *file;
|
||||
unsigned short s;
|
||||
|
||||
{
|
||||
unsigned char file_short[2];
|
||||
|
||||
file_short[0] = (s & (unsigned) 0xff00) >> 8;
|
||||
file_short[1] = s & 0xff;
|
||||
|
||||
if (fwrite ((char *) file_short, (int) sizeof (file_short), 1, file) != 1)
|
||||
return (0);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
static Status
|
||||
write_string (file, string)
|
||||
|
||||
FILE *file;
|
||||
char *string;
|
||||
|
||||
{
|
||||
unsigned short count = strlen (string);
|
||||
|
||||
if (!write_short (file, count))
|
||||
return (0);
|
||||
|
||||
if (fwrite (string, (int) sizeof (char), (int) count, file) != count)
|
||||
return (0);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
static Status
|
||||
write_counted_string (file, count, string)
|
||||
|
||||
FILE *file;
|
||||
unsigned short count;
|
||||
char *string;
|
||||
|
||||
{
|
||||
if (!write_short (file, count))
|
||||
return (0);
|
||||
|
||||
if (fwrite (string, (int) sizeof (char), (int) count, file) != count)
|
||||
return (0);
|
||||
|
||||
return (1);
|
||||
}
|
||||
543
lib/libICE/src/connect.c
Normal file
543
lib/libICE/src/connect.c
Normal file
@@ -0,0 +1,543 @@
|
||||
/* $Xorg: connect.c,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
/* $XFree86: xc/lib/ICE/connect.c,v 3.9 2001/12/14 19:53:35 dawes Exp $ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
#include <X11/Xtrans/Xtrans.h>
|
||||
#include "globals.h"
|
||||
|
||||
static XtransConnInfo ConnectToPeer();
|
||||
|
||||
#define Strstr strstr
|
||||
|
||||
IceConn
|
||||
IceOpenConnection (networkIdsList, context, mustAuthenticate, majorOpcodeCheck,
|
||||
errorLength, errorStringRet)
|
||||
|
||||
char *networkIdsList;
|
||||
IcePointer context;
|
||||
Bool mustAuthenticate;
|
||||
int majorOpcodeCheck;
|
||||
int errorLength;
|
||||
char *errorStringRet;
|
||||
|
||||
{
|
||||
IceConn iceConn;
|
||||
int extra, i, j;
|
||||
int endian;
|
||||
Bool gotReply, ioErrorOccured;
|
||||
unsigned long setup_sequence;
|
||||
iceByteOrderMsg *pByteOrderMsg;
|
||||
iceConnectionSetupMsg *pSetupMsg;
|
||||
char *pData;
|
||||
IceReplyWaitInfo replyWait;
|
||||
_IceReply reply;
|
||||
int authUsableCount;
|
||||
int authUsableFlags[MAX_ICE_AUTH_NAMES];
|
||||
int authIndices[MAX_ICE_AUTH_NAMES];
|
||||
|
||||
if (errorStringRet && errorLength > 0)
|
||||
*errorStringRet = '\0';
|
||||
|
||||
if (networkIdsList == NULL || *networkIdsList == '\0')
|
||||
{
|
||||
strncpy (errorStringRet,
|
||||
"networkIdsList argument is NULL", errorLength);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check to see if we can use a previously created ICE connection.
|
||||
*
|
||||
* If iceConn->want_to_close is True, or iceConn->free_asap is True,
|
||||
* we can not use the iceConn.
|
||||
*
|
||||
* If 'context' is non-NULL, we will only use a previously opened ICE
|
||||
* connection if the specified 'context' is equal to the context
|
||||
* associated with the ICE connection, or if the context associated
|
||||
* with the ICE connection is NULL.
|
||||
*
|
||||
* If 'majorOpcodeCheck' is non-zero, it will contain a protocol major
|
||||
* opcode that we should make sure is not already active on the ICE
|
||||
* connection. Some clients will want two seperate connections for the
|
||||
* same protocol to the same destination client.
|
||||
*/
|
||||
|
||||
for (i = 0; i < _IceConnectionCount; i++)
|
||||
{
|
||||
char *strptr;
|
||||
if ((strptr = (char *) Strstr (
|
||||
networkIdsList, _IceConnectionStrings[i])) != NULL)
|
||||
{
|
||||
char ch = *(strptr + strlen (_IceConnectionStrings[i]));
|
||||
if (ch == ',' || ch == '\0')
|
||||
{
|
||||
/*
|
||||
* OK, we found a connection. Make sure we can reuse it.
|
||||
*/
|
||||
|
||||
IceConn iceConn = _IceConnectionObjs[i];
|
||||
|
||||
if (iceConn->want_to_close || iceConn->free_asap ||
|
||||
(context && iceConn->context &&
|
||||
iceConn->context != context))
|
||||
{
|
||||
/* force a new connection to be created */
|
||||
break;
|
||||
}
|
||||
|
||||
if (majorOpcodeCheck)
|
||||
{
|
||||
for (j = iceConn->his_min_opcode;
|
||||
j <= iceConn->his_max_opcode; j++)
|
||||
{
|
||||
if (iceConn->process_msg_info[
|
||||
j - iceConn->his_min_opcode].in_use &&
|
||||
iceConn->process_msg_info[
|
||||
j - iceConn->his_min_opcode].my_opcode ==
|
||||
majorOpcodeCheck)
|
||||
break;
|
||||
}
|
||||
|
||||
if (j <= iceConn->his_max_opcode ||
|
||||
(iceConn->protosetup_to_you &&
|
||||
iceConn->protosetup_to_you->my_opcode ==
|
||||
majorOpcodeCheck))
|
||||
{
|
||||
/* force a new connection to be created */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
iceConn->open_ref_count++;
|
||||
if (context && !iceConn->context)
|
||||
iceConn->context = context;
|
||||
return (iceConn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((iceConn = (IceConn) malloc (sizeof (struct _IceConn))) == NULL)
|
||||
{
|
||||
strncpy (errorStringRet, "Can't malloc", errorLength);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Open a network connection with the peer client.
|
||||
*/
|
||||
|
||||
if ((iceConn->trans_conn = ConnectToPeer (networkIdsList,
|
||||
&iceConn->connection_string)) == NULL)
|
||||
{
|
||||
free ((char *) iceConn);
|
||||
strncpy (errorStringRet, "Could not open network socket", errorLength);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set close-on-exec so that programs that fork() don't get confused.
|
||||
*/
|
||||
|
||||
_IceTransSetOption (iceConn->trans_conn, TRANS_CLOSEONEXEC, 1);
|
||||
|
||||
iceConn->listen_obj = NULL;
|
||||
|
||||
iceConn->connection_status = IceConnectPending;
|
||||
iceConn->io_ok = True;
|
||||
iceConn->dispatch_level = 0;
|
||||
iceConn->context = context;
|
||||
iceConn->my_ice_version_index = 0;
|
||||
iceConn->send_sequence = 0;
|
||||
iceConn->receive_sequence = 0;
|
||||
|
||||
iceConn->vendor = NULL;
|
||||
iceConn->release = NULL;
|
||||
iceConn->outbuf = NULL;
|
||||
|
||||
iceConn->scratch = NULL;
|
||||
iceConn->scratch_size = 0;
|
||||
|
||||
iceConn->process_msg_info = NULL;
|
||||
|
||||
iceConn->connect_to_you = NULL;
|
||||
iceConn->protosetup_to_you = NULL;
|
||||
|
||||
iceConn->connect_to_me = NULL;
|
||||
iceConn->protosetup_to_me = NULL;
|
||||
|
||||
if ((iceConn->inbuf = iceConn->inbufptr =
|
||||
(char *) malloc (ICE_INBUFSIZE)) == NULL)
|
||||
{
|
||||
_IceFreeConnection (iceConn);
|
||||
strncpy (errorStringRet, "Can't malloc", errorLength);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
iceConn->inbufmax = iceConn->inbuf + ICE_INBUFSIZE;
|
||||
|
||||
if ((iceConn->outbuf = iceConn->outbufptr =
|
||||
(char *) calloc (1, ICE_OUTBUFSIZE)) == NULL)
|
||||
{
|
||||
_IceFreeConnection (iceConn);
|
||||
strncpy (errorStringRet, "Can't malloc", errorLength);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
iceConn->outbufmax = iceConn->outbuf + ICE_OUTBUFSIZE;
|
||||
|
||||
iceConn->open_ref_count = 1;
|
||||
iceConn->proto_ref_count = 0;
|
||||
|
||||
iceConn->skip_want_to_close = False;
|
||||
iceConn->want_to_close = False;
|
||||
iceConn->free_asap = False;
|
||||
|
||||
iceConn->saved_reply_waits = NULL;
|
||||
iceConn->ping_waits = NULL;
|
||||
|
||||
iceConn->connect_to_you = (_IceConnectToYouInfo *) malloc (
|
||||
sizeof (_IceConnectToYouInfo));
|
||||
iceConn->connect_to_you->auth_active = 0;
|
||||
|
||||
/*
|
||||
* Send our byte order.
|
||||
*/
|
||||
|
||||
IceGetHeader (iceConn, 0, ICE_ByteOrder,
|
||||
SIZEOF (iceByteOrderMsg), iceByteOrderMsg, pByteOrderMsg);
|
||||
|
||||
endian = 1;
|
||||
if (*(char *) &endian)
|
||||
pByteOrderMsg->byteOrder = IceLSBfirst;
|
||||
else
|
||||
pByteOrderMsg->byteOrder = IceMSBfirst;
|
||||
|
||||
IceFlush (iceConn);
|
||||
|
||||
|
||||
/*
|
||||
* Now read the ByteOrder message from the other client.
|
||||
* iceConn->swap should be set to the appropriate boolean
|
||||
* value after the call to IceProcessMessages.
|
||||
*/
|
||||
|
||||
iceConn->waiting_for_byteorder = True;
|
||||
|
||||
ioErrorOccured = False;
|
||||
while (iceConn->waiting_for_byteorder == True && !ioErrorOccured)
|
||||
{
|
||||
ioErrorOccured = (IceProcessMessages (
|
||||
iceConn, NULL, NULL) == IceProcessMessagesIOError);
|
||||
}
|
||||
|
||||
if (ioErrorOccured)
|
||||
{
|
||||
_IceFreeConnection (iceConn);
|
||||
strncpy (errorStringRet, "IO error occured opening connection",
|
||||
errorLength);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (iceConn->connection_status == IceConnectRejected)
|
||||
{
|
||||
/*
|
||||
* We failed to get the required ByteOrder message.
|
||||
*/
|
||||
|
||||
_IceFreeConnection (iceConn);
|
||||
strncpy (errorStringRet,
|
||||
"Internal error - did not receive the expected ByteOrder message",
|
||||
errorLength);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Determine which authentication methods are available for
|
||||
* the Connection Setup authentication.
|
||||
*/
|
||||
|
||||
_IceGetPoValidAuthIndices (
|
||||
"ICE", iceConn->connection_string,
|
||||
_IceAuthCount, _IceAuthNames, &authUsableCount, authIndices);
|
||||
|
||||
for (i = 0; i < _IceAuthCount; i++)
|
||||
{
|
||||
authUsableFlags[i] = 0;
|
||||
for (j = 0; j < authUsableCount && !authUsableFlags[i]; j++)
|
||||
authUsableFlags[i] = (authIndices[j] == i);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Now send a Connection Setup message.
|
||||
*/
|
||||
|
||||
extra = STRING_BYTES (IceVendorString) + STRING_BYTES (IceReleaseString);
|
||||
|
||||
for (i = 0; i < _IceAuthCount; i++)
|
||||
if (authUsableFlags[i])
|
||||
{
|
||||
extra += STRING_BYTES (_IceAuthNames[i]);
|
||||
}
|
||||
|
||||
extra += (_IceVersionCount * 4);
|
||||
|
||||
IceGetHeaderExtra (iceConn, 0, ICE_ConnectionSetup,
|
||||
SIZEOF (iceConnectionSetupMsg), WORD64COUNT (extra),
|
||||
iceConnectionSetupMsg, pSetupMsg, pData);
|
||||
|
||||
setup_sequence = iceConn->send_sequence;
|
||||
|
||||
pSetupMsg->versionCount = _IceVersionCount;
|
||||
pSetupMsg->authCount = authUsableCount;
|
||||
pSetupMsg->mustAuthenticate = mustAuthenticate;
|
||||
|
||||
STORE_STRING (pData, IceVendorString);
|
||||
STORE_STRING (pData, IceReleaseString);
|
||||
|
||||
for (i = 0; i < _IceAuthCount; i++)
|
||||
if (authUsableFlags[i])
|
||||
{
|
||||
STORE_STRING (pData, _IceAuthNames[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < _IceVersionCount; i++)
|
||||
{
|
||||
STORE_CARD16 (pData, _IceVersions[i].major_version);
|
||||
STORE_CARD16 (pData, _IceVersions[i].minor_version);
|
||||
}
|
||||
|
||||
IceFlush (iceConn);
|
||||
|
||||
|
||||
/*
|
||||
* Process messages until we get a Connection Reply or an Error Message.
|
||||
* Authentication will take place behind the scenes.
|
||||
*/
|
||||
|
||||
replyWait.sequence_of_request = setup_sequence;
|
||||
replyWait.major_opcode_of_request = 0;
|
||||
replyWait.minor_opcode_of_request = ICE_ConnectionSetup;
|
||||
replyWait.reply = (IcePointer) &reply;
|
||||
|
||||
gotReply = False;
|
||||
ioErrorOccured = False;
|
||||
|
||||
while (!gotReply && !ioErrorOccured)
|
||||
{
|
||||
ioErrorOccured = (IceProcessMessages (
|
||||
iceConn, &replyWait, &gotReply) == IceProcessMessagesIOError);
|
||||
|
||||
if (ioErrorOccured)
|
||||
{
|
||||
strncpy (errorStringRet, "IO error occured opening connection",
|
||||
errorLength);
|
||||
_IceFreeConnection (iceConn);
|
||||
iceConn = NULL;
|
||||
}
|
||||
else if (gotReply)
|
||||
{
|
||||
if (reply.type == ICE_CONNECTION_REPLY)
|
||||
{
|
||||
if (reply.connection_reply.version_index >= _IceVersionCount)
|
||||
{
|
||||
strncpy (errorStringRet,
|
||||
"Got a bad version index in the Connection Reply",
|
||||
errorLength);
|
||||
|
||||
free (reply.connection_reply.vendor);
|
||||
free (reply.connection_reply.release);
|
||||
_IceFreeConnection (iceConn);
|
||||
iceConn = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
iceConn->my_ice_version_index =
|
||||
reply.connection_reply.version_index;
|
||||
iceConn->vendor = reply.connection_reply.vendor;
|
||||
iceConn->release = reply.connection_reply.release;
|
||||
|
||||
_IceConnectionObjs[_IceConnectionCount] = iceConn;
|
||||
_IceConnectionStrings[_IceConnectionCount] =
|
||||
iceConn->connection_string;
|
||||
_IceConnectionCount++;
|
||||
|
||||
free ((char *) iceConn->connect_to_you);
|
||||
iceConn->connect_to_you = NULL;
|
||||
|
||||
iceConn->connection_status = IceConnectAccepted;
|
||||
}
|
||||
}
|
||||
else /* reply.type == ICE_CONNECTION_ERROR */
|
||||
{
|
||||
/* Connection failed */
|
||||
|
||||
strncpy (errorStringRet, reply.connection_error.error_message,
|
||||
errorLength);
|
||||
|
||||
free (reply.connection_error.error_message);
|
||||
|
||||
_IceFreeConnection (iceConn);
|
||||
iceConn = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (iceConn && _IceWatchProcs)
|
||||
{
|
||||
/*
|
||||
* Notify the watch procedures that an iceConn was opened.
|
||||
*/
|
||||
|
||||
_IceConnectionOpened (iceConn);
|
||||
}
|
||||
|
||||
return (iceConn);
|
||||
}
|
||||
|
||||
|
||||
|
||||
IcePointer
|
||||
IceGetConnectionContext (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
return (iceConn->context);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- *
|
||||
* local routines *
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
#define ICE_CONNECTION_RETRIES 5
|
||||
|
||||
|
||||
static XtransConnInfo
|
||||
ConnectToPeer (networkIdsList, actualConnectionRet)
|
||||
|
||||
char *networkIdsList;
|
||||
char **actualConnectionRet;
|
||||
|
||||
{
|
||||
char addrbuf[256];
|
||||
char* address;
|
||||
char *ptr, *endptr, *delim;
|
||||
int madeConnection = 0;
|
||||
int len, retry;
|
||||
int connect_stat;
|
||||
int address_size;
|
||||
XtransConnInfo trans_conn = NULL;
|
||||
|
||||
*actualConnectionRet = NULL;
|
||||
|
||||
ptr = networkIdsList;
|
||||
len = strlen (networkIdsList);
|
||||
endptr = networkIdsList + len;
|
||||
|
||||
if (len < sizeof addrbuf)
|
||||
{
|
||||
address = addrbuf;
|
||||
address_size = 256;
|
||||
}
|
||||
else
|
||||
{
|
||||
address = malloc (len + 1);
|
||||
address_size = len;
|
||||
}
|
||||
|
||||
while (ptr < endptr && !madeConnection)
|
||||
{
|
||||
if ((delim = (char *) strchr (ptr, ',')) == NULL)
|
||||
delim = endptr;
|
||||
|
||||
len = delim - ptr;
|
||||
if (len > address_size - 1)
|
||||
len = address_size - 1;
|
||||
strncpy (address, ptr, len);
|
||||
address[len] = '\0';
|
||||
|
||||
ptr = delim + 1;
|
||||
|
||||
for (retry = ICE_CONNECTION_RETRIES; retry >= 0; retry--)
|
||||
{
|
||||
if ((trans_conn = _IceTransOpenCOTSClient (address)) == NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if ((connect_stat = _IceTransConnect (trans_conn, address)) < 0)
|
||||
{
|
||||
_IceTransClose (trans_conn);
|
||||
|
||||
if (connect_stat == TRANS_TRY_CONNECT_AGAIN)
|
||||
{
|
||||
sleep(1);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
madeConnection = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (madeConnection)
|
||||
{
|
||||
/*
|
||||
* We need to return the actual network connection string
|
||||
*/
|
||||
|
||||
*actualConnectionRet = (char *) malloc (strlen (address) + 1);
|
||||
strcpy (*actualConnectionRet, address);
|
||||
|
||||
|
||||
/*
|
||||
* Return the file descriptor
|
||||
*/
|
||||
}
|
||||
else trans_conn = NULL;
|
||||
|
||||
if (address != addrbuf) free (address);
|
||||
|
||||
return trans_conn;
|
||||
}
|
||||
647
lib/libICE/src/error.c
Normal file
647
lib/libICE/src/error.c
Normal file
@@ -0,0 +1,647 @@
|
||||
/* $XdotOrg: $ */
|
||||
/* $Xorg: error.c,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
/* $XFree86: xc/lib/ICE/error.c,v 1.5 2001/10/28 03:32:28 tsi Exp $ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
void
|
||||
_IceErrorBadMinor (iceConn, majorOpcode, offendingMinor, severity)
|
||||
|
||||
IceConn iceConn;
|
||||
int majorOpcode;
|
||||
int offendingMinor;
|
||||
int severity;
|
||||
|
||||
{
|
||||
IceErrorHeader (iceConn,
|
||||
majorOpcode, offendingMinor,
|
||||
iceConn->receive_sequence,
|
||||
severity,
|
||||
IceBadMinor,
|
||||
0);
|
||||
|
||||
IceFlush (iceConn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_IceErrorBadState (iceConn, majorOpcode, offendingMinor, severity)
|
||||
|
||||
IceConn iceConn;
|
||||
int majorOpcode;
|
||||
int offendingMinor;
|
||||
int severity;
|
||||
|
||||
{
|
||||
IceErrorHeader (iceConn,
|
||||
majorOpcode, offendingMinor,
|
||||
iceConn->receive_sequence,
|
||||
severity,
|
||||
IceBadState,
|
||||
0);
|
||||
|
||||
IceFlush (iceConn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_IceErrorBadLength (iceConn, majorOpcode, offendingMinor, severity)
|
||||
|
||||
IceConn iceConn;
|
||||
int majorOpcode;
|
||||
int offendingMinor;
|
||||
int severity;
|
||||
|
||||
{
|
||||
IceErrorHeader (iceConn,
|
||||
majorOpcode, offendingMinor,
|
||||
iceConn->receive_sequence,
|
||||
severity,
|
||||
IceBadLength,
|
||||
0);
|
||||
|
||||
IceFlush (iceConn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_IceErrorBadValue (iceConn, majorOpcode, offendingMinor, offset, length, value)
|
||||
|
||||
IceConn iceConn;
|
||||
int majorOpcode;
|
||||
int offendingMinor;
|
||||
int offset;
|
||||
int length; /* in bytes */
|
||||
IcePointer value;
|
||||
|
||||
{
|
||||
IceErrorHeader (iceConn,
|
||||
majorOpcode, offendingMinor,
|
||||
iceConn->receive_sequence,
|
||||
IceCanContinue,
|
||||
IceBadValue,
|
||||
WORD64COUNT (8 + length));
|
||||
|
||||
IceWriteData32 (iceConn, 4, &offset);
|
||||
IceWriteData32 (iceConn, 4, &length);
|
||||
IceWriteData (iceConn, length, (char *) value);
|
||||
|
||||
if (PAD64 (length))
|
||||
IceWritePad (iceConn, PAD64 (length));
|
||||
|
||||
IceFlush (iceConn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_IceErrorNoAuthentication (iceConn, offendingMinor)
|
||||
|
||||
IceConn iceConn;
|
||||
int offendingMinor;
|
||||
|
||||
{
|
||||
int severity = (offendingMinor == ICE_ConnectionSetup) ?
|
||||
IceFatalToConnection : IceFatalToProtocol;
|
||||
|
||||
IceErrorHeader (iceConn,
|
||||
0, offendingMinor,
|
||||
iceConn->receive_sequence,
|
||||
severity,
|
||||
IceNoAuth,
|
||||
0);
|
||||
|
||||
IceFlush (iceConn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_IceErrorNoVersion (iceConn, offendingMinor)
|
||||
|
||||
IceConn iceConn;
|
||||
int offendingMinor;
|
||||
|
||||
{
|
||||
int severity = (offendingMinor == ICE_ConnectionSetup) ?
|
||||
IceFatalToConnection : IceFatalToProtocol;
|
||||
|
||||
IceErrorHeader (iceConn,
|
||||
0, offendingMinor,
|
||||
iceConn->receive_sequence,
|
||||
severity,
|
||||
IceNoVersion,
|
||||
0);
|
||||
|
||||
IceFlush (iceConn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_IceErrorSetupFailed (iceConn, offendingMinor, reason)
|
||||
|
||||
IceConn iceConn;
|
||||
int offendingMinor;
|
||||
char *reason;
|
||||
|
||||
{
|
||||
char *pBuf, *pStart;
|
||||
int bytes;
|
||||
int severity = (offendingMinor == ICE_ConnectionSetup) ?
|
||||
IceFatalToConnection : IceFatalToProtocol;
|
||||
|
||||
if (!reason)
|
||||
reason = "";
|
||||
bytes = STRING_BYTES (reason);
|
||||
|
||||
IceErrorHeader (iceConn,
|
||||
0, offendingMinor,
|
||||
iceConn->receive_sequence,
|
||||
severity,
|
||||
IceSetupFailed,
|
||||
WORD64COUNT (bytes));
|
||||
|
||||
pBuf = pStart = IceAllocScratch (iceConn, PADDED_BYTES64 (bytes));
|
||||
STORE_STRING (pBuf, reason);
|
||||
|
||||
IceWriteData (iceConn, PADDED_BYTES64 (bytes), pStart);
|
||||
IceFlush (iceConn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_IceErrorAuthenticationRejected (iceConn, offendingMinor, reason)
|
||||
|
||||
IceConn iceConn;
|
||||
int offendingMinor;
|
||||
char *reason;
|
||||
|
||||
{
|
||||
char *pBuf, *pStart;
|
||||
int bytes;
|
||||
|
||||
if (!reason)
|
||||
reason = "";
|
||||
bytes = STRING_BYTES (reason);
|
||||
|
||||
IceErrorHeader (iceConn,
|
||||
0, offendingMinor,
|
||||
iceConn->receive_sequence,
|
||||
IceFatalToProtocol,
|
||||
IceAuthRejected,
|
||||
WORD64COUNT (bytes));
|
||||
|
||||
pBuf = pStart = IceAllocScratch (iceConn, PADDED_BYTES64 (bytes));
|
||||
STORE_STRING (pBuf, reason);
|
||||
|
||||
IceWriteData (iceConn, PADDED_BYTES64 (bytes), pStart);
|
||||
IceFlush (iceConn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_IceErrorAuthenticationFailed (iceConn, offendingMinor, reason)
|
||||
|
||||
IceConn iceConn;
|
||||
int offendingMinor;
|
||||
char *reason;
|
||||
|
||||
{
|
||||
char *pBuf, *pStart;
|
||||
int bytes;
|
||||
|
||||
if (!reason)
|
||||
reason = "";
|
||||
bytes = STRING_BYTES (reason);
|
||||
|
||||
IceErrorHeader (iceConn,
|
||||
0, offendingMinor,
|
||||
iceConn->receive_sequence,
|
||||
IceFatalToProtocol,
|
||||
IceAuthFailed,
|
||||
WORD64COUNT (bytes));
|
||||
|
||||
pBuf = pStart = IceAllocScratch (iceConn, PADDED_BYTES64 (bytes));
|
||||
STORE_STRING (pBuf, reason);
|
||||
|
||||
IceWriteData (iceConn, PADDED_BYTES64 (bytes), pStart);
|
||||
IceFlush (iceConn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_IceErrorProtocolDuplicate (iceConn, protocolName)
|
||||
|
||||
IceConn iceConn;
|
||||
char *protocolName;
|
||||
|
||||
{
|
||||
char *pBuf, *pStart;
|
||||
int bytes;
|
||||
|
||||
if (!protocolName)
|
||||
protocolName = "";
|
||||
bytes = STRING_BYTES (protocolName);
|
||||
|
||||
IceErrorHeader (iceConn,
|
||||
0, ICE_ProtocolSetup,
|
||||
iceConn->receive_sequence,
|
||||
IceFatalToProtocol,
|
||||
IceProtocolDuplicate,
|
||||
WORD64COUNT (bytes));
|
||||
|
||||
pBuf = pStart = IceAllocScratch (iceConn, PADDED_BYTES64 (bytes));
|
||||
STORE_STRING (pBuf, protocolName);
|
||||
|
||||
IceWriteData (iceConn, PADDED_BYTES64 (bytes), pStart);
|
||||
IceFlush (iceConn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_IceErrorMajorOpcodeDuplicate (iceConn, majorOpcode)
|
||||
|
||||
IceConn iceConn;
|
||||
int majorOpcode;
|
||||
|
||||
{
|
||||
char mOp = (char) majorOpcode;
|
||||
|
||||
IceErrorHeader (iceConn,
|
||||
0, ICE_ProtocolSetup,
|
||||
iceConn->receive_sequence,
|
||||
IceFatalToProtocol,
|
||||
IceMajorOpcodeDuplicate,
|
||||
1 /* length */);
|
||||
|
||||
IceWriteData (iceConn, 8, &mOp);
|
||||
IceFlush (iceConn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_IceErrorUnknownProtocol (iceConn, protocolName)
|
||||
|
||||
IceConn iceConn;
|
||||
char *protocolName;
|
||||
|
||||
{
|
||||
char *pBuf, *pStart;
|
||||
int bytes;
|
||||
|
||||
if (!protocolName)
|
||||
protocolName = "";
|
||||
bytes = STRING_BYTES (protocolName);
|
||||
|
||||
IceErrorHeader (iceConn,
|
||||
0, ICE_ProtocolSetup,
|
||||
iceConn->receive_sequence,
|
||||
IceFatalToProtocol,
|
||||
IceUnknownProtocol,
|
||||
WORD64COUNT (bytes));
|
||||
|
||||
pBuf = pStart = IceAllocScratch (iceConn, PADDED_BYTES64 (bytes));
|
||||
STORE_STRING (pBuf, protocolName);
|
||||
|
||||
IceWriteData (iceConn, PADDED_BYTES64 (bytes), pStart);
|
||||
IceFlush (iceConn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_IceErrorBadMajor (iceConn, offendingMajor, offendingMinor, severity)
|
||||
|
||||
IceConn iceConn;
|
||||
int offendingMajor;
|
||||
int offendingMinor;
|
||||
int severity;
|
||||
|
||||
{
|
||||
char maj = (char) offendingMajor;
|
||||
|
||||
IceErrorHeader (iceConn,
|
||||
0, offendingMinor,
|
||||
iceConn->receive_sequence,
|
||||
severity,
|
||||
IceBadMajor,
|
||||
1 /* length */);
|
||||
|
||||
IceWriteData (iceConn, 8, &maj);
|
||||
IceFlush (iceConn);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Default error handler.
|
||||
*/
|
||||
|
||||
void
|
||||
_IceDefaultErrorHandler (iceConn, swap,
|
||||
offendingMinorOpcode, offendingSequence, errorClass, severity, values)
|
||||
|
||||
IceConn iceConn;
|
||||
Bool swap;
|
||||
int offendingMinorOpcode;
|
||||
unsigned long offendingSequence;
|
||||
int errorClass;
|
||||
int severity;
|
||||
IcePointer values;
|
||||
|
||||
{
|
||||
char *str;
|
||||
char *pData = (char *) values;
|
||||
|
||||
switch (offendingMinorOpcode)
|
||||
{
|
||||
case ICE_ConnectionSetup:
|
||||
str = "ConnectionSetup";
|
||||
break;
|
||||
case ICE_AuthRequired:
|
||||
str = "AuthRequired";
|
||||
break;
|
||||
case ICE_AuthReply:
|
||||
str = "AuthReply";
|
||||
break;
|
||||
case ICE_AuthNextPhase:
|
||||
str = "AuthNextPhase";
|
||||
break;
|
||||
case ICE_ConnectionReply:
|
||||
str = "ConnectionReply";
|
||||
break;
|
||||
case ICE_ProtocolSetup:
|
||||
str = "ProtocolSetup";
|
||||
break;
|
||||
case ICE_ProtocolReply:
|
||||
str = "ProtocolReply";
|
||||
break;
|
||||
case ICE_Ping:
|
||||
str = "Ping";
|
||||
break;
|
||||
case ICE_PingReply:
|
||||
str = "PingReply";
|
||||
break;
|
||||
case ICE_WantToClose:
|
||||
str = "WantToClose";
|
||||
break;
|
||||
case ICE_NoClose:
|
||||
str = "NoClose";
|
||||
break;
|
||||
default:
|
||||
str = "";
|
||||
}
|
||||
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
fprintf (stderr, "ICE error: Offending minor opcode = %d (%s)\n",
|
||||
offendingMinorOpcode, str);
|
||||
|
||||
fprintf (stderr, " Offending sequence number = %lu\n",
|
||||
offendingSequence);
|
||||
|
||||
switch (errorClass)
|
||||
{
|
||||
case IceBadMinor:
|
||||
str = "BadMinor";
|
||||
break;
|
||||
case IceBadState:
|
||||
str = "BadState";
|
||||
break;
|
||||
case IceBadLength:
|
||||
str = "BadLength";
|
||||
break;
|
||||
case IceBadValue:
|
||||
str = "BadValue";
|
||||
break;
|
||||
case IceBadMajor:
|
||||
str = "BadMajor";
|
||||
break;
|
||||
case IceNoAuth:
|
||||
str = "NoAuthentication";
|
||||
break;
|
||||
case IceNoVersion:
|
||||
str = "NoVersion";
|
||||
break;
|
||||
case IceSetupFailed:
|
||||
str = "SetupFailed";
|
||||
break;
|
||||
case IceAuthRejected:
|
||||
str = "AuthenticationRejected";
|
||||
break;
|
||||
case IceAuthFailed:
|
||||
str = "AuthenticationFailed";
|
||||
break;
|
||||
case IceProtocolDuplicate:
|
||||
str = "ProtocolDuplicate";
|
||||
break;
|
||||
case IceMajorOpcodeDuplicate:
|
||||
str = "MajorOpcodeDuplicate";
|
||||
break;
|
||||
case IceUnknownProtocol:
|
||||
str = "UnknownProtocol";
|
||||
break;
|
||||
default:
|
||||
str = "???";
|
||||
}
|
||||
|
||||
fprintf (stderr, " Error class = %s\n", str);
|
||||
|
||||
if (severity == IceCanContinue)
|
||||
str = "CanContinue";
|
||||
else if (severity == IceFatalToProtocol)
|
||||
str = "FatalToProtocol";
|
||||
else if (severity == IceFatalToConnection)
|
||||
str = "FatalToConnection";
|
||||
else
|
||||
str = "???";
|
||||
|
||||
fprintf (stderr, " Severity = %s\n", str);
|
||||
|
||||
switch (errorClass)
|
||||
{
|
||||
case IceBadValue:
|
||||
{
|
||||
int offset, length, val;
|
||||
|
||||
EXTRACT_CARD32 (pData, swap, offset);
|
||||
EXTRACT_CARD32 (pData, swap, length);
|
||||
|
||||
fprintf (stderr,
|
||||
" BadValue Offset = %d\n", offset);
|
||||
fprintf (stderr,
|
||||
" BadValue Length = %d\n", length);
|
||||
|
||||
if (length <= 4)
|
||||
{
|
||||
if (length == 1)
|
||||
val = (int) *pData;
|
||||
else if (length == 2)
|
||||
{
|
||||
EXTRACT_CARD16 (pData, swap, val);
|
||||
}
|
||||
else
|
||||
{
|
||||
EXTRACT_CARD32 (pData, swap, val);
|
||||
}
|
||||
|
||||
fprintf (stderr,
|
||||
" BadValue = %d\n", val);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case IceBadMajor:
|
||||
|
||||
fprintf (stderr, "Major opcode : %d\n", (int) *pData);
|
||||
break;
|
||||
|
||||
case IceSetupFailed:
|
||||
|
||||
EXTRACT_STRING (pData, swap, str);
|
||||
fprintf (stderr, "Reason : %s\n", str);
|
||||
free(str);
|
||||
break;
|
||||
|
||||
case IceAuthRejected:
|
||||
|
||||
EXTRACT_STRING (pData, swap, str);
|
||||
fprintf (stderr, "Reason : %s\n", str);
|
||||
free(str);
|
||||
break;
|
||||
|
||||
case IceAuthFailed:
|
||||
|
||||
EXTRACT_STRING (pData, swap, str);
|
||||
fprintf (stderr, "Reason : %s\n", str);
|
||||
free(str);
|
||||
break;
|
||||
|
||||
case IceProtocolDuplicate:
|
||||
|
||||
EXTRACT_STRING (pData, swap, str);
|
||||
fprintf (stderr, "Protocol name : %s\n", str);
|
||||
free(str);
|
||||
break;
|
||||
|
||||
case IceMajorOpcodeDuplicate:
|
||||
|
||||
fprintf (stderr, "Major opcode : %d\n", (int) *pData);
|
||||
break;
|
||||
|
||||
case IceUnknownProtocol:
|
||||
|
||||
EXTRACT_STRING (pData, swap, str);
|
||||
fprintf (stderr, "Protocol name : %s\n", str);
|
||||
free(str);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
if (severity != IceCanContinue)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* This procedure sets the ICE error handler to be the specified
|
||||
* routine. If NULL is passed in the default error handler is restored.
|
||||
* The function's return value is the previous error handler.
|
||||
*/
|
||||
|
||||
IceErrorHandler
|
||||
IceSetErrorHandler (handler)
|
||||
|
||||
IceErrorHandler handler;
|
||||
|
||||
{
|
||||
IceErrorHandler oldHandler = _IceErrorHandler;
|
||||
|
||||
if (handler != NULL)
|
||||
_IceErrorHandler = handler;
|
||||
else
|
||||
_IceErrorHandler = _IceDefaultErrorHandler;
|
||||
|
||||
return (oldHandler);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Default IO error handler.
|
||||
*/
|
||||
|
||||
void
|
||||
_IceDefaultIOErrorHandler (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
fprintf (stderr,
|
||||
"ICE default IO error handler doing an exit(), pid = %ld, errno = %d\n",
|
||||
(long)getpid(), errno);
|
||||
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* This procedure sets the ICE fatal I/O error handler to be the
|
||||
* specified routine. If NULL is passed in the default error
|
||||
* handler is restored. The function's return value is the
|
||||
* previous error handler.
|
||||
*/
|
||||
|
||||
IceIOErrorHandler
|
||||
IceSetIOErrorHandler (handler)
|
||||
|
||||
IceIOErrorHandler handler;
|
||||
|
||||
{
|
||||
IceIOErrorHandler oldHandler = _IceIOErrorHandler;
|
||||
|
||||
if (handler != NULL)
|
||||
_IceIOErrorHandler = handler;
|
||||
else
|
||||
_IceIOErrorHandler = _IceDefaultIOErrorHandler;
|
||||
|
||||
return (oldHandler);
|
||||
}
|
||||
274
lib/libICE/src/getauth.c
Normal file
274
lib/libICE/src/getauth.c
Normal file
@@ -0,0 +1,274 @@
|
||||
/* $Xorg: getauth.c,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
/* $XFree86: xc/lib/ICE/getauth.c,v 1.2 2001/10/28 03:32:28 tsi Exp $ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
#include <X11/ICE/ICEutil.h>
|
||||
|
||||
static Bool auth_valid ();
|
||||
|
||||
extern int _IcePaAuthDataEntryCount;
|
||||
extern IceAuthDataEntry _IcePaAuthDataEntries[];
|
||||
|
||||
|
||||
/*
|
||||
* The functions in this file are not a standard part of ICElib.
|
||||
*
|
||||
* The sample implementation uses an .ICEauthority to manipulate
|
||||
* authentication data.
|
||||
*
|
||||
* For the client that initiates a Protocol Setup, we look in the
|
||||
* .ICEauthority file to get the data.
|
||||
*
|
||||
* For the client accepting the Protocol Setup, we get the data
|
||||
* from an in-memory database of authentication data (set by the
|
||||
* application calling IceSetPaAuthData). We have to get the data
|
||||
* from memory because getting it directly from the .ICEauthority
|
||||
* file is not secure - someone can just modify the contents of the
|
||||
* .ICEauthority file behind our back.
|
||||
*/
|
||||
|
||||
void
|
||||
_IceGetPoAuthData (protocolName, networkId, authName,
|
||||
authDataLenRet, authDataRet)
|
||||
|
||||
char *protocolName;
|
||||
char *networkId;
|
||||
char *authName;
|
||||
unsigned short *authDataLenRet;
|
||||
char **authDataRet;
|
||||
|
||||
{
|
||||
IceAuthFileEntry *entry;
|
||||
|
||||
entry = IceGetAuthFileEntry (protocolName, networkId, authName);
|
||||
|
||||
if (entry)
|
||||
{
|
||||
*authDataLenRet = entry->auth_data_length;
|
||||
|
||||
if ((*authDataRet = (char *) malloc (entry->auth_data_length)) != NULL)
|
||||
memcpy (*authDataRet, entry->auth_data, entry->auth_data_length);
|
||||
}
|
||||
else
|
||||
{
|
||||
*authDataLenRet = 0;
|
||||
*authDataRet = NULL;
|
||||
}
|
||||
|
||||
IceFreeAuthFileEntry (entry);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
_IceGetPaAuthData (protocolName, networkId, authName,
|
||||
authDataLenRet, authDataRet)
|
||||
|
||||
char *protocolName;
|
||||
char *networkId;
|
||||
char *authName;
|
||||
unsigned short *authDataLenRet;
|
||||
char **authDataRet;
|
||||
|
||||
{
|
||||
IceAuthDataEntry *entry = NULL;
|
||||
int found = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < _IcePaAuthDataEntryCount && !found; i++)
|
||||
{
|
||||
entry = &_IcePaAuthDataEntries[i];
|
||||
|
||||
found =
|
||||
strcmp (protocolName, entry->protocol_name) == 0 &&
|
||||
strcmp (networkId, entry->network_id) == 0 &&
|
||||
strcmp (authName, entry->auth_name) == 0;
|
||||
}
|
||||
|
||||
if (found)
|
||||
{
|
||||
*authDataLenRet = entry->auth_data_length;
|
||||
|
||||
if ((*authDataRet = (char *) malloc (entry->auth_data_length)) != NULL)
|
||||
memcpy (*authDataRet, entry->auth_data, entry->auth_data_length);
|
||||
}
|
||||
else
|
||||
{
|
||||
*authDataLenRet = 0;
|
||||
*authDataRet = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
_IceGetPoValidAuthIndices (protocol_name, network_id,
|
||||
num_auth_names, auth_names, num_indices_ret, indices_ret)
|
||||
|
||||
char *protocol_name;
|
||||
char *network_id;
|
||||
int num_auth_names;
|
||||
char **auth_names;
|
||||
int *num_indices_ret;
|
||||
int *indices_ret; /* in/out arg */
|
||||
|
||||
{
|
||||
FILE *auth_file;
|
||||
char *filename;
|
||||
IceAuthFileEntry *entry;
|
||||
int index_ret, i;
|
||||
|
||||
*num_indices_ret = 0;
|
||||
|
||||
if (!(filename = IceAuthFileName ()))
|
||||
return;
|
||||
|
||||
if (access (filename, R_OK) != 0) /* checks REAL id */
|
||||
return;
|
||||
|
||||
if (!(auth_file = fopen (filename, "rb")))
|
||||
return;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (!(entry = IceReadAuthFileEntry (auth_file)))
|
||||
break;
|
||||
|
||||
if (strcmp (protocol_name, entry->protocol_name) == 0 &&
|
||||
strcmp (network_id, entry->network_id) == 0 &&
|
||||
auth_valid (entry->auth_name, num_auth_names,
|
||||
auth_names, &index_ret))
|
||||
{
|
||||
/*
|
||||
* Make sure we didn't store this index already.
|
||||
*/
|
||||
|
||||
for (i = 0; i < *num_indices_ret; i++)
|
||||
if (index_ret == indices_ret[i])
|
||||
break;
|
||||
|
||||
if (i >= *num_indices_ret)
|
||||
{
|
||||
indices_ret[*num_indices_ret] = index_ret;
|
||||
*num_indices_ret += 1;
|
||||
}
|
||||
}
|
||||
|
||||
IceFreeAuthFileEntry (entry);
|
||||
}
|
||||
|
||||
fclose (auth_file);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
_IceGetPaValidAuthIndices (protocol_name, network_id,
|
||||
num_auth_names, auth_names, num_indices_ret, indices_ret)
|
||||
|
||||
char *protocol_name;
|
||||
char *network_id;
|
||||
int num_auth_names;
|
||||
char **auth_names;
|
||||
int *num_indices_ret;
|
||||
int *indices_ret; /* in/out arg */
|
||||
|
||||
{
|
||||
int index_ret;
|
||||
int i, j;
|
||||
IceAuthDataEntry *entry;
|
||||
|
||||
*num_indices_ret = 0;
|
||||
|
||||
for (i = 0; i < _IcePaAuthDataEntryCount; i++)
|
||||
{
|
||||
entry = &_IcePaAuthDataEntries[i];
|
||||
|
||||
if (strcmp (protocol_name, entry->protocol_name) == 0 &&
|
||||
strcmp (network_id, entry->network_id) == 0 &&
|
||||
auth_valid (entry->auth_name, num_auth_names,
|
||||
auth_names, &index_ret))
|
||||
{
|
||||
/*
|
||||
* Make sure we didn't store this index already.
|
||||
*/
|
||||
|
||||
for (j = 0; j < *num_indices_ret; j++)
|
||||
if (index_ret == indices_ret[j])
|
||||
break;
|
||||
|
||||
if (j >= *num_indices_ret)
|
||||
{
|
||||
indices_ret[*num_indices_ret] = index_ret;
|
||||
*num_indices_ret += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* local routines
|
||||
*/
|
||||
|
||||
static Bool
|
||||
auth_valid (auth_name, num_auth_names, auth_names, index_ret)
|
||||
|
||||
char *auth_name;
|
||||
int num_auth_names;
|
||||
char **auth_names;
|
||||
int *index_ret;
|
||||
|
||||
{
|
||||
/*
|
||||
* Check if auth_name is in auth_names. Return index.
|
||||
*/
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_auth_names; i++)
|
||||
if (strcmp (auth_name, auth_names[i]) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (i < num_auth_names)
|
||||
{
|
||||
*index_ret = i;
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
return (0);
|
||||
}
|
||||
64
lib/libICE/src/globals.h
Normal file
64
lib/libICE/src/globals.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/* $Xorg: globals.h,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
/* $XFree86: xc/lib/ICE/globals.h,v 1.4 2001/12/14 19:53:35 dawes Exp $ */
|
||||
|
||||
extern void _IceDefaultErrorHandler ();
|
||||
extern void _IceDefaultIOErrorHandler ();
|
||||
|
||||
extern IcePoAuthStatus _IcePoMagicCookie1Proc ();
|
||||
extern IcePaAuthStatus _IcePaMagicCookie1Proc ();
|
||||
|
||||
extern void _IceProcessCoreMessage ();
|
||||
|
||||
#ifndef __UNIXOS2__
|
||||
IceConn _IceConnectionObjs[256];
|
||||
char *_IceConnectionStrings[256];
|
||||
_IceProtocol _IceProtocols[255];
|
||||
#else
|
||||
IceConn _IceConnectionObjs[256] = {0};
|
||||
char *_IceConnectionStrings[256] = {0};
|
||||
_IceProtocol _IceProtocols[255] = {0};
|
||||
#endif
|
||||
int _IceConnectionCount = 0;
|
||||
|
||||
int _IceLastMajorOpcode = 0;
|
||||
|
||||
int _IceAuthCount = 1;
|
||||
char *_IceAuthNames[] = {"MIT-MAGIC-COOKIE-1"};
|
||||
IcePoAuthProc _IcePoAuthProcs[] = {_IcePoMagicCookie1Proc};
|
||||
IcePaAuthProc _IcePaAuthProcs[] = {_IcePaMagicCookie1Proc};
|
||||
|
||||
int _IceVersionCount = 1;
|
||||
_IceVersion _IceVersions[] = {
|
||||
{IceProtoMajor, IceProtoMinor, _IceProcessCoreMessage}};
|
||||
|
||||
_IceWatchProc *_IceWatchProcs = NULL;
|
||||
|
||||
IceErrorHandler _IceErrorHandler = _IceDefaultErrorHandler;
|
||||
IceIOErrorHandler _IceIOErrorHandler = _IceDefaultIOErrorHandler;
|
||||
278
lib/libICE/src/iceauth.c
Normal file
278
lib/libICE/src/iceauth.c
Normal file
@@ -0,0 +1,278 @@
|
||||
/* $Xorg: iceauth.c,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
/* $XFree86: xc/lib/ICE/iceauth.c,v 3.5 2001/12/14 19:53:36 dawes Exp $ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
#include <X11/ICE/ICEutil.h>
|
||||
|
||||
#include <time.h>
|
||||
#define Time_t time_t
|
||||
|
||||
static int binaryEqual ();
|
||||
|
||||
static int was_called_state;
|
||||
|
||||
/*
|
||||
* MIT-MAGIC-COOKIE-1 is a sample authentication method implemented by
|
||||
* the SI. It is not part of standard ICElib.
|
||||
*/
|
||||
|
||||
|
||||
char *
|
||||
IceGenerateMagicCookie (len)
|
||||
|
||||
int len;
|
||||
|
||||
{
|
||||
char *auth;
|
||||
long ldata[2];
|
||||
int seed;
|
||||
int value;
|
||||
int i;
|
||||
|
||||
if ((auth = (char *) malloc (len + 1)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
#ifdef ITIMER_REAL
|
||||
{
|
||||
struct timeval now;
|
||||
X_GETTIMEOFDAY (&now);
|
||||
ldata[0] = now.tv_sec;
|
||||
ldata[1] = now.tv_usec;
|
||||
}
|
||||
#else
|
||||
{
|
||||
#ifndef __UNIXOS2__
|
||||
long time ();
|
||||
#endif
|
||||
ldata[0] = time ((long *) 0);
|
||||
ldata[1] = getpid ();
|
||||
}
|
||||
#endif
|
||||
seed = (ldata[0]) + (ldata[1] << 16);
|
||||
srand (seed);
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
value = rand ();
|
||||
auth[i] = value & 0xff;
|
||||
}
|
||||
auth[len] = '\0';
|
||||
|
||||
return (auth);
|
||||
}
|
||||
|
||||
|
||||
|
||||
IcePoAuthStatus
|
||||
_IcePoMagicCookie1Proc (iceConn, authStatePtr, cleanUp, swap,
|
||||
authDataLen, authData, replyDataLenRet, replyDataRet, errorStringRet)
|
||||
|
||||
IceConn iceConn;
|
||||
IcePointer *authStatePtr;
|
||||
Bool cleanUp;
|
||||
Bool swap;
|
||||
int authDataLen;
|
||||
IcePointer authData;
|
||||
int *replyDataLenRet;
|
||||
IcePointer *replyDataRet;
|
||||
char **errorStringRet;
|
||||
|
||||
{
|
||||
if (cleanUp)
|
||||
{
|
||||
/*
|
||||
* We didn't allocate any state. We're done.
|
||||
*/
|
||||
|
||||
return (IcePoAuthDoneCleanup);
|
||||
}
|
||||
|
||||
*errorStringRet = NULL;
|
||||
|
||||
if (*authStatePtr == NULL)
|
||||
{
|
||||
/*
|
||||
* This is the first time we're being called. Search the
|
||||
* authentication data for the first occurence of
|
||||
* MIT-MAGIC-COOKIE-1 that matches iceConn->connection_string.
|
||||
*/
|
||||
|
||||
unsigned short length;
|
||||
char *data;
|
||||
|
||||
_IceGetPoAuthData ("ICE", iceConn->connection_string,
|
||||
"MIT-MAGIC-COOKIE-1", &length, &data);
|
||||
|
||||
if (!data)
|
||||
{
|
||||
char *tempstr =
|
||||
"Could not find correct MIT-MAGIC-COOKIE-1 authentication";
|
||||
|
||||
*errorStringRet = (char *) malloc (strlen (tempstr) + 1);
|
||||
if (*errorStringRet)
|
||||
strcpy (*errorStringRet, tempstr);
|
||||
|
||||
return (IcePoAuthFailed);
|
||||
}
|
||||
else
|
||||
{
|
||||
*authStatePtr = (IcePointer) &was_called_state;
|
||||
|
||||
*replyDataLenRet = length;
|
||||
*replyDataRet = data;
|
||||
|
||||
return (IcePoAuthHaveReply);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* We should never get here for MIT-MAGIC-COOKIE-1 since it is
|
||||
* a single pass authentication method.
|
||||
*/
|
||||
|
||||
char *tempstr = "MIT-MAGIC-COOKIE-1 authentication internal error";
|
||||
|
||||
*errorStringRet = (char *) malloc (strlen (tempstr) + 1);
|
||||
if (*errorStringRet)
|
||||
strcpy (*errorStringRet, tempstr);
|
||||
|
||||
return (IcePoAuthFailed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
IcePaAuthStatus
|
||||
_IcePaMagicCookie1Proc (iceConn, authStatePtr, swap,
|
||||
authDataLen, authData, replyDataLenRet, replyDataRet, errorStringRet)
|
||||
|
||||
IceConn iceConn;
|
||||
IcePointer *authStatePtr;
|
||||
Bool swap;
|
||||
int authDataLen;
|
||||
IcePointer authData;
|
||||
int *replyDataLenRet;
|
||||
IcePointer *replyDataRet;
|
||||
char **errorStringRet;
|
||||
|
||||
{
|
||||
*errorStringRet = NULL;
|
||||
*replyDataLenRet = 0;
|
||||
*replyDataRet = NULL;
|
||||
|
||||
if (*authStatePtr == NULL)
|
||||
{
|
||||
/*
|
||||
* This is the first time we're being called. We don't have
|
||||
* any data to pass to the other client.
|
||||
*/
|
||||
|
||||
*authStatePtr = (IcePointer) &was_called_state;
|
||||
|
||||
return (IcePaAuthContinue);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Search the authentication data for the first occurence of
|
||||
* MIT-MAGIC-COOKIE-1 that matches iceConn->connection_string.
|
||||
*/
|
||||
|
||||
unsigned short length;
|
||||
char *data;
|
||||
|
||||
_IceGetPaAuthData ("ICE", iceConn->connection_string,
|
||||
"MIT-MAGIC-COOKIE-1", &length, &data);
|
||||
|
||||
if (data)
|
||||
{
|
||||
IcePaAuthStatus stat;
|
||||
|
||||
if (authDataLen == length &&
|
||||
binaryEqual ((char *) authData, data, authDataLen))
|
||||
{
|
||||
stat = IcePaAuthAccepted;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *tempstr = "MIT-MAGIC-COOKIE-1 authentication rejected";
|
||||
|
||||
*errorStringRet = (char *) malloc (strlen (tempstr) + 1);
|
||||
if (*errorStringRet)
|
||||
strcpy (*errorStringRet, tempstr);
|
||||
|
||||
stat = IcePaAuthRejected;
|
||||
}
|
||||
|
||||
free (data);
|
||||
return (stat);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* We should never get here because in the ConnectionReply
|
||||
* we should have passed all the valid methods. So we should
|
||||
* always find a valid entry.
|
||||
*/
|
||||
|
||||
char *tempstr =
|
||||
"MIT-MAGIC-COOKIE-1 authentication internal error";
|
||||
|
||||
*errorStringRet = (char *) malloc (strlen (tempstr) + 1);
|
||||
if (*errorStringRet)
|
||||
strcpy (*errorStringRet, tempstr);
|
||||
|
||||
return (IcePaAuthFailed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* local routines
|
||||
*/
|
||||
|
||||
static int
|
||||
binaryEqual (a, b, len)
|
||||
|
||||
register char *a, *b;
|
||||
register unsigned len;
|
||||
|
||||
{
|
||||
while (len--)
|
||||
if (*a++ != *b++)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
33
lib/libICE/src/icetrans.c
Normal file
33
lib/libICE/src/icetrans.c
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* $Id: icetrans.c,v 1.1.1.1 2006/11/25 16:45:58 matthieu Exp $
|
||||
*
|
||||
* Copyright © 2003 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Keith Packard not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Keith Packard makes no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#define ICE_t
|
||||
#define TRANS_CLIENT
|
||||
#define TRANS_SERVER
|
||||
|
||||
#include <X11/Xtrans/transport.c>
|
||||
283
lib/libICE/src/listen.c
Normal file
283
lib/libICE/src/listen.c
Normal file
@@ -0,0 +1,283 @@
|
||||
/* $Xorg: listen.c,v 1.5 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
#include <X11/Xtrans/Xtrans.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
Status
|
||||
IceListenForConnections (countRet, listenObjsRet, errorLength, errorStringRet)
|
||||
|
||||
int *countRet;
|
||||
IceListenObj **listenObjsRet;
|
||||
int errorLength;
|
||||
char *errorStringRet;
|
||||
|
||||
{
|
||||
struct _IceListenObj *listenObjs;
|
||||
char *networkId;
|
||||
int transCount, partial, i, j;
|
||||
Status status = 1;
|
||||
XtransConnInfo *transConns = NULL;
|
||||
|
||||
|
||||
if ((_IceTransMakeAllCOTSServerListeners (NULL, &partial,
|
||||
&transCount, &transConns) < 0) || (transCount < 1))
|
||||
{
|
||||
*listenObjsRet = NULL;
|
||||
*countRet = 0;
|
||||
|
||||
strncpy (errorStringRet,
|
||||
"Cannot establish any listening sockets", errorLength);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
if ((listenObjs = (struct _IceListenObj *) malloc (
|
||||
transCount * sizeof (struct _IceListenObj))) == NULL)
|
||||
{
|
||||
for (i = 0; i < transCount; i++)
|
||||
_IceTransClose (transConns[i]);
|
||||
free ((char *) transConns);
|
||||
return (0);
|
||||
}
|
||||
|
||||
*countRet = 0;
|
||||
|
||||
for (i = 0; i < transCount; i++)
|
||||
{
|
||||
networkId = _IceTransGetMyNetworkId (transConns[i]);
|
||||
|
||||
if (networkId)
|
||||
{
|
||||
listenObjs[*countRet].trans_conn = transConns[i];
|
||||
listenObjs[*countRet].network_id = networkId;
|
||||
|
||||
(*countRet)++;
|
||||
}
|
||||
}
|
||||
|
||||
if (*countRet == 0)
|
||||
{
|
||||
*listenObjsRet = NULL;
|
||||
|
||||
strncpy (errorStringRet,
|
||||
"Cannot establish any listening sockets", errorLength);
|
||||
|
||||
status = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*listenObjsRet = (IceListenObj *) malloc (
|
||||
*countRet * sizeof (IceListenObj));
|
||||
|
||||
if (*listenObjsRet == NULL)
|
||||
{
|
||||
strncpy (errorStringRet, "Malloc failed", errorLength);
|
||||
|
||||
status = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < *countRet; i++)
|
||||
{
|
||||
(*listenObjsRet)[i] = (IceListenObj) malloc (
|
||||
sizeof (struct _IceListenObj));
|
||||
|
||||
if ((*listenObjsRet)[i] == NULL)
|
||||
{
|
||||
strncpy (errorStringRet, "Malloc failed", errorLength);
|
||||
|
||||
for (j = 0; j < i; j++)
|
||||
free ((char *) (*listenObjsRet)[j]);
|
||||
|
||||
free ((char *) *listenObjsRet);
|
||||
|
||||
status = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*((*listenObjsRet)[i]) = listenObjs[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (status == 1)
|
||||
{
|
||||
if (errorStringRet && errorLength > 0)
|
||||
*errorStringRet = '\0';
|
||||
|
||||
for (i = 0; i < *countRet; i++)
|
||||
{
|
||||
(*listenObjsRet)[i]->host_based_auth_proc = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < transCount; i++)
|
||||
_IceTransClose (transConns[i]);
|
||||
}
|
||||
|
||||
free ((char *) listenObjs);
|
||||
free ((char *) transConns);
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
IceGetListenConnectionNumber (listenObj)
|
||||
|
||||
IceListenObj listenObj;
|
||||
|
||||
{
|
||||
return (_IceTransGetConnectionNumber (listenObj->trans_conn));
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *
|
||||
IceGetListenConnectionString (listenObj)
|
||||
|
||||
IceListenObj listenObj;
|
||||
|
||||
{
|
||||
char *networkId;
|
||||
|
||||
networkId = (char *) malloc (strlen (listenObj->network_id) + 1);
|
||||
|
||||
if (networkId)
|
||||
strcpy (networkId, listenObj->network_id);
|
||||
|
||||
return (networkId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *
|
||||
IceComposeNetworkIdList (count, listenObjs)
|
||||
|
||||
int count;
|
||||
IceListenObj *listenObjs;
|
||||
|
||||
{
|
||||
char *list;
|
||||
int len = 0;
|
||||
int i;
|
||||
|
||||
if (count < 1 || listenObjs == NULL)
|
||||
return (NULL);
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
len += (strlen (listenObjs[i]->network_id) + 1);
|
||||
|
||||
list = (char *) malloc (len);
|
||||
|
||||
if (list == NULL)
|
||||
return (NULL);
|
||||
else
|
||||
{
|
||||
int doneCount = 0;
|
||||
|
||||
list[0] = '\0';
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
if (_IceTransIsLocal (listenObjs[i]->trans_conn))
|
||||
{
|
||||
strcat (list, listenObjs[i]->network_id);
|
||||
doneCount++;
|
||||
if (doneCount < count)
|
||||
strcat (list, ",");
|
||||
}
|
||||
}
|
||||
|
||||
if (doneCount < count)
|
||||
{
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
if (!_IceTransIsLocal (listenObjs[i]->trans_conn))
|
||||
{
|
||||
strcat (list, listenObjs[i]->network_id);
|
||||
doneCount++;
|
||||
if (doneCount < count)
|
||||
strcat (list, ",");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
IceFreeListenObjs (count, listenObjs)
|
||||
|
||||
int count;
|
||||
IceListenObj *listenObjs;
|
||||
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
free (listenObjs[i]->network_id);
|
||||
_IceTransClose (listenObjs[i]->trans_conn);
|
||||
free ((char *) listenObjs[i]);
|
||||
}
|
||||
|
||||
free ((char *) listenObjs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Allow host based authentication for the ICE Connection Setup.
|
||||
* Do not confuse with the host based authentication callbacks that
|
||||
* can be set up in IceRegisterForProtocolReply.
|
||||
*/
|
||||
|
||||
void
|
||||
IceSetHostBasedAuthProc (listenObj, hostBasedAuthProc)
|
||||
|
||||
IceListenObj listenObj;
|
||||
IceHostBasedAuthProc hostBasedAuthProc;
|
||||
|
||||
{
|
||||
listenObj->host_based_auth_proc = hostBasedAuthProc;
|
||||
}
|
||||
161
lib/libICE/src/listenwk.c
Normal file
161
lib/libICE/src/listenwk.c
Normal file
@@ -0,0 +1,161 @@
|
||||
/* $Xorg: listenwk.c,v 1.5 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
|
||||
/*
|
||||
|
||||
Copyright 1996, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
*/
|
||||
/* $XFree86: xc/lib/ICE/listenwk.c,v 1.3 2001/01/17 19:41:29 dawes Exp $ */
|
||||
|
||||
|
||||
/* Author: Ralph Mor, X Consortium */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
#include <X11/Xtrans/Xtrans.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
Status
|
||||
IceListenForWellKnownConnections (port, countRet, listenObjsRet, errorLength, errorStringRet)
|
||||
|
||||
char *port;
|
||||
int *countRet;
|
||||
IceListenObj **listenObjsRet;
|
||||
int errorLength;
|
||||
char *errorStringRet;
|
||||
|
||||
{
|
||||
struct _IceListenObj *listenObjs;
|
||||
char *networkId;
|
||||
int transCount, partial, i, j;
|
||||
Status status = 1;
|
||||
XtransConnInfo *transConns = NULL;
|
||||
|
||||
|
||||
if ((_IceTransMakeAllCOTSServerListeners (port, &partial,
|
||||
&transCount, &transConns) < 0) || (transCount < 1))
|
||||
{
|
||||
*listenObjsRet = NULL;
|
||||
*countRet = 0;
|
||||
|
||||
strncpy (errorStringRet,
|
||||
"Cannot establish any listening sockets", errorLength);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
if ((listenObjs = (struct _IceListenObj *) malloc (
|
||||
transCount * sizeof (struct _IceListenObj))) == NULL)
|
||||
{
|
||||
for (i = 0; i < transCount; i++)
|
||||
_IceTransClose (transConns[i]);
|
||||
free ((char *) transConns);
|
||||
return (0);
|
||||
}
|
||||
|
||||
*countRet = 0;
|
||||
|
||||
for (i = 0; i < transCount; i++)
|
||||
{
|
||||
networkId = (char *)_IceTransGetMyNetworkId (transConns[i]);
|
||||
|
||||
if (networkId)
|
||||
{
|
||||
listenObjs[*countRet].trans_conn = transConns[i];
|
||||
listenObjs[*countRet].network_id = networkId;
|
||||
|
||||
(*countRet)++;
|
||||
}
|
||||
}
|
||||
|
||||
if (*countRet == 0)
|
||||
{
|
||||
*listenObjsRet = NULL;
|
||||
|
||||
strncpy (errorStringRet,
|
||||
"Cannot establish any listening sockets", errorLength);
|
||||
|
||||
status = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*listenObjsRet = (IceListenObj *) malloc (
|
||||
*countRet * sizeof (IceListenObj));
|
||||
|
||||
if (*listenObjsRet == NULL)
|
||||
{
|
||||
strncpy (errorStringRet, "Malloc failed", errorLength);
|
||||
|
||||
status = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < *countRet; i++)
|
||||
{
|
||||
(*listenObjsRet)[i] = (IceListenObj) malloc (
|
||||
sizeof (struct _IceListenObj));
|
||||
|
||||
if ((*listenObjsRet)[i] == NULL)
|
||||
{
|
||||
strncpy (errorStringRet, "Malloc failed", errorLength);
|
||||
|
||||
for (j = 0; j < i; j++)
|
||||
free ((char *) (*listenObjsRet)[j]);
|
||||
|
||||
free ((char *) *listenObjsRet);
|
||||
|
||||
status = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*((*listenObjsRet)[i]) = listenObjs[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (status == 1)
|
||||
{
|
||||
if (errorStringRet && errorLength > 0)
|
||||
*errorStringRet = '\0';
|
||||
|
||||
for (i = 0; i < *countRet; i++)
|
||||
{
|
||||
(*listenObjsRet)[i]->host_based_auth_proc = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < transCount; i++)
|
||||
_IceTransClose (transConns[i]);
|
||||
}
|
||||
|
||||
free ((char *) listenObjs);
|
||||
free ((char *) transConns);
|
||||
|
||||
return (status);
|
||||
}
|
||||
67
lib/libICE/src/locking.c
Normal file
67
lib/libICE/src/locking.c
Normal file
@@ -0,0 +1,67 @@
|
||||
/* $Xorg: locking.c,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
|
||||
|
||||
/*
|
||||
* NOT IMPLEMENTED YET
|
||||
*/
|
||||
|
||||
|
||||
Status
|
||||
IceInitThreads ()
|
||||
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IceAppLockConn (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
IceLockConn (iceConn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IceAppUnlockConn (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
IceUnlockConn (iceConn);
|
||||
}
|
||||
630
lib/libICE/src/misc.c
Normal file
630
lib/libICE/src/misc.c
Normal file
@@ -0,0 +1,630 @@
|
||||
/* $Xorg: misc.c,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
/* $XFree86: xc/lib/ICE/misc.c,v 1.3 2001/01/17 19:41:29 dawes Exp $ */
|
||||
|
||||
#ifdef WIN32
|
||||
#define _WILLWINSOCK_
|
||||
#endif
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
#include <X11/Xtrans/Xtrans.h>
|
||||
#include <stdio.h>
|
||||
#ifdef WIN32
|
||||
#include <X11/Xwinsock.h>
|
||||
#include <X11/Xw32defs.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* scratch buffer
|
||||
*/
|
||||
|
||||
char *
|
||||
IceAllocScratch (iceConn, size)
|
||||
|
||||
IceConn iceConn;
|
||||
unsigned long size;
|
||||
|
||||
{
|
||||
if (!iceConn->scratch || size > iceConn->scratch_size)
|
||||
{
|
||||
if (iceConn->scratch)
|
||||
free (iceConn->scratch);
|
||||
|
||||
iceConn->scratch = (char *) malloc ((unsigned) size);
|
||||
iceConn->scratch_size = size;
|
||||
}
|
||||
|
||||
return (iceConn->scratch);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Output/Input buffer functions
|
||||
*/
|
||||
|
||||
int
|
||||
IceFlush (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
_IceWrite (iceConn,
|
||||
(unsigned long) (iceConn->outbufptr - iceConn->outbuf),
|
||||
iceConn->outbuf);
|
||||
|
||||
iceConn->outbufptr = iceConn->outbuf;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
IceGetOutBufSize (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
return (iceConn->outbufmax - iceConn->outbuf);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
IceGetInBufSize (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
return (iceConn->inbufmax - iceConn->inbuf);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* informational functions
|
||||
*/
|
||||
|
||||
IceConnectStatus
|
||||
IceConnectionStatus (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
return (iceConn->connection_status);
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
IceVendor (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
char *string = (char *) malloc (strlen (iceConn->vendor) + 1);
|
||||
|
||||
if (string)
|
||||
strcpy (string, iceConn->vendor);
|
||||
|
||||
return (string);
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
IceRelease (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
char *string = (char *) malloc (strlen (iceConn->release) + 1);
|
||||
|
||||
if (string)
|
||||
strcpy (string, iceConn->release);
|
||||
|
||||
return (string);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
IceProtocolVersion (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
return (_IceVersions[iceConn->my_ice_version_index].major_version);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
IceProtocolRevision (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
return (_IceVersions[iceConn->my_ice_version_index].minor_version);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
IceConnectionNumber (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
return (_IceTransGetConnectionNumber (iceConn->trans_conn));
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
IceConnectionString (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
if (iceConn->connection_string)
|
||||
{
|
||||
char *string = (char *) malloc (
|
||||
strlen (iceConn->connection_string) + 1);
|
||||
|
||||
if (string)
|
||||
strcpy (string, iceConn->connection_string);
|
||||
|
||||
return (string);
|
||||
}
|
||||
else
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
unsigned long
|
||||
IceLastSentSequenceNumber (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
return (iceConn->send_sequence);
|
||||
}
|
||||
|
||||
|
||||
unsigned long
|
||||
IceLastReceivedSequenceNumber (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
return (iceConn->receive_sequence);
|
||||
}
|
||||
|
||||
|
||||
Bool
|
||||
IceSwapping (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
return (iceConn->swap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Read "n" bytes from a connection.
|
||||
*
|
||||
* Return Status 0 if we detected an EXPECTED closed connection.
|
||||
*
|
||||
*/
|
||||
|
||||
Status
|
||||
_IceRead (iceConn, nbytes, ptr)
|
||||
|
||||
register IceConn iceConn;
|
||||
unsigned long nbytes;
|
||||
register char *ptr;
|
||||
|
||||
{
|
||||
register unsigned long nleft;
|
||||
|
||||
nleft = nbytes;
|
||||
while (nleft > 0)
|
||||
{
|
||||
int nread;
|
||||
|
||||
if (iceConn->io_ok)
|
||||
nread = _IceTransRead (iceConn->trans_conn, ptr, (int) nleft);
|
||||
else
|
||||
return (1);
|
||||
|
||||
if (nread <= 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
errno = WSAGetLastError();
|
||||
#endif
|
||||
if (iceConn->want_to_close)
|
||||
{
|
||||
/*
|
||||
* We sent a WantToClose message and now we detected that
|
||||
* the other side closed the connection.
|
||||
*/
|
||||
|
||||
_IceConnectionClosed (iceConn); /* invoke watch procs */
|
||||
_IceFreeConnection (iceConn);
|
||||
|
||||
return (0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Fatal IO error. First notify each protocol's IceIOErrorProc
|
||||
* callback, then invoke the application IO error handler.
|
||||
*/
|
||||
|
||||
iceConn->io_ok = False;
|
||||
|
||||
if (iceConn->connection_status == IceConnectPending)
|
||||
{
|
||||
/*
|
||||
* Don't invoke IO error handler if we are in the
|
||||
* middle of a connection setup.
|
||||
*/
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (iceConn->process_msg_info)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = iceConn->his_min_opcode;
|
||||
i <= iceConn->his_max_opcode; i++)
|
||||
{
|
||||
_IceProcessMsgInfo *process;
|
||||
|
||||
process = &iceConn->process_msg_info[
|
||||
i - iceConn->his_min_opcode];
|
||||
|
||||
if ((process != NULL) && process->in_use)
|
||||
{
|
||||
IceIOErrorProc IOErrProc = process->accept_flag ?
|
||||
process->protocol->accept_client->io_error_proc :
|
||||
process->protocol->orig_client->io_error_proc;
|
||||
|
||||
if (IOErrProc)
|
||||
(*IOErrProc) (iceConn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
(*_IceIOErrorHandler) (iceConn);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
nleft -= nread;
|
||||
ptr += nread;
|
||||
}
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* If we read a message header with a bad major or minor opcode,
|
||||
* we need to advance to the end of the message. This way, the next
|
||||
* message can be processed correctly.
|
||||
*/
|
||||
|
||||
void
|
||||
_IceReadSkip (iceConn, nbytes)
|
||||
|
||||
register IceConn iceConn;
|
||||
register unsigned long nbytes;
|
||||
|
||||
{
|
||||
char temp[512];
|
||||
|
||||
while (nbytes > 0)
|
||||
{
|
||||
unsigned long rbytes = nbytes > 512 ? 512 : nbytes;
|
||||
|
||||
_IceRead (iceConn, rbytes, temp);
|
||||
nbytes -= rbytes;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Write "n" bytes to a connection.
|
||||
*/
|
||||
|
||||
void
|
||||
_IceWrite (iceConn, nbytes, ptr)
|
||||
|
||||
register IceConn iceConn;
|
||||
unsigned long nbytes;
|
||||
register char *ptr;
|
||||
|
||||
{
|
||||
register unsigned long nleft;
|
||||
|
||||
nleft = nbytes;
|
||||
while (nleft > 0)
|
||||
{
|
||||
int nwritten;
|
||||
|
||||
if (iceConn->io_ok)
|
||||
nwritten = _IceTransWrite (iceConn->trans_conn, ptr, (int) nleft);
|
||||
else
|
||||
return;
|
||||
|
||||
if (nwritten <= 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
errno = WSAGetLastError();
|
||||
#endif
|
||||
/*
|
||||
* Fatal IO error. First notify each protocol's IceIOErrorProc
|
||||
* callback, then invoke the application IO error handler.
|
||||
*/
|
||||
|
||||
iceConn->io_ok = False;
|
||||
|
||||
if (iceConn->connection_status == IceConnectPending)
|
||||
{
|
||||
/*
|
||||
* Don't invoke IO error handler if we are in the
|
||||
* middle of a connection setup.
|
||||
*/
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (iceConn->process_msg_info)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = iceConn->his_min_opcode;
|
||||
i <= iceConn->his_max_opcode; i++)
|
||||
{
|
||||
_IceProcessMsgInfo *process;
|
||||
|
||||
process = &iceConn->process_msg_info[
|
||||
i - iceConn->his_min_opcode];
|
||||
|
||||
if (process->in_use)
|
||||
{
|
||||
IceIOErrorProc IOErrProc = process->accept_flag ?
|
||||
process->protocol->accept_client->io_error_proc :
|
||||
process->protocol->orig_client->io_error_proc;
|
||||
|
||||
if (IOErrProc)
|
||||
(*IOErrProc) (iceConn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
(*_IceIOErrorHandler) (iceConn);
|
||||
return;
|
||||
}
|
||||
|
||||
nleft -= nwritten;
|
||||
ptr += nwritten;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WORD64
|
||||
|
||||
IceWriteData16 (iceConn, nbytes, data)
|
||||
|
||||
IceConn iceConn;
|
||||
unsigned long nbytes;
|
||||
short *data;
|
||||
|
||||
{
|
||||
int numShorts = nbytes / 2;
|
||||
int index = 0;
|
||||
|
||||
while (index < numShorts)
|
||||
{
|
||||
int spaceLeft, count, i;
|
||||
int shortsLeft = numShorts - index;
|
||||
|
||||
spaceLeft = iceConn->outbufmax - iceConn->outbufptr - 1;
|
||||
|
||||
if (spaceLeft < 2)
|
||||
{
|
||||
IceFlush (iceConn);
|
||||
spaceLeft = iceConn->outbufmax - iceConn->outbufptr - 1;
|
||||
}
|
||||
|
||||
count = (shortsLeft < spaceLeft / 2) ? shortsLeft : spaceLeft / 2;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
STORE_CARD16 (iceConn->outbufptr, data[index++]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IceWriteData32 (iceConn, nbytes, data)
|
||||
|
||||
IceConn iceConn;
|
||||
unsigned long nbytes;
|
||||
int *data;
|
||||
|
||||
{
|
||||
int numLongs = nbytes / 4;
|
||||
int index = 0;
|
||||
|
||||
while (index < numLongs)
|
||||
{
|
||||
int spaceLeft, count, i;
|
||||
int longsLeft = numLongs - index;
|
||||
|
||||
spaceLeft = iceConn->outbufmax - iceConn->outbufptr - 1;
|
||||
|
||||
if (spaceLeft < 4)
|
||||
{
|
||||
IceFlush (iceConn);
|
||||
spaceLeft = iceConn->outbufmax - iceConn->outbufptr - 1;
|
||||
}
|
||||
|
||||
count = (longsLeft < spaceLeft / 4) ? longsLeft : spaceLeft / 4;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
STORE_CARD32 (iceConn->outbufptr, data[index++]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IceReadData16 (iceConn, swap, nbytes, data)
|
||||
|
||||
IceConn iceConn;
|
||||
Bool swap;
|
||||
unsigned long nbytes;
|
||||
short *data;
|
||||
|
||||
{
|
||||
/* NOT IMPLEMENTED YET */
|
||||
}
|
||||
|
||||
|
||||
IceReadData32 (iceConn, swap, nbytes, data)
|
||||
|
||||
IceConn iceConn;
|
||||
Bool swap;
|
||||
unsigned long nbytes;
|
||||
int *data;
|
||||
|
||||
{
|
||||
/* NOT IMPLEMENTED YET */
|
||||
}
|
||||
|
||||
#endif /* WORD64 */
|
||||
|
||||
|
||||
|
||||
void
|
||||
_IceAddOpcodeMapping (iceConn, hisOpcode, myOpcode)
|
||||
|
||||
IceConn iceConn;
|
||||
int hisOpcode;
|
||||
int myOpcode;
|
||||
|
||||
{
|
||||
if (hisOpcode <= 0 || hisOpcode > 255)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (iceConn->process_msg_info == NULL)
|
||||
{
|
||||
iceConn->process_msg_info = (_IceProcessMsgInfo *) malloc (
|
||||
sizeof (_IceProcessMsgInfo));
|
||||
iceConn->his_min_opcode = iceConn->his_max_opcode = hisOpcode;
|
||||
}
|
||||
else if (hisOpcode < iceConn->his_min_opcode)
|
||||
{
|
||||
_IceProcessMsgInfo *oldVec = iceConn->process_msg_info;
|
||||
int oldsize = iceConn->his_max_opcode - iceConn->his_min_opcode + 1;
|
||||
int newsize = iceConn->his_max_opcode - hisOpcode + 1;
|
||||
int i;
|
||||
|
||||
iceConn->process_msg_info = (_IceProcessMsgInfo *) malloc (
|
||||
newsize * sizeof (_IceProcessMsgInfo));
|
||||
|
||||
memcpy (&iceConn->process_msg_info[
|
||||
iceConn->his_min_opcode - hisOpcode], oldVec,
|
||||
oldsize * sizeof (_IceProcessMsgInfo));
|
||||
|
||||
free ((char *) oldVec);
|
||||
|
||||
for (i = hisOpcode + 1; i < iceConn->his_min_opcode; i++)
|
||||
{
|
||||
iceConn->process_msg_info[i -
|
||||
iceConn->his_min_opcode].in_use = False;
|
||||
|
||||
iceConn->process_msg_info[i -
|
||||
iceConn->his_min_opcode].protocol = NULL;
|
||||
}
|
||||
|
||||
iceConn->his_min_opcode = hisOpcode;
|
||||
}
|
||||
else if (hisOpcode > iceConn->his_max_opcode)
|
||||
{
|
||||
_IceProcessMsgInfo *oldVec = iceConn->process_msg_info;
|
||||
int oldsize = iceConn->his_max_opcode - iceConn->his_min_opcode + 1;
|
||||
int newsize = hisOpcode - iceConn->his_min_opcode + 1;
|
||||
int i;
|
||||
|
||||
iceConn->process_msg_info = (_IceProcessMsgInfo *) malloc (
|
||||
newsize * sizeof (_IceProcessMsgInfo));
|
||||
|
||||
memcpy (iceConn->process_msg_info, oldVec,
|
||||
oldsize * sizeof (_IceProcessMsgInfo));
|
||||
|
||||
free ((char *) oldVec);
|
||||
|
||||
for (i = iceConn->his_max_opcode + 1; i < hisOpcode; i++)
|
||||
{
|
||||
iceConn->process_msg_info[i -
|
||||
iceConn->his_min_opcode].in_use = False;
|
||||
|
||||
iceConn->process_msg_info[i -
|
||||
iceConn->his_min_opcode].protocol = NULL;
|
||||
}
|
||||
|
||||
iceConn->his_max_opcode = hisOpcode;
|
||||
}
|
||||
|
||||
iceConn->process_msg_info[hisOpcode -
|
||||
iceConn->his_min_opcode].in_use = True;
|
||||
|
||||
iceConn->process_msg_info[hisOpcode -
|
||||
iceConn->his_min_opcode].my_opcode = myOpcode;
|
||||
|
||||
iceConn->process_msg_info[hisOpcode -
|
||||
iceConn->his_min_opcode].protocol = &_IceProtocols[myOpcode - 1];
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *
|
||||
IceGetPeerName (IceConn iceConn)
|
||||
{
|
||||
return (_IceTransGetPeerNetworkId (iceConn->trans_conn));
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
_IceGetPeerName (IceConn iceConn)
|
||||
{
|
||||
return (IceGetPeerName(iceConn));
|
||||
}
|
||||
66
lib/libICE/src/ping.c
Normal file
66
lib/libICE/src/ping.c
Normal file
@@ -0,0 +1,66 @@
|
||||
/* $Xorg: ping.c,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
|
||||
Status
|
||||
IcePing (iceConn, pingReplyProc, clientData)
|
||||
|
||||
IceConn iceConn;
|
||||
IcePingReplyProc pingReplyProc;
|
||||
IcePointer clientData;
|
||||
|
||||
{
|
||||
_IcePingWait *newping = (_IcePingWait *) malloc (sizeof (_IcePingWait));
|
||||
_IcePingWait *ptr = iceConn->ping_waits;
|
||||
|
||||
if (newping == NULL)
|
||||
return (0);
|
||||
|
||||
newping->ping_reply_proc = pingReplyProc;
|
||||
newping->client_data = clientData;
|
||||
newping->next = NULL;
|
||||
|
||||
while (ptr && ptr->next)
|
||||
ptr = ptr->next;
|
||||
|
||||
if (ptr == NULL)
|
||||
iceConn->ping_waits = newping;
|
||||
else
|
||||
ptr->next = newping;
|
||||
|
||||
IceSimpleMessage (iceConn, 0, ICE_Ping);
|
||||
IceFlush (iceConn);
|
||||
|
||||
return (1);
|
||||
}
|
||||
2548
lib/libICE/src/process.c
Normal file
2548
lib/libICE/src/process.c
Normal file
File diff suppressed because it is too large
Load Diff
293
lib/libICE/src/protosetup.c
Normal file
293
lib/libICE/src/protosetup.c
Normal file
@@ -0,0 +1,293 @@
|
||||
/* $Xorg: protosetup.c,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
/* $XFree86: xc/lib/ICE/protosetup.c,v 1.2 2001/10/28 03:32:28 tsi Exp $ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
|
||||
|
||||
IceProtocolSetupStatus
|
||||
IceProtocolSetup (iceConn, myOpcode, clientData, mustAuthenticate,
|
||||
majorVersionRet, minorVersionRet, vendorRet, releaseRet,
|
||||
errorLength, errorStringRet)
|
||||
|
||||
IceConn iceConn;
|
||||
int myOpcode;
|
||||
IcePointer clientData;
|
||||
Bool mustAuthenticate;
|
||||
int *majorVersionRet;
|
||||
int *minorVersionRet;
|
||||
char **vendorRet;
|
||||
char **releaseRet;
|
||||
int errorLength;
|
||||
char *errorStringRet;
|
||||
|
||||
{
|
||||
iceProtocolSetupMsg *pMsg;
|
||||
char *pData;
|
||||
_IceProtocol *myProtocol;
|
||||
int extra;
|
||||
Bool gotReply, ioErrorOccured;
|
||||
int accepted, i;
|
||||
int hisOpcode;
|
||||
unsigned long setup_sequence;
|
||||
IceReplyWaitInfo replyWait;
|
||||
_IceReply reply;
|
||||
IcePoVersionRec *versionRec = NULL;
|
||||
int authCount;
|
||||
int *authIndices;
|
||||
|
||||
if (errorStringRet && errorLength > 0)
|
||||
*errorStringRet = '\0';
|
||||
|
||||
*majorVersionRet = 0;
|
||||
*minorVersionRet = 0;
|
||||
*vendorRet = NULL;
|
||||
*releaseRet = NULL;
|
||||
|
||||
if (myOpcode < 1 || myOpcode > _IceLastMajorOpcode)
|
||||
{
|
||||
strncpy (errorStringRet, "myOpcode out of range", errorLength);
|
||||
return (IceProtocolSetupFailure);
|
||||
}
|
||||
|
||||
myProtocol = &_IceProtocols[myOpcode - 1];
|
||||
|
||||
if (myProtocol->orig_client == NULL)
|
||||
{
|
||||
strncpy (errorStringRet,
|
||||
"IceRegisterForProtocolSetup was not called", errorLength);
|
||||
return (IceProtocolSetupFailure);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Make sure this protocol hasn't been activated already.
|
||||
*/
|
||||
|
||||
if (iceConn->process_msg_info)
|
||||
{
|
||||
for (i = iceConn->his_min_opcode; i <= iceConn->his_max_opcode; i++)
|
||||
{
|
||||
if (iceConn->process_msg_info[
|
||||
i - iceConn->his_min_opcode].in_use &&
|
||||
iceConn->process_msg_info[
|
||||
i - iceConn->his_min_opcode ].my_opcode == myOpcode)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i <= iceConn->his_max_opcode)
|
||||
{
|
||||
return (IceProtocolAlreadyActive);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate the message.
|
||||
*/
|
||||
|
||||
if (myProtocol->orig_client->auth_count > 0)
|
||||
{
|
||||
authIndices = (int *) malloc (
|
||||
myProtocol->orig_client->auth_count * sizeof (int));
|
||||
|
||||
_IceGetPoValidAuthIndices (myProtocol->protocol_name,
|
||||
iceConn->connection_string,
|
||||
myProtocol->orig_client->auth_count,
|
||||
myProtocol->orig_client->auth_names,
|
||||
&authCount, authIndices);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
authCount = 0;
|
||||
authIndices = NULL;
|
||||
}
|
||||
|
||||
extra = STRING_BYTES (myProtocol->protocol_name) +
|
||||
STRING_BYTES (myProtocol->orig_client->vendor) +
|
||||
STRING_BYTES (myProtocol->orig_client->release);
|
||||
|
||||
for (i = 0; i < authCount; i++)
|
||||
{
|
||||
extra += STRING_BYTES (myProtocol->orig_client->auth_names[
|
||||
authIndices[i]]);
|
||||
}
|
||||
|
||||
extra += (myProtocol->orig_client->version_count * 4);
|
||||
|
||||
IceGetHeaderExtra (iceConn, 0, ICE_ProtocolSetup,
|
||||
SIZEOF (iceProtocolSetupMsg), WORD64COUNT (extra),
|
||||
iceProtocolSetupMsg, pMsg, pData);
|
||||
|
||||
setup_sequence = iceConn->send_sequence;
|
||||
|
||||
pMsg->protocolOpcode = myOpcode;
|
||||
pMsg->versionCount = myProtocol->orig_client->version_count;
|
||||
pMsg->authCount = authCount;
|
||||
pMsg->mustAuthenticate = mustAuthenticate;
|
||||
|
||||
STORE_STRING (pData, myProtocol->protocol_name);
|
||||
STORE_STRING (pData, myProtocol->orig_client->vendor);
|
||||
STORE_STRING (pData, myProtocol->orig_client->release);
|
||||
|
||||
for (i = 0; i < authCount; i++)
|
||||
{
|
||||
STORE_STRING (pData, myProtocol->orig_client->auth_names[
|
||||
authIndices[i]]);
|
||||
}
|
||||
|
||||
for (i = 0; i < myProtocol->orig_client->version_count; i++)
|
||||
{
|
||||
STORE_CARD16 (pData,
|
||||
myProtocol->orig_client->version_recs[i].major_version);
|
||||
STORE_CARD16 (pData,
|
||||
myProtocol->orig_client->version_recs[i].minor_version);
|
||||
}
|
||||
|
||||
IceFlush (iceConn);
|
||||
|
||||
|
||||
/*
|
||||
* Process messages until we get a Protocol Reply.
|
||||
*/
|
||||
|
||||
replyWait.sequence_of_request = setup_sequence;
|
||||
replyWait.major_opcode_of_request = 0;
|
||||
replyWait.minor_opcode_of_request = ICE_ProtocolSetup;
|
||||
replyWait.reply = (IcePointer) &reply;
|
||||
|
||||
iceConn->protosetup_to_you = (_IceProtoSetupToYouInfo *) malloc (
|
||||
sizeof (_IceProtoSetupToYouInfo));
|
||||
iceConn->protosetup_to_you->my_opcode = myOpcode;
|
||||
iceConn->protosetup_to_you->my_auth_count = authCount;
|
||||
iceConn->protosetup_to_you->auth_active = 0;
|
||||
iceConn->protosetup_to_you->my_auth_indices = authIndices;
|
||||
|
||||
gotReply = False;
|
||||
ioErrorOccured = False;
|
||||
accepted = 0;
|
||||
|
||||
while (!gotReply && !ioErrorOccured)
|
||||
{
|
||||
ioErrorOccured = (IceProcessMessages (
|
||||
iceConn, &replyWait, &gotReply) == IceProcessMessagesIOError);
|
||||
|
||||
if (ioErrorOccured)
|
||||
{
|
||||
strncpy (errorStringRet,
|
||||
"IO error occured doing Protocol Setup on connection",
|
||||
errorLength);
|
||||
return (IceProtocolSetupIOError);
|
||||
}
|
||||
else if (gotReply)
|
||||
{
|
||||
if (reply.type == ICE_PROTOCOL_REPLY)
|
||||
{
|
||||
if (reply.protocol_reply.version_index >=
|
||||
myProtocol->orig_client->version_count)
|
||||
{
|
||||
strncpy (errorStringRet,
|
||||
"Got a bad version index in the Protocol Reply",
|
||||
errorLength);
|
||||
|
||||
free (reply.protocol_reply.vendor);
|
||||
free (reply.protocol_reply.release);
|
||||
}
|
||||
else
|
||||
{
|
||||
versionRec = &(myProtocol->orig_client->version_recs[
|
||||
reply.protocol_reply.version_index]);
|
||||
|
||||
accepted = 1;
|
||||
}
|
||||
}
|
||||
else /* reply.type == ICE_PROTOCOL_ERROR */
|
||||
{
|
||||
/* Protocol Setup failed */
|
||||
|
||||
strncpy (errorStringRet, reply.protocol_error.error_message,
|
||||
errorLength);
|
||||
|
||||
free (reply.protocol_error.error_message);
|
||||
}
|
||||
|
||||
if (iceConn->protosetup_to_you->my_auth_indices)
|
||||
free ((char *) iceConn->protosetup_to_you->my_auth_indices);
|
||||
free ((char *) iceConn->protosetup_to_you);
|
||||
iceConn->protosetup_to_you = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (accepted)
|
||||
{
|
||||
_IceProcessMsgInfo *process_msg_info;
|
||||
|
||||
*majorVersionRet = versionRec->major_version;
|
||||
*minorVersionRet = versionRec->minor_version;
|
||||
*vendorRet = reply.protocol_reply.vendor;
|
||||
*releaseRet = reply.protocol_reply.release;
|
||||
|
||||
|
||||
/*
|
||||
* Increase the reference count for the number of active protocols.
|
||||
*/
|
||||
|
||||
iceConn->proto_ref_count++;
|
||||
|
||||
|
||||
/*
|
||||
* We may be using a different major opcode for this protocol
|
||||
* than the other client. Whenever we get a message, we must
|
||||
* map to our own major opcode.
|
||||
*/
|
||||
|
||||
hisOpcode = reply.protocol_reply.major_opcode;
|
||||
|
||||
_IceAddOpcodeMapping (iceConn, hisOpcode, myOpcode);
|
||||
|
||||
process_msg_info = &iceConn->process_msg_info[hisOpcode -
|
||||
iceConn->his_min_opcode];
|
||||
|
||||
process_msg_info->client_data = clientData;
|
||||
process_msg_info->accept_flag = 0;
|
||||
|
||||
process_msg_info->process_msg_proc.orig_client =
|
||||
versionRec->process_msg_proc;
|
||||
|
||||
return (IceProtocolSetupSuccess);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (IceProtocolSetupFailure);
|
||||
}
|
||||
}
|
||||
256
lib/libICE/src/register.c
Normal file
256
lib/libICE/src/register.c
Normal file
@@ -0,0 +1,256 @@
|
||||
/* $Xorg: register.c,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
|
||||
int
|
||||
IceRegisterForProtocolSetup (protocolName, vendor, release,
|
||||
versionCount, versionRecs, authCount, authNames, authProcs, IOErrorProc)
|
||||
|
||||
char *protocolName;
|
||||
char *vendor;
|
||||
char *release;
|
||||
int versionCount;
|
||||
IcePoVersionRec *versionRecs;
|
||||
int authCount;
|
||||
char **authNames;
|
||||
IcePoAuthProc *authProcs;
|
||||
IceIOErrorProc IOErrorProc;
|
||||
|
||||
{
|
||||
_IcePoProtocol *p;
|
||||
int opcodeRet, i;
|
||||
|
||||
for (i = 1; i <= _IceLastMajorOpcode; i++)
|
||||
if (strcmp (protocolName, _IceProtocols[i - 1].protocol_name) == 0)
|
||||
{
|
||||
if (_IceProtocols[i - 1].orig_client != NULL)
|
||||
{
|
||||
/*
|
||||
* We've already registered this protocol.
|
||||
*/
|
||||
|
||||
return (i);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i <= _IceLastMajorOpcode)
|
||||
{
|
||||
p = _IceProtocols[i - 1].orig_client =
|
||||
(_IcePoProtocol *) malloc (sizeof (_IcePoProtocol));
|
||||
opcodeRet = i;
|
||||
}
|
||||
else if (_IceLastMajorOpcode == 255 ||
|
||||
versionCount < 1 ||
|
||||
strlen (protocolName) == 0)
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
char *name;
|
||||
|
||||
_IceProtocols[_IceLastMajorOpcode].protocol_name = name =
|
||||
(char *) malloc (strlen (protocolName) + 1);
|
||||
strcpy (name, protocolName);
|
||||
|
||||
p = _IceProtocols[_IceLastMajorOpcode].orig_client =
|
||||
(_IcePoProtocol *) malloc (sizeof (_IcePoProtocol));
|
||||
|
||||
_IceProtocols[_IceLastMajorOpcode].accept_client = NULL;
|
||||
|
||||
opcodeRet = ++_IceLastMajorOpcode;
|
||||
}
|
||||
|
||||
p->vendor = (char *) malloc (strlen (vendor) + 1);
|
||||
strcpy (p->vendor, vendor);
|
||||
|
||||
p->release = (char *) malloc (strlen (release) + 1);
|
||||
strcpy (p->release, release);
|
||||
|
||||
p->version_count = versionCount;
|
||||
|
||||
p->version_recs = (IcePoVersionRec *) malloc (
|
||||
versionCount * sizeof (IcePoVersionRec));
|
||||
memcpy (p->version_recs, versionRecs,
|
||||
versionCount * sizeof (IcePoVersionRec));
|
||||
|
||||
if ((p->auth_count = authCount) > 0)
|
||||
{
|
||||
p->auth_names = (char **) malloc (
|
||||
authCount * sizeof (char *));
|
||||
|
||||
p->auth_procs = (IcePoAuthProc *) malloc (
|
||||
authCount * sizeof (IcePoAuthProc));
|
||||
|
||||
for (i = 0; i < authCount; i++)
|
||||
{
|
||||
p->auth_names[i] =
|
||||
(char *) malloc (strlen (authNames[i]) + 1);
|
||||
strcpy (p->auth_names[i], authNames[i]);
|
||||
|
||||
p->auth_procs[i] = authProcs[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
p->auth_names = NULL;
|
||||
p->auth_procs = NULL;
|
||||
}
|
||||
|
||||
p->io_error_proc = IOErrorProc;
|
||||
|
||||
return (opcodeRet);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
IceRegisterForProtocolReply (protocolName, vendor, release,
|
||||
versionCount, versionRecs, authCount, authNames, authProcs,
|
||||
hostBasedAuthProc, protocolSetupProc, protocolActivateProc,
|
||||
IOErrorProc)
|
||||
|
||||
char *protocolName;
|
||||
char *vendor;
|
||||
char *release;
|
||||
int versionCount;
|
||||
IcePaVersionRec *versionRecs;
|
||||
int authCount;
|
||||
char **authNames;
|
||||
IcePaAuthProc *authProcs;
|
||||
IceHostBasedAuthProc hostBasedAuthProc;
|
||||
IceProtocolSetupProc protocolSetupProc;
|
||||
IceProtocolActivateProc protocolActivateProc;
|
||||
IceIOErrorProc IOErrorProc;
|
||||
|
||||
{
|
||||
_IcePaProtocol *p;
|
||||
int opcodeRet, i;
|
||||
|
||||
for (i = 1; i <= _IceLastMajorOpcode; i++)
|
||||
if (strcmp (protocolName, _IceProtocols[i - 1].protocol_name) == 0)
|
||||
{
|
||||
if (_IceProtocols[i - 1].accept_client != NULL)
|
||||
{
|
||||
/*
|
||||
* We've already registered this protocol.
|
||||
*/
|
||||
|
||||
return (i);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (i <= _IceLastMajorOpcode)
|
||||
{
|
||||
p = _IceProtocols[i - 1].accept_client =
|
||||
(_IcePaProtocol *) malloc (sizeof (_IcePaProtocol));
|
||||
opcodeRet = i;
|
||||
}
|
||||
else if (_IceLastMajorOpcode == 255 ||
|
||||
versionCount < 1 ||
|
||||
strlen (protocolName) == 0)
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
char *name;
|
||||
|
||||
_IceProtocols[_IceLastMajorOpcode].protocol_name = name =
|
||||
(char *) malloc (strlen (protocolName) + 1);
|
||||
strcpy (name, protocolName);
|
||||
|
||||
_IceProtocols[_IceLastMajorOpcode].orig_client = NULL;
|
||||
|
||||
p = _IceProtocols[_IceLastMajorOpcode].accept_client =
|
||||
(_IcePaProtocol *) malloc (sizeof (_IcePaProtocol));
|
||||
|
||||
opcodeRet = ++_IceLastMajorOpcode;
|
||||
}
|
||||
|
||||
p->vendor = (char *) malloc (strlen (vendor) + 1);
|
||||
strcpy (p->vendor, vendor);
|
||||
|
||||
p->release = (char *) malloc (strlen (release) + 1);
|
||||
strcpy (p->release, release);
|
||||
|
||||
p->version_count = versionCount;
|
||||
|
||||
p->version_recs = (IcePaVersionRec *) malloc (
|
||||
versionCount * sizeof (IcePaVersionRec));
|
||||
memcpy (p->version_recs, versionRecs,
|
||||
versionCount * sizeof (IcePaVersionRec));
|
||||
|
||||
p->protocol_setup_proc = protocolSetupProc;
|
||||
p->protocol_activate_proc = protocolActivateProc;
|
||||
|
||||
if ((p->auth_count = authCount) > 0)
|
||||
{
|
||||
p->auth_names = (char **) malloc (
|
||||
authCount * sizeof (char *));
|
||||
|
||||
p->auth_procs = (IcePaAuthProc *) malloc (
|
||||
authCount * sizeof (IcePaAuthProc));
|
||||
|
||||
for (i = 0; i < authCount; i++)
|
||||
{
|
||||
p->auth_names[i] =
|
||||
(char *) malloc (strlen (authNames[i]) + 1);
|
||||
strcpy (p->auth_names[i], authNames[i]);
|
||||
|
||||
p->auth_procs[i] = authProcs[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
p->auth_names = NULL;
|
||||
p->auth_procs = NULL;
|
||||
}
|
||||
|
||||
p->host_based_auth_proc = hostBasedAuthProc;
|
||||
|
||||
p->io_error_proc = IOErrorProc;
|
||||
|
||||
return (opcodeRet);
|
||||
}
|
||||
|
||||
161
lib/libICE/src/replywait.c
Normal file
161
lib/libICE/src/replywait.c
Normal file
@@ -0,0 +1,161 @@
|
||||
/* $Xorg: replywait.c,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
|
||||
|
||||
void
|
||||
_IceAddReplyWait (iceConn, replyWait)
|
||||
|
||||
IceConn iceConn;
|
||||
IceReplyWaitInfo *replyWait;
|
||||
|
||||
{
|
||||
/*
|
||||
* Add this replyWait to the end of the list (only if the
|
||||
* replyWait is not already in the list).
|
||||
*/
|
||||
|
||||
_IceSavedReplyWait *savedReplyWait;
|
||||
_IceSavedReplyWait *prev, *last;
|
||||
|
||||
prev = NULL;
|
||||
last = iceConn->saved_reply_waits;
|
||||
|
||||
while (last)
|
||||
{
|
||||
if (last->reply_wait == replyWait)
|
||||
return;
|
||||
|
||||
prev = last;
|
||||
last = last->next;
|
||||
}
|
||||
|
||||
savedReplyWait = (_IceSavedReplyWait *) malloc (
|
||||
sizeof (_IceSavedReplyWait));
|
||||
|
||||
savedReplyWait->reply_wait = replyWait;
|
||||
savedReplyWait->reply_ready = False;
|
||||
savedReplyWait->next = NULL;
|
||||
|
||||
if (prev == NULL)
|
||||
iceConn->saved_reply_waits = savedReplyWait;
|
||||
else
|
||||
prev->next = savedReplyWait;
|
||||
}
|
||||
|
||||
|
||||
|
||||
IceReplyWaitInfo *
|
||||
_IceSearchReplyWaits (iceConn, majorOpcode)
|
||||
|
||||
IceConn iceConn;
|
||||
int majorOpcode;
|
||||
|
||||
{
|
||||
/*
|
||||
* Return the first replyWait in the list with the given majorOpcode
|
||||
*/
|
||||
|
||||
_IceSavedReplyWait *savedReplyWait = iceConn->saved_reply_waits;
|
||||
|
||||
while (savedReplyWait && !savedReplyWait->reply_ready &&
|
||||
savedReplyWait->reply_wait->major_opcode_of_request != majorOpcode)
|
||||
{
|
||||
savedReplyWait = savedReplyWait->next;
|
||||
}
|
||||
|
||||
return (savedReplyWait ? savedReplyWait->reply_wait : NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
_IceSetReplyReady (iceConn, replyWait)
|
||||
|
||||
IceConn iceConn;
|
||||
IceReplyWaitInfo *replyWait;
|
||||
|
||||
{
|
||||
/*
|
||||
* The replyWait specified has a reply ready.
|
||||
*/
|
||||
|
||||
_IceSavedReplyWait *savedReplyWait = iceConn->saved_reply_waits;
|
||||
|
||||
while (savedReplyWait && savedReplyWait->reply_wait != replyWait)
|
||||
savedReplyWait = savedReplyWait->next;
|
||||
|
||||
if (savedReplyWait)
|
||||
savedReplyWait->reply_ready = True;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Bool
|
||||
_IceCheckReplyReady (iceConn, replyWait)
|
||||
|
||||
IceConn iceConn;
|
||||
IceReplyWaitInfo *replyWait;
|
||||
|
||||
{
|
||||
_IceSavedReplyWait *savedReplyWait = iceConn->saved_reply_waits;
|
||||
_IceSavedReplyWait *prev = NULL;
|
||||
Bool found = False;
|
||||
Bool ready;
|
||||
|
||||
while (savedReplyWait && !found)
|
||||
{
|
||||
if (savedReplyWait->reply_wait == replyWait)
|
||||
found = True;
|
||||
else
|
||||
{
|
||||
prev = savedReplyWait;
|
||||
savedReplyWait = savedReplyWait->next;
|
||||
}
|
||||
}
|
||||
|
||||
ready = found && savedReplyWait->reply_ready;
|
||||
|
||||
if (ready)
|
||||
{
|
||||
if (prev == NULL)
|
||||
iceConn->saved_reply_waits = savedReplyWait->next;
|
||||
else
|
||||
prev->next = savedReplyWait->next;
|
||||
|
||||
free ((char *) savedReplyWait);
|
||||
}
|
||||
|
||||
return (ready);
|
||||
}
|
||||
121
lib/libICE/src/setauth.c
Normal file
121
lib/libICE/src/setauth.c
Normal file
@@ -0,0 +1,121 @@
|
||||
/* $Xorg: setauth.c,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
/* $XFree86: xc/lib/ICE/setauth.c,v 1.4 2001/12/14 19:53:36 dawes Exp $ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
#include <X11/ICE/ICEutil.h>
|
||||
|
||||
|
||||
/*
|
||||
* IceSetPaAuthData is not a standard part of ICElib, it is specific
|
||||
* to the sample implementation.
|
||||
*
|
||||
* For the client that initiates a Protocol Setup, we look in the
|
||||
* .ICEauthority file to get authentication data.
|
||||
*
|
||||
* For the client accepting the Protocol Setup, we get the data
|
||||
* from an in-memory database of authentication data (set by the
|
||||
* application calling IceSetPaAuthData). We have to get the data
|
||||
* from memory because getting it directly from the .ICEauthority
|
||||
* file is not secure - someone can just modify the contents of the
|
||||
* .ICEauthority file behind our back.
|
||||
*/
|
||||
|
||||
int _IcePaAuthDataEntryCount = 0;
|
||||
#ifndef __UNIXOS2__
|
||||
IceAuthDataEntry _IcePaAuthDataEntries[ICE_MAX_AUTH_DATA_ENTRIES];
|
||||
#else
|
||||
IceAuthDataEntry _IcePaAuthDataEntries[ICE_MAX_AUTH_DATA_ENTRIES] = {0};
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
IceSetPaAuthData (numEntries, entries)
|
||||
|
||||
int numEntries;
|
||||
IceAuthDataEntry *entries;
|
||||
|
||||
{
|
||||
/*
|
||||
* _IcePaAuthDataEntries should really be a linked list.
|
||||
* On my list of TO DO stuff.
|
||||
*/
|
||||
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < numEntries; i++)
|
||||
{
|
||||
for (j = 0; j < _IcePaAuthDataEntryCount; j++)
|
||||
if (strcmp (entries[i].protocol_name,
|
||||
_IcePaAuthDataEntries[j].protocol_name) == 0 &&
|
||||
strcmp (entries[i].network_id,
|
||||
_IcePaAuthDataEntries[j].network_id) == 0 &&
|
||||
strcmp (entries[i].auth_name,
|
||||
_IcePaAuthDataEntries[j].auth_name) == 0)
|
||||
break;
|
||||
|
||||
if (j < _IcePaAuthDataEntryCount)
|
||||
{
|
||||
free (_IcePaAuthDataEntries[j].protocol_name);
|
||||
free (_IcePaAuthDataEntries[j].network_id);
|
||||
free (_IcePaAuthDataEntries[j].auth_name);
|
||||
free (_IcePaAuthDataEntries[j].auth_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
_IcePaAuthDataEntryCount++;
|
||||
}
|
||||
|
||||
_IcePaAuthDataEntries[j].protocol_name = (char *) malloc (
|
||||
strlen (entries[i].protocol_name) + 1);
|
||||
strcpy (_IcePaAuthDataEntries[j].protocol_name,
|
||||
entries[i].protocol_name);
|
||||
|
||||
_IcePaAuthDataEntries[j].network_id = (char *) malloc (
|
||||
strlen (entries[i].network_id) + 1);
|
||||
strcpy (_IcePaAuthDataEntries[j].network_id,
|
||||
entries[i].network_id);
|
||||
|
||||
_IcePaAuthDataEntries[j].auth_name = (char *) malloc (
|
||||
strlen (entries[i].auth_name) + 1);
|
||||
strcpy (_IcePaAuthDataEntries[j].auth_name,
|
||||
entries[i].auth_name);
|
||||
|
||||
_IcePaAuthDataEntries[j].auth_data_length =
|
||||
entries[i].auth_data_length;
|
||||
_IcePaAuthDataEntries[j].auth_data = (char *) malloc (
|
||||
entries[i].auth_data_length);
|
||||
memcpy (_IcePaAuthDataEntries[j].auth_data,
|
||||
entries[i].auth_data, entries[i].auth_data_length);
|
||||
}
|
||||
}
|
||||
330
lib/libICE/src/shutdown.c
Normal file
330
lib/libICE/src/shutdown.c
Normal file
@@ -0,0 +1,330 @@
|
||||
/* $Xorg: shutdown.c,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
/* $XFree86: xc/lib/ICE/shutdown.c,v 3.3 2001/08/01 00:44:37 tsi Exp $ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
#include <X11/Xtrans/Xtrans.h>
|
||||
|
||||
|
||||
Status
|
||||
IceProtocolShutdown (iceConn, majorOpcode)
|
||||
|
||||
IceConn iceConn;
|
||||
int majorOpcode;
|
||||
|
||||
{
|
||||
if (iceConn->proto_ref_count == 0 || iceConn->process_msg_info == NULL ||
|
||||
majorOpcode < 1 || majorOpcode > _IceLastMajorOpcode)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Make sure this majorOpcode is really being used.
|
||||
*/
|
||||
|
||||
int i;
|
||||
|
||||
for (i = iceConn->his_min_opcode; i <= iceConn->his_max_opcode; i++)
|
||||
{
|
||||
if (iceConn->process_msg_info[
|
||||
i - iceConn->his_min_opcode].in_use &&
|
||||
iceConn->process_msg_info[
|
||||
i - iceConn->his_min_opcode].my_opcode == majorOpcode)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i > iceConn->his_max_opcode)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* OK, we can shut down the protocol.
|
||||
*/
|
||||
|
||||
iceConn->process_msg_info[
|
||||
i - iceConn->his_min_opcode].in_use = False;
|
||||
iceConn->proto_ref_count--;
|
||||
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
IceSetShutdownNegotiation (iceConn, negotiate)
|
||||
|
||||
IceConn iceConn;
|
||||
Bool negotiate;
|
||||
|
||||
{
|
||||
iceConn->skip_want_to_close = negotiate ? False : True;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Bool
|
||||
IceCheckShutdownNegotiation (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
return (iceConn->skip_want_to_close ? False : True);
|
||||
}
|
||||
|
||||
|
||||
|
||||
IceCloseStatus
|
||||
IceCloseConnection (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
int refCountReachedZero;
|
||||
IceCloseStatus status;
|
||||
|
||||
/*
|
||||
* If this connection object was never valid, we can close
|
||||
* it right now. This happens if IceAcceptConnection was
|
||||
* called, but after calling IceProcessMessages several times
|
||||
* the connection was rejected (because of authentication or
|
||||
* some other reason).
|
||||
*/
|
||||
|
||||
if (iceConn->listen_obj &&
|
||||
iceConn->connection_status != IceConnectAccepted)
|
||||
{
|
||||
_IceConnectionClosed (iceConn); /* invoke watch procs */
|
||||
_IceFreeConnection (iceConn);
|
||||
return (IceClosedNow);
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------
|
||||
|
||||
ACTIONS:
|
||||
|
||||
A = Invoke Watch Procedures
|
||||
B = Set free-asap bit
|
||||
C = Free connection
|
||||
D = Initialize shutdown negotiation
|
||||
N = do nothing
|
||||
|
||||
|
||||
ACTION TABLE:
|
||||
|
||||
IO free- dispatch protocol shutdown
|
||||
error asap bit level refcount negotiation ACTION
|
||||
occured set reached 0 reached 0
|
||||
|
||||
0 0 0 0 0 N
|
||||
0 0 0 0 1 N
|
||||
0 0 0 1 0 AB
|
||||
0 0 0 1 1 N
|
||||
0 0 1 0 0 N
|
||||
0 0 1 0 1 N
|
||||
0 0 1 1 0 AC
|
||||
0 0 1 1 1 D
|
||||
0 1 0 0 0 N
|
||||
0 1 0 0 1 N
|
||||
0 1 0 1 0 N
|
||||
0 1 0 1 1 N
|
||||
0 1 1 0 0 C
|
||||
0 1 1 0 1 D
|
||||
0 1 1 1 0 C
|
||||
0 1 1 1 1 D
|
||||
1 0 0 0 0 AB
|
||||
1 0 0 0 1 AB
|
||||
1 0 0 1 0 AB
|
||||
1 0 0 1 1 AB
|
||||
1 0 1 0 0 AC
|
||||
1 0 1 0 1 AC
|
||||
1 0 1 1 0 AC
|
||||
1 0 1 1 1 AC
|
||||
1 1 0 0 0 N
|
||||
1 1 0 0 1 N
|
||||
1 1 0 1 0 N
|
||||
1 1 0 1 1 N
|
||||
1 1 1 0 0 C
|
||||
1 1 1 0 1 C
|
||||
1 1 1 1 0 C
|
||||
1 1 1 1 1 C
|
||||
|
||||
---------------------------------------------------------------*/
|
||||
|
||||
if (iceConn->open_ref_count > 0)
|
||||
iceConn->open_ref_count--;
|
||||
|
||||
refCountReachedZero = iceConn->open_ref_count == 0 &&
|
||||
iceConn->proto_ref_count == 0;
|
||||
|
||||
status = IceConnectionInUse;
|
||||
|
||||
if (!iceConn->free_asap && (!iceConn->io_ok ||
|
||||
(iceConn->io_ok && refCountReachedZero &&
|
||||
iceConn->skip_want_to_close)))
|
||||
{
|
||||
/*
|
||||
* Invoke the watch procedures now.
|
||||
*/
|
||||
|
||||
_IceConnectionClosed (iceConn);
|
||||
status = IceClosedNow; /* may be overwritten by IceClosedASAP */
|
||||
}
|
||||
|
||||
if (!iceConn->free_asap && iceConn->dispatch_level != 0 &&
|
||||
(!iceConn->io_ok ||
|
||||
(iceConn->io_ok && refCountReachedZero &&
|
||||
iceConn->skip_want_to_close)))
|
||||
{
|
||||
/*
|
||||
* Set flag so we free the connection as soon as possible.
|
||||
*/
|
||||
|
||||
iceConn->free_asap = True;
|
||||
status = IceClosedASAP;
|
||||
}
|
||||
|
||||
if (iceConn->io_ok && iceConn->dispatch_level == 0 &&
|
||||
!iceConn->skip_want_to_close && refCountReachedZero)
|
||||
{
|
||||
/*
|
||||
* Initiate shutdown negotiation.
|
||||
*/
|
||||
|
||||
IceSimpleMessage (iceConn, 0, ICE_WantToClose);
|
||||
IceFlush (iceConn);
|
||||
|
||||
iceConn->want_to_close = 1;
|
||||
|
||||
status = IceStartedShutdownNegotiation;
|
||||
}
|
||||
else if (iceConn->dispatch_level == 0 &&
|
||||
(!iceConn->io_ok || (iceConn->io_ok && iceConn->skip_want_to_close &&
|
||||
(iceConn->free_asap || (!iceConn->free_asap && refCountReachedZero)))))
|
||||
{
|
||||
/*
|
||||
* Free the connection.
|
||||
*/
|
||||
|
||||
_IceFreeConnection (iceConn);
|
||||
|
||||
status = IceClosedNow;
|
||||
}
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
_IceFreeConnection (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
if (iceConn->listen_obj == NULL)
|
||||
{
|
||||
/*
|
||||
* This iceConn was created with IceOpenConnection.
|
||||
* We keep track of all open IceConn's, so we need
|
||||
* to remove it from the list.
|
||||
*/
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < _IceConnectionCount; i++)
|
||||
if (_IceConnectionObjs[i] == iceConn)
|
||||
break;
|
||||
|
||||
if (i < _IceConnectionCount)
|
||||
{
|
||||
if (i < _IceConnectionCount - 1)
|
||||
{
|
||||
_IceConnectionObjs[i] =
|
||||
_IceConnectionObjs[_IceConnectionCount - 1];
|
||||
_IceConnectionStrings[i] =
|
||||
_IceConnectionStrings[_IceConnectionCount - 1];
|
||||
}
|
||||
|
||||
_IceConnectionCount--;
|
||||
}
|
||||
}
|
||||
|
||||
if (iceConn->trans_conn)
|
||||
_IceTransClose (iceConn->trans_conn);
|
||||
|
||||
if (iceConn->connection_string)
|
||||
free (iceConn->connection_string);
|
||||
|
||||
if (iceConn->vendor)
|
||||
free (iceConn->vendor);
|
||||
|
||||
if (iceConn->release)
|
||||
free (iceConn->release);
|
||||
|
||||
if (iceConn->inbuf)
|
||||
free (iceConn->inbuf);
|
||||
|
||||
if (iceConn->outbuf)
|
||||
free (iceConn->outbuf);
|
||||
|
||||
if (iceConn->scratch)
|
||||
free (iceConn->scratch);
|
||||
|
||||
if (iceConn->process_msg_info)
|
||||
free ((char *) iceConn->process_msg_info);
|
||||
|
||||
if (iceConn->connect_to_you)
|
||||
free ((char *) iceConn->connect_to_you);
|
||||
|
||||
if (iceConn->protosetup_to_you)
|
||||
free ((char *) iceConn->protosetup_to_you);
|
||||
|
||||
if (iceConn->connect_to_me)
|
||||
free ((char *) iceConn->connect_to_me);
|
||||
|
||||
if (iceConn->protosetup_to_me)
|
||||
free ((char *) iceConn->protosetup_to_me);
|
||||
|
||||
free ((char *) iceConn);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
206
lib/libICE/src/watch.c
Normal file
206
lib/libICE/src/watch.c
Normal file
@@ -0,0 +1,206 @@
|
||||
/* $Xorg: watch.c,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
|
||||
/******************************************************************************
|
||||
|
||||
|
||||
Copyright 1993, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
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
|
||||
OPEN GROUP 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 name of The Open Group 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 Open Group.
|
||||
|
||||
Author: Ralph Mor, X Consortium
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <X11/ICE/ICElib.h>
|
||||
#include "ICElibint.h"
|
||||
|
||||
|
||||
Status
|
||||
IceAddConnectionWatch (watchProc, clientData)
|
||||
|
||||
IceWatchProc watchProc;
|
||||
IcePointer clientData;
|
||||
|
||||
{
|
||||
/*
|
||||
* watchProc will be called each time an ICE connection is
|
||||
* created/destroyed by ICElib.
|
||||
*/
|
||||
|
||||
_IceWatchProc *ptr = _IceWatchProcs;
|
||||
_IceWatchProc *newWatchProc;
|
||||
int i;
|
||||
|
||||
if ((newWatchProc = (_IceWatchProc *) malloc (
|
||||
sizeof (_IceWatchProc))) == NULL)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
newWatchProc->watch_proc = watchProc;
|
||||
newWatchProc->client_data = clientData;
|
||||
newWatchProc->watched_connections = NULL;
|
||||
newWatchProc->next = NULL;
|
||||
|
||||
while (ptr && ptr->next)
|
||||
ptr = ptr->next;
|
||||
|
||||
if (ptr == NULL)
|
||||
_IceWatchProcs = newWatchProc;
|
||||
else
|
||||
ptr->next = newWatchProc;
|
||||
|
||||
|
||||
/*
|
||||
* Invoke the watch proc with any previously opened ICE connections.
|
||||
*/
|
||||
|
||||
for (i = 0; i < _IceConnectionCount; i++)
|
||||
{
|
||||
_IceWatchedConnection *newWatchedConn = (_IceWatchedConnection *)
|
||||
malloc (sizeof (_IceWatchedConnection));
|
||||
|
||||
newWatchedConn->iceConn = _IceConnectionObjs[i];
|
||||
newWatchedConn->next = NULL;
|
||||
|
||||
newWatchProc->watched_connections = newWatchedConn;
|
||||
|
||||
(*newWatchProc->watch_proc) (_IceConnectionObjs[i],
|
||||
newWatchProc->client_data, True, &newWatchedConn->watch_data);
|
||||
}
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
IceRemoveConnectionWatch (watchProc, clientData)
|
||||
|
||||
IceWatchProc watchProc;
|
||||
IcePointer clientData;
|
||||
|
||||
{
|
||||
_IceWatchProc *currWatchProc = _IceWatchProcs;
|
||||
_IceWatchProc *prevWatchProc = NULL;
|
||||
|
||||
while (currWatchProc && (currWatchProc->watch_proc != watchProc ||
|
||||
currWatchProc->client_data != clientData))
|
||||
{
|
||||
prevWatchProc = currWatchProc;
|
||||
currWatchProc = currWatchProc->next;
|
||||
}
|
||||
|
||||
if (currWatchProc)
|
||||
{
|
||||
_IceWatchProc *nextWatchProc = currWatchProc->next;
|
||||
_IceWatchedConnection *watchedConn;
|
||||
|
||||
watchedConn = currWatchProc->watched_connections;
|
||||
while (watchedConn)
|
||||
{
|
||||
_IceWatchedConnection *nextWatchedConn = watchedConn->next;
|
||||
free ((char *) watchedConn);
|
||||
watchedConn = nextWatchedConn;
|
||||
}
|
||||
|
||||
if (prevWatchProc == NULL)
|
||||
_IceWatchProcs = nextWatchProc;
|
||||
else
|
||||
prevWatchProc->next = nextWatchProc;
|
||||
|
||||
free ((char *) currWatchProc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
_IceConnectionOpened (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
_IceWatchProc *watchProc = _IceWatchProcs;
|
||||
|
||||
while (watchProc)
|
||||
{
|
||||
_IceWatchedConnection *newWatchedConn = (_IceWatchedConnection *)
|
||||
malloc (sizeof (_IceWatchedConnection));
|
||||
_IceWatchedConnection *watchedConn;
|
||||
|
||||
watchedConn = watchProc->watched_connections;
|
||||
while (watchedConn && watchedConn->next)
|
||||
watchedConn = watchedConn->next;
|
||||
|
||||
newWatchedConn->iceConn = iceConn;
|
||||
newWatchedConn->next = NULL;
|
||||
|
||||
if (watchedConn == NULL)
|
||||
watchProc->watched_connections = newWatchedConn;
|
||||
else
|
||||
watchedConn->next = newWatchedConn;
|
||||
|
||||
(*watchProc->watch_proc) (iceConn,
|
||||
watchProc->client_data, True, &newWatchedConn->watch_data);
|
||||
|
||||
watchProc = watchProc->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
_IceConnectionClosed (iceConn)
|
||||
|
||||
IceConn iceConn;
|
||||
|
||||
{
|
||||
_IceWatchProc *watchProc = _IceWatchProcs;
|
||||
|
||||
while (watchProc)
|
||||
{
|
||||
_IceWatchedConnection *watchedConn = watchProc->watched_connections;
|
||||
_IceWatchedConnection *prev = NULL;
|
||||
|
||||
while (watchedConn && watchedConn->iceConn != iceConn)
|
||||
{
|
||||
prev = watchedConn;
|
||||
watchedConn = watchedConn->next;
|
||||
}
|
||||
|
||||
if (watchedConn)
|
||||
{
|
||||
(*watchProc->watch_proc) (iceConn,
|
||||
watchProc->client_data, False, &watchedConn->watch_data);
|
||||
|
||||
if (prev == NULL)
|
||||
watchProc->watched_connections = watchedConn->next;
|
||||
else
|
||||
prev->next = watchedConn->next;
|
||||
|
||||
free ((char *) watchedConn);
|
||||
}
|
||||
|
||||
watchProc = watchProc->next;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user