Update to libICE 1.0.5.
Main change: ansification. Bumped major since some symbols which were not part of the public API have been changed to 'static'.
This commit is contained in:
parent
c8fe3e6a3b
commit
6a4a9fe60e
@ -1,3 +1,128 @@
|
|||||||
|
commit ab9dff549534c6d7b33f440bff7a841d60c1206c
|
||||||
|
Author: Peter Breitenlohner <peb@mppmu.mpg.de>
|
||||||
|
Date: Mon Dec 8 18:45:44 2008 +0100
|
||||||
|
|
||||||
|
bump to 1.0.5
|
||||||
|
|
||||||
|
commit 71695c4bf7ae07228605683f6cdeca0457c8495a
|
||||||
|
Author: Peter Breitenlohner <peb@mppmu.mpg.de>
|
||||||
|
Date: Mon Dec 8 18:44:26 2008 +0100
|
||||||
|
|
||||||
|
remove ChangeLog from EXTRA_DIST and CLEANFILES
|
||||||
|
|
||||||
|
commit 653f659fe65ae8c2a9fe5b1fdbfc78da43f2cf90
|
||||||
|
Author: Peter Breitenlohner <peb@mppmu.mpg.de>
|
||||||
|
Date: Mon Dec 8 18:41:34 2008 +0100
|
||||||
|
|
||||||
|
use memcmp instead of binaryEqual
|
||||||
|
|
||||||
|
suggested by Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
|
||||||
|
http://lists.freedesktop.org/archives/xorg/2008-December/041222.html
|
||||||
|
|
||||||
|
commit bf138553afe6eecd0e6c218dc6ae4f63065e4196
|
||||||
|
Author: Peter Breitenlohner <peb@mppmu.mpg.de>
|
||||||
|
Date: Tue Dec 2 22:06:15 2008 +0100
|
||||||
|
|
||||||
|
Use NULL, not zero, for pointers
|
||||||
|
|
||||||
|
From Magnus Kessler <Magnus.Kessler@gmx.net>
|
||||||
|
http://lists.freedesktop.org/archives/xorg/2008-October/039799.html
|
||||||
|
http://lists.freedesktop.org/archives/xorg/attachments/20081030/b2ea5b1c/attachment-0001.bin
|
||||||
|
|
||||||
|
commit b01e82ce1deedb36c9696d4d27a3b9a5d5a52d08
|
||||||
|
Author: Peter Breitenlohner <peb@mppmu.mpg.de>
|
||||||
|
Date: Thu Oct 30 12:01:06 2008 +0100
|
||||||
|
|
||||||
|
ANSI C
|
||||||
|
|
||||||
|
convert all old style function declarations
|
||||||
|
|
||||||
|
see also: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
|
||||||
|
http://bugs.freedesktop.org/show_bug.cgi?id=14683
|
||||||
|
http://bugs.freedesktop.org/attachment.cgi?id=14582
|
||||||
|
|
||||||
|
see also: Magnus Kessler <Magnus.Kessler@gmx.net>
|
||||||
|
http://lists.freedesktop.org/archives/xorg/2008-October/039799.html
|
||||||
|
http://lists.freedesktop.org/archives/xorg/attachments/20081030/b2ea5b1c/attachment-0001.bin
|
||||||
|
|
||||||
|
commit 2aba1bc0583aeb3ee6e26e3bfacd123abef744d9
|
||||||
|
Author: Peter Breitenlohner <peb@mppmu.mpg.de>
|
||||||
|
Date: Mon Dec 1 23:06:22 2008 +0100
|
||||||
|
|
||||||
|
towards ANSI C
|
||||||
|
|
||||||
|
make _IceProcessCoreMessage and default error handlers static
|
||||||
|
|
||||||
|
commit 69a1b4b6d34291738dfbc3aa19d0ce3f2842ec8f
|
||||||
|
Author: Peter Breitenlohner <peb@mppmu.mpg.de>
|
||||||
|
Date: Mon Dec 1 22:22:12 2008 +0100
|
||||||
|
|
||||||
|
Activate CWARNFLAGS with lots of gcc warnings
|
||||||
|
|
||||||
|
commit 898ed95cad1133940a83dcf428865c5d3fb2c939
|
||||||
|
Author: Peter Breitenlohner <peb@mppmu.mpg.de>
|
||||||
|
Date: Mon Dec 1 22:18:45 2008 +0100
|
||||||
|
|
||||||
|
use xorg-macros-1.2.1
|
||||||
|
|
||||||
|
Use XORG_CHANGELOG for rule to generate ChangeLog from git log
|
||||||
|
Use XORG_CWARNFLAGS for compiler warning flags, leave CFLAGS to user
|
||||||
|
|
||||||
|
commit a99fbad09ab850e65ddd57e4d4488e4726295e14
|
||||||
|
Author: Peter Breitenlohner <peb@mppmu.mpg.de>
|
||||||
|
Date: Tue Oct 7 13:21:48 2008 -0700
|
||||||
|
|
||||||
|
Constify some arguments in libICE to clear warnings in libSM
|
||||||
|
|
||||||
|
This patch avoids the gcc (3.4.6) warnings:
|
||||||
|
../../libSM-1.0.3/src/sm_client.c:104: warning: passing arg 7 of `IceRegisterForProtocolSetup' from incompatible pointer type
|
||||||
|
../../libSM-1.0.3/src/sm_manager.c:168: warning: passing arg 7 of `IceRegisterForProtocolReply' from incompatible pointer type
|
||||||
|
when compiling libSM
|
||||||
|
|
||||||
|
commit 3bceaeb3192ca75a14854d614e1621d28fb82274
|
||||||
|
Author: Peter Breitenlohner <peb@mppmu.mpg.de>
|
||||||
|
Date: Tue Oct 7 11:25:42 2008 -0700
|
||||||
|
|
||||||
|
define macros to 1 in icetrans.c to avoid redefined macro warnings
|
||||||
|
|
||||||
|
X.Org Bug #17947 <http://bugs.freedesktop.org/show_bug.cgi?id=17947>
|
||||||
|
Patch #19444 <http://bugs.freedesktop.org/attachment.cgi?id=19444>
|
||||||
|
|
||||||
|
Define as 1 (one) as done by autoconf and the command line
|
||||||
|
option, e.g. -DICE_t, not as empty.
|
||||||
|
|
||||||
|
This avoids the gcc (3.4.6) warnings:
|
||||||
|
../../libICE-1.0.4/src/icetrans.c:29:1: warning: "ICE_t" redefined
|
||||||
|
../config.h:38:1: warning: this is the location of the previous definition
|
||||||
|
../../libICE-1.0.4/src/icetrans.c:30:1: warning: "TRANS_CLIENT" redefined
|
||||||
|
<command line>:6:1: warning: this is the location of the previous definition
|
||||||
|
../../libICE-1.0.4/src/icetrans.c:31:1: warning: "TRANS_SERVER" redefined
|
||||||
|
<command line>:7:1: warning: this is the location of the previous definition
|
||||||
|
|
||||||
|
commit b707104f4dba0963ab17c1d6a29c1e3a848ea408
|
||||||
|
Author: Alan Hourihane <alanh@tungstengraphics.com>
|
||||||
|
Date: Tue Apr 29 00:41:40 2008 +0100
|
||||||
|
|
||||||
|
silence warning
|
||||||
|
|
||||||
|
commit e6b525aefc05b5203391699b00053ad52243cc6b
|
||||||
|
Author: Colin Harrison <colin.harrison-at-virgin.net>
|
||||||
|
Date: Tue Apr 29 00:40:48 2008 +0100
|
||||||
|
|
||||||
|
include for sleep()
|
||||||
|
|
||||||
|
commit ef58f37724b841ef2246757be27111775aa86559
|
||||||
|
Author: Matthieu Herrb <matthieu.herrb@laas.fr>
|
||||||
|
Date: Sun Mar 9 09:02:40 2008 +0100
|
||||||
|
|
||||||
|
nuke RCS Ids
|
||||||
|
|
||||||
|
commit 47d86e8343d3d0201166c4d75da2ec9c12638cc1
|
||||||
|
Author: James Cloos <cloos@jhcloos.com>
|
||||||
|
Date: Thu Dec 6 15:51:13 2007 -0500
|
||||||
|
|
||||||
|
Add missing PHONY line for automatic ChangeLog generation
|
||||||
|
|
||||||
commit f415da71dd26f128df7d550ecd7631f8888eb1d2
|
commit f415da71dd26f128df7d550ecd7631f8888eb1d2
|
||||||
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
Author: Alan Coopersmith <alan.coopersmith@sun.com>
|
||||||
Date: Mon Aug 20 13:21:07 2007 -0700
|
Date: Mon Aug 20 13:21:07 2007 -0700
|
||||||
|
@ -3,11 +3,12 @@ SUBDIRS = src
|
|||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA = ice.pc
|
pkgconfig_DATA = ice.pc
|
||||||
|
|
||||||
EXTRA_DIST=ice.pc.in ChangeLog
|
EXTRA_DIST=ice.pc.in
|
||||||
CLEANFILES = ChangeLog
|
|
||||||
|
.PHONY: ChangeLog
|
||||||
|
|
||||||
ChangeLog:
|
ChangeLog:
|
||||||
(GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
|
$(CHANGELOG_CMD)
|
||||||
|
|
||||||
dist-hook: ChangeLog
|
dist-hook: ChangeLog
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# $OpenBSD: Makefile.bsd-wrapper,v 1.1 2006/11/26 12:07:34 matthieu Exp $
|
# $OpenBSD: Makefile.bsd-wrapper,v 1.2 2009/04/09 20:29:45 matthieu Exp $
|
||||||
|
|
||||||
SHARED_LIBS= ICE 8.1
|
SHARED_LIBS= ICE 9.0
|
||||||
|
|
||||||
.include <bsd.xorg.mk>
|
.include <bsd.xorg.mk>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
AC_PREREQ(2.57)
|
AC_PREREQ(2.57)
|
||||||
AC_INIT([libICE],
|
AC_INIT([libICE],
|
||||||
1.0.4,
|
1.0.5,
|
||||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
||||||
libICE)
|
libICE)
|
||||||
|
|
||||||
@ -36,17 +36,19 @@ AC_DEFINE(ICE_t, 1, [Xtrans transport type])
|
|||||||
# Checks for header files.
|
# Checks for header files.
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
|
|
||||||
|
# Require xorg-macros at least 1.2.1
|
||||||
|
XORG_MACROS_VERSION([1.2.1])
|
||||||
|
m4_ifndef([XORG_MACROS_VERSION],
|
||||||
|
[AC_FATAL([must install xorg-macros 1.2.1 or later before running autoconf/autogen])])
|
||||||
|
|
||||||
dnl Allow checking code with lint, sparse, etc.
|
dnl Allow checking code with lint, sparse, etc.
|
||||||
XORG_WITH_LINT
|
XORG_WITH_LINT
|
||||||
XORG_LINT_LIBRARY([ICE])
|
XORG_LINT_LIBRARY([ICE])
|
||||||
LINT_FLAGS="${LINT_FLAGS} ${ICE_CFLAGS} ${XTRANS_CFLAGS}"
|
LINT_FLAGS="${LINT_FLAGS} ${ICE_CFLAGS} ${XTRANS_CFLAGS}"
|
||||||
|
|
||||||
if test "x$GCC" = "xyes"; then
|
XORG_CHANGELOG
|
||||||
GCC_WARNINGS="-Wall -Wpointer-arith -Wstrict-prototypes \
|
|
||||||
-Wmissing-prototypes -Wmissing-declarations \
|
XORG_CWARNFLAGS
|
||||||
-Wnested-externs -fno-strict-aliasing"
|
|
||||||
CFLAGS="$GCC_WARNINGS $CFLAGS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
XORG_RELEASE_VERSION
|
XORG_RELEASE_VERSION
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ extern int IceRegisterForProtocolSetup (
|
|||||||
int /* versionCount */,
|
int /* versionCount */,
|
||||||
IcePoVersionRec * /* versionRecs */,
|
IcePoVersionRec * /* versionRecs */,
|
||||||
int /* authCount */,
|
int /* authCount */,
|
||||||
char ** /* authNames */,
|
const char ** /* authNames */,
|
||||||
IcePoAuthProc * /* authProcs */,
|
IcePoAuthProc * /* authProcs */,
|
||||||
IceIOErrorProc /* IOErrorProc */
|
IceIOErrorProc /* IOErrorProc */
|
||||||
);
|
);
|
||||||
@ -226,7 +226,7 @@ extern int IceRegisterForProtocolReply (
|
|||||||
int /* versionCount */,
|
int /* versionCount */,
|
||||||
IcePaVersionRec * /* versionRecs */,
|
IcePaVersionRec * /* versionRecs */,
|
||||||
int /* authCount */,
|
int /* authCount */,
|
||||||
char ** /* authNames */,
|
const char ** /* authNames */,
|
||||||
IcePaAuthProc * /* authProcs */,
|
IcePaAuthProc * /* authProcs */,
|
||||||
IceHostBasedAuthProc /* hostBasedAuthProc */,
|
IceHostBasedAuthProc /* hostBasedAuthProc */,
|
||||||
IceProtocolSetupProc /* protocolSetupProc */,
|
IceProtocolSetupProc /* protocolSetupProc */,
|
||||||
|
@ -89,6 +89,29 @@ extern void _IceErrorBadValue (
|
|||||||
IcePointer /* value */
|
IcePointer /* value */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
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 */
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Macro to check if IO operations are valid on an ICE connection.
|
* Macro to check if IO operations are valid on an ICE connection.
|
||||||
|
@ -37,6 +37,9 @@ Author: Ralph Mor, X Consortium
|
|||||||
#include <X11/ICE/ICEproto.h>
|
#include <X11/ICE/ICEproto.h>
|
||||||
#include <X11/ICE/ICEconn.h>
|
#include <X11/ICE/ICEconn.h>
|
||||||
#include <X11/ICE/ICEmsg.h>
|
#include <X11/ICE/ICEmsg.h>
|
||||||
|
#ifdef WIN32
|
||||||
|
#include <X11/Xwindows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
lib_LTLIBRARIES=libICE.la
|
lib_LTLIBRARIES=libICE.la
|
||||||
|
|
||||||
AM_CFLAGS= -I${top_srcdir}/include $(ICE_CFLAGS) $(XTRANS_CFLAGS) \
|
AM_CFLAGS= -I${top_srcdir}/include $(ICE_CFLAGS) $(XTRANS_CFLAGS) \
|
||||||
-DICE_t -DTRANS_CLIENT -DTRANS_SERVER
|
-DICE_t -DTRANS_CLIENT -DTRANS_SERVER $(CWARNFLAGS)
|
||||||
|
|
||||||
libICE_la_LDFLAGS = -version-number 6:3:0 -no-undefined
|
libICE_la_LDFLAGS = -version-number 6:3:0 -no-undefined
|
||||||
|
|
||||||
|
@ -36,11 +36,10 @@ Author: Ralph Mor, X Consortium
|
|||||||
|
|
||||||
|
|
||||||
IceConn
|
IceConn
|
||||||
IceAcceptConnection (listenObj, statusRet)
|
IceAcceptConnection (
|
||||||
|
IceListenObj listenObj,
|
||||||
IceListenObj listenObj;
|
IceAcceptStatus *statusRet
|
||||||
IceAcceptStatus *statusRet;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
IceConn iceConn;
|
IceConn iceConn;
|
||||||
XtransConnInfo newconn;
|
XtransConnInfo newconn;
|
||||||
@ -51,7 +50,7 @@ IceAcceptStatus *statusRet;
|
|||||||
* Accept the connection.
|
* Accept the connection.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((newconn = _IceTransAccept (listenObj->trans_conn, &status)) == 0)
|
if ((newconn = _IceTransAccept (listenObj->trans_conn, &status)) == NULL)
|
||||||
{
|
{
|
||||||
if (status == TRANS_ACCEPT_BAD_MALLOC)
|
if (status == TRANS_ACCEPT_BAD_MALLOC)
|
||||||
*statusRet = IceAcceptBadMalloc;
|
*statusRet = IceAcceptBadMalloc;
|
||||||
|
@ -72,7 +72,6 @@ static Status write_counted_string (FILE *file, unsigned short count, char *stri
|
|||||||
|
|
||||||
char *
|
char *
|
||||||
IceAuthFileName (void)
|
IceAuthFileName (void)
|
||||||
|
|
||||||
{
|
{
|
||||||
static char slashDotICEauthority[] = "/.ICEauthority";
|
static char slashDotICEauthority[] = "/.ICEauthority";
|
||||||
char *name;
|
char *name;
|
||||||
@ -101,7 +100,7 @@ IceAuthFileName (void)
|
|||||||
if ((ptr1 = getenv("HOMEDRIVE")) && (ptr2 = getenv("HOMEDIR"))) {
|
if ((ptr1 = getenv("HOMEDRIVE")) && (ptr2 = getenv("HOMEDIR"))) {
|
||||||
len1 = strlen (ptr1);
|
len1 = strlen (ptr1);
|
||||||
len2 = strlen (ptr2);
|
len2 = strlen (ptr2);
|
||||||
} else if (ptr2 = getenv("USERNAME")) {
|
} else if ((ptr2 = getenv("USERNAME"))) {
|
||||||
len1 = strlen (ptr1 = "/users/");
|
len1 = strlen (ptr1 = "/users/");
|
||||||
len2 = strlen (ptr2);
|
len2 = strlen (ptr2);
|
||||||
}
|
}
|
||||||
@ -140,13 +139,12 @@ IceAuthFileName (void)
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
IceLockAuthFile (file_name, retries, timeout, dead)
|
IceLockAuthFile (
|
||||||
|
char *file_name,
|
||||||
char *file_name;
|
int retries,
|
||||||
int retries;
|
int timeout,
|
||||||
int timeout;
|
long dead
|
||||||
long dead;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
char creat_name[1025], link_name[1025];
|
char creat_name[1025], link_name[1025];
|
||||||
struct stat statb;
|
struct stat statb;
|
||||||
@ -217,10 +215,9 @@ long dead;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
IceUnlockAuthFile (file_name)
|
IceUnlockAuthFile (
|
||||||
|
char *file_name
|
||||||
char *file_name;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
char creat_name[1025];
|
char creat_name[1025];
|
||||||
@ -246,10 +243,9 @@ char *file_name;
|
|||||||
|
|
||||||
|
|
||||||
IceAuthFileEntry *
|
IceAuthFileEntry *
|
||||||
IceReadAuthFileEntry (auth_file)
|
IceReadAuthFileEntry (
|
||||||
|
FILE *auth_file
|
||||||
FILE *auth_file;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
IceAuthFileEntry local;
|
IceAuthFileEntry local;
|
||||||
IceAuthFileEntry *ret;
|
IceAuthFileEntry *ret;
|
||||||
@ -298,10 +294,9 @@ FILE *auth_file;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
IceFreeAuthFileEntry (auth)
|
IceFreeAuthFileEntry (
|
||||||
|
IceAuthFileEntry *auth
|
||||||
IceAuthFileEntry *auth;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
if (auth)
|
if (auth)
|
||||||
{
|
{
|
||||||
@ -317,11 +312,10 @@ IceAuthFileEntry *auth;
|
|||||||
|
|
||||||
|
|
||||||
Status
|
Status
|
||||||
IceWriteAuthFileEntry (auth_file, auth)
|
IceWriteAuthFileEntry (
|
||||||
|
FILE *auth_file,
|
||||||
FILE *auth_file;
|
IceAuthFileEntry *auth
|
||||||
IceAuthFileEntry *auth;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
if (!write_string (auth_file, auth->protocol_name))
|
if (!write_string (auth_file, auth->protocol_name))
|
||||||
return (0);
|
return (0);
|
||||||
@ -346,12 +340,11 @@ IceAuthFileEntry *auth;
|
|||||||
|
|
||||||
|
|
||||||
IceAuthFileEntry *
|
IceAuthFileEntry *
|
||||||
IceGetAuthFileEntry (protocol_name, network_id, auth_name)
|
IceGetAuthFileEntry (
|
||||||
|
char *protocol_name,
|
||||||
char *protocol_name;
|
char *network_id,
|
||||||
char *network_id;
|
char *auth_name
|
||||||
char *auth_name;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
FILE *auth_file;
|
FILE *auth_file;
|
||||||
char *filename;
|
char *filename;
|
||||||
@ -448,7 +441,7 @@ read_counted_string (FILE *file, unsigned short *countp, char **stringp)
|
|||||||
|
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
{
|
{
|
||||||
data = 0;
|
data = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -42,16 +42,14 @@ static XtransConnInfo ConnectToPeer(char *networkIdsList,
|
|||||||
#define Strstr strstr
|
#define Strstr strstr
|
||||||
|
|
||||||
IceConn
|
IceConn
|
||||||
IceOpenConnection (networkIdsList, context, mustAuthenticate, majorOpcodeCheck,
|
IceOpenConnection (
|
||||||
errorLength, errorStringRet)
|
char *networkIdsList,
|
||||||
|
IcePointer context,
|
||||||
char *networkIdsList;
|
Bool mustAuthenticate,
|
||||||
IcePointer context;
|
int majorOpcodeCheck,
|
||||||
Bool mustAuthenticate;
|
int errorLength,
|
||||||
int majorOpcodeCheck;
|
char *errorStringRet
|
||||||
int errorLength;
|
)
|
||||||
char *errorStringRet;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
IceConn iceConn;
|
IceConn iceConn;
|
||||||
int extra, i, j;
|
int extra, i, j;
|
||||||
@ -432,10 +430,9 @@ char *errorStringRet;
|
|||||||
|
|
||||||
|
|
||||||
IcePointer
|
IcePointer
|
||||||
IceGetConnectionContext (iceConn)
|
IceGetConnectionContext (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
return (iceConn->context);
|
return (iceConn->context);
|
||||||
}
|
}
|
||||||
|
@ -40,13 +40,12 @@ Author: Ralph Mor, X Consortium
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceErrorBadMinor (iceConn, majorOpcode, offendingMinor, severity)
|
_IceErrorBadMinor (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int majorOpcode,
|
||||||
int majorOpcode;
|
int offendingMinor,
|
||||||
int offendingMinor;
|
int severity
|
||||||
int severity;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
IceErrorHeader (iceConn,
|
IceErrorHeader (iceConn,
|
||||||
majorOpcode, offendingMinor,
|
majorOpcode, offendingMinor,
|
||||||
@ -60,13 +59,12 @@ int severity;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceErrorBadState (iceConn, majorOpcode, offendingMinor, severity)
|
_IceErrorBadState (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int majorOpcode,
|
||||||
int majorOpcode;
|
int offendingMinor,
|
||||||
int offendingMinor;
|
int severity
|
||||||
int severity;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
IceErrorHeader (iceConn,
|
IceErrorHeader (iceConn,
|
||||||
majorOpcode, offendingMinor,
|
majorOpcode, offendingMinor,
|
||||||
@ -80,13 +78,12 @@ int severity;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceErrorBadLength (iceConn, majorOpcode, offendingMinor, severity)
|
_IceErrorBadLength (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int majorOpcode,
|
||||||
int majorOpcode;
|
int offendingMinor,
|
||||||
int offendingMinor;
|
int severity
|
||||||
int severity;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
IceErrorHeader (iceConn,
|
IceErrorHeader (iceConn,
|
||||||
majorOpcode, offendingMinor,
|
majorOpcode, offendingMinor,
|
||||||
@ -100,15 +97,14 @@ int severity;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceErrorBadValue (iceConn, majorOpcode, offendingMinor, offset, length, value)
|
_IceErrorBadValue (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int majorOpcode,
|
||||||
int majorOpcode;
|
int offendingMinor,
|
||||||
int offendingMinor;
|
int offset,
|
||||||
int offset;
|
int length, /* in bytes */
|
||||||
int length; /* in bytes */
|
IcePointer value
|
||||||
IcePointer value;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
IceErrorHeader (iceConn,
|
IceErrorHeader (iceConn,
|
||||||
majorOpcode, offendingMinor,
|
majorOpcode, offendingMinor,
|
||||||
@ -129,11 +125,10 @@ IcePointer value;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceErrorNoAuthentication (iceConn, offendingMinor)
|
_IceErrorNoAuthentication (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int offendingMinor
|
||||||
int offendingMinor;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
int severity = (offendingMinor == ICE_ConnectionSetup) ?
|
int severity = (offendingMinor == ICE_ConnectionSetup) ?
|
||||||
IceFatalToConnection : IceFatalToProtocol;
|
IceFatalToConnection : IceFatalToProtocol;
|
||||||
@ -150,11 +145,10 @@ int offendingMinor;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceErrorNoVersion (iceConn, offendingMinor)
|
_IceErrorNoVersion (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int offendingMinor
|
||||||
int offendingMinor;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
int severity = (offendingMinor == ICE_ConnectionSetup) ?
|
int severity = (offendingMinor == ICE_ConnectionSetup) ?
|
||||||
IceFatalToConnection : IceFatalToProtocol;
|
IceFatalToConnection : IceFatalToProtocol;
|
||||||
@ -171,12 +165,11 @@ int offendingMinor;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceErrorSetupFailed (iceConn, offendingMinor, reason)
|
_IceErrorSetupFailed (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int offendingMinor,
|
||||||
int offendingMinor;
|
char *reason
|
||||||
char *reason;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *pBuf, *pStart;
|
char *pBuf, *pStart;
|
||||||
int bytes;
|
int bytes;
|
||||||
@ -203,12 +196,11 @@ char *reason;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceErrorAuthenticationRejected (iceConn, offendingMinor, reason)
|
_IceErrorAuthenticationRejected (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int offendingMinor,
|
||||||
int offendingMinor;
|
char *reason
|
||||||
char *reason;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *pBuf, *pStart;
|
char *pBuf, *pStart;
|
||||||
int bytes;
|
int bytes;
|
||||||
@ -233,12 +225,11 @@ char *reason;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceErrorAuthenticationFailed (iceConn, offendingMinor, reason)
|
_IceErrorAuthenticationFailed (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int offendingMinor,
|
||||||
int offendingMinor;
|
char *reason
|
||||||
char *reason;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *pBuf, *pStart;
|
char *pBuf, *pStart;
|
||||||
int bytes;
|
int bytes;
|
||||||
@ -263,11 +254,10 @@ char *reason;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceErrorProtocolDuplicate (iceConn, protocolName)
|
_IceErrorProtocolDuplicate (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
char *protocolName
|
||||||
char *protocolName;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *pBuf, *pStart;
|
char *pBuf, *pStart;
|
||||||
int bytes;
|
int bytes;
|
||||||
@ -292,11 +282,10 @@ char *protocolName;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceErrorMajorOpcodeDuplicate (iceConn, majorOpcode)
|
_IceErrorMajorOpcodeDuplicate (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int majorOpcode
|
||||||
int majorOpcode;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
char mOp = (char) majorOpcode;
|
char mOp = (char) majorOpcode;
|
||||||
|
|
||||||
@ -313,11 +302,10 @@ int majorOpcode;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceErrorUnknownProtocol (iceConn, protocolName)
|
_IceErrorUnknownProtocol (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
char *protocolName
|
||||||
char *protocolName;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *pBuf, *pStart;
|
char *pBuf, *pStart;
|
||||||
int bytes;
|
int bytes;
|
||||||
@ -342,13 +330,12 @@ char *protocolName;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceErrorBadMajor (iceConn, offendingMajor, offendingMinor, severity)
|
_IceErrorBadMajor (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int offendingMajor,
|
||||||
int offendingMajor;
|
int offendingMinor,
|
||||||
int offendingMinor;
|
int severity
|
||||||
int severity;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
char maj = (char) offendingMajor;
|
char maj = (char) offendingMajor;
|
||||||
|
|
||||||
@ -369,18 +356,16 @@ int severity;
|
|||||||
* Default error handler.
|
* Default error handler.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
static void
|
||||||
_IceDefaultErrorHandler (iceConn, swap,
|
_IceDefaultErrorHandler (
|
||||||
offendingMinorOpcode, offendingSequence, errorClass, severity, values)
|
IceConn iceConn,
|
||||||
|
Bool swap,
|
||||||
IceConn iceConn;
|
int offendingMinorOpcode,
|
||||||
Bool swap;
|
unsigned long offendingSequence,
|
||||||
int offendingMinorOpcode;
|
int errorClass,
|
||||||
unsigned long offendingSequence;
|
int severity,
|
||||||
int errorClass;
|
IcePointer values
|
||||||
int severity;
|
)
|
||||||
IcePointer values;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
char *str;
|
char *str;
|
||||||
char *pData = (char *) values;
|
char *pData = (char *) values;
|
||||||
@ -578,6 +563,7 @@ IcePointer values;
|
|||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IceErrorHandler _IceErrorHandler = _IceDefaultErrorHandler;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -587,10 +573,9 @@ IcePointer values;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
IceErrorHandler
|
IceErrorHandler
|
||||||
IceSetErrorHandler (handler)
|
IceSetErrorHandler (
|
||||||
|
IceErrorHandler handler
|
||||||
IceErrorHandler handler;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
IceErrorHandler oldHandler = _IceErrorHandler;
|
IceErrorHandler oldHandler = _IceErrorHandler;
|
||||||
|
|
||||||
@ -608,11 +593,10 @@ IceErrorHandler handler;
|
|||||||
* Default IO error handler.
|
* Default IO error handler.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
static void
|
||||||
_IceDefaultIOErrorHandler (iceConn)
|
_IceDefaultIOErrorHandler (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"ICE default IO error handler doing an exit(), pid = %ld, errno = %d\n",
|
"ICE default IO error handler doing an exit(), pid = %ld, errno = %d\n",
|
||||||
@ -621,6 +605,7 @@ IceConn iceConn;
|
|||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IceIOErrorHandler _IceIOErrorHandler = _IceDefaultIOErrorHandler;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -631,10 +616,9 @@ IceConn iceConn;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
IceIOErrorHandler
|
IceIOErrorHandler
|
||||||
IceSetIOErrorHandler (handler)
|
IceSetIOErrorHandler (
|
||||||
|
IceIOErrorHandler handler
|
||||||
IceIOErrorHandler handler;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
IceIOErrorHandler oldHandler = _IceIOErrorHandler;
|
IceIOErrorHandler oldHandler = _IceIOErrorHandler;
|
||||||
|
|
||||||
|
@ -60,15 +60,13 @@ extern IceAuthDataEntry _IcePaAuthDataEntries[];
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceGetPoAuthData (protocolName, networkId, authName,
|
_IceGetPoAuthData (
|
||||||
authDataLenRet, authDataRet)
|
char *protocolName,
|
||||||
|
char *networkId,
|
||||||
char *protocolName;
|
char *authName,
|
||||||
char *networkId;
|
unsigned short *authDataLenRet,
|
||||||
char *authName;
|
char **authDataRet
|
||||||
unsigned short *authDataLenRet;
|
)
|
||||||
char **authDataRet;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
IceAuthFileEntry *entry;
|
IceAuthFileEntry *entry;
|
||||||
|
|
||||||
@ -93,15 +91,13 @@ char **authDataRet;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceGetPaAuthData (protocolName, networkId, authName,
|
_IceGetPaAuthData (
|
||||||
authDataLenRet, authDataRet)
|
char *protocolName,
|
||||||
|
char *networkId,
|
||||||
char *protocolName;
|
char *authName,
|
||||||
char *networkId;
|
unsigned short *authDataLenRet,
|
||||||
char *authName;
|
char **authDataRet
|
||||||
unsigned short *authDataLenRet;
|
)
|
||||||
char **authDataRet;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
IceAuthDataEntry *entry = NULL;
|
IceAuthDataEntry *entry = NULL;
|
||||||
int found = 0;
|
int found = 0;
|
||||||
@ -134,16 +130,14 @@ char **authDataRet;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceGetPoValidAuthIndices (protocol_name, network_id,
|
_IceGetPoValidAuthIndices (
|
||||||
num_auth_names, auth_names, num_indices_ret, indices_ret)
|
char *protocol_name,
|
||||||
|
char *network_id,
|
||||||
char *protocol_name;
|
int num_auth_names,
|
||||||
char *network_id;
|
char **auth_names,
|
||||||
int num_auth_names;
|
int *num_indices_ret,
|
||||||
char **auth_names;
|
int *indices_ret /* in/out arg */
|
||||||
int *num_indices_ret;
|
)
|
||||||
int *indices_ret; /* in/out arg */
|
|
||||||
|
|
||||||
{
|
{
|
||||||
FILE *auth_file;
|
FILE *auth_file;
|
||||||
char *filename;
|
char *filename;
|
||||||
@ -195,16 +189,14 @@ int *indices_ret; /* in/out arg */
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceGetPaValidAuthIndices (protocol_name, network_id,
|
_IceGetPaValidAuthIndices (
|
||||||
num_auth_names, auth_names, num_indices_ret, indices_ret)
|
char *protocol_name,
|
||||||
|
char *network_id,
|
||||||
char *protocol_name;
|
int num_auth_names,
|
||||||
char *network_id;
|
char **auth_names,
|
||||||
int num_auth_names;
|
int *num_indices_ret,
|
||||||
char **auth_names;
|
int *indices_ret /* in/out arg */
|
||||||
int *num_indices_ret;
|
)
|
||||||
int *indices_ret; /* in/out arg */
|
|
||||||
|
|
||||||
{
|
{
|
||||||
int index_ret;
|
int index_ret;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -28,14 +28,6 @@ Author: Ralph Mor, X Consortium
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
/* $XFree86: xc/lib/ICE/globals.h,v 1.4 2001/12/14 19:53:35 dawes Exp $ */
|
/* $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__
|
#ifndef __UNIXOS2__
|
||||||
IceConn _IceConnectionObjs[256];
|
IceConn _IceConnectionObjs[256];
|
||||||
char *_IceConnectionStrings[256];
|
char *_IceConnectionStrings[256];
|
||||||
@ -51,14 +43,5 @@ int _IceLastMajorOpcode = 0;
|
|||||||
|
|
||||||
int _IceAuthCount = 1;
|
int _IceAuthCount = 1;
|
||||||
char *_IceAuthNames[] = {"MIT-MAGIC-COOKIE-1"};
|
char *_IceAuthNames[] = {"MIT-MAGIC-COOKIE-1"};
|
||||||
IcePoAuthProc _IcePoAuthProcs[] = {_IcePoMagicCookie1Proc};
|
|
||||||
IcePaAuthProc _IcePaAuthProcs[] = {_IcePaMagicCookie1Proc};
|
|
||||||
|
|
||||||
int _IceVersionCount = 1;
|
|
||||||
_IceVersion _IceVersions[] = {
|
|
||||||
{IceProtoMajor, IceProtoMinor, _IceProcessCoreMessage}};
|
|
||||||
|
|
||||||
_IceWatchProc *_IceWatchProcs = NULL;
|
_IceWatchProc *_IceWatchProcs = NULL;
|
||||||
|
|
||||||
IceErrorHandler _IceErrorHandler = _IceDefaultErrorHandler;
|
|
||||||
IceIOErrorHandler _IceIOErrorHandler = _IceDefaultIOErrorHandler;
|
|
||||||
|
@ -38,8 +38,6 @@ Author: Ralph Mor, X Consortium
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#define Time_t time_t
|
#define Time_t time_t
|
||||||
|
|
||||||
static int binaryEqual (const char *a, const char *b, unsigned len);
|
|
||||||
|
|
||||||
static int was_called_state;
|
static int was_called_state;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -49,10 +47,9 @@ static int was_called_state;
|
|||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
IceGenerateMagicCookie (len)
|
IceGenerateMagicCookie (
|
||||||
|
int len
|
||||||
int len;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *auth;
|
char *auth;
|
||||||
long ldata[2];
|
long ldata[2];
|
||||||
@ -94,19 +91,17 @@ int len;
|
|||||||
|
|
||||||
|
|
||||||
IcePoAuthStatus
|
IcePoAuthStatus
|
||||||
_IcePoMagicCookie1Proc (iceConn, authStatePtr, cleanUp, swap,
|
_IcePoMagicCookie1Proc (
|
||||||
authDataLen, authData, replyDataLenRet, replyDataRet, errorStringRet)
|
IceConn iceConn,
|
||||||
|
IcePointer *authStatePtr,
|
||||||
IceConn iceConn;
|
Bool cleanUp,
|
||||||
IcePointer *authStatePtr;
|
Bool swap,
|
||||||
Bool cleanUp;
|
int authDataLen,
|
||||||
Bool swap;
|
IcePointer authData,
|
||||||
int authDataLen;
|
int *replyDataLenRet,
|
||||||
IcePointer authData;
|
IcePointer *replyDataRet,
|
||||||
int *replyDataLenRet;
|
char **errorStringRet
|
||||||
IcePointer *replyDataRet;
|
)
|
||||||
char **errorStringRet;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
if (cleanUp)
|
if (cleanUp)
|
||||||
{
|
{
|
||||||
@ -168,21 +163,20 @@ char **errorStringRet;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IcePoAuthProc _IcePoAuthProcs[] = {_IcePoMagicCookie1Proc};
|
||||||
|
|
||||||
|
|
||||||
IcePaAuthStatus
|
IcePaAuthStatus
|
||||||
_IcePaMagicCookie1Proc (iceConn, authStatePtr, swap,
|
_IcePaMagicCookie1Proc (
|
||||||
authDataLen, authData, replyDataLenRet, replyDataRet, errorStringRet)
|
IceConn iceConn,
|
||||||
|
IcePointer *authStatePtr,
|
||||||
IceConn iceConn;
|
Bool swap,
|
||||||
IcePointer *authStatePtr;
|
int authDataLen,
|
||||||
Bool swap;
|
IcePointer authData,
|
||||||
int authDataLen;
|
int *replyDataLenRet,
|
||||||
IcePointer authData;
|
IcePointer *replyDataRet,
|
||||||
int *replyDataLenRet;
|
char **errorStringRet
|
||||||
IcePointer *replyDataRet;
|
)
|
||||||
char **errorStringRet;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
*errorStringRet = NULL;
|
*errorStringRet = NULL;
|
||||||
*replyDataLenRet = 0;
|
*replyDataLenRet = 0;
|
||||||
@ -217,7 +211,7 @@ char **errorStringRet;
|
|||||||
IcePaAuthStatus stat;
|
IcePaAuthStatus stat;
|
||||||
|
|
||||||
if (authDataLen == length &&
|
if (authDataLen == length &&
|
||||||
binaryEqual ((char *) authData, data, authDataLen))
|
memcmp (authData, data, authDataLen) == 0)
|
||||||
{
|
{
|
||||||
stat = IcePaAuthAccepted;
|
stat = IcePaAuthAccepted;
|
||||||
}
|
}
|
||||||
@ -252,18 +246,4 @@ char **errorStringRet;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IcePaAuthProc _IcePaAuthProcs[] = {_IcePaMagicCookie1Proc};
|
||||||
|
|
||||||
/*
|
|
||||||
* local routines
|
|
||||||
*/
|
|
||||||
|
|
||||||
static int
|
|
||||||
binaryEqual (const char *a, const char *b, unsigned len)
|
|
||||||
|
|
||||||
{
|
|
||||||
while (len--)
|
|
||||||
if (*a++ != *b++)
|
|
||||||
return 0;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: icetrans.c,v 1.1.1.1 2006/11/25 16:45:58 matthieu Exp $
|
|
||||||
*
|
|
||||||
* Copyright © 2003 Keith Packard
|
* Copyright © 2003 Keith Packard
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||||
@ -26,8 +24,8 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ICE_t
|
#define ICE_t 1
|
||||||
#define TRANS_CLIENT
|
#define TRANS_CLIENT 1
|
||||||
#define TRANS_SERVER
|
#define TRANS_SERVER 1
|
||||||
|
|
||||||
#include <X11/Xtrans/transport.c>
|
#include <X11/Xtrans/transport.c>
|
||||||
|
@ -37,13 +37,12 @@ Author: Ralph Mor, X Consortium
|
|||||||
|
|
||||||
|
|
||||||
Status
|
Status
|
||||||
IceListenForConnections (countRet, listenObjsRet, errorLength, errorStringRet)
|
IceListenForConnections (
|
||||||
|
int *countRet,
|
||||||
int *countRet;
|
IceListenObj **listenObjsRet,
|
||||||
IceListenObj **listenObjsRet;
|
int errorLength,
|
||||||
int errorLength;
|
char *errorStringRet
|
||||||
char *errorStringRet;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct _IceListenObj *listenObjs;
|
struct _IceListenObj *listenObjs;
|
||||||
char *networkId;
|
char *networkId;
|
||||||
@ -161,10 +160,9 @@ char *errorStringRet;
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
IceGetListenConnectionNumber (listenObj)
|
IceGetListenConnectionNumber (
|
||||||
|
IceListenObj listenObj
|
||||||
IceListenObj listenObj;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
return (_IceTransGetConnectionNumber (listenObj->trans_conn));
|
return (_IceTransGetConnectionNumber (listenObj->trans_conn));
|
||||||
}
|
}
|
||||||
@ -172,10 +170,9 @@ IceListenObj listenObj;
|
|||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
IceGetListenConnectionString (listenObj)
|
IceGetListenConnectionString (
|
||||||
|
IceListenObj listenObj
|
||||||
IceListenObj listenObj;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
return strdup(listenObj->network_id);
|
return strdup(listenObj->network_id);
|
||||||
}
|
}
|
||||||
@ -183,11 +180,10 @@ IceListenObj listenObj;
|
|||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
IceComposeNetworkIdList (count, listenObjs)
|
IceComposeNetworkIdList (
|
||||||
|
int count,
|
||||||
int count;
|
IceListenObj *listenObjs
|
||||||
IceListenObj *listenObjs;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *list;
|
char *list;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
@ -241,11 +237,10 @@ IceListenObj *listenObjs;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
IceFreeListenObjs (count, listenObjs)
|
IceFreeListenObjs (
|
||||||
|
int count,
|
||||||
int count;
|
IceListenObj *listenObjs
|
||||||
IceListenObj *listenObjs;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -268,11 +263,10 @@ IceListenObj *listenObjs;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
IceSetHostBasedAuthProc (listenObj, hostBasedAuthProc)
|
IceSetHostBasedAuthProc (
|
||||||
|
IceListenObj listenObj,
|
||||||
IceListenObj listenObj;
|
IceHostBasedAuthProc hostBasedAuthProc
|
||||||
IceHostBasedAuthProc hostBasedAuthProc;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
listenObj->host_based_auth_proc = hostBasedAuthProc;
|
listenObj->host_based_auth_proc = hostBasedAuthProc;
|
||||||
}
|
}
|
||||||
|
@ -40,14 +40,13 @@ in this Software without prior written authorization from The Open Group.
|
|||||||
|
|
||||||
|
|
||||||
Status
|
Status
|
||||||
IceListenForWellKnownConnections (port, countRet, listenObjsRet, errorLength, errorStringRet)
|
IceListenForWellKnownConnections (
|
||||||
|
char *port,
|
||||||
char *port;
|
int *countRet,
|
||||||
int *countRet;
|
IceListenObj **listenObjsRet,
|
||||||
IceListenObj **listenObjsRet;
|
int errorLength,
|
||||||
int errorLength;
|
char *errorStringRet
|
||||||
char *errorStringRet;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct _IceListenObj *listenObjs;
|
struct _IceListenObj *listenObjs;
|
||||||
char *networkId;
|
char *networkId;
|
||||||
|
@ -40,28 +40,27 @@ Author: Ralph Mor, X Consortium
|
|||||||
|
|
||||||
|
|
||||||
Status
|
Status
|
||||||
IceInitThreads ()
|
IceInitThreads (
|
||||||
|
void
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
IceAppLockConn (iceConn)
|
IceAppLockConn (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
IceLockConn (iceConn);
|
IceLockConn (iceConn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
IceAppUnlockConn (iceConn)
|
IceAppUnlockConn (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
IceUnlockConn (iceConn);
|
IceUnlockConn (iceConn);
|
||||||
}
|
}
|
||||||
|
@ -49,11 +49,10 @@ Author: Ralph Mor, X Consortium
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
char *
|
char *
|
||||||
IceAllocScratch (iceConn, size)
|
IceAllocScratch (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
unsigned long size
|
||||||
unsigned long size;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
if (!iceConn->scratch || size > iceConn->scratch_size)
|
if (!iceConn->scratch || size > iceConn->scratch_size)
|
||||||
{
|
{
|
||||||
@ -74,10 +73,9 @@ unsigned long size;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
IceFlush (iceConn)
|
IceFlush (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
_IceWrite (iceConn,
|
_IceWrite (iceConn,
|
||||||
(unsigned long) (iceConn->outbufptr - iceConn->outbuf),
|
(unsigned long) (iceConn->outbufptr - iceConn->outbuf),
|
||||||
@ -89,20 +87,18 @@ IceConn iceConn;
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
IceGetOutBufSize (iceConn)
|
IceGetOutBufSize (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
return (iceConn->outbufmax - iceConn->outbuf);
|
return (iceConn->outbufmax - iceConn->outbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
IceGetInBufSize (iceConn)
|
IceGetInBufSize (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
return (iceConn->inbufmax - iceConn->inbuf);
|
return (iceConn->inbufmax - iceConn->inbuf);
|
||||||
}
|
}
|
||||||
@ -114,70 +110,63 @@ IceConn iceConn;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
IceConnectStatus
|
IceConnectStatus
|
||||||
IceConnectionStatus (iceConn)
|
IceConnectionStatus (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
return (iceConn->connection_status);
|
return (iceConn->connection_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
IceVendor (iceConn)
|
IceVendor (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
return strdup(iceConn->vendor);
|
return strdup(iceConn->vendor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
IceRelease (iceConn)
|
IceRelease (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
return strdup(iceConn->release);
|
return strdup(iceConn->release);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
IceProtocolVersion (iceConn)
|
IceProtocolVersion (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
return (_IceVersions[iceConn->my_ice_version_index].major_version);
|
return (_IceVersions[iceConn->my_ice_version_index].major_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
IceProtocolRevision (iceConn)
|
IceProtocolRevision (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
return (_IceVersions[iceConn->my_ice_version_index].minor_version);
|
return (_IceVersions[iceConn->my_ice_version_index].minor_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
IceConnectionNumber (iceConn)
|
IceConnectionNumber (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
return (_IceTransGetConnectionNumber (iceConn->trans_conn));
|
return (_IceTransGetConnectionNumber (iceConn->trans_conn));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
IceConnectionString (iceConn)
|
IceConnectionString (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
if (iceConn->connection_string)
|
if (iceConn->connection_string)
|
||||||
{
|
{
|
||||||
@ -189,30 +178,27 @@ IceConn iceConn;
|
|||||||
|
|
||||||
|
|
||||||
unsigned long
|
unsigned long
|
||||||
IceLastSentSequenceNumber (iceConn)
|
IceLastSentSequenceNumber (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
return (iceConn->send_sequence);
|
return (iceConn->send_sequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned long
|
unsigned long
|
||||||
IceLastReceivedSequenceNumber (iceConn)
|
IceLastReceivedSequenceNumber (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
return (iceConn->receive_sequence);
|
return (iceConn->receive_sequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
IceSwapping (iceConn)
|
IceSwapping (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
return (iceConn->swap);
|
return (iceConn->swap);
|
||||||
}
|
}
|
||||||
@ -227,12 +213,11 @@ IceConn iceConn;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Status
|
Status
|
||||||
_IceRead (iceConn, nbytes, ptr)
|
_IceRead (
|
||||||
|
register IceConn iceConn,
|
||||||
register IceConn iceConn;
|
unsigned long nbytes,
|
||||||
unsigned long nbytes;
|
register char *ptr
|
||||||
register char *ptr;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
register unsigned long nleft;
|
register unsigned long nleft;
|
||||||
|
|
||||||
@ -327,11 +312,10 @@ register char *ptr;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceReadSkip (iceConn, nbytes)
|
_IceReadSkip (
|
||||||
|
register IceConn iceConn,
|
||||||
register IceConn iceConn;
|
register unsigned long nbytes
|
||||||
register unsigned long nbytes;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
char temp[512];
|
char temp[512];
|
||||||
|
|
||||||
@ -351,12 +335,11 @@ register unsigned long nbytes;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceWrite (iceConn, nbytes, ptr)
|
_IceWrite (
|
||||||
|
register IceConn iceConn,
|
||||||
register IceConn iceConn;
|
unsigned long nbytes,
|
||||||
unsigned long nbytes;
|
register char *ptr
|
||||||
register char *ptr;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
register unsigned long nleft;
|
register unsigned long nleft;
|
||||||
|
|
||||||
@ -427,12 +410,11 @@ register char *ptr;
|
|||||||
|
|
||||||
#ifdef WORD64
|
#ifdef WORD64
|
||||||
|
|
||||||
IceWriteData16 (iceConn, nbytes, data)
|
IceWriteData16 (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
unsigned long nbytes,
|
||||||
unsigned long nbytes;
|
short *data
|
||||||
short *data;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
int numShorts = nbytes / 2;
|
int numShorts = nbytes / 2;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
@ -458,12 +440,11 @@ short *data;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IceWriteData32 (iceConn, nbytes, data)
|
IceWriteData32 (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
unsigned long nbytes,
|
||||||
unsigned long nbytes;
|
int *data
|
||||||
int *data;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
int numLongs = nbytes / 4;
|
int numLongs = nbytes / 4;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
@ -489,25 +470,23 @@ int *data;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IceReadData16 (iceConn, swap, nbytes, data)
|
IceReadData16 (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
Bool swap,
|
||||||
Bool swap;
|
unsigned long nbytes,
|
||||||
unsigned long nbytes;
|
short *data
|
||||||
short *data;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
/* NOT IMPLEMENTED YET */
|
/* NOT IMPLEMENTED YET */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IceReadData32 (iceConn, swap, nbytes, data)
|
IceReadData32 (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
Bool swap,
|
||||||
Bool swap;
|
unsigned long nbytes,
|
||||||
unsigned long nbytes;
|
int *data
|
||||||
int *data;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
/* NOT IMPLEMENTED YET */
|
/* NOT IMPLEMENTED YET */
|
||||||
}
|
}
|
||||||
@ -517,12 +496,11 @@ int *data;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceAddOpcodeMapping (iceConn, hisOpcode, myOpcode)
|
_IceAddOpcodeMapping (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int hisOpcode,
|
||||||
int hisOpcode;
|
int myOpcode
|
||||||
int myOpcode;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
if (hisOpcode <= 0 || hisOpcode > 255)
|
if (hisOpcode <= 0 || hisOpcode > 255)
|
||||||
{
|
{
|
||||||
|
@ -34,12 +34,11 @@ Author: Ralph Mor, X Consortium
|
|||||||
#include "ICElibint.h"
|
#include "ICElibint.h"
|
||||||
|
|
||||||
Status
|
Status
|
||||||
IcePing (iceConn, pingReplyProc, clientData)
|
IcePing (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
IcePingReplyProc pingReplyProc,
|
||||||
IcePingReplyProc pingReplyProc;
|
IcePointer clientData
|
||||||
IcePointer clientData;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
_IcePingWait *newping = (_IcePingWait *) malloc (sizeof (_IcePingWait));
|
_IcePingWait *newping = (_IcePingWait *) malloc (sizeof (_IcePingWait));
|
||||||
_IcePingWait *ptr = iceConn->ping_waits;
|
_IcePingWait *ptr = iceConn->ping_waits;
|
||||||
|
@ -124,12 +124,11 @@ Author: Ralph Mor, X Consortium
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
IceProcessMessagesStatus
|
IceProcessMessagesStatus
|
||||||
IceProcessMessages (iceConn, replyWait, replyReadyRet)
|
IceProcessMessages (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
IceReplyWaitInfo *replyWait,
|
||||||
IceReplyWaitInfo *replyWait;
|
Bool *replyReadyRet
|
||||||
Bool *replyReadyRet;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
iceMsg *header;
|
iceMsg *header;
|
||||||
Bool replyReady = False;
|
Bool replyReady = False;
|
||||||
@ -390,13 +389,12 @@ Bool *replyReadyRet;
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
AuthRequired (iceConn, authIndex, authDataLen, authData)
|
AuthRequired (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int authIndex,
|
||||||
int authIndex;
|
int authDataLen,
|
||||||
int authDataLen;
|
IcePointer authData
|
||||||
IcePointer authData;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
iceAuthRequiredMsg *pMsg;
|
iceAuthRequiredMsg *pMsg;
|
||||||
|
|
||||||
@ -418,12 +416,11 @@ IcePointer authData;
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
AuthReply (iceConn, authDataLen, authData)
|
AuthReply (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int authDataLen,
|
||||||
int authDataLen;
|
IcePointer authData
|
||||||
IcePointer authData;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
iceAuthReplyMsg *pMsg;
|
iceAuthReplyMsg *pMsg;
|
||||||
|
|
||||||
@ -444,12 +441,11 @@ IcePointer authData;
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
AuthNextPhase (iceConn, authDataLen, authData)
|
AuthNextPhase (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int authDataLen,
|
||||||
int authDataLen;
|
IcePointer authData
|
||||||
IcePointer authData;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
iceAuthNextPhaseMsg *pMsg;
|
iceAuthNextPhaseMsg *pMsg;
|
||||||
|
|
||||||
@ -470,11 +466,10 @@ IcePointer authData;
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
AcceptConnection (iceConn, versionIndex)
|
AcceptConnection (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int versionIndex
|
||||||
int versionIndex;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
iceConnectionReplyMsg *pMsg;
|
iceConnectionReplyMsg *pMsg;
|
||||||
char *pData;
|
char *pData;
|
||||||
@ -499,15 +494,14 @@ int versionIndex;
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
AcceptProtocol (iceConn, hisOpcode, myOpcode, versionIndex, vendor, release)
|
AcceptProtocol (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int hisOpcode,
|
||||||
int hisOpcode;
|
int myOpcode,
|
||||||
int myOpcode;
|
int versionIndex,
|
||||||
int versionIndex;
|
char *vendor,
|
||||||
char *vendor;
|
char *release
|
||||||
char *release;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
iceProtocolReplyMsg *pMsg;
|
iceProtocolReplyMsg *pMsg;
|
||||||
char *pData;
|
char *pData;
|
||||||
@ -540,10 +534,9 @@ char *release;
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
PingReply (iceConn)
|
PingReply (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
IceSimpleMessage (iceConn, 0, ICE_PingReply);
|
IceSimpleMessage (iceConn, 0, ICE_PingReply);
|
||||||
IceFlush (iceConn);
|
IceFlush (iceConn);
|
||||||
@ -552,13 +545,12 @@ IceConn iceConn;
|
|||||||
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
ProcessError (iceConn, length, swap, replyWait)
|
ProcessError (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
unsigned long length,
|
||||||
unsigned long length;
|
Bool swap,
|
||||||
Bool swap;
|
IceReplyWaitInfo *replyWait
|
||||||
IceReplyWaitInfo *replyWait;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
int invokeHandler = 0;
|
int invokeHandler = 0;
|
||||||
Bool errorReturned = False;
|
Bool errorReturned = False;
|
||||||
@ -822,12 +814,11 @@ IceReplyWaitInfo *replyWait;
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcessConnectionSetup (iceConn, length, swap)
|
ProcessConnectionSetup (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
unsigned long length,
|
||||||
unsigned long length;
|
Bool swap
|
||||||
Bool swap;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
iceConnectionSetupMsg *message;
|
iceConnectionSetupMsg *message;
|
||||||
int myVersionCount, hisVersionCount;
|
int myVersionCount, hisVersionCount;
|
||||||
@ -1077,13 +1068,12 @@ Bool swap;
|
|||||||
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
ProcessAuthRequired (iceConn, length, swap, replyWait)
|
ProcessAuthRequired (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
unsigned long length,
|
||||||
unsigned long length;
|
Bool swap,
|
||||||
Bool swap;
|
IceReplyWaitInfo *replyWait
|
||||||
IceReplyWaitInfo *replyWait;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
iceAuthRequiredMsg *message;
|
iceAuthRequiredMsg *message;
|
||||||
int authDataLen;
|
int authDataLen;
|
||||||
@ -1272,12 +1262,11 @@ IceReplyWaitInfo *replyWait;
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcessAuthReply (iceConn, length, swap)
|
ProcessAuthReply (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
unsigned long length,
|
||||||
unsigned long length;
|
Bool swap
|
||||||
Bool swap;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
iceAuthReplyMsg *message;
|
iceAuthReplyMsg *message;
|
||||||
int replyDataLen;
|
int replyDataLen;
|
||||||
@ -1568,13 +1557,12 @@ Bool swap;
|
|||||||
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
ProcessAuthNextPhase (iceConn, length, swap, replyWait)
|
ProcessAuthNextPhase (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
unsigned long length,
|
||||||
unsigned long length;
|
Bool swap,
|
||||||
Bool swap;
|
IceReplyWaitInfo *replyWait
|
||||||
IceReplyWaitInfo *replyWait;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
iceAuthNextPhaseMsg *message;
|
iceAuthNextPhaseMsg *message;
|
||||||
int authDataLen;
|
int authDataLen;
|
||||||
@ -1701,13 +1689,12 @@ IceReplyWaitInfo *replyWait;
|
|||||||
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
ProcessConnectionReply (iceConn, length, swap, replyWait)
|
ProcessConnectionReply (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
unsigned long length,
|
||||||
unsigned long length;
|
Bool swap,
|
||||||
Bool swap;
|
IceReplyWaitInfo *replyWait
|
||||||
IceReplyWaitInfo *replyWait;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
iceConnectionReplyMsg *message;
|
iceConnectionReplyMsg *message;
|
||||||
char *pData, *pStart, *pEnd;
|
char *pData, *pStart, *pEnd;
|
||||||
@ -1804,12 +1791,11 @@ IceReplyWaitInfo *replyWait;
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcessProtocolSetup (iceConn, length, swap)
|
ProcessProtocolSetup (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
unsigned long length,
|
||||||
unsigned long length;
|
Bool swap
|
||||||
Bool swap;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
iceProtocolSetupMsg *message;
|
iceProtocolSetupMsg *message;
|
||||||
_IcePaProtocol *myProtocol;
|
_IcePaProtocol *myProtocol;
|
||||||
@ -2202,13 +2188,12 @@ Bool swap;
|
|||||||
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
ProcessProtocolReply (iceConn, length, swap, replyWait)
|
ProcessProtocolReply (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
unsigned long length,
|
||||||
unsigned long length;
|
Bool swap,
|
||||||
Bool swap;
|
IceReplyWaitInfo *replyWait
|
||||||
IceReplyWaitInfo *replyWait;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
iceProtocolReplyMsg *message;
|
iceProtocolReplyMsg *message;
|
||||||
char *pData, *pStart, *pEnd;
|
char *pData, *pStart, *pEnd;
|
||||||
@ -2317,11 +2302,10 @@ IceReplyWaitInfo *replyWait;
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcessPing (iceConn, length)
|
ProcessPing (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
unsigned long length
|
||||||
unsigned long length;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
CHECK_SIZE_MATCH (iceConn, ICE_Ping,
|
CHECK_SIZE_MATCH (iceConn, ICE_Ping,
|
||||||
length, SIZEOF (icePingMsg), IceFatalToConnection, 0);
|
length, SIZEOF (icePingMsg), IceFatalToConnection, 0);
|
||||||
@ -2334,11 +2318,10 @@ unsigned long length;
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcessPingReply (iceConn, length)
|
ProcessPingReply (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
unsigned long length
|
||||||
unsigned long length;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
CHECK_SIZE_MATCH (iceConn, ICE_PingReply,
|
CHECK_SIZE_MATCH (iceConn, ICE_PingReply,
|
||||||
length, SIZEOF (icePingReplyMsg), IceFatalToConnection, 0);
|
length, SIZEOF (icePingReplyMsg), IceFatalToConnection, 0);
|
||||||
@ -2364,12 +2347,11 @@ unsigned long length;
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcessWantToClose (iceConn, length, connectionClosedRet)
|
ProcessWantToClose (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
unsigned long length,
|
||||||
unsigned long length;
|
Bool *connectionClosedRet
|
||||||
Bool *connectionClosedRet;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
*connectionClosedRet = False;
|
*connectionClosedRet = False;
|
||||||
|
|
||||||
@ -2424,11 +2406,10 @@ Bool *connectionClosedRet;
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcessNoClose (iceConn, length)
|
ProcessNoClose (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
unsigned long length
|
||||||
unsigned long length;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
CHECK_SIZE_MATCH (iceConn, ICE_NoClose,
|
CHECK_SIZE_MATCH (iceConn, ICE_NoClose,
|
||||||
length, SIZEOF (iceNoCloseMsg), IceFatalToConnection, 0);
|
length, SIZEOF (iceNoCloseMsg), IceFatalToConnection, 0);
|
||||||
@ -2452,18 +2433,16 @@ unsigned long length;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
static void
|
||||||
_IceProcessCoreMessage (iceConn, opcode, length, swap,
|
_IceProcessCoreMessage (
|
||||||
replyWait, replyReadyRet, connectionClosedRet)
|
IceConn iceConn,
|
||||||
|
int opcode,
|
||||||
IceConn iceConn;
|
unsigned long length,
|
||||||
int opcode;
|
Bool swap,
|
||||||
unsigned long length;
|
IceReplyWaitInfo *replyWait,
|
||||||
Bool swap;
|
Bool *replyReadyRet,
|
||||||
IceReplyWaitInfo *replyWait;
|
Bool *connectionClosedRet
|
||||||
Bool *replyReadyRet;
|
)
|
||||||
Bool *connectionClosedRet;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Bool replyReady = False;
|
Bool replyReady = False;
|
||||||
|
|
||||||
@ -2542,3 +2521,7 @@ Bool *connectionClosedRet;
|
|||||||
*replyReadyRet = replyReady;
|
*replyReadyRet = replyReady;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int _IceVersionCount = 1;
|
||||||
|
_IceVersion _IceVersions[] = {
|
||||||
|
{IceProtoMajor, IceProtoMinor, _IceProcessCoreMessage}};
|
||||||
|
|
||||||
|
@ -36,21 +36,18 @@ Author: Ralph Mor, X Consortium
|
|||||||
|
|
||||||
|
|
||||||
IceProtocolSetupStatus
|
IceProtocolSetupStatus
|
||||||
IceProtocolSetup (iceConn, myOpcode, clientData, mustAuthenticate,
|
IceProtocolSetup (
|
||||||
majorVersionRet, minorVersionRet, vendorRet, releaseRet,
|
IceConn iceConn,
|
||||||
errorLength, errorStringRet)
|
int myOpcode,
|
||||||
|
IcePointer clientData,
|
||||||
IceConn iceConn;
|
Bool mustAuthenticate,
|
||||||
int myOpcode;
|
int *majorVersionRet,
|
||||||
IcePointer clientData;
|
int *minorVersionRet,
|
||||||
Bool mustAuthenticate;
|
char **vendorRet,
|
||||||
int *majorVersionRet;
|
char **releaseRet,
|
||||||
int *minorVersionRet;
|
int errorLength,
|
||||||
char **vendorRet;
|
char *errorStringRet
|
||||||
char **releaseRet;
|
)
|
||||||
int errorLength;
|
|
||||||
char *errorStringRet;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
iceProtocolSetupMsg *pMsg;
|
iceProtocolSetupMsg *pMsg;
|
||||||
char *pData;
|
char *pData;
|
||||||
|
@ -34,19 +34,17 @@ Author: Ralph Mor, X Consortium
|
|||||||
#include "ICElibint.h"
|
#include "ICElibint.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
IceRegisterForProtocolSetup (protocolName, vendor, release,
|
IceRegisterForProtocolSetup (
|
||||||
versionCount, versionRecs, authCount, authNames, authProcs, IOErrorProc)
|
char *protocolName,
|
||||||
|
char *vendor,
|
||||||
char *protocolName;
|
char *release,
|
||||||
char *vendor;
|
int versionCount,
|
||||||
char *release;
|
IcePoVersionRec *versionRecs,
|
||||||
int versionCount;
|
int authCount,
|
||||||
IcePoVersionRec *versionRecs;
|
const char **authNames,
|
||||||
int authCount;
|
IcePoAuthProc *authProcs,
|
||||||
char **authNames;
|
IceIOErrorProc IOErrorProc
|
||||||
IcePoAuthProc *authProcs;
|
)
|
||||||
IceIOErrorProc IOErrorProc;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
_IcePoProtocol *p;
|
_IcePoProtocol *p;
|
||||||
int opcodeRet, i;
|
int opcodeRet, i;
|
||||||
@ -133,24 +131,20 @@ IceIOErrorProc IOErrorProc;
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
IceRegisterForProtocolReply (protocolName, vendor, release,
|
IceRegisterForProtocolReply (
|
||||||
versionCount, versionRecs, authCount, authNames, authProcs,
|
char *protocolName,
|
||||||
hostBasedAuthProc, protocolSetupProc, protocolActivateProc,
|
char *vendor,
|
||||||
IOErrorProc)
|
char *release,
|
||||||
|
int versionCount,
|
||||||
char *protocolName;
|
IcePaVersionRec *versionRecs,
|
||||||
char *vendor;
|
int authCount,
|
||||||
char *release;
|
const char **authNames,
|
||||||
int versionCount;
|
IcePaAuthProc *authProcs,
|
||||||
IcePaVersionRec *versionRecs;
|
IceHostBasedAuthProc hostBasedAuthProc,
|
||||||
int authCount;
|
IceProtocolSetupProc protocolSetupProc,
|
||||||
char **authNames;
|
IceProtocolActivateProc protocolActivateProc,
|
||||||
IcePaAuthProc *authProcs;
|
IceIOErrorProc IOErrorProc
|
||||||
IceHostBasedAuthProc hostBasedAuthProc;
|
)
|
||||||
IceProtocolSetupProc protocolSetupProc;
|
|
||||||
IceProtocolActivateProc protocolActivateProc;
|
|
||||||
IceIOErrorProc IOErrorProc;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
_IcePaProtocol *p;
|
_IcePaProtocol *p;
|
||||||
int opcodeRet, i;
|
int opcodeRet, i;
|
||||||
|
@ -35,11 +35,10 @@ Author: Ralph Mor, X Consortium
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceAddReplyWait (iceConn, replyWait)
|
_IceAddReplyWait (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
IceReplyWaitInfo *replyWait
|
||||||
IceReplyWaitInfo *replyWait;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Add this replyWait to the end of the list (only if the
|
* Add this replyWait to the end of the list (only if the
|
||||||
@ -77,11 +76,10 @@ IceReplyWaitInfo *replyWait;
|
|||||||
|
|
||||||
|
|
||||||
IceReplyWaitInfo *
|
IceReplyWaitInfo *
|
||||||
_IceSearchReplyWaits (iceConn, majorOpcode)
|
_IceSearchReplyWaits (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int majorOpcode
|
||||||
int majorOpcode;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Return the first replyWait in the list with the given majorOpcode
|
* Return the first replyWait in the list with the given majorOpcode
|
||||||
@ -101,11 +99,10 @@ int majorOpcode;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceSetReplyReady (iceConn, replyWait)
|
_IceSetReplyReady (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
IceReplyWaitInfo *replyWait
|
||||||
IceReplyWaitInfo *replyWait;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* The replyWait specified has a reply ready.
|
* The replyWait specified has a reply ready.
|
||||||
@ -123,11 +120,10 @@ IceReplyWaitInfo *replyWait;
|
|||||||
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
_IceCheckReplyReady (iceConn, replyWait)
|
_IceCheckReplyReady (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
IceReplyWaitInfo *replyWait
|
||||||
IceReplyWaitInfo *replyWait;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
_IceSavedReplyWait *savedReplyWait = iceConn->saved_reply_waits;
|
_IceSavedReplyWait *savedReplyWait = iceConn->saved_reply_waits;
|
||||||
_IceSavedReplyWait *prev = NULL;
|
_IceSavedReplyWait *prev = NULL;
|
||||||
|
@ -60,11 +60,10 @@ IceAuthDataEntry _IcePaAuthDataEntries[ICE_MAX_AUTH_DATA_ENTRIES] = {0};
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
IceSetPaAuthData (numEntries, entries)
|
IceSetPaAuthData (
|
||||||
|
int numEntries,
|
||||||
int numEntries;
|
IceAuthDataEntry *entries
|
||||||
IceAuthDataEntry *entries;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* _IcePaAuthDataEntries should really be a linked list.
|
* _IcePaAuthDataEntries should really be a linked list.
|
||||||
|
@ -37,11 +37,10 @@ Author: Ralph Mor, X Consortium
|
|||||||
|
|
||||||
|
|
||||||
Status
|
Status
|
||||||
IceProtocolShutdown (iceConn, majorOpcode)
|
IceProtocolShutdown (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
int majorOpcode
|
||||||
int majorOpcode;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
if (iceConn->proto_ref_count == 0 || iceConn->process_msg_info == NULL ||
|
if (iceConn->proto_ref_count == 0 || iceConn->process_msg_info == NULL ||
|
||||||
majorOpcode < 1 || majorOpcode > _IceLastMajorOpcode)
|
majorOpcode < 1 || majorOpcode > _IceLastMajorOpcode)
|
||||||
@ -87,11 +86,10 @@ int majorOpcode;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
IceSetShutdownNegotiation (iceConn, negotiate)
|
IceSetShutdownNegotiation (
|
||||||
|
IceConn iceConn,
|
||||||
IceConn iceConn;
|
Bool negotiate
|
||||||
Bool negotiate;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
iceConn->skip_want_to_close = negotiate ? False : True;
|
iceConn->skip_want_to_close = negotiate ? False : True;
|
||||||
}
|
}
|
||||||
@ -99,10 +97,9 @@ Bool negotiate;
|
|||||||
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
IceCheckShutdownNegotiation (iceConn)
|
IceCheckShutdownNegotiation (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
return (iceConn->skip_want_to_close ? False : True);
|
return (iceConn->skip_want_to_close ? False : True);
|
||||||
}
|
}
|
||||||
@ -110,10 +107,9 @@ IceConn iceConn;
|
|||||||
|
|
||||||
|
|
||||||
IceCloseStatus
|
IceCloseStatus
|
||||||
IceCloseConnection (iceConn)
|
IceCloseConnection (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
int refCountReachedZero;
|
int refCountReachedZero;
|
||||||
IceCloseStatus status;
|
IceCloseStatus status;
|
||||||
@ -253,10 +249,9 @@ IceConn iceConn;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceFreeConnection (iceConn)
|
_IceFreeConnection (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
if (iceConn->listen_obj == NULL)
|
if (iceConn->listen_obj == NULL)
|
||||||
{
|
{
|
||||||
|
@ -35,11 +35,10 @@ Author: Ralph Mor, X Consortium
|
|||||||
|
|
||||||
|
|
||||||
Status
|
Status
|
||||||
IceAddConnectionWatch (watchProc, clientData)
|
IceAddConnectionWatch (
|
||||||
|
IceWatchProc watchProc,
|
||||||
IceWatchProc watchProc;
|
IcePointer clientData
|
||||||
IcePointer clientData;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* watchProc will be called each time an ICE connection is
|
* watchProc will be called each time an ICE connection is
|
||||||
@ -94,11 +93,10 @@ IcePointer clientData;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
IceRemoveConnectionWatch (watchProc, clientData)
|
IceRemoveConnectionWatch (
|
||||||
|
IceWatchProc watchProc,
|
||||||
IceWatchProc watchProc;
|
IcePointer clientData
|
||||||
IcePointer clientData;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
_IceWatchProc *currWatchProc = _IceWatchProcs;
|
_IceWatchProc *currWatchProc = _IceWatchProcs;
|
||||||
_IceWatchProc *prevWatchProc = NULL;
|
_IceWatchProc *prevWatchProc = NULL;
|
||||||
@ -135,10 +133,9 @@ IcePointer clientData;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceConnectionOpened (iceConn)
|
_IceConnectionOpened (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
_IceWatchProc *watchProc = _IceWatchProcs;
|
_IceWatchProc *watchProc = _IceWatchProcs;
|
||||||
|
|
||||||
@ -170,10 +167,9 @@ IceConn iceConn;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_IceConnectionClosed (iceConn)
|
_IceConnectionClosed (
|
||||||
|
IceConn iceConn
|
||||||
IceConn iceConn;
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
_IceWatchProc *watchProc = _IceWatchProcs;
|
_IceWatchProc *watchProc = _IceWatchProcs;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user