diff options
Diffstat (limited to 'common/set.c')
-rw-r--r-- | common/set.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/common/set.c b/common/set.c index 7e82730..d36ce2d 100644 --- a/common/set.c +++ b/common/set.c @@ -2,7 +2,7 @@ set.c - set functions This file is part of the nss-pam-ldapd library. - Copyright (C) 2008 Arthur de Jong + Copyright (C) 2008, 2009 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,12 @@ #include "set.h" #include "dict.h" +/* + The SET object is just a DICT which is passed around. The value + for each entry in the dict is just the pointer to the dict. + Another API is provided to give it a more set-like interface. +*/ + SET *set_new(void) { return (SET *)dict_new(); @@ -50,15 +56,7 @@ void set_free(SET *set) dict_free((DICT *)set); } -void set_loop_first(SET *set) -{ - dict_loop_first((DICT *)set); -} - -const char *set_loop_next(SET *set) +const char **set_tolist(SET *set) { - const char *value=NULL; - if (dict_loop_next((DICT *)set,&value,NULL)==NULL) - return NULL; - return value; + return dict_keys((DICT *)set); } |