diff options
author | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-03-25 17:57:54 -0400 |
---|---|---|
committer | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-03-25 17:57:54 -0400 |
commit | 4b5802ddbd45271be3cadeae0a83a6742df2515b (patch) | |
tree | 9569d18b523da979175562b113dd610752afd6ec /os | |
parent | 04b87d6dfae02e4ecdb5216d12c6cdafd1e8c2b4 (diff) |
General DIX static and dead code cleanup.
Diffstat (limited to 'os')
-rw-r--r-- | os/access.c | 6 | ||||
-rw-r--r-- | os/auth.c | 20 | ||||
-rw-r--r-- | os/io.c | 13 | ||||
-rw-r--r-- | os/osdep.h | 8 | ||||
-rw-r--r-- | os/xdmcp.c | 58 |
5 files changed, 35 insertions, 70 deletions
diff --git a/os/access.c b/os/access.c index db5ca3135..221b8cbcd 100644 --- a/os/access.c +++ b/os/access.c @@ -234,8 +234,8 @@ static Bool NewHost(int /*family*/, int /*len*/, int /* addingLocalHosts */); -int LocalClientCredAndGroups(ClientPtr client, int *pUid, int *pGid, - int **pSuppGids, int *nSuppGids); +static int LocalClientCredAndGroups(ClientPtr client, int *pUid, int *pGid, + int **pSuppGids, int *nSuppGids); /* XFree86 bug #156: To keep track of which hosts were explicitly requested in @@ -1431,7 +1431,7 @@ LocalClientCred(ClientPtr client, int *pUid, int *pGid) * * Used by localuser & localgroup ServerInterpreted access control forms below */ -int +static int LocalClientCredAndGroups(ClientPtr client, int *pUid, int *pGid, int **pSuppGids, int *nSuppGids) { @@ -255,26 +255,6 @@ ResetAuthorization (void) ShouldLoadAuth = TRUE; } -XID -AuthorizationToID ( - unsigned short name_length, - char *name, - unsigned short data_length, - char *data) -{ - int i; - - for (i = 0; i < NUM_AUTHORIZATION; i++) { - if (protocols[i].name_length == name_length && - memcmp (protocols[i].name, name, (int) name_length) == 0 && - protocols[i].ToID) - { - return (*protocols[i].ToID) (data_length, data); - } - } - return (XID) ~0L; -} - int AuthorizationFromID ( XID id, @@ -90,6 +90,11 @@ SOFTWARE. _X_EXPORT CallbackListPtr ReplyCallback; _X_EXPORT CallbackListPtr FlushCallback; +static ConnectionInputPtr AllocateInputBuffer(void); +static ConnectionOutputPtr AllocateOutputBuffer(void); +static xReqPtr PeekNextRequest(xReqPtr req, ClientPtr client, Bool readmore); +static void SkipRequests(xReqPtr req, ClientPtr client, int numskipped); + /* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX * systems are broken and return EWOULDBLOCK when they should return EAGAIN */ @@ -635,7 +640,7 @@ ResetCurrentRequest(ClientPtr client) * **********************/ -xReqPtr +static xReqPtr PeekNextRequest( xReqPtr req, /* request we're starting from */ ClientPtr client, /* client whose requests we're skipping */ @@ -697,7 +702,7 @@ PeekNextRequest( _X_EXPORT CallbackListPtr SkippedRequestsCallback = NULL; -void +static void SkipRequests( xReqPtr req, /* last request being skipped */ ClientPtr client, /* client whose requests we're skipping */ @@ -1165,7 +1170,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount) return extraCount; /* return only the amount explicitly requested */ } -ConnectionInputPtr +static ConnectionInputPtr AllocateInputBuffer(void) { ConnectionInputPtr oci; @@ -1186,7 +1191,7 @@ AllocateInputBuffer(void) return oci; } -ConnectionOutputPtr +static ConnectionOutputPtr AllocateOutputBuffer(void) { ConnectionOutputPtr oco; diff --git a/os/osdep.h b/os/osdep.h index 3d303f913..0984d51e8 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -210,10 +210,6 @@ extern void FreeOsBuffers( #include "dix.h" -extern ConnectionInputPtr AllocateInputBuffer(void); - -extern ConnectionOutputPtr AllocateOutputBuffer(void); - extern fd_set AllSockets; extern fd_set AllClients; extern fd_set LastSelectMask; @@ -293,14 +289,12 @@ extern XID AuthSecurityCheck (AuthCheckArgs); /* in xdmcp.c */ extern void XdmcpUseMsg (void); extern int XdmcpOptions(int argc, char **argv, int i); -extern void XdmcpSetAuthentication (ARRAY8Ptr name); extern void XdmcpRegisterConnection ( int type, char *address, int addrlen); extern void XdmcpRegisterAuthorizations (void); extern void XdmcpRegisterAuthorization (char *name, int namelen); -extern void XdmcpRegisterDisplayClass (char *name, int length); extern void XdmcpInit (void); extern void XdmcpReset (void); extern void XdmcpOpenDisplay(int sock); @@ -313,8 +307,6 @@ extern void XdmcpRegisterAuthentication ( ValidatorFunc Validator, GeneratorFunc Generator, AddAuthorFunc AddAuth); -extern int XdmcpCheckAuthentication (ARRAY8Ptr Name, ARRAY8Ptr Data, int packet_type); -extern int XdmcpAddAuthorization (ARRAY8Ptr name, ARRAY8Ptr data); struct sockaddr_in; extern void XdmcpRegisterBroadcastAddress (struct sockaddr_in *addr); diff --git a/os/xdmcp.c b/os/xdmcp.c index cfc1005c2..310f33bc0 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -197,8 +197,6 @@ static void receive_packet(int /*socketfd*/); static void send_packet(void); -extern void XdmcpDeadSession(char * /*reason*/); - static void timeout(void); static void restart(void); @@ -213,10 +211,23 @@ static void XdmcpWakeupHandler( int /*i*/, pointer /*LastSelectMask*/); -void XdmcpRegisterManufacturerDisplayID( - char * /*name*/, - int /*length*/); +/* + * Register the Manufacturer display ID + */ + +static ARRAY8 ManufacturerDisplayID; + +static void +XdmcpRegisterManufacturerDisplayID (char *name, int length) +{ + int i; + XdmcpDisposeARRAY8 (&ManufacturerDisplayID); + if (!XdmcpAllocARRAY8 (&ManufacturerDisplayID, length)) + return; + for (i = 0; i < length; i++) + ManufacturerDisplayID.data[i] = (CARD8) name[i]; +} static unsigned short xdm_udp_port = XDM_UDP_PORT; static Bool OneSession = FALSE; @@ -417,7 +428,7 @@ static ARRAY8Ptr AuthenticationName = &noAuthenticationName; static ARRAY8Ptr AuthenticationData = &noAuthenticationData; static AuthenticationFuncsPtr AuthenticationFuncs; -void +static void XdmcpSetAuthentication (ARRAY8Ptr name) { int i; @@ -549,7 +560,7 @@ XdmcpRegisterAuthorization (char *name, int namelen) static ARRAY8 DisplayClass; -void +static void XdmcpRegisterDisplayClass (char *name, int length) { int i; @@ -561,24 +572,6 @@ XdmcpRegisterDisplayClass (char *name, int length) DisplayClass.data[i] = (CARD8) name[i]; } -/* - * Register the Manufacturer display ID - */ - -static ARRAY8 ManufacturerDisplayID; - -void -XdmcpRegisterManufacturerDisplayID (char *name, int length) -{ - int i; - - XdmcpDisposeARRAY8 (&ManufacturerDisplayID); - if (!XdmcpAllocARRAY8 (&ManufacturerDisplayID, length)) - return; - for (i = 0; i < length; i++) - ManufacturerDisplayID.data[i] = (CARD8) name[i]; -} - /* * initialize XDMCP; create the socket, compute the display * number, set up the state machine @@ -867,7 +860,7 @@ send_packet(void) * timeouts, or Keepalive failure. */ -void +static void XdmcpDeadSession (char *reason) { ErrorF ("XDM: %s, declaring session dead\n", reason); @@ -960,21 +953,16 @@ restart(void) send_packet(); } -int -XdmcpCheckAuthentication ( - ARRAY8Ptr Name, - ARRAY8Ptr Data, - int packet_type) +static int +XdmcpCheckAuthentication (ARRAY8Ptr Name, ARRAY8Ptr Data, int packet_type) { return (XdmcpARRAY8Equal (Name, AuthenticationName) && (AuthenticationName->length == 0 || (*AuthenticationFuncs->Validator) (AuthenticationData, Data, packet_type))); } -int -XdmcpAddAuthorization ( - ARRAY8Ptr name, - ARRAY8Ptr data) +static int +XdmcpAddAuthorization (ARRAY8Ptr name, ARRAY8Ptr data) { AddAuthorFunc AddAuth; |