| stringlist(3bsd) | 3bsd | stringlist(3bsd) |
stringlist,
sl_init, sl_add,
sl_free, sl_find,
sl_delete — stringlist
manipulation functions
library “libbsd”
#include
<stringlist.h> (See
libbsd(7) for include usage.)
StringList *
sl_init(void);
int
sl_add(StringList
*sl, char
*item);
void
sl_free(StringList
*sl, int
freeall);
char *
sl_find(StringList
*sl, const char
*item);
int
sl_delete(StringList
*sl, const char
*item, int
freeit);
The stringlist functions manipulate
stringlists, which are lists of strings that extend automatically if
necessary.
The StringList structure has the following definition:
typedef struct _stringlist {
char **sl_str;
size_t sl_max;
size_t sl_cur;
} StringList;
where:
The following stringlist manipulation functions are available:
sl_init()NULL in case
of failure.sl_free()sl_add()sl_find()NULL if it's not found.sl_delete()0 if the name is found and
-1 if the name is not found.The stringlist functions appeared in
FreeBSD 2.2.6 and NetBSD
1.3.
| May 6, 2010 | Debian |