From 281e1e7f5edfacd7a09f2300db3184fdba8650bf Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Mon, 25 Feb 2008 18:22:18 -0300 Subject: [PATCH] libICE ansification. There are no prototypes using char or short. --- src/accept.c | 8 +- src/authutil.c | 47 ++++-------- src/connect.c | 22 ++---- src/error.c | 168 ++++++++++++++++-------------------------- src/getauth.c | 64 +++++++---------- src/globals.h | 53 ++++++++++++-- src/iceauth.c | 49 +++++------- src/listen.c | 46 ++++-------- src/listenwk.c | 14 ++-- src/locking.c | 13 +--- src/misc.c | 155 ++++++++++++--------------------------- src/ping.c | 10 +-- src/process.c | 214 ++++++++++++++++++++++-------------------------------- src/protosetup.c | 26 +++---- src/register.c | 54 ++++++-------- src/replywait.c | 32 +++----- src/setauth.c | 8 +- src/shutdown.c | 31 ++------ src/watch.c | 26 ++----- 19 files changed, 414 insertions(+), 626 deletions(-) diff --git a/src/accept.c b/src/accept.c index d54ffd4..0a5a920 100644 --- a/src/accept.c +++ b/src/accept.c @@ -36,11 +36,9 @@ Author: Ralph Mor, X Consortium IceConn -IceAcceptConnection (listenObj, statusRet) - -IceListenObj listenObj; -IceAcceptStatus *statusRet; - +IceAcceptConnection ( + IceListenObj listenObj, + IceAcceptStatus *statusRet) { IceConn iceConn; XtransConnInfo newconn; diff --git a/src/authutil.c b/src/authutil.c index c1d1aee..1f733c8 100644 --- a/src/authutil.c +++ b/src/authutil.c @@ -49,7 +49,7 @@ extern char* getenv(const char*); #include #else #ifndef WIN32 -extern unsigned sleep (); +extern unsigned sleep (unsigned int); #else #define link rename #endif @@ -140,13 +140,11 @@ IceAuthFileName (void) int -IceLockAuthFile (file_name, retries, timeout, dead) - -char *file_name; -int retries; -int timeout; -long dead; - +IceLockAuthFile ( + char *file_name, + int retries, + int timeout, + long dead) { char creat_name[1025], link_name[1025]; struct stat statb; @@ -217,10 +215,7 @@ long dead; void -IceUnlockAuthFile (file_name) - -char *file_name; - +IceUnlockAuthFile (char *file_name) { #ifndef WIN32 char creat_name[1025]; @@ -246,10 +241,7 @@ char *file_name; IceAuthFileEntry * -IceReadAuthFileEntry (auth_file) - -FILE *auth_file; - +IceReadAuthFileEntry (FILE *auth_file) { IceAuthFileEntry local; IceAuthFileEntry *ret; @@ -298,10 +290,7 @@ FILE *auth_file; void -IceFreeAuthFileEntry (auth) - -IceAuthFileEntry *auth; - +IceFreeAuthFileEntry (IceAuthFileEntry *auth) { if (auth) { @@ -317,11 +306,9 @@ IceAuthFileEntry *auth; Status -IceWriteAuthFileEntry (auth_file, auth) - -FILE *auth_file; -IceAuthFileEntry *auth; - +IceWriteAuthFileEntry ( + FILE *auth_file, + IceAuthFileEntry *auth) { if (!write_string (auth_file, auth->protocol_name)) return (0); @@ -346,12 +333,10 @@ IceAuthFileEntry *auth; IceAuthFileEntry * -IceGetAuthFileEntry (protocol_name, network_id, auth_name) - -char *protocol_name; -char *network_id; -char *auth_name; - +IceGetAuthFileEntry ( + char *protocol_name, + char *network_id, + char *auth_name) { FILE *auth_file; char *filename; diff --git a/src/connect.c b/src/connect.c index 3874058..5ac1041 100644 --- a/src/connect.c +++ b/src/connect.c @@ -42,16 +42,13 @@ static XtransConnInfo ConnectToPeer(char *networkIdsList, #define Strstr strstr IceConn -IceOpenConnection (networkIdsList, context, mustAuthenticate, majorOpcodeCheck, - errorLength, errorStringRet) - -char *networkIdsList; -IcePointer context; -Bool mustAuthenticate; -int majorOpcodeCheck; -int errorLength; -char *errorStringRet; - +IceOpenConnection ( + char *networkIdsList, + IcePointer context, + Bool mustAuthenticate, + int majorOpcodeCheck, + int errorLength, + char *errorStringRet) { IceConn iceConn; int extra, i, j; @@ -432,10 +429,7 @@ char *errorStringRet; IcePointer -IceGetConnectionContext (iceConn) - -IceConn iceConn; - +IceGetConnectionContext (IceConn iceConn) { return (iceConn->context); } diff --git a/src/error.c b/src/error.c index 8021ad4..f61d271 100644 --- a/src/error.c +++ b/src/error.c @@ -40,13 +40,11 @@ Author: Ralph Mor, X Consortium void -_IceErrorBadMinor (iceConn, majorOpcode, offendingMinor, severity) - -IceConn iceConn; -int majorOpcode; -int offendingMinor; -int severity; - +_IceErrorBadMinor ( + IceConn iceConn, + int majorOpcode, + int offendingMinor, + int severity) { IceErrorHeader (iceConn, majorOpcode, offendingMinor, @@ -60,13 +58,11 @@ int severity; void -_IceErrorBadState (iceConn, majorOpcode, offendingMinor, severity) - -IceConn iceConn; -int majorOpcode; -int offendingMinor; -int severity; - +_IceErrorBadState ( + IceConn iceConn, + int majorOpcode, + int offendingMinor, + int severity) { IceErrorHeader (iceConn, majorOpcode, offendingMinor, @@ -80,13 +76,11 @@ int severity; void -_IceErrorBadLength (iceConn, majorOpcode, offendingMinor, severity) - -IceConn iceConn; -int majorOpcode; -int offendingMinor; -int severity; - +_IceErrorBadLength ( + IceConn iceConn, + int majorOpcode, + int offendingMinor, + int severity) { IceErrorHeader (iceConn, majorOpcode, offendingMinor, @@ -100,15 +94,13 @@ int severity; void -_IceErrorBadValue (iceConn, majorOpcode, offendingMinor, offset, length, value) - -IceConn iceConn; -int majorOpcode; -int offendingMinor; -int offset; -int length; /* in bytes */ -IcePointer value; - +_IceErrorBadValue ( + IceConn iceConn, + int majorOpcode, + int offendingMinor, + int offset, + int length, /* in bytes */ + IcePointer value) { IceErrorHeader (iceConn, majorOpcode, offendingMinor, @@ -129,11 +121,9 @@ IcePointer value; void -_IceErrorNoAuthentication (iceConn, offendingMinor) - -IceConn iceConn; -int offendingMinor; - +_IceErrorNoAuthentication ( + IceConn iceConn, + int offendingMinor) { int severity = (offendingMinor == ICE_ConnectionSetup) ? IceFatalToConnection : IceFatalToProtocol; @@ -150,11 +140,9 @@ int offendingMinor; void -_IceErrorNoVersion (iceConn, offendingMinor) - -IceConn iceConn; -int offendingMinor; - +_IceErrorNoVersion ( + IceConn iceConn, + int offendingMinor) { int severity = (offendingMinor == ICE_ConnectionSetup) ? IceFatalToConnection : IceFatalToProtocol; @@ -171,12 +159,10 @@ int offendingMinor; void -_IceErrorSetupFailed (iceConn, offendingMinor, reason) - -IceConn iceConn; -int offendingMinor; -char *reason; - +_IceErrorSetupFailed ( + IceConn iceConn, + int offendingMinor, + char *reason) { char *pBuf, *pStart; int bytes; @@ -203,12 +189,10 @@ char *reason; void -_IceErrorAuthenticationRejected (iceConn, offendingMinor, reason) - -IceConn iceConn; -int offendingMinor; -char *reason; - +_IceErrorAuthenticationRejected ( + IceConn iceConn, + int offendingMinor, + char *reason) { char *pBuf, *pStart; int bytes; @@ -233,12 +217,10 @@ char *reason; void -_IceErrorAuthenticationFailed (iceConn, offendingMinor, reason) - -IceConn iceConn; -int offendingMinor; -char *reason; - +_IceErrorAuthenticationFailed ( + IceConn iceConn, + int offendingMinor, + char *reason) { char *pBuf, *pStart; int bytes; @@ -263,11 +245,9 @@ char *reason; void -_IceErrorProtocolDuplicate (iceConn, protocolName) - -IceConn iceConn; -char *protocolName; - +_IceErrorProtocolDuplicate ( + IceConn iceConn, + char *protocolName) { char *pBuf, *pStart; int bytes; @@ -292,11 +272,9 @@ char *protocolName; void -_IceErrorMajorOpcodeDuplicate (iceConn, majorOpcode) - -IceConn iceConn; -int majorOpcode; - +_IceErrorMajorOpcodeDuplicate ( + IceConn iceConn, + int majorOpcode) { char mOp = (char) majorOpcode; @@ -313,11 +291,9 @@ int majorOpcode; void -_IceErrorUnknownProtocol (iceConn, protocolName) - -IceConn iceConn; -char *protocolName; - +_IceErrorUnknownProtocol ( + IceConn iceConn, + char *protocolName) { char *pBuf, *pStart; int bytes; @@ -342,13 +318,11 @@ char *protocolName; void -_IceErrorBadMajor (iceConn, offendingMajor, offendingMinor, severity) - -IceConn iceConn; -int offendingMajor; -int offendingMinor; -int severity; - +_IceErrorBadMajor ( + IceConn iceConn, + int offendingMajor, + int offendingMinor, + int severity) { char maj = (char) offendingMajor; @@ -370,17 +344,14 @@ int severity; */ void -_IceDefaultErrorHandler (iceConn, swap, - offendingMinorOpcode, offendingSequence, errorClass, severity, values) - -IceConn iceConn; -Bool swap; -int offendingMinorOpcode; -unsigned long offendingSequence; -int errorClass; -int severity; -IcePointer values; - +_IceDefaultErrorHandler ( + IceConn iceConn, + Bool swap, + int offendingMinorOpcode, + unsigned long offendingSequence, + int errorClass, + int severity, + IcePointer values) { char *str; char *pData = (char *) values; @@ -587,10 +558,7 @@ IcePointer values; */ IceErrorHandler -IceSetErrorHandler (handler) - -IceErrorHandler handler; - +IceSetErrorHandler (IceErrorHandler handler) { IceErrorHandler oldHandler = _IceErrorHandler; @@ -609,10 +577,7 @@ IceErrorHandler handler; */ void -_IceDefaultIOErrorHandler (iceConn) - -IceConn iceConn; - +_IceDefaultIOErrorHandler (IceConn iceConn) { fprintf (stderr, "ICE default IO error handler doing an exit(), pid = %ld, errno = %d\n", @@ -631,10 +596,7 @@ IceConn iceConn; */ IceIOErrorHandler -IceSetIOErrorHandler (handler) - -IceIOErrorHandler handler; - +IceSetIOErrorHandler (IceIOErrorHandler handler) { IceIOErrorHandler oldHandler = _IceIOErrorHandler; diff --git a/src/getauth.c b/src/getauth.c index 4ad7878..d7b1648 100644 --- a/src/getauth.c +++ b/src/getauth.c @@ -60,15 +60,12 @@ extern IceAuthDataEntry _IcePaAuthDataEntries[]; */ void -_IceGetPoAuthData (protocolName, networkId, authName, - authDataLenRet, authDataRet) - -char *protocolName; -char *networkId; -char *authName; -unsigned short *authDataLenRet; -char **authDataRet; - +_IceGetPoAuthData ( + char *protocolName, + char *networkId, + char *authName, + unsigned short *authDataLenRet, + char **authDataRet) { IceAuthFileEntry *entry; @@ -93,15 +90,12 @@ char **authDataRet; void -_IceGetPaAuthData (protocolName, networkId, authName, - authDataLenRet, authDataRet) - -char *protocolName; -char *networkId; -char *authName; -unsigned short *authDataLenRet; -char **authDataRet; - +_IceGetPaAuthData ( + char *protocolName, + char *networkId, + char *authName, + unsigned short *authDataLenRet, + char **authDataRet) { IceAuthDataEntry *entry = NULL; int found = 0; @@ -134,16 +128,13 @@ char **authDataRet; void -_IceGetPoValidAuthIndices (protocol_name, network_id, - num_auth_names, auth_names, num_indices_ret, indices_ret) - -char *protocol_name; -char *network_id; -int num_auth_names; -char **auth_names; -int *num_indices_ret; -int *indices_ret; /* in/out arg */ - +_IceGetPoValidAuthIndices ( + char *protocol_name, + char *network_id, + int num_auth_names, + char **auth_names, + int *num_indices_ret, + int *indices_ret) /* in/out arg */ { FILE *auth_file; char *filename; @@ -195,16 +186,13 @@ int *indices_ret; /* in/out arg */ void -_IceGetPaValidAuthIndices (protocol_name, network_id, - num_auth_names, auth_names, num_indices_ret, indices_ret) - -char *protocol_name; -char *network_id; -int num_auth_names; -char **auth_names; -int *num_indices_ret; -int *indices_ret; /* in/out arg */ - +_IceGetPaValidAuthIndices ( + char *protocol_name, + char *network_id, + int num_auth_names, + char **auth_names, + int *num_indices_ret, + int *indices_ret) /* in/out arg */ { int index_ret; int i, j; diff --git a/src/globals.h b/src/globals.h index 0532f55..4f41add 100644 --- a/src/globals.h +++ b/src/globals.h @@ -28,13 +28,52 @@ Author: Ralph Mor, X Consortium ******************************************************************************/ /* $XFree86: xc/lib/ICE/globals.h,v 1.4 2001/12/14 19:53:35 dawes Exp $ */ -extern void _IceDefaultErrorHandler (); -extern void _IceDefaultIOErrorHandler (); - -extern IcePoAuthStatus _IcePoMagicCookie1Proc (); -extern IcePaAuthStatus _IcePaMagicCookie1Proc (); - -extern void _IceProcessCoreMessage (); +extern void _IceDefaultErrorHandler ( + IceConn /* iceConn */, + Bool /* swap */, + int /* offendingMinorOpcode */, + unsigned long /* offendingSequence */, + int /* errorClass */, + int /* severity */, + IcePointer /* values */ +); + +extern void _IceDefaultIOErrorHandler ( + IceConn /* iceConn */ +); + +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 */ +); + +extern void _IceProcessCoreMessage ( + IceConn /* iceConn */, + int /* opcode */, + unsigned long /* length */, + Bool /* swap */, + IceReplyWaitInfo * /* replyWait */, + Bool * /* replyReadyRet */, + Bool * /* connectionClosedRet */ +); #ifndef __UNIXOS2__ IceConn _IceConnectionObjs[256]; diff --git a/src/iceauth.c b/src/iceauth.c index dcee7ed..fa05287 100644 --- a/src/iceauth.c +++ b/src/iceauth.c @@ -49,10 +49,7 @@ static int was_called_state; char * -IceGenerateMagicCookie (len) - -int len; - +IceGenerateMagicCookie (int len) { char *auth; long ldata[2]; @@ -94,19 +91,16 @@ int len; IcePoAuthStatus -_IcePoMagicCookie1Proc (iceConn, authStatePtr, cleanUp, swap, - authDataLen, authData, replyDataLenRet, replyDataRet, errorStringRet) - -IceConn iceConn; -IcePointer *authStatePtr; -Bool cleanUp; -Bool swap; -int authDataLen; -IcePointer authData; -int *replyDataLenRet; -IcePointer *replyDataRet; -char **errorStringRet; - +_IcePoMagicCookie1Proc ( + IceConn iceConn, + IcePointer *authStatePtr, + Bool cleanUp, + Bool swap, + int authDataLen, + IcePointer authData, + int *replyDataLenRet, + IcePointer *replyDataRet, + char **errorStringRet) { if (cleanUp) { @@ -171,18 +165,15 @@ char **errorStringRet; IcePaAuthStatus -_IcePaMagicCookie1Proc (iceConn, authStatePtr, swap, - authDataLen, authData, replyDataLenRet, replyDataRet, errorStringRet) - -IceConn iceConn; -IcePointer *authStatePtr; -Bool swap; -int authDataLen; -IcePointer authData; -int *replyDataLenRet; -IcePointer *replyDataRet; -char **errorStringRet; - +_IcePaMagicCookie1Proc ( + IceConn iceConn, + IcePointer *authStatePtr, + Bool swap, + int authDataLen, + IcePointer authData, + int *replyDataLenRet, + IcePointer *replyDataRet, + char **errorStringRet) { *errorStringRet = NULL; *replyDataLenRet = 0; diff --git a/src/listen.c b/src/listen.c index d3aa4b2..8a91d45 100644 --- a/src/listen.c +++ b/src/listen.c @@ -37,13 +37,11 @@ Author: Ralph Mor, X Consortium Status -IceListenForConnections (countRet, listenObjsRet, errorLength, errorStringRet) - -int *countRet; -IceListenObj **listenObjsRet; -int errorLength; -char *errorStringRet; - +IceListenForConnections ( + int *countRet, + IceListenObj **listenObjsRet, + int errorLength, + char *errorStringRet) { struct _IceListenObj *listenObjs; char *networkId; @@ -161,10 +159,7 @@ char *errorStringRet; int -IceGetListenConnectionNumber (listenObj) - -IceListenObj listenObj; - +IceGetListenConnectionNumber (IceListenObj listenObj) { return (_IceTransGetConnectionNumber (listenObj->trans_conn)); } @@ -172,10 +167,7 @@ IceListenObj listenObj; char * -IceGetListenConnectionString (listenObj) - -IceListenObj listenObj; - +IceGetListenConnectionString (IceListenObj listenObj) { return strdup(listenObj->network_id); } @@ -183,11 +175,9 @@ IceListenObj listenObj; char * -IceComposeNetworkIdList (count, listenObjs) - -int count; -IceListenObj *listenObjs; - +IceComposeNetworkIdList ( + int count, + IceListenObj *listenObjs) { char *list; int len = 0; @@ -241,11 +231,9 @@ IceListenObj *listenObjs; void -IceFreeListenObjs (count, listenObjs) - -int count; -IceListenObj *listenObjs; - +IceFreeListenObjs ( + int count, + IceListenObj *listenObjs) { int i; @@ -268,11 +256,9 @@ IceListenObj *listenObjs; */ void -IceSetHostBasedAuthProc (listenObj, hostBasedAuthProc) - -IceListenObj listenObj; -IceHostBasedAuthProc hostBasedAuthProc; - +IceSetHostBasedAuthProc ( + IceListenObj listenObj, + IceHostBasedAuthProc hostBasedAuthProc) { listenObj->host_based_auth_proc = hostBasedAuthProc; } diff --git a/src/listenwk.c b/src/listenwk.c index 26bb6e0..6add63c 100644 --- a/src/listenwk.c +++ b/src/listenwk.c @@ -40,14 +40,12 @@ in this Software without prior written authorization from The Open Group. Status -IceListenForWellKnownConnections (port, countRet, listenObjsRet, errorLength, errorStringRet) - -char *port; -int *countRet; -IceListenObj **listenObjsRet; -int errorLength; -char *errorStringRet; - +IceListenForWellKnownConnections ( + char *port, + int *countRet, + IceListenObj **listenObjsRet, + int errorLength, + char *errorStringRet) { struct _IceListenObj *listenObjs; char *networkId; diff --git a/src/locking.c b/src/locking.c index 5108030..1757d40 100644 --- a/src/locking.c +++ b/src/locking.c @@ -40,28 +40,21 @@ Author: Ralph Mor, X Consortium Status -IceInitThreads () - +IceInitThreads (void) { return (0); } void -IceAppLockConn (iceConn) - -IceConn iceConn; - +IceAppLockConn (IceConn iceConn) { IceLockConn (iceConn); } void -IceAppUnlockConn (iceConn) - -IceConn iceConn; - +IceAppUnlockConn (IceConn iceConn) { IceUnlockConn (iceConn); } diff --git a/src/misc.c b/src/misc.c index 304ae60..74cb959 100644 --- a/src/misc.c +++ b/src/misc.c @@ -49,11 +49,9 @@ Author: Ralph Mor, X Consortium */ char * -IceAllocScratch (iceConn, size) - -IceConn iceConn; -unsigned long size; - +IceAllocScratch ( + IceConn iceConn, + unsigned long size) { if (!iceConn->scratch || size > iceConn->scratch_size) { @@ -74,10 +72,7 @@ unsigned long size; */ int -IceFlush (iceConn) - -IceConn iceConn; - +IceFlush (IceConn iceConn) { _IceWrite (iceConn, (unsigned long) (iceConn->outbufptr - iceConn->outbuf), @@ -89,20 +84,14 @@ IceConn iceConn; int -IceGetOutBufSize (iceConn) - -IceConn iceConn; - +IceGetOutBufSize (IceConn iceConn) { return (iceConn->outbufmax - iceConn->outbuf); } int -IceGetInBufSize (iceConn) - -IceConn iceConn; - +IceGetInBufSize (IceConn iceConn) { return (iceConn->inbufmax - iceConn->inbuf); } @@ -114,70 +103,49 @@ IceConn iceConn; */ IceConnectStatus -IceConnectionStatus (iceConn) - -IceConn iceConn; - +IceConnectionStatus (IceConn iceConn) { return (iceConn->connection_status); } char * -IceVendor (iceConn) - -IceConn iceConn; - +IceVendor (IceConn iceConn) { return strdup(iceConn->vendor); } char * -IceRelease (iceConn) - -IceConn iceConn; - +IceRelease (IceConn iceConn) { return strdup(iceConn->release); } int -IceProtocolVersion (iceConn) - -IceConn iceConn; - +IceProtocolVersion (IceConn iceConn) { return (_IceVersions[iceConn->my_ice_version_index].major_version); } int -IceProtocolRevision (iceConn) - -IceConn iceConn; - +IceProtocolRevision (IceConn iceConn) { return (_IceVersions[iceConn->my_ice_version_index].minor_version); } int -IceConnectionNumber (iceConn) - -IceConn iceConn; - +IceConnectionNumber (IceConn iceConn) { return (_IceTransGetConnectionNumber (iceConn->trans_conn)); } char * -IceConnectionString (iceConn) - -IceConn iceConn; - +IceConnectionString (IceConn iceConn) { if (iceConn->connection_string) { @@ -189,30 +157,21 @@ IceConn iceConn; unsigned long -IceLastSentSequenceNumber (iceConn) - -IceConn iceConn; - +IceLastSentSequenceNumber (IceConn iceConn) { return (iceConn->send_sequence); } unsigned long -IceLastReceivedSequenceNumber (iceConn) - -IceConn iceConn; - +IceLastReceivedSequenceNumber (IceConn iceConn) { return (iceConn->receive_sequence); } Bool -IceSwapping (iceConn) - -IceConn iceConn; - +IceSwapping (IceConn iceConn) { return (iceConn->swap); } @@ -227,12 +186,10 @@ IceConn iceConn; */ Status -_IceRead (iceConn, nbytes, ptr) - -register IceConn iceConn; -unsigned long nbytes; -register char *ptr; - +_IceRead ( + register IceConn iceConn, + unsigned long nbytes, + register char *ptr) { register unsigned long nleft; @@ -327,11 +284,9 @@ register char *ptr; */ void -_IceReadSkip (iceConn, nbytes) - -register IceConn iceConn; -register unsigned long nbytes; - +_IceReadSkip ( + register IceConn iceConn, + register unsigned long nbytes) { char temp[512]; @@ -351,12 +306,10 @@ register unsigned long nbytes; */ void -_IceWrite (iceConn, nbytes, ptr) - -register IceConn iceConn; -unsigned long nbytes; -register char *ptr; - +_IceWrite ( + register IceConn iceConn, + unsigned long nbytes, + register char *ptr) { register unsigned long nleft; @@ -427,12 +380,10 @@ register char *ptr; #ifdef WORD64 -IceWriteData16 (iceConn, nbytes, data) - -IceConn iceConn; -unsigned long nbytes; -short *data; - +IceWriteData16 ( + IceConn iceConn, + unsigned long nbytes, + short *data) { int numShorts = nbytes / 2; int index = 0; @@ -458,12 +409,10 @@ short *data; } -IceWriteData32 (iceConn, nbytes, data) - -IceConn iceConn; -unsigned long nbytes; -int *data; - +IceWriteData32 ( + IceConn iceConn, + unsigned long nbytes, + int *data) { int numLongs = nbytes / 4; int index = 0; @@ -489,25 +438,21 @@ int *data; } -IceReadData16 (iceConn, swap, nbytes, data) - -IceConn iceConn; -Bool swap; -unsigned long nbytes; -short *data; - +IceReadData16 ( + IceConn iceConn, + Bool swap, + unsigned long nbytes, + short *data) { /* NOT IMPLEMENTED YET */ } -IceReadData32 (iceConn, swap, nbytes, data) - -IceConn iceConn; -Bool swap; -unsigned long nbytes; -int *data; - +IceReadData32 ( + IceConn iceConn, + Bool swap, + unsigned long nbytes, + int *data) { /* NOT IMPLEMENTED YET */ } @@ -517,12 +462,10 @@ int *data; void -_IceAddOpcodeMapping (iceConn, hisOpcode, myOpcode) - -IceConn iceConn; -int hisOpcode; -int myOpcode; - +_IceAddOpcodeMapping ( + IceConn iceConn, + int hisOpcode, + int myOpcode) { if (hisOpcode <= 0 || hisOpcode > 255) { diff --git a/src/ping.c b/src/ping.c index 45329b6..61d8229 100644 --- a/src/ping.c +++ b/src/ping.c @@ -34,12 +34,10 @@ Author: Ralph Mor, X Consortium #include "ICElibint.h" Status -IcePing (iceConn, pingReplyProc, clientData) - -IceConn iceConn; -IcePingReplyProc pingReplyProc; -IcePointer clientData; - +IcePing ( + IceConn iceConn, + IcePingReplyProc pingReplyProc, + IcePointer clientData) { _IcePingWait *newping = (_IcePingWait *) malloc (sizeof (_IcePingWait)); _IcePingWait *ptr = iceConn->ping_waits; diff --git a/src/process.c b/src/process.c index 416f1c6..188131f 100644 --- a/src/process.c +++ b/src/process.c @@ -124,12 +124,10 @@ Author: Ralph Mor, X Consortium */ IceProcessMessagesStatus -IceProcessMessages (iceConn, replyWait, replyReadyRet) - -IceConn iceConn; -IceReplyWaitInfo *replyWait; -Bool *replyReadyRet; - +IceProcessMessages ( + IceConn iceConn, + IceReplyWaitInfo *replyWait, + Bool *replyReadyRet) { iceMsg *header; Bool replyReady = False; @@ -390,13 +388,11 @@ Bool *replyReadyRet; static void -AuthRequired (iceConn, authIndex, authDataLen, authData) - -IceConn iceConn; -int authIndex; -int authDataLen; -IcePointer authData; - +AuthRequired ( + IceConn iceConn, + int authIndex, + int authDataLen, + IcePointer authData) { iceAuthRequiredMsg *pMsg; @@ -418,12 +414,10 @@ IcePointer authData; static void -AuthReply (iceConn, authDataLen, authData) - -IceConn iceConn; -int authDataLen; -IcePointer authData; - +AuthReply ( + IceConn iceConn, + int authDataLen, + IcePointer authData) { iceAuthReplyMsg *pMsg; @@ -444,12 +438,10 @@ IcePointer authData; static void -AuthNextPhase (iceConn, authDataLen, authData) - -IceConn iceConn; -int authDataLen; -IcePointer authData; - +AuthNextPhase ( + IceConn iceConn, + int authDataLen, + IcePointer authData) { iceAuthNextPhaseMsg *pMsg; @@ -470,11 +462,9 @@ IcePointer authData; static void -AcceptConnection (iceConn, versionIndex) - -IceConn iceConn; -int versionIndex; - +AcceptConnection ( + IceConn iceConn, + int versionIndex) { iceConnectionReplyMsg *pMsg; char *pData; @@ -499,15 +489,13 @@ int versionIndex; static void -AcceptProtocol (iceConn, hisOpcode, myOpcode, versionIndex, vendor, release) - -IceConn iceConn; -int hisOpcode; -int myOpcode; -int versionIndex; -char *vendor; -char *release; - +AcceptProtocol ( + IceConn iceConn, + int hisOpcode, + int myOpcode, + int versionIndex, + char *vendor, + char *release) { iceProtocolReplyMsg *pMsg; char *pData; @@ -540,10 +528,7 @@ char *release; static void -PingReply (iceConn) - -IceConn iceConn; - +PingReply (IceConn iceConn) { IceSimpleMessage (iceConn, 0, ICE_PingReply); IceFlush (iceConn); @@ -552,13 +537,11 @@ IceConn iceConn; static Bool -ProcessError (iceConn, length, swap, replyWait) - -IceConn iceConn; -unsigned long length; -Bool swap; -IceReplyWaitInfo *replyWait; - +ProcessError ( + IceConn iceConn, + unsigned long length, + Bool swap, + IceReplyWaitInfo *replyWait) { int invokeHandler = 0; Bool errorReturned = False; @@ -822,12 +805,10 @@ IceReplyWaitInfo *replyWait; static int -ProcessConnectionSetup (iceConn, length, swap) - -IceConn iceConn; -unsigned long length; -Bool swap; - +ProcessConnectionSetup ( + IceConn iceConn, + unsigned long length, + Bool swap) { iceConnectionSetupMsg *message; int myVersionCount, hisVersionCount; @@ -1077,13 +1058,11 @@ Bool swap; static Bool -ProcessAuthRequired (iceConn, length, swap, replyWait) - -IceConn iceConn; -unsigned long length; -Bool swap; -IceReplyWaitInfo *replyWait; - +ProcessAuthRequired ( + IceConn iceConn, + unsigned long length, + Bool swap, + IceReplyWaitInfo *replyWait) { iceAuthRequiredMsg *message; int authDataLen; @@ -1272,12 +1251,10 @@ IceReplyWaitInfo *replyWait; static int -ProcessAuthReply (iceConn, length, swap) - -IceConn iceConn; -unsigned long length; -Bool swap; - +ProcessAuthReply ( + IceConn iceConn, + unsigned long length, + Bool swap) { iceAuthReplyMsg *message; int replyDataLen; @@ -1568,13 +1545,11 @@ Bool swap; static Bool -ProcessAuthNextPhase (iceConn, length, swap, replyWait) - -IceConn iceConn; -unsigned long length; -Bool swap; -IceReplyWaitInfo *replyWait; - +ProcessAuthNextPhase ( + IceConn iceConn, + unsigned long length, + Bool swap, + IceReplyWaitInfo *replyWait) { iceAuthNextPhaseMsg *message; int authDataLen; @@ -1701,13 +1676,11 @@ IceReplyWaitInfo *replyWait; static Bool -ProcessConnectionReply (iceConn, length, swap, replyWait) - -IceConn iceConn; -unsigned long length; -Bool swap; -IceReplyWaitInfo *replyWait; - +ProcessConnectionReply ( + IceConn iceConn, + unsigned long length, + Bool swap, + IceReplyWaitInfo *replyWait) { iceConnectionReplyMsg *message; char *pData, *pStart, *pEnd; @@ -1804,12 +1777,10 @@ IceReplyWaitInfo *replyWait; static int -ProcessProtocolSetup (iceConn, length, swap) - -IceConn iceConn; -unsigned long length; -Bool swap; - +ProcessProtocolSetup ( + IceConn iceConn, + unsigned long length, + Bool swap) { iceProtocolSetupMsg *message; _IcePaProtocol *myProtocol; @@ -2202,13 +2173,11 @@ Bool swap; static Bool -ProcessProtocolReply (iceConn, length, swap, replyWait) - -IceConn iceConn; -unsigned long length; -Bool swap; -IceReplyWaitInfo *replyWait; - +ProcessProtocolReply ( + IceConn iceConn, + unsigned long length, + Bool swap, + IceReplyWaitInfo *replyWait) { iceProtocolReplyMsg *message; char *pData, *pStart, *pEnd; @@ -2317,11 +2286,9 @@ IceReplyWaitInfo *replyWait; static int -ProcessPing (iceConn, length) - -IceConn iceConn; -unsigned long length; - +ProcessPing ( + IceConn iceConn, + unsigned long length) { CHECK_SIZE_MATCH (iceConn, ICE_Ping, length, SIZEOF (icePingMsg), IceFatalToConnection, 0); @@ -2334,11 +2301,9 @@ unsigned long length; static int -ProcessPingReply (iceConn, length) - -IceConn iceConn; -unsigned long length; - +ProcessPingReply ( + IceConn iceConn, + unsigned long length) { CHECK_SIZE_MATCH (iceConn, ICE_PingReply, length, SIZEOF (icePingReplyMsg), IceFatalToConnection, 0); @@ -2364,12 +2329,10 @@ unsigned long length; static int -ProcessWantToClose (iceConn, length, connectionClosedRet) - -IceConn iceConn; -unsigned long length; -Bool *connectionClosedRet; - +ProcessWantToClose ( + IceConn iceConn, + unsigned long length, + Bool *connectionClosedRet) { *connectionClosedRet = False; @@ -2424,11 +2387,9 @@ Bool *connectionClosedRet; static int -ProcessNoClose (iceConn, length) - -IceConn iceConn; -unsigned long length; - +ProcessNoClose ( + IceConn iceConn, + unsigned long length) { CHECK_SIZE_MATCH (iceConn, ICE_NoClose, length, SIZEOF (iceNoCloseMsg), IceFatalToConnection, 0); @@ -2453,17 +2414,14 @@ unsigned long length; void -_IceProcessCoreMessage (iceConn, opcode, length, swap, - replyWait, replyReadyRet, connectionClosedRet) - -IceConn iceConn; -int opcode; -unsigned long length; -Bool swap; -IceReplyWaitInfo *replyWait; -Bool *replyReadyRet; -Bool *connectionClosedRet; - +_IceProcessCoreMessage ( + IceConn iceConn, + int opcode, + unsigned long length, + Bool swap, + IceReplyWaitInfo *replyWait, + Bool *replyReadyRet, + Bool *connectionClosedRet) { Bool replyReady = False; diff --git a/src/protosetup.c b/src/protosetup.c index 7a21e2e..1797154 100644 --- a/src/protosetup.c +++ b/src/protosetup.c @@ -36,21 +36,17 @@ Author: Ralph Mor, X Consortium IceProtocolSetupStatus -IceProtocolSetup (iceConn, myOpcode, clientData, mustAuthenticate, - majorVersionRet, minorVersionRet, vendorRet, releaseRet, - errorLength, errorStringRet) - -IceConn iceConn; -int myOpcode; -IcePointer clientData; -Bool mustAuthenticate; -int *majorVersionRet; -int *minorVersionRet; -char **vendorRet; -char **releaseRet; -int errorLength; -char *errorStringRet; - +IceProtocolSetup ( + IceConn iceConn, + int myOpcode, + IcePointer clientData, + Bool mustAuthenticate, + int *majorVersionRet, + int *minorVersionRet, + char **vendorRet, + char **releaseRet, + int errorLength, + char *errorStringRet) { iceProtocolSetupMsg *pMsg; char *pData; diff --git a/src/register.c b/src/register.c index bcf95a2..0e1b6d8 100644 --- a/src/register.c +++ b/src/register.c @@ -34,19 +34,16 @@ Author: Ralph Mor, X Consortium #include "ICElibint.h" int -IceRegisterForProtocolSetup (protocolName, vendor, release, - versionCount, versionRecs, authCount, authNames, authProcs, IOErrorProc) - -char *protocolName; -char *vendor; -char *release; -int versionCount; -IcePoVersionRec *versionRecs; -int authCount; -char **authNames; -IcePoAuthProc *authProcs; -IceIOErrorProc IOErrorProc; - +IceRegisterForProtocolSetup ( + char *protocolName, + char *vendor, + char *release, + int versionCount, + IcePoVersionRec *versionRecs, + int authCount, + char **authNames, + IcePoAuthProc *authProcs, + IceIOErrorProc IOErrorProc) { _IcePoProtocol *p; int opcodeRet, i; @@ -133,24 +130,19 @@ IceIOErrorProc IOErrorProc; int -IceRegisterForProtocolReply (protocolName, vendor, release, - versionCount, versionRecs, authCount, authNames, authProcs, - hostBasedAuthProc, protocolSetupProc, protocolActivateProc, - IOErrorProc) - -char *protocolName; -char *vendor; -char *release; -int versionCount; -IcePaVersionRec *versionRecs; -int authCount; -char **authNames; -IcePaAuthProc *authProcs; -IceHostBasedAuthProc hostBasedAuthProc; -IceProtocolSetupProc protocolSetupProc; -IceProtocolActivateProc protocolActivateProc; -IceIOErrorProc IOErrorProc; - +IceRegisterForProtocolReply ( + char *protocolName, + char *vendor, + char *release, + int versionCount, + IcePaVersionRec *versionRecs, + int authCount, + char **authNames, + IcePaAuthProc *authProcs, + IceHostBasedAuthProc hostBasedAuthProc, + IceProtocolSetupProc protocolSetupProc, + IceProtocolActivateProc protocolActivateProc, + IceIOErrorProc IOErrorProc) { _IcePaProtocol *p; int opcodeRet, i; diff --git a/src/replywait.c b/src/replywait.c index e00eb92..feb9c4c 100644 --- a/src/replywait.c +++ b/src/replywait.c @@ -35,11 +35,9 @@ Author: Ralph Mor, X Consortium void -_IceAddReplyWait (iceConn, replyWait) - -IceConn iceConn; -IceReplyWaitInfo *replyWait; - +_IceAddReplyWait ( + IceConn iceConn, + IceReplyWaitInfo *replyWait) { /* * Add this replyWait to the end of the list (only if the @@ -77,11 +75,9 @@ IceReplyWaitInfo *replyWait; IceReplyWaitInfo * -_IceSearchReplyWaits (iceConn, majorOpcode) - -IceConn iceConn; -int majorOpcode; - +_IceSearchReplyWaits ( + IceConn iceConn, + int majorOpcode) { /* * Return the first replyWait in the list with the given majorOpcode @@ -101,11 +97,9 @@ int majorOpcode; void -_IceSetReplyReady (iceConn, replyWait) - -IceConn iceConn; -IceReplyWaitInfo *replyWait; - +_IceSetReplyReady ( + IceConn iceConn, + IceReplyWaitInfo *replyWait) { /* * The replyWait specified has a reply ready. @@ -123,11 +117,9 @@ IceReplyWaitInfo *replyWait; Bool -_IceCheckReplyReady (iceConn, replyWait) - -IceConn iceConn; -IceReplyWaitInfo *replyWait; - +_IceCheckReplyReady ( + IceConn iceConn, + IceReplyWaitInfo *replyWait) { _IceSavedReplyWait *savedReplyWait = iceConn->saved_reply_waits; _IceSavedReplyWait *prev = NULL; diff --git a/src/setauth.c b/src/setauth.c index 8ed9cef..3503ba1 100644 --- a/src/setauth.c +++ b/src/setauth.c @@ -60,11 +60,9 @@ IceAuthDataEntry _IcePaAuthDataEntries[ICE_MAX_AUTH_DATA_ENTRIES] = {0}; void -IceSetPaAuthData (numEntries, entries) - -int numEntries; -IceAuthDataEntry *entries; - +IceSetPaAuthData ( + int numEntries, + IceAuthDataEntry *entries) { /* * _IcePaAuthDataEntries should really be a linked list. diff --git a/src/shutdown.c b/src/shutdown.c index 5c957c7..086a5d4 100644 --- a/src/shutdown.c +++ b/src/shutdown.c @@ -37,11 +37,9 @@ Author: Ralph Mor, X Consortium Status -IceProtocolShutdown (iceConn, majorOpcode) - -IceConn iceConn; -int majorOpcode; - +IceProtocolShutdown ( + IceConn iceConn, + int majorOpcode) { if (iceConn->proto_ref_count == 0 || iceConn->process_msg_info == NULL || majorOpcode < 1 || majorOpcode > _IceLastMajorOpcode) @@ -87,11 +85,9 @@ int majorOpcode; void -IceSetShutdownNegotiation (iceConn, negotiate) - -IceConn iceConn; -Bool negotiate; - +IceSetShutdownNegotiation ( + IceConn iceConn, + Bool negotiate) { iceConn->skip_want_to_close = negotiate ? False : True; } @@ -99,10 +95,7 @@ Bool negotiate; Bool -IceCheckShutdownNegotiation (iceConn) - -IceConn iceConn; - +IceCheckShutdownNegotiation (IceConn iceConn) { return (iceConn->skip_want_to_close ? False : True); } @@ -110,10 +103,7 @@ IceConn iceConn; IceCloseStatus -IceCloseConnection (iceConn) - -IceConn iceConn; - +IceCloseConnection (IceConn iceConn) { int refCountReachedZero; IceCloseStatus status; @@ -253,10 +243,7 @@ IceConn iceConn; void -_IceFreeConnection (iceConn) - -IceConn iceConn; - +_IceFreeConnection (IceConn iceConn) { if (iceConn->listen_obj == NULL) { diff --git a/src/watch.c b/src/watch.c index ec90d78..3b76e78 100644 --- a/src/watch.c +++ b/src/watch.c @@ -35,11 +35,9 @@ Author: Ralph Mor, X Consortium Status -IceAddConnectionWatch (watchProc, clientData) - -IceWatchProc watchProc; -IcePointer clientData; - +IceAddConnectionWatch ( + IceWatchProc watchProc, + IcePointer clientData) { /* * watchProc will be called each time an ICE connection is @@ -94,11 +92,9 @@ IcePointer clientData; void -IceRemoveConnectionWatch (watchProc, clientData) - -IceWatchProc watchProc; -IcePointer clientData; - +IceRemoveConnectionWatch ( + IceWatchProc watchProc, + IcePointer clientData) { _IceWatchProc *currWatchProc = _IceWatchProcs; _IceWatchProc *prevWatchProc = NULL; @@ -135,10 +131,7 @@ IcePointer clientData; void -_IceConnectionOpened (iceConn) - -IceConn iceConn; - +_IceConnectionOpened (IceConn iceConn) { _IceWatchProc *watchProc = _IceWatchProcs; @@ -170,10 +163,7 @@ IceConn iceConn; void -_IceConnectionClosed (iceConn) - -IceConn iceConn; - +_IceConnectionClosed (IceConn iceConn) { _IceWatchProc *watchProc = _IceWatchProcs; -- 1.5.3.5