diff options
-rw-r--r-- | AuDispose.c | 2 | ||||
-rw-r--r-- | AuFileName.c | 4 | ||||
-rw-r--r-- | AuGetAddr.c | 13 | ||||
-rw-r--r-- | AuGetBest.c | 19 | ||||
-rw-r--r-- | AuLock.c | 12 | ||||
-rw-r--r-- | AuRead.c | 18 | ||||
-rw-r--r-- | AuUnlock.c | 6 | ||||
-rw-r--r-- | AuWrite.c | 16 | ||||
-rw-r--r-- | Xau.man | 7 | ||||
-rw-r--r-- | include/X11/Xauth.h | 4 |
10 files changed, 49 insertions, 52 deletions
diff --git a/AuDispose.c b/AuDispose.c index b21cb67..4847abc 100644 --- a/AuDispose.c +++ b/AuDispose.c @@ -25,8 +25,10 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/lib/Xau/AuDispose.c,v 1.5 2001/12/14 19:54:36 dawes Exp $ */ #include <X11/Xauth.h> +#include <stdlib.h> void XauDisposeAuth (auth) diff --git a/AuFileName.c b/AuFileName.c index aa456a1..a1bb520 100644 --- a/AuFileName.c +++ b/AuFileName.c @@ -25,15 +25,17 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/lib/Xau/AuFileName.c,v 3.7 2001/12/14 19:54:36 dawes Exp $ */ #include <X11/Xauth.h> #include <X11/Xos.h> +#include <stdlib.h> char * XauFileName () { char *slashDotXauthority = "/.Xauthority"; - char *name, *malloc (), *getenv (); + char *name; static char *buf; static int bsize; #ifdef WIN32 diff --git a/AuGetAddr.c b/AuGetAddr.c index af28414..cd6948b 100644 --- a/AuGetAddr.c +++ b/AuGetAddr.c @@ -25,14 +25,13 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/lib/Xau/AuGetAddr.c,v 1.5 2001/12/14 19:54:36 dawes Exp $ */ #include <X11/Xauth.h> #include <X11/Xos.h> -static -binaryEqual (a, b, len) -register char *a, *b; -register int len; +static int +binaryEqual (_Xconst char *a, _Xconst char *b, int len) { while (len--) if (*a++ != *b++) @@ -96,10 +95,8 @@ char *name; /* * Match when: * either family or entry->family are FamilyWild or - * family and entry->family are the same - * and - * either address or entry->address are empty or - * address and entry->address are the same + * family and entry->family are the same and + * address and entry->address are the same * and * either number or entry->number are empty or * number and entry->number are the same diff --git a/AuGetBest.c b/AuGetBest.c index ff24813..01ba34e 100644 --- a/AuGetBest.c +++ b/AuGetBest.c @@ -25,6 +25,7 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/lib/Xau/AuGetBest.c,v 1.7 2001/12/14 19:54:36 dawes Exp $ */ #include <X11/Xauth.h> #include <X11/Xos.h> @@ -37,10 +38,8 @@ in this Software without prior written authorization from The Open Group. #include <X11/Xos_r.h> #endif -static -binaryEqual (a, b, len) -register char *a, *b; -register int len; +static int +binaryEqual (_Xconst char *a, _Xconst char *b, int len) { while (len--) if (*a++ != *b++) @@ -105,7 +104,9 @@ XauGetBestAuthByAddr (family, address_length, address, #ifdef hpux if (family == FamilyLocal) { +#ifdef XTHREADS_NEEDS_BYNAMEPARAMS _Xgethostbynameparams hparams; +#endif struct hostent *hostp; /* make sure we try fully-qualified hostname */ @@ -130,16 +131,14 @@ XauGetBestAuthByAddr (family, address_length, address, /* * Match when: * either family or entry->family are FamilyWild or - * family and entry->family are the same - * and - * either address or entry->address are empty or - * address and entry->address are the same + * family and entry->family are the same and + * address and entry->address are the same * and * either number or entry->number are empty or * number and entry->number are the same * and - * name matches one of the specified names, or no names - * were specified + * either name or entry->name are empty or + * name and entry->name are the same */ if ((family == FamilyWild || entry->family == FamilyWild || @@ -25,19 +25,14 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/lib/Xau/AuLock.c,v 3.6 2002/05/31 18:45:43 dawes Exp $ */ #include <X11/Xauth.h> #include <X11/Xos.h> #include <sys/stat.h> #include <errno.h> -#ifdef X_NOT_STDC_ENV -extern int errno; -#define Time_t long -extern Time_t time (); -#else #include <time.h> #define Time_t time_t -#endif #ifndef X_NOT_POSIX #include <unistd.h> #else @@ -47,6 +42,9 @@ extern unsigned sleep (); #define link rename #endif #endif +#ifdef __UNIXOS2__ +#define link rename +#endif #if NeedFunctionPrototypes int @@ -89,7 +87,7 @@ long dead; while (retries > 0) { if (creat_fd == -1) { - creat_fd = creat (creat_name, 0666); + creat_fd = open (creat_name, O_WRONLY | O_CREAT | O_EXCL, 0600); if (creat_fd == -1) { if (errno != EACCES) return LOCK_ERROR; @@ -25,13 +25,13 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/lib/Xau/AuRead.c,v 1.6 2001/12/14 19:54:36 dawes Exp $ */ #include <X11/Xauth.h> +#include <stdlib.h> -static -read_short (shortp, file) -unsigned short *shortp; -FILE *file; +static int +read_short (unsigned short *shortp, FILE *file) { unsigned char file_short[2]; @@ -41,14 +41,11 @@ FILE *file; return 1; } -static -read_counted_string (countp, stringp, file) -unsigned short *countp; -char **stringp; -FILE *file; +static int +read_counted_string (unsigned short *countp, char **stringp, FILE *file) { unsigned short len; - char *data, *malloc (); + char *data; if (read_short (&len, file) == 0) return 0; @@ -75,7 +72,6 @@ FILE *auth_file; { Xauth local; Xauth *ret; - char *malloc (); if (read_short (&local.family, auth_file) == 0) return 0; @@ -25,10 +25,12 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/lib/Xau/AuUnlock.c,v 1.4 2001/12/14 19:54:36 dawes Exp $ */ #include <X11/Xauth.h> #include <X11/Xos.h> +int #if NeedFunctionPrototypes XauUnlockAuth ( _Xconst char *file_name) @@ -43,7 +45,7 @@ char *file_name; char link_name[1025]; if (strlen (file_name) > 1022) - return; + return 0; #ifndef WIN32 (void) strcpy (creat_name, file_name); (void) strcat (creat_name, "-c"); @@ -57,4 +59,6 @@ char *file_name; (void) unlink (creat_name); #endif (void) unlink (link_name); + + return 1; } @@ -25,13 +25,12 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/lib/Xau/AuWrite.c,v 1.4 2001/12/14 19:54:36 dawes Exp $ */ #include <X11/Xauth.h> -static -write_short (s, file) -unsigned short s; -FILE *file; +static int +write_short (unsigned short s, FILE *file) { unsigned char file_short[2]; @@ -42,11 +41,8 @@ FILE *file; return 1; } -static -write_counted_string (count, string, file) -unsigned short count; -char *string; -FILE *file; +static int +write_counted_string (unsigned short count, char *string, FILE *file) { if (write_short (count, file) == 0) return 0; @@ -60,8 +56,6 @@ XauWriteAuth (auth_file, auth) FILE *auth_file; Xauth *auth; { - char *malloc (); - if (write_short (auth->family, auth_file) == 0) return 0; if (write_counted_string (auth->address_length, auth->address, auth_file) == 0) @@ -1,4 +1,4 @@ -.\" $Xorg: Xau.man,v 1.4 2001/03/16 17:48:26 pookie Exp $ +.\" $Xorg: Xau.man,v 1.3 2000/08/17 19:41:54 cpqbld Exp $ .\" Copyright (c) 1994 X Consortium .\" .\" Permission is hereby granted, free of charge, to any person obtaining a @@ -23,7 +23,10 @@ .\" be used in advertising or otherwise to promote the sale, use or other .\" dealing in this Software without prior written authorization from the .\" X Consortium. -.TH Xau 3 "Release 6.6" "X Version 11" +.\" +.\" $XFree86: xc/doc/man/Xau/Xau.man,v 1.2 2001/01/27 18:20:19 dawes Exp $ +.\" +.TH Xau 3 __xorgversion__ .SH NAME Xau library: XauFileName, XauReadAuth, XauLockAuth, XauUnlockAuth, XauWriteAuth, XauDisposeAuth, diff --git a/include/X11/Xauth.h b/include/X11/Xauth.h index eb69628..e4efc2d 100644 --- a/include/X11/Xauth.h +++ b/include/X11/Xauth.h @@ -26,6 +26,8 @@ in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/lib/Xau/Xauth.h,v 1.5 2001/12/14 19:54:36 dawes Exp $ */ + #ifndef _Xauth_h #define _Xauth_h @@ -57,7 +59,7 @@ typedef struct xauth { _XFUNCPROTOBEGIN -char *XauFileName(); +char *XauFileName(void); Xauth *XauReadAuth( #if NeedFunctionPrototypes |