diff options
Diffstat (limited to 'lib/libICE/src/error.c')
-rw-r--r-- | lib/libICE/src/error.c | 194 |
1 files changed, 89 insertions, 105 deletions
diff --git a/lib/libICE/src/error.c b/lib/libICE/src/error.c index 8021ad4cc..44b885378 100644 --- a/lib/libICE/src/error.c +++ b/lib/libICE/src/error.c @@ -40,13 +40,12 @@ 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 +59,12 @@ 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 +78,12 @@ 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 +97,14 @@ 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 +125,10 @@ IcePointer value; void -_IceErrorNoAuthentication (iceConn, offendingMinor) - -IceConn iceConn; -int offendingMinor; - +_IceErrorNoAuthentication ( + IceConn iceConn, + int offendingMinor +) { int severity = (offendingMinor == ICE_ConnectionSetup) ? IceFatalToConnection : IceFatalToProtocol; @@ -150,11 +145,10 @@ int offendingMinor; void -_IceErrorNoVersion (iceConn, offendingMinor) - -IceConn iceConn; -int offendingMinor; - +_IceErrorNoVersion ( + IceConn iceConn, + int offendingMinor +) { int severity = (offendingMinor == ICE_ConnectionSetup) ? IceFatalToConnection : IceFatalToProtocol; @@ -171,12 +165,11 @@ 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 +196,11 @@ 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 +225,11 @@ 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 +254,10 @@ char *reason; void -_IceErrorProtocolDuplicate (iceConn, protocolName) - -IceConn iceConn; -char *protocolName; - +_IceErrorProtocolDuplicate ( + IceConn iceConn, + char *protocolName +) { char *pBuf, *pStart; int bytes; @@ -292,11 +282,10 @@ char *protocolName; void -_IceErrorMajorOpcodeDuplicate (iceConn, majorOpcode) - -IceConn iceConn; -int majorOpcode; - +_IceErrorMajorOpcodeDuplicate ( + IceConn iceConn, + int majorOpcode +) { char mOp = (char) majorOpcode; @@ -313,11 +302,10 @@ int majorOpcode; void -_IceErrorUnknownProtocol (iceConn, protocolName) - -IceConn iceConn; -char *protocolName; - +_IceErrorUnknownProtocol ( + IceConn iceConn, + char *protocolName +) { char *pBuf, *pStart; int bytes; @@ -342,13 +330,12 @@ 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; @@ -369,18 +356,16 @@ int severity; * Default error handler. */ -void -_IceDefaultErrorHandler (iceConn, swap, - offendingMinorOpcode, offendingSequence, errorClass, severity, values) - -IceConn iceConn; -Bool swap; -int offendingMinorOpcode; -unsigned long offendingSequence; -int errorClass; -int severity; -IcePointer values; - +static void +_IceDefaultErrorHandler ( + IceConn iceConn, + Bool swap, + int offendingMinorOpcode, + unsigned long offendingSequence, + int errorClass, + int severity, + IcePointer values +) { char *str; char *pData = (char *) values; @@ -578,6 +563,7 @@ IcePointer values; exit (1); } +IceErrorHandler _IceErrorHandler = _IceDefaultErrorHandler; /* @@ -587,10 +573,9 @@ IcePointer values; */ IceErrorHandler -IceSetErrorHandler (handler) - -IceErrorHandler handler; - +IceSetErrorHandler ( + IceErrorHandler handler +) { IceErrorHandler oldHandler = _IceErrorHandler; @@ -608,11 +593,10 @@ IceErrorHandler handler; * Default IO error handler. */ -void -_IceDefaultIOErrorHandler (iceConn) - -IceConn iceConn; - +static void +_IceDefaultIOErrorHandler ( + IceConn iceConn +) { fprintf (stderr, "ICE default IO error handler doing an exit(), pid = %ld, errno = %d\n", @@ -621,6 +605,7 @@ IceConn iceConn; exit (1); } +IceIOErrorHandler _IceIOErrorHandler = _IceDefaultIOErrorHandler; /* @@ -631,10 +616,9 @@ IceConn iceConn; */ IceIOErrorHandler -IceSetIOErrorHandler (handler) - -IceIOErrorHandler handler; - +IceSetIOErrorHandler ( + IceIOErrorHandler handler +) { IceIOErrorHandler oldHandler = _IceIOErrorHandler; |