* Local protoypes
*/
static int alias_compare __P((const void *, const void *));
-static void alias_free __P((void *));
/*
* Comparison function for the red-black tree.
/*
* Free memory used by an alias struct and its members.
*/
-static void
+void
alias_free(v)
void *v;
{
}
/*
- * Find the named alias, delete it from the tree and recover its resources.
+ * Find the named alias, remove it from the tree and return it.
*/
-int
+struct alias *
alias_remove(name, type)
char *name;
int type;
key.name = name;
key.type = type;
if ((node = rbfind(aliases, &key)) == NULL)
- return(FALSE);
+ return(NULL);
a = rbdelete(aliases, node);
- alias_free(a);
- return(TRUE);
+ return(a);
}
void
*/
char *alias_add __P((char *, int, struct member *));
int addr_matches __P((char *));
-int alias_remove __P((char *, int));
int cmnd_matches __P((struct member *));
int cmndlist_matches __P((struct member_list *));
int command_matches __P((char *, char *));
int userpw_matches __P((char *, char *, struct passwd *));
int group_matches __P((char *, struct group *));
struct alias *alias_find __P((char *, int));
+struct alias *alias_remove __P((char *, int));
+void alias_free __P((void *));
void alias_apply __P((int (*)(void *, void *), void *));
void init_aliases __P((void));
void init_parser __P((char *, int));
struct member *m;
struct alias *a;
- alias_seqno++;
if ((a = alias_find(name, type)) != NULL) {
tq_foreach_fwd(&a->members, m) {
if (m->type == ALIAS) {
}
}
}
+ alias_seqno++;
(void) alias_remove(name, type);
}