diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/SMlibint.h | 9 | ||||
-rw-r--r-- | src/globals.h | 19 | ||||
-rw-r--r-- | src/sm_client.c | 18 | ||||
-rw-r--r-- | src/sm_manager.c | 16 |
4 files changed, 29 insertions, 33 deletions
diff --git a/src/SMlibint.h b/src/SMlibint.h index e9fa9cd..dce55b2 100644 --- a/src/SMlibint.h +++ b/src/SMlibint.h @@ -499,15 +499,6 @@ struct _SmsConn { extern int _SmcOpcode; extern int _SmsOpcode; -extern int _SmVersionCount; -extern IcePoVersionRec _SmcVersions[]; -extern IcePaVersionRec _SmsVersions[]; - -extern int _SmAuthCount; -extern char *_SmAuthNames[]; -extern IcePoAuthProc _SmcAuthProcs[]; -extern IcePaAuthProc _SmsAuthProcs[]; - extern SmsNewClientProc _SmsNewClientProc; extern SmPointer _SmsNewClientData; diff --git a/src/globals.h b/src/globals.h index 2f26a78..40b0ffc 100644 --- a/src/globals.h +++ b/src/globals.h @@ -34,28 +34,9 @@ in this Software without prior written authorization from The Open Group. extern void _SmcDefaultErrorHandler (); extern void _SmsDefaultErrorHandler (); -extern IcePoAuthStatus _IcePoMagicCookie1Proc (); -extern IcePaAuthStatus _IcePaMagicCookie1Proc (); - -extern void _SmcProcessMessage (); -extern void _SmsProcessMessage (); - int _SmcOpcode = 0; int _SmsOpcode = 0; -int _SmVersionCount = 1; - -IcePoVersionRec _SmcVersions[] = { - {SmProtoMajor, SmProtoMinor, _SmcProcessMessage}}; - -IcePaVersionRec _SmsVersions[] = { - {SmProtoMajor, SmProtoMinor, _SmsProcessMessage}}; - -int _SmAuthCount = 1; -char *_SmAuthNames[] = {"MIT-MAGIC-COOKIE-1"}; -IcePoAuthProc _SmcAuthProcs[] = {_IcePoMagicCookie1Proc}; -IcePaAuthProc _SmsAuthProcs[] = {_IcePaMagicCookie1Proc}; - #ifndef __UNIXOS2__ SmsNewClientProc _SmsNewClientProc; SmPointer _SmsNewClientData; diff --git a/src/sm_client.c b/src/sm_client.c index 047924b..03ffc0e 100644 --- a/src/sm_client.c +++ b/src/sm_client.c @@ -38,6 +38,8 @@ in this Software without prior written authorization from The Open Group. #include "SMlibint.h" #include "globals.h" +extern IcePoAuthStatus _IcePoMagicCookie1Proc (); +extern void _SmcProcessMessage (); static void set_callbacks(); @@ -73,6 +75,16 @@ char *errorStringRet; _SmcRegisterClientReply reply; Bool gotReply, ioErrorOccured; + const char *auth_names[] = {"MIT-MAGIC-COOKIE-1"}; + IcePoAuthProc auth_procs[] = {_IcePoMagicCookie1Proc}; + int auth_count = 1; + + IcePoVersionRec versions[] = { + {SmProtoMajor, SmProtoMinor, _SmcProcessMessage} + }; + int version_count = 1; + + *clientIdRet = NULL; if (errorStringRet && errorLength > 0) @@ -83,13 +95,13 @@ char *errorStringRet; /* * For now, there is only one version of XSMP, so we don't * have to check {xsmpMajorRev, xsmpMinorRev}. In the future, - * we will check against _SmcVersions and generate the list + * we will check against versions and generate the list * of versions the application actually supports. */ if ((_SmcOpcode = IceRegisterForProtocolSetup ("XSMP", - SmVendorString, SmReleaseString, _SmVersionCount, _SmcVersions, - _SmAuthCount, _SmAuthNames, _SmcAuthProcs, NULL)) < 0) + SmVendorString, SmReleaseString, version_count, versions, + auth_count, auth_names, auth_procs, NULL)) < 0) { if (errorStringRet && errorLength > 0) { strncpy (errorStringRet, diff --git a/src/sm_manager.c b/src/sm_manager.c index 57f53b5..f2b4cd1 100644 --- a/src/sm_manager.c +++ b/src/sm_manager.c @@ -42,6 +42,9 @@ in this Software without prior written authorization from The Open Group. #undef shutdown #endif +extern IcePaAuthStatus _IcePaMagicCookie1Proc (); +extern void _SmsProcessMessage (); + static Status @@ -123,6 +126,15 @@ int errorLength; char *errorStringRet; { + const char *auth_names[] = {"MIT-MAGIC-COOKIE-1"}; + IcePaAuthProc auth_procs[] = {_IcePaMagicCookie1Proc}; + int auth_count = 1; + + IcePaVersionRec versions[] = { + {SmProtoMajor, SmProtoMinor, _SmsProcessMessage} + }; + int version_count = 1; + if (errorStringRet && errorLength > 0) *errorStringRet = '\0'; @@ -142,8 +154,8 @@ char *errorStringRet; { if ((_SmsOpcode = IceRegisterForProtocolReply ("XSMP", - vendor, release, _SmVersionCount, _SmsVersions, - _SmAuthCount, _SmAuthNames, _SmsAuthProcs, hostBasedAuthProc, + vendor, release, version_count, versions, + auth_count, auth_names, auth_procs, hostBasedAuthProc, _SmsProtocolSetupProc, NULL, /* IceProtocolActivateProc - we don't care about when the Protocol Reply is sent, because the |