...
 
Commits (172)
#
# X.Org module default exclusion patterns
# The next section if for module specific patterns
#
# Do not edit the following section
# GNU Build System (Autotools)
aclocal.m4
autom4te.cache/
autoscan.log
ChangeLog
compile
config.guess
config.h
config.h.in
config.log
config-ml.in
config.py
config.status
config.status.lineno
config.sub
configure
configure.scan
depcomp
.deps/
INSTALL
install-sh
.libs/
libtool
libtool.m4
ltmain.sh
lt~obsolete.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
Makefile
Makefile.in
mdate-sh
missing
mkinstalldirs
*.pc
py-compile
stamp-h?
symlink-tree
texinfo.tex
ylwrap
# Do not edit the following section
# Edit Compile Debug Document Distribute
*~
*.[0-9]
*.[0-9]x
*.bak
*.bin
core
*.dll
*.exe
*-ISO*.bdf
*-JIS*.bdf
*-KOI8*.bdf
*.kld
*.ko
*.ko.cmd
*.lai
*.l[oa]
*.[oa]
*.obj
*.patch
*.so
*.pcf.gz
*.pdb
*.tar.bz2
*.tar.gz
#
# Add & Override patterns for libICE
#
# Edit the following section as needed
# For example, !report.pc overrides *.pc. See 'man gitignore'
#
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.
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
SUBDIRS = doc specs src
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = ice.pc
MAINTAINERCLEANFILES = ChangeLog INSTALL
.PHONY: ChangeLog INSTALL
INSTALL:
$(INSTALL_CMD)
ChangeLog:
$(CHANGELOG_CMD)
dist-hook: ChangeLog INSTALL
if LINT
lint:
(cd src && $(MAKE) $(MFLAGS) lint)
endif LINT
EXTRA_DIST = README.md
libICE - Inter-Client Exchange Library
--------------------------------------
Documentation for this API can be found in the doc directory of the source
code, or online at:
https://www.x.org/releases/current/doc/libICE/
All questions regarding this software should be directed at the
Xorg mailing list:
https://lists.x.org/mailman/listinfo/xorg
The master development code repository can be found at:
https://gitlab.freedesktop.org/xorg/lib/libICE
Please submit bug reports and requests to merge patches there.
For patch submission instructions, see:
https://www.x.org/wiki/Development/Documentation/SubmittingPatches
#! /bin/sh
srcdir=`dirname "$0"`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd "$srcdir"
autoreconf -v --install || exit 1
cd "$ORIGDIR" || exit $?
git config --local --get format.subjectPrefix >/dev/null 2>&1 ||
git config --local format.subjectPrefix "PATCH libICE"
if test -z "$NOCONFIGURE"; then
exec "$srcdir"/configure "$@"
fi
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([libICE], [1.0.10],
[https://gitlab.freedesktop.org/xorg/lib/libICE/issues], [libICE])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
# Set common system defines for POSIX extensions, such as _GNU_SOURCE
# Must be called before any macros that run the compiler (like
# AC_PROG_LIBTOOL or XORG_DEFAULT_OPTIONS) to avoid autoconf errors.
AC_USE_SYSTEM_EXTENSIONS
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
# Initialize libtool
AC_PROG_LIBTOOL
# Require xorg-macros minimum of 1.12 for DocBook external references
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.12 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.12)
XORG_DEFAULT_OPTIONS
XORG_ENABLE_DOCS
XORG_ENABLE_SPECS
XORG_WITH_XMLTO(0.0.22)
XORG_WITH_FOP
XORG_WITH_XSLTPROC
XORG_CHECK_SGML_DOCTOOLS(1.8)
# Obtain compiler/linker options for depedencies
PKG_CHECK_MODULES(ICE, xproto xtrans)
# Transport selection macro from xtrans.m4
XTRANS_CONNECTION_FLAGS
AC_DEFINE(ICE_t, 1, [Xtrans transport type])
AC_DEFINE(TRANS_CLIENT, 1, [Xtrans transport client code])
AC_DEFINE(TRANS_SERVER, 1, [Xtrans transport server code])
# Checks for library functions.
AC_CHECK_LIB([bsd], [arc4random_buf])
AC_CHECK_FUNCS([asprintf arc4random_buf getentropy])
# Allow checking code with lint, sparse, etc.
XORG_WITH_LINT
XORG_LINT_LIBRARY([ICE])
LINT_FLAGS="${LINT_FLAGS} ${ICE_CFLAGS} ${XTRANS_CFLAGS}"
AC_CONFIG_FILES([Makefile
doc/Makefile
specs/Makefile
src/Makefile
ice.pc])
AC_OUTPUT
*.html
*.ps
*.pdf
*.txt
*.db
This source diff could not be displayed because it is too large. You can view the blob instead.
if ENABLE_DOCS
# Main DocBook/XML files (DOCTYPE book)
docbook = ICElib.xml
# The location where the DocBook/XML files and their generated formats are installed
shelfdir = $(docdir)
# Generate DocBook/XML output formats with or without stylesheets
include $(top_srcdir)/docbook.am
endif ENABLE_DOCS
#
# Generate output formats for a single DocBook/XML with/without chapters
#
# Variables set by the calling Makefile:
# shelfdir: the location where the docs/specs are installed. Typically $(docdir)
# docbook: the main DocBook/XML file, no chapters, appendix or image files
# chapters: all files pulled in by an XInclude statement and images.
#
#
# This makefile is intended for Users Documentation and Functional Specifications.
# Do not use for Developer Documentation which is not installed and does not require olink.
# Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393
# for an explanation on documents classification.
#
# DocBook/XML generated output formats to be installed
shelf_DATA =
# DocBook/XML file with chapters, appendix and images it includes
dist_shelf_DATA = $(docbook) $(chapters)
if HAVE_XMLTO
if HAVE_STYLESHEETS
XMLTO_SEARCHPATH_FLAGS = \
--searchpath "$(XORG_SGML_PATH)/X11" \
--searchpath "$(abs_top_builddir)"
XMLTO_HTML_OLINK_FLAGS = \
--stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.html.xml \
--stringparam current.docid="$(<:.xml=)"
XMLTO_HTML_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
XMLTO_HTML_FLAGS = \
$(XMLTO_SEARCHPATH_FLAGS) \
$(XMLTO_HTML_STYLESHEET_FLAGS) \
$(XMLTO_HTML_OLINK_FLAGS)
shelf_DATA += $(docbook:.xml=.html)
%.html: %.xml $(chapters)
$(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $<
if HAVE_XMLTO_TEXT
shelf_DATA += $(docbook:.xml=.txt)
%.txt: %.xml $(chapters)
$(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $<
endif HAVE_XMLTO_TEXT
if HAVE_FOP
XMLTO_FO_IMAGEPATH_FLAGS = --stringparam img.src.path=$(abs_builddir)/
XMLTO_PDF_OLINK_FLAGS = \
--stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.pdf.xml \
--stringparam current.docid="$(<:.xml=)"
XMLTO_FO_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl
XMLTO_FO_FLAGS = \
$(XMLTO_SEARCHPATH_FLAGS) \
$(XMLTO_FO_STYLESHEET_FLAGS) \
$(XMLTO_FO_IMAGEPATH_FLAGS) \
$(XMLTO_PDF_OLINK_FLAGS)
shelf_DATA += $(docbook:.xml=.pdf)
%.pdf: %.xml $(chapters)
$(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $<
shelf_DATA += $(docbook:.xml=.ps)
%.ps: %.xml $(chapters)
$(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $<
endif HAVE_FOP
# Generate documents cross-reference target databases
if HAVE_XSLTPROC
XSLT_SEARCHPATH_FLAGS = \
--path "$(XORG_SGML_PATH)/X11" \
--path "$(abs_top_builddir)"
XSLT_OLINK_FLAGS = \
--stringparam targets.filename "$@" \
--stringparam collect.xref.targets "only" \
--stringparam olink.base.uri "$(@:.db=)"
XSLT_HTML_FLAGS = \
$(XSLT_SEARCHPATH_FLAGS) \
$(XSLT_OLINK_FLAGS) \
--nonet --xinclude \
$(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
XSLT_PDF_FLAGS = \
$(XSLT_SEARCHPATH_FLAGS) \
$(XSLT_OLINK_FLAGS) \
--nonet --xinclude \
$(STYLESHEET_SRCDIR)/xorg-fo.xsl
shelf_DATA += $(docbook:.xml=.html.db)
%.html.db: %.xml $(chapters)
$(AM_V_GEN)$(XSLTPROC) $(XSLT_HTML_FLAGS) $<
shelf_DATA += $(docbook:.xml=.pdf.db)
%.pdf.db: %.xml $(chapters)
$(AM_V_GEN)$(XSLTPROC) $(XSLT_PDF_FLAGS) $<
endif HAVE_XSLTPROC
endif HAVE_STYLESHEETS
endif HAVE_XMLTO
CLEANFILES = $(shelf_DATA)
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
/* $Xorg: ICE.h,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
/******************************************************************************
......
/* $Xorg: ICEconn.h,v 1.5 2001/02/09 02:03:26 xorgcvs Exp $ */
/******************************************************************************
......@@ -33,7 +32,7 @@ Author: Ralph Mor, X Consortium
#include <X11/ICE/ICElib.h>
/*
* Data structures for ICE connection object
* Data structures for ICE connection object
*/
typedef struct _IceSavedReplyWait {
......
/* $Xorg: ICElib.h,v 1.5 2001/02/09 02:03:26 xorgcvs Exp $ */
/******************************************************************************
......@@ -38,11 +37,7 @@ Author: Ralph Mor, X Consortium
#define True 1
#define False 0
#if NeedFunctionPrototypes
typedef void *IcePointer;
#else
typedef char *IcePointer;
#endif
typedef enum {
IcePoAuthHaveReply,
......@@ -102,16 +97,13 @@ typedef struct _IceConn *IceConn;
typedef struct _IceListenObj *IceListenObj;
typedef void (*IceWatchProc) (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
IcePointer /* clientData */,
Bool /* opening */,
IcePointer * /* watchData */
#endif
);
typedef void (*IcePoProcessMsgProc) (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
IcePointer /* clientData */,
int /* opcode */,
......@@ -119,17 +111,14 @@ typedef void (*IcePoProcessMsgProc) (
Bool /* swap */,
IceReplyWaitInfo * /* replyWait */,
Bool * /* replyReadyRet */
#endif
);
typedef void (*IcePaProcessMsgProc) (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
IcePointer /* clientData */,
int /* opcode */,
unsigned long /* length */,
Bool /* swap */
#endif
);
typedef struct {
......@@ -145,7 +134,6 @@ typedef struct {
} IcePaVersionRec;
typedef IcePoAuthStatus (*IcePoAuthProc) (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
IcePointer * /* authStatePtr */,
Bool /* cleanUp */,
......@@ -155,11 +143,9 @@ typedef IcePoAuthStatus (*IcePoAuthProc) (
int * /* replyDataLenRet */,
IcePointer * /* replyDataRet */,
char ** /* errorStringRet */
#endif
);
typedef IcePaAuthStatus (*IcePaAuthProc) (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
IcePointer * /* authStatePtr */,
Bool /* swap */,
......@@ -168,17 +154,13 @@ typedef IcePaAuthStatus (*IcePaAuthProc) (
int * /* replyDataLenRet */,
IcePointer * /* replyDataRet */,
char ** /* errorStringRet */
#endif
);
typedef Bool (*IceHostBasedAuthProc) (
#if NeedFunctionPrototypes
char * /* hostName */
#endif
);
typedef Status (*IceProtocolSetupProc) (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* majorVersion */,
int /* minorVersion */,
......@@ -186,31 +168,23 @@ typedef Status (*IceProtocolSetupProc) (
char * /* release */,
IcePointer * /* clientDataRet */,
char ** /* failureReasonRet */
#endif
);
typedef void (*IceProtocolActivateProc) (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
IcePointer /* clientData */
#endif
);
typedef void (*IceIOErrorProc) (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
typedef void (*IcePingReplyProc) (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
IcePointer /* clientData */
#endif
);
typedef void (*IceErrorHandler) (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
Bool /* swap */,
int /* offendingMinorOpcode */,
......@@ -218,13 +192,10 @@ typedef void (*IceErrorHandler) (
int /* errorClass */,
int /* severity */,
IcePointer /* values */
#endif
);
typedef void (*IceIOErrorHandler) (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
......@@ -235,147 +206,112 @@ typedef void (*IceIOErrorHandler) (
_XFUNCPROTOBEGIN
extern int IceRegisterForProtocolSetup (
#if NeedFunctionPrototypes
char * /* protocolName */,
char * /* vendor */,
char * /* release */,
const char * /* protocolName */,
const char * /* vendor */,
const char * /* release */,
int /* versionCount */,
IcePoVersionRec * /* versionRecs */,
int /* authCount */,
char ** /* authNames */,
const char ** /* authNames */,
IcePoAuthProc * /* authProcs */,
IceIOErrorProc /* IOErrorProc */
#endif
);
extern int IceRegisterForProtocolReply (
#if NeedFunctionPrototypes
char * /* protocolName */,
char * /* vendor */,
char * /* release */,
const char * /* protocolName */,
const char * /* vendor */,
const char * /* release */,
int /* versionCount */,
IcePaVersionRec * /* versionRecs */,
int /* authCount */,
char ** /* authNames */,
const char ** /* authNames */,
IcePaAuthProc * /* authProcs */,
IceHostBasedAuthProc /* hostBasedAuthProc */,
IceProtocolSetupProc /* protocolSetupProc */,
IceProtocolActivateProc /* protocolActivateProc */,
IceIOErrorProc /* IOErrorProc */
#endif
);
extern IceConn IceOpenConnection (
#if NeedFunctionPrototypes
char * /* networkIdsList */,
IcePointer /* context */,
Bool /* mustAuthenticate */,
int /* majorOpcodeCheck */,
int /* errorLength */,
char * /* errorStringRet */
#endif
);
extern IcePointer IceGetConnectionContext (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern Status IceListenForConnections (
#if NeedFunctionPrototypes
int * /* countRet */,
IceListenObj ** /* listenObjsRet */,
int /* errorLength */,
char * /* errorStringRet */
#endif
);
extern Status IceListenForWellKnownConnections (
#if NeedFunctionPrototypes
char * /* port */,
int * /* countRet */,
IceListenObj ** /* listenObjsRet */,
int /* errorLength */,
char * /* errorStringRet */
#endif
);
extern int IceGetListenConnectionNumber (
#if NeedFunctionPrototypes
IceListenObj /* listenObj */
#endif
);
extern char *IceGetListenConnectionString (
#if NeedFunctionPrototypes
IceListenObj /* listenObj */
#endif
);
extern char *IceComposeNetworkIdList (
#if NeedFunctionPrototypes
int /* count */,
IceListenObj * /* listenObjs */
#endif
);
extern void IceFreeListenObjs (
#if NeedFunctionPrototypes
int /* count */,
IceListenObj * /* listenObjs */
#endif
);
extern void IceSetHostBasedAuthProc (
#if NeedFunctionPrototypes
IceListenObj /* listenObj */,
IceHostBasedAuthProc /* hostBasedAuthProc */
#endif
);
extern IceConn IceAcceptConnection (
#if NeedFunctionPrototypes
IceListenObj /* listenObj */,
IceAcceptStatus * /* statusRet */
#endif
);
extern void IceSetShutdownNegotiation (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
Bool /* negotiate */
#endif
);
extern Bool IceCheckShutdownNegotiation (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern IceCloseStatus IceCloseConnection (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern Status IceAddConnectionWatch (
#if NeedFunctionPrototypes
IceWatchProc /* watchProc */,
IcePointer /* clientData */
#endif
);
extern void IceRemoveConnectionWatch (
#if NeedFunctionPrototypes
IceWatchProc /* watchProc */,
IcePointer /* clientData */
#endif
);
extern IceProtocolSetupStatus IceProtocolSetup (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* myOpcode */,
IcePointer /* clientData */,
......@@ -386,150 +322,108 @@ extern IceProtocolSetupStatus IceProtocolSetup (
char ** /* releaseRet */,
int /* errorLength */,
char * /* errorStringRet */
#endif
);
extern Status IceProtocolShutdown (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* majorOpcode */
#endif
);
extern IceProcessMessagesStatus IceProcessMessages (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
IceReplyWaitInfo * /* replyWait */,
Bool * /* replyReadyRet */
#endif
);
extern Status IcePing (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
IcePingReplyProc /* pingReplyProc */,
IcePointer /* clientData */
#endif
);
extern char *IceAllocScratch (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
unsigned long /* size */
#endif
);
extern int IceFlush (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern int IceGetOutBufSize (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern int IceGetInBufSize (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern IceConnectStatus IceConnectionStatus (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern char *IceVendor (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern char *IceRelease (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern int IceProtocolVersion (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern int IceProtocolRevision (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern int IceConnectionNumber (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern char *IceConnectionString (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern unsigned long IceLastSentSequenceNumber (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern unsigned long IceLastReceivedSequenceNumber (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern Bool IceSwapping (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern IceErrorHandler IceSetErrorHandler (
#if NeedFunctionPrototypes
IceErrorHandler /* handler */
#endif
);
extern IceIOErrorHandler IceSetIOErrorHandler (
#if NeedFunctionPrototypes
IceIOErrorHandler /* handler */
#endif
);
extern char *IceGetPeerName (
IceConn /* iceConn */
);
/*
* Multithread Routines
*/
extern Status IceInitThreads (
#if NeedFunctionPrototypes
void
#endif
);
extern void IceAppLockConn (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern void IceAppUnlockConn (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
_XFUNCPROTOEND
......
/* $Xorg: ICEmsg.h,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
/******************************************************************************
......@@ -30,72 +29,85 @@ Author: Ralph Mor, X Consortium
#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 (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
unsigned long /* nbytes */,
char * /* ptr */
#endif
);
extern void _IceReadSkip (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
unsigned long /* nbytes */
#endif
);
extern void _IceWrite (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
unsigned long /* nbytes */,
char * /* ptr */
#endif
);
extern void _IceErrorBadMinor (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* majorOpcode */,
int /* offendingMinor */,
int /* severity */
#endif
);
extern void _IceErrorBadState (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* majorOpcode */,
int /* offendingMinor */,
int /* severity */
#endif
);
extern void _IceErrorBadLength (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* majorOpcode */,
int /* offendingMinor */,
int /* severity */
#endif
);
extern void _IceErrorBadValue (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* majorOpcode */,
int /* offendingMinor */,
int /* offset */,
int /* length */,
IcePointer /* value */
#endif
);
extern IcePoAuthStatus _IcePoMagicCookie1Proc (
IceConn /* iceConn */,
IcePointer * /* authStatePtr */,
Bool /* cleanUp */,
Bool /* swap */,
int /* authDataLen */,
IcePointer /* authData */,
int * /* replyDataLenRet */,
IcePointer * /* replyDataRet */,
char ** /* errorStringRet */
);
extern IcePaAuthStatus _IcePaMagicCookie1Proc (
IceConn /* iceConn */,
IcePointer * /* authStatePtr */,
Bool /* swap */,
int /* authDataLen */,
IcePointer /* authData */,
int * /* replyDataLenRet */,
IcePointer * /* replyDataRet */,
char ** /* errorStringRet */
);
......@@ -149,10 +161,10 @@ extern void _IceErrorBadValue (
IceGetHeader (_iceConn, _offendingMajorOpcode, ICE_Error, \
SIZEOF (iceErrorMsg), iceErrorMsg, _pMsg); \
_pMsg->length += (_dataLength); \
_pMsg->offendingMinorOpcode = _offendingMinorOpcode; \
_pMsg->severity = _severity; \
_pMsg->offendingSequenceNum = _offendingSequenceNum; \
_pMsg->errorClass = _errorClass; \
_pMsg->offendingMinorOpcode = (CARD8) _offendingMinorOpcode; \
_pMsg->severity = (CARD8) _severity; \
_pMsg->offendingSequenceNum = (CARD32) _offendingSequenceNum; \
_pMsg->errorClass = (CARD16) _errorClass; \
}
......@@ -174,20 +186,12 @@ extern void _IceErrorBadValue (
} \
}
#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
......@@ -205,21 +209,13 @@ extern void _IceErrorBadValue (
/*
* Write pad bytes. Used to force 32 or 64 bit alignment.
* A maxium of 7 pad bytes can be specified.
* A maximum 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); \
} \
char _dummy[7] = { 0 }; \
IceWriteData (_iceConn, (_bytes), _dummy); \
}
......@@ -240,7 +236,7 @@ extern void _IceErrorBadValue (
} \
else \
{ \
_pData = (char *) malloc ((unsigned) _bytes); \
_pData = malloc (_bytes); \
if (_pData) \
_IceRead (_iceConn, _bytes, _pData); \
else \
......@@ -251,7 +247,7 @@ extern void _IceErrorBadValue (
#define IceDisposeCompleteMessage(_iceConn, _pData) \
if ((char *) _pData < _iceConn->inbuf || \
(char *) _pData >= _iceConn->inbufmax) \
free ((char *) _pData);
free (_pData);
#define IceReadSimpleMessage(_iceConn, _msgType, _pMsg) \
......@@ -269,8 +265,6 @@ extern void _IceErrorBadValue (
#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); \
......@@ -281,12 +275,6 @@ extern void _IceErrorBadValue (
_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).
......@@ -299,4 +287,6 @@ extern void _IceErrorBadValue (
_IceRead (_iceConn, (unsigned long) (_bytes), _dummy); \
}
_XFUNCPROTOEND
#endif /* _ICEMSG_H_ */
/* $Xorg: ICEproto.h,v 1.5 2001/02/09 02:03:26 xorgcvs Exp $ */
/******************************************************************************
......@@ -36,18 +35,18 @@ typedef struct {
CARD8 majorOpcode;
CARD8 minorOpcode;
CARD8 data[2];
CARD32 length B32;
CARD32 length;
} iceMsg;
typedef struct {
CARD8 majorOpcode;
CARD8 minorOpcode;
CARD16 errorClass B16;
CARD32 length B32;
CARD16 errorClass;
CARD32 length;
CARD8 offendingMinorOpcode;
CARD8 severity;
CARD16 unused B16;
CARD32 offendingSequenceNum B32;
CARD16 unused;
CARD32 offendingSequenceNum;
/* n varying values */
/* p p = pad (n, 8) */
} iceErrorMsg;
......@@ -57,7 +56,7 @@ typedef struct {
CARD8 minorOpcode;
CARD8 byteOrder;
CARD8 unused;
CARD32 length B32;
CARD32 length;
} iceByteOrderMsg;
typedef struct {
......@@ -65,7 +64,7 @@ typedef struct {
CARD8 minorOpcode;
CARD8 versionCount;
CARD8 authCount;
CARD32 length B32;
CARD32 length;
CARD8 mustAuthenticate;
CARD8 unused[7];
/* i STRING vendor */
......@@ -80,8 +79,8 @@ typedef struct {
CARD8 minorOpcode;
CARD8 authIndex;
CARD8 unused1;
CARD32 length B32;
CARD16 authDataLength B16;
CARD32 length;
CARD16 authDataLength;
CARD8 unused2[6];
/* n varying data */
/* p p = pad (n, 8) */
......@@ -91,8 +90,8 @@ typedef struct {
CARD8 majorOpcode;
CARD8 minorOpcode;
CARD8 unused1[2];
CARD32 length B32;
CARD16 authDataLength B16;
CARD32 length;
CARD16 authDataLength;
CARD8 unused2[6];
/* n varying data */
/* p p = pad (n, 8) */
......@@ -102,8 +101,8 @@ typedef struct {
CARD8 majorOpcode;
CARD8 minorOpcode;
CARD8 unused1[2];
CARD32 length B32;
CARD16 authDataLength B16;
CARD32 length;
CARD16 authDataLength;
CARD8 unused2[6];
/* n varying data */
/* p p = pad (n, 8) */
......@@ -114,7 +113,7 @@ typedef struct {
CARD8 minorOpcode;
CARD8 versionIndex;
CARD8 unused;
CARD32 length B32;
CARD32 length;
/* i STRING vendor */
/* j STRING release */
/* p p = pad (i+j, 8) */
......@@ -125,7 +124,7 @@ typedef struct {
CARD8 minorOpcode;
CARD8 protocolOpcode;
CARD8 mustAuthenticate;
CARD32 length B32;
CARD32 length;
CARD8 versionCount;
CARD8 authCount;
CARD8 unused[6];
......@@ -142,7 +141,7 @@ typedef struct {
CARD8 minorOpcode;
CARD8 versionIndex;
CARD8 protocolOpcode;
CARD32 length B32;
CARD32 length;
/* i STRING vendor */
/* j STRING release */
/* p p = pad (i+j, 8) */
......
/* $Xorg: ICEutil.h,v 1.5 2001/02/09 02:03:26 xorgcvs Exp $ */
/******************************************************************************
......@@ -30,8 +29,11 @@ Author: Ralph Mor, X Consortium
#ifndef _ICEUTIL_H_
#define _ICEUTIL_H_
#include <X11/Xfuncproto.h>
#include <stdio.h>
#include <X11/Xlib.h>
_XFUNCPROTOBEGIN
/*
* Data structure for entry in ICE authority file
......@@ -75,64 +77,48 @@ typedef struct {
*/
extern char *IceAuthFileName (
#if NeedFunctionPrototypes
void
#endif
);
extern int IceLockAuthFile (
#if NeedFunctionPrototypes
char * /* file_name */,
const char * /* file_name */,
int /* retries */,
int /* timeout */,
long /* dead */
#endif
);
extern void IceUnlockAuthFile (
#if NeedFunctionPrototypes
char * /* file_name */
#endif
const char * /* file_name */
);
extern IceAuthFileEntry *IceReadAuthFileEntry (
#if NeedFunctionPrototypes
FILE * /* auth_file */
#endif
);
extern void IceFreeAuthFileEntry (
#if NeedFunctionPrototypes
IceAuthFileEntry * /* auth */
#endif
);
extern Status IceWriteAuthFileEntry (
#if NeedFunctionPrototypes
FILE * /* auth_file */,
IceAuthFileEntry * /* auth */
#endif
);
extern IceAuthFileEntry *IceGetAuthFileEntry (
#if NeedFunctionPrototypes
char * /* protocol_name */,
char * /* network_id */,
char * /* auth_name */
#endif
const char * /* protocol_name */,
const char * /* network_id */,
const char * /* auth_name */
);
extern char *IceGenerateMagicCookie (
#if NeedFunctionPrototypes
int /* len */
#endif
);
extern void IceSetPaAuthData (
#if NeedFunctionPrototypes
int /* numEntries */,
IceAuthDataEntry * /* entries */
#endif
);
_XFUNCPROTOEND
#endif /* _ICEUTIL_H_ */
*.html
*.ps
*.pdf
*.txt
*.db
if ENABLE_SPECS
# Main DocBook/XML files (DOCTYPE book)
docbook = ice.xml
# The location where the DocBook/XML files and their generated formats are installed
shelfdir = $(docdir)
# Generate DocBook/XML output formats with or without stylesheets
include $(top_srcdir)/docbook.am
endif ENABLE_SPECS
This diff is collapsed.
/* $Xorg: ICElibint.h,v 1.4 2001/02/09 02:03:26 xorgcvs Exp $ */
/******************************************************************************
......@@ -36,16 +35,13 @@ Author: Ralph Mor, X Consortium
#include <X11/ICE/ICEproto.h>
#include <X11/ICE/ICEconn.h>
#include <X11/ICE/ICEmsg.h>
#ifndef X_NOT_STDC_ENV
#include <stdlib.h>
#else
char *malloc();
#include <X11/ICE/ICEutil.h>
#ifdef WIN32
#include <X11/Xwindows.h>
#endif
#ifndef NULL
#define NULL 0
#endif
#include <stdlib.h>
#include <stddef.h>
/*
......@@ -62,7 +58,7 @@ char *malloc();
#define PAD64(_bytes) ((8 - ((unsigned int) (_bytes) % 8)) % 8)
#define PADDED_BYTES64(_bytes) (_bytes + PAD64 (_bytes))
#define PADDED_BYTES64(_bytes) ((unsigned int) _bytes + PAD64 (_bytes))
/*
......@@ -71,7 +67,7 @@ char *malloc();
#define PAD32(_bytes) ((4 - ((unsigned int) (_bytes) % 4)) % 4)
#define PADDED_BYTES32(_bytes) (_bytes + PAD32 (_bytes))
#define PADDED_BYTES32(_bytes) ((unsigned int) _bytes + PAD32 (_bytes))
/*
......@@ -133,7 +129,6 @@ struct _IceListenObj {
*/
typedef void (*_IceProcessCoreMsgProc) (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* opcode */,
unsigned long /* length */,
......@@ -141,7 +136,6 @@ typedef void (*_IceProcessCoreMsgProc) (
IceReplyWaitInfo * /* replyWait */,
Bool * /* replyReadyRet */,
Bool * /* connectionClosedRet */
#endif
);
typedef struct {
......@@ -161,8 +155,6 @@ typedef struct {
_pBuf += 1; \
}
#ifndef WORD64
#define STORE_CARD16(_pBuf, _val) \
{ \
*((CARD16 *) _pBuf) = _val; \
......@@ -175,34 +167,10 @@ typedef struct {
_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); \
CARD16 _len = (CARD16) strlen (_string); \
STORE_CARD16 (_pBuf, _len); \
memcpy (_pBuf, _string, _len); \
_pBuf += _len; \
......@@ -221,8 +189,6 @@ typedef struct {
_pBuf += 1; \
}
#ifndef WORD64
#define EXTRACT_CARD16(_pBuf, _swap, _val) \
{ \
_val = *((CARD16 *) _pBuf); \
......@@ -239,39 +205,12 @@ typedef struct {
_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); \
_string = malloc (_len + 1); \
memcpy (_string, _pBuf, _len); \
_pBuf += _len; \
_string[_len] = '\0'; \
......@@ -287,24 +226,25 @@ typedef struct {
}
#define SKIP_STRING(_pBuf, _swap) \
#define SKIP_STRING(_pBuf, _swap, _end, _bail) \
{ \
CARD16 _len; \
EXTRACT_CARD16 (_pBuf, _swap, _len); \
_pBuf += _len; \
if (PAD32 (2 + _len)) \
_pBuf += PAD32 (2 + _len); \
_pBuf += _len + PAD32(2+_len); \
if (_pBuf > _end) { \
_bail; \
} \
}
#define SKIP_LISTOF_STRING(_pBuf, _swap, _count) \
#define SKIP_LISTOF_STRING(_pBuf, _swap, _count, _end, _bail) \
{ \
int _i; \
for (_i = 0; _i < _count; _i++) \
SKIP_STRING (_pBuf, _swap); \
SKIP_STRING (_pBuf, _swap, _end, _bail); \
}
/*
* Byte swapping
*/
......@@ -319,7 +259,7 @@ typedef struct {
#define lswaps(_val) ((((_val) & 0xff) << 8) | (((_val) >> 8) & 0xff))
/*
* ICE replies (not processed via callbacks because we block)
*/
......@@ -394,195 +334,153 @@ typedef struct _IceWatchProc {
* Extern declarations
*/
extern IceConn _IceConnectionObjs[];
extern char *_IceConnectionStrings[];
extern int _IceConnectionCount;
extern IceConn _IceConnectionObjs[];
extern char *_IceConnectionStrings[];
extern int _IceConnectionCount;
extern _IceProtocol _IceProtocols[];
extern int _IceLastMajorOpcode;
extern _IceProtocol _IceProtocols[];
extern int _IceLastMajorOpcode;
extern int _IceAuthCount;
extern char *_IceAuthNames[];
extern IcePoAuthProc _IcePoAuthProcs[];
extern IcePaAuthProc _IcePaAuthProcs[];
extern int _IceAuthCount;
extern const char *_IceAuthNames[];
extern IcePoAuthProc _IcePoAuthProcs[];
extern IcePaAuthProc _IcePaAuthProcs[];
extern int _IceVersionCount;
extern _IceVersion _IceVersions[];
extern const int _IceVersionCount;
extern const _IceVersion _IceVersions[];
extern _IceWatchProc *_IceWatchProcs;
extern _IceWatchProc *_IceWatchProcs;
extern IceErrorHandler _IceErrorHandler;
extern IceIOErrorHandler _IceIOErrorHandler;
extern IceErrorHandler _IceErrorHandler;
extern IceIOErrorHandler _IceIOErrorHandler;
extern IceAuthDataEntry _IcePaAuthDataEntries[];
extern int _IcePaAuthDataEntryCount;
extern void _IceErrorBadMajor (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* offendingMajor */,
int /* offendingMinor */,
int /* severity */
#endif
);
extern void _IceErrorNoAuthentication (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* offendingMinor */
#endif
);
extern void _IceErrorNoVersion (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* offendingMinor */
#endif
);
extern void _IceErrorSetupFailed (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* offendingMinor */,
char * /* reason */
#endif
const char * /* reason */
);
extern void _IceErrorAuthenticationRejected (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* offendingMinor */,
char * /* reason */
#endif
const char * /* reason */
);
extern void _IceErrorAuthenticationFailed (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* offendingMinor */,
char * /* reason */
#endif
const char * /* reason */
);
extern void _IceErrorProtocolDuplicate (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
char * /* protocolName */
#endif
const char * /* protocolName */
);
extern void _IceErrorMajorOpcodeDuplicate (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* majorOpcode */
#endif
);
extern void _IceErrorUnknownProtocol (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
char * /* protocolName */
#endif
const char * /* protocolName */
);
extern void _IceAddOpcodeMapping (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* hisOpcode */,
int /* myOpcode */
#endif
);
extern char *_IceGetPeerName (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern void _IceFreeConnection (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern void _IceAddReplyWait (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
IceReplyWaitInfo * /* replyWait */
#endif
);
extern IceReplyWaitInfo *_IceSearchReplyWaits (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
int /* majorOpcode */
#endif
);
extern void _IceSetReplyReady (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
IceReplyWaitInfo * /* replyWait */
#endif
);
extern Bool _IceCheckReplyReady (
#if NeedFunctionPrototypes
IceConn /* iceConn */,
IceReplyWaitInfo * /* replyWait */
#endif
);
extern void _IceConnectionOpened (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern void _IceConnectionClosed (
#if NeedFunctionPrototypes
IceConn /* iceConn */
#endif
);
extern void _IceGetPoAuthData (
#if NeedFunctionPrototypes
char * /* protocol_name */,
char * /* address */,
char * /* auth_name */,
const char * /* protocol_name */,
const char * /* address */,
const char * /* auth_name */,
unsigned short * /* auth_data_length_ret */,
char ** /* auth_data_ret */
#endif
);
extern void _IceGetPaAuthData (
#if NeedFunctionPrototypes
char * /* protocol_name */,
char * /* address */,
char * /* auth_name */,
const char * /* protocol_name */,
const char * /* address */,
const char * /* auth_name */,
unsigned short * /* auth_data_length_ret */,
char ** /* auth_data_ret */
#endif
);
extern void _IceGetPoValidAuthIndices (
#if NeedFunctionPrototypes
char * /* protocol_name */,
char * /* address */,
const char * /* protocol_name */,
const char * /* address */,
int /* num_auth_names */,