[PATCH 4/5] os: remove unused set_font_authorizations function

Mikhail Gusarov dottedmag at dottedmag.net
Fri Jun 11 11:22:50 PDT 2010


Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net>
---
 include/os.h |    5 ----
 os/utils.c   |   67 ----------------------------------------------------------
 2 files changed, 0 insertions(+), 72 deletions(-)

diff --git a/include/os.h b/include/os.h
index efa202c..6f79ddc 100644
--- a/include/os.h
+++ b/include/os.h
@@ -207,11 +207,6 @@ extern _X_EXPORT void UseMsg(void);
 
 extern _X_EXPORT void ProcessCommandLine(int /*argc*/, char* /*argv*/[]);
 
-extern _X_EXPORT int set_font_authorizations(
-    char ** /* authorizations */, 
-    int * /*authlen */, 
-    pointer /* client */);
-
 #ifndef _HAVE_XALLOC_DECLS
 #define _HAVE_XALLOC_DECLS
 
diff --git a/os/utils.c b/os/utils.c
index f6bcecb..7523d9e 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -954,73 +954,6 @@ ProcessCommandLine(int argc, char *argv[])
     }
 }
 
-/* Implement a simple-minded font authorization scheme.  The authorization
-   name is "hp-hostname-1", the contents are simply the host name. */
-int
-set_font_authorizations(char **authorizations, int *authlen, pointer client)
-{
-#define AUTHORIZATION_NAME "hp-hostname-1"
-#if defined(TCPCONN) || defined(STREAMSCONN)
-    static char *result = NULL;
-    static char *p = NULL;
-
-    if (p == NULL)
-    {
-	char hname[1024], *hnameptr;
-	unsigned int len;
-#if defined(IPv6) && defined(AF_INET6)
-	struct addrinfo hints, *ai = NULL;
-#else
-	struct hostent *host;
-#ifdef XTHREADS_NEEDS_BYNAMEPARAMS
-	_Xgethostbynameparams hparams;
-#endif
-#endif
-
-	gethostname(hname, 1024);
-#if defined(IPv6) && defined(AF_INET6)
-	memset(&hints, 0, sizeof(hints));
-	hints.ai_flags = AI_CANONNAME;
-	if (getaddrinfo(hname, NULL, &hints, &ai) == 0) {
-	    hnameptr = ai->ai_canonname;
-	} else {
-	    hnameptr = hname;
-	}
-#else
-	host = _XGethostbyname(hname, hparams);
-	if (host == NULL)
-	    hnameptr = hname;
-	else
-	    hnameptr = host->h_name;
-#endif
-
-	len = strlen(hnameptr) + 1;
-	result = malloc(len + sizeof(AUTHORIZATION_NAME) + 4);
-
-	p = result;
-        *p++ = sizeof(AUTHORIZATION_NAME) >> 8;
-        *p++ = sizeof(AUTHORIZATION_NAME) & 0xff;
-        *p++ = (len) >> 8;
-        *p++ = (len & 0xff);
-
-	memmove(p, AUTHORIZATION_NAME, sizeof(AUTHORIZATION_NAME));
-	p += sizeof(AUTHORIZATION_NAME);
-	memmove(p, hnameptr, len);
-	p += len;
-#if defined(IPv6) && defined(AF_INET6)
-	if (ai) {
-	    freeaddrinfo(ai);
-	}
-#endif
-    }
-    *authlen = p - result;
-    *authorizations = result;
-    return 1;
-#else /* TCPCONN */
-    return 0;
-#endif /* TCPCONN */
-}
-
 void *
 Xalloc(unsigned long amount)
 {
-- 
1.7.1



More information about the xorg-devel mailing list