[Cvs-nserver-commits] CVS: cvs-nserver/acl user-acl.c,1.1.2.4,1.1.2.5 user-acl.h,1.1.2.1,1.1.2.2
Brought to you by:
tyranny
From: Alexey M. <ty...@us...> - 2002-06-09 11:41:59
|
Update of /cvsroot/cvs-nserver/cvs-nserver/acl In directory usw-pr-cvs1:/tmp/cvs-serv12035 Modified Files: Tag: NCLI-1-11-1 user-acl.c user-acl.h Log Message: Allow freeing struct USER_ACL Index: user-acl.c =================================================================== RCS file: /cvsroot/cvs-nserver/cvs-nserver/acl/Attic/user-acl.c,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -d -r1.1.2.4 -r1.1.2.5 --- user-acl.c 29 Sep 2001 23:50:32 -0000 1.1.2.4 +++ user-acl.c 9 Jun 2002 11:41:50 -0000 1.1.2.5 @@ -25,6 +25,31 @@ #include <stdlib.h> #include <string.h> +static void +free_user_ace (USER_ACE* ace) +{ + if (!ace) + return; + + free(ace->username); + free(ace); +} + +void +free_user_acls (USER_ACL* acls) +{ + USER_ACL* current = acls; + + while (current) { + USER_ACL* next = current->next; + + free_user_ace(current); + + current = next; + } +} + + USER_ACE * get_user_ace (USER_ACL *acls, char *username) { Index: user-acl.h =================================================================== RCS file: /cvsroot/cvs-nserver/cvs-nserver/acl/Attic/user-acl.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- user-acl.h 29 Aug 2001 17:28:11 -0000 1.1.2.1 +++ user-acl.h 9 Jun 2002 11:41:50 -0000 1.1.2.2 @@ -29,10 +29,10 @@ typedef struct USER_ACL USER_ACE; -USER_ACL * -set_user_ace(USER_ACL *acls, char *username, int perm); +void free_user_acls (USER_ACL* acls); -USER_ACE * -get_user_ace (USER_ACL *acls, char *username); +USER_ACL * set_user_ace(USER_ACL *acls, char *username, int perm); + +USER_ACE * get_user_ace (USER_ACL *acls, char *username); #endif /* USER_ACL_H */ |