]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-libacl-prototypes-20090315
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Mon, 16 Mar 2009 02:42:45 +0000 (02:42 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 16 Mar 2009 02:42:45 +0000 (02:42 +0000)
LICENSE IPL10
FIXES 124256

prototype the libacl directory

(cherry picked from commit 8952e3d64d8099a5238be3ccf9cb56a7c0d1a2df)

src/libacl/aclprocs.c
src/libacl/netprocs.c

index 03a3fd485ad57722e36e3fc6d576cef3764deda8..82f6727f0f141e88479398fab4bdadb5bb128395 100644 (file)
@@ -29,6 +29,7 @@ RCSID
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <afs/ptclient.h>
+#include <afs/ptuser.h>
 #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;
 
index 67b0bf324a89cd34c36d03894300be11efb3bc88..940529399435cc6a7311cfd540967358da90522b 100644 (file)
@@ -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. */