From 8952e3d64d8099a5238be3ccf9cb56a7c0d1a2df Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Mon, 16 Mar 2009 02:42:34 +0000 Subject: [PATCH] libacl-prototypes-20090315 LICENSE IPL10 FIXES 124256 prototype the libacl directory --- src/libacl/aclprocs.c | 47 ++++++++++++++++++++++++++----------------- src/libacl/netprocs.c | 6 ++---- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/libacl/aclprocs.c b/src/libacl/aclprocs.c index 03a3fd485..82f6727f0 100644 --- a/src/libacl/aclprocs.c +++ b/src/libacl/aclprocs.c @@ -29,6 +29,7 @@ RCSID #include #include #include +#include #include "acl.h" #ifdef AFS_PTHREAD_ENV @@ -37,9 +38,6 @@ RCSID pthread_mutex_t acl_list_mutex; #endif /* AFS_PTHREAD_ENV */ -static int AddToList(); -static int GetFromList(); - struct freeListEntry { struct freeListEntry *next; int size; @@ -48,11 +46,16 @@ struct freeListEntry { struct freeListEntry *freeList; +static int AddToList(struct freeListEntry **, struct freeListEntry *); +static int GetFromList(struct freeListEntry **, struct freeListEntry **, + afs_int32); + /*todo: for sorting acls - make sure they work with new groups lists 10/5*/ static int -CmpPlus(a, b) - struct acl_accessEntry *a, *b; +CmpPlus(const void *arg1, const void *arg2) { + const struct acl_accessEntry *a = (struct acl_accessEntry *) arg1; + const struct acl_accessEntry *b = (struct acl_accessEntry *) arg2; if (a->id < b->id) return (-1); if (a->id == b->id) @@ -61,9 +64,11 @@ CmpPlus(a, b) } static int -CmpMinus(a, b) - struct acl_accessEntry *a, *b; +CmpMinus(const void *arg1, const void *arg2) { + const struct acl_accessEntry *a = (struct acl_accessEntry *) arg1; + const struct acl_accessEntry *b = (struct acl_accessEntry *) arg2; + if (a->id > b->id) return (-1); if (a->id == b->id) @@ -72,8 +77,7 @@ CmpMinus(a, b) } static int -CmpInt(x, y) - afs_int32 x, y; +CmpInt(int x, int y) { if (x < y) return (-1); @@ -170,7 +174,11 @@ acl_FreeExternalACL(char **r) int acl_Externalize(struct acl_accessList *acl, char **elist) { - /* Converts the access list defined by acl into the external access list in elist. Non-translatable id's are converted to their ASCII string representations. Returns 0 on success, -1 if number of entries exceeds ACL_MAXENTRIES, or a failure code from the protection server if the problem occured there. */ + /* Converts the access list defined by acl into the external access list + * in elist. Non-translatable id's are converted to their ASCII string + * representations. Returns 0 on success, -1 if number of entries + * exceeds ACL_MAXENTRIES, or a failure code from the protection server + * if the problem occured there. */ register int i; register int j; @@ -228,7 +236,9 @@ acl_Externalize(struct acl_accessList *acl, char **elist) int acl_Internalize(char *elist, struct acl_accessList **acl) { - /* Converts the external access list elist into the access list acl. Returns 0 on success, -1 if ANY name is not translatable, or if the number of entries exceeds al_maxExtEntries. */ + /* Converts the external access list elist into the access list acl. + * Returns 0 on success, -1 if ANY name is not translatable, or if + * the number of entries exceeds al_maxExtEntries. */ register int i; register int j; register char *nextc; @@ -424,9 +434,7 @@ acl_IsAMember(afs_int32 aid, prlist *cps) static int -AddToList(pflist, elem) - struct freeListEntry **pflist; - struct freeListEntry *elem; +AddToList(struct freeListEntry **pflist, struct freeListEntry *elem) { /* Adds elem to the freelist flist; returns 0 */ #ifdef AFS_PTHREAD_ENV @@ -441,12 +449,13 @@ AddToList(pflist, elem) } static int -GetFromList(pflist, elem, minsize) - struct freeListEntry **pflist; - struct freeListEntry **elem; - afs_int32 minsize; +GetFromList(struct freeListEntry **pflist, struct freeListEntry **elem, + afs_int32 minsize) { - /* Looks for an element whose body is at least minsize bytes in the freelist flist. If found, unlinks it, puts its address in elem, and returns 0, else returns -1. A trivial first-fit algorithm is used. */ + /* Looks for an element whose body is at least minsize bytes in the + * freelist flist. If found, unlinks it, puts its address in elem, + * and returns 0, else returns -1. A trivial first-fit algorithm is + * used. */ struct freeListEntry *y, *z; diff --git a/src/libacl/netprocs.c b/src/libacl/netprocs.c index 67b0bf324..940529399 100644 --- a/src/libacl/netprocs.c +++ b/src/libacl/netprocs.c @@ -31,8 +31,7 @@ RCSID #include "acl.h" int -acl_HtonACL(acl) - struct acl_accessList *acl; +acl_HtonACL(struct acl_accessList *acl) { /* Converts the access list defined by acl to network order. Returns 0 always. */ @@ -56,8 +55,7 @@ acl_HtonACL(acl) } int -acl_NtohACL(acl) - struct acl_accessList *acl; +acl_NtohACL(struct acl_accessList *acl) { /* Converts the access list defined by acl to network order. Returns 0 always. */ -- 2.39.5