#include <afsconfig.h>
#include <afs/param.h>
-RCSID
- ("$Header$");
#include <sys/types.h>
#ifdef AFS_NT40_ENV
#else
#include <netinet/in.h>
#endif
-#ifdef HAVE_STRING_H
#include <string.h>
-#endif
#include <rx/xdr.h>
#include <rx/rx.h>
#include <afs/ptclient.h>
+#include <afs/ptuser.h>
#include "acl.h"
#ifdef AFS_PTHREAD_ENV
pthread_mutex_t acl_list_mutex;
#endif /* AFS_PTHREAD_ENV */
-static int AddToList();
-static int GetFromList();
-
struct freeListEntry {
struct freeListEntry *next;
int size;
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)
}
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)
}
static int
-CmpInt(x, y)
- afs_int32 x, y;
+CmpInt(int x, int y)
{
if (x < y)
return (-1);
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;
- register code;
+ register int code;
register char *nextc;
idlist lids;
namelist lnames;
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;
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
}
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;