NAME
ssttrriinngglliisstt, sslliinniitt, ssllaadddd, ssllffrreeee, ssllffiinndd - stringlist manipulation
functions LLIIBBRRAARRYYStandard C Library (libc, -lc)
SYNOPSIS
##iinncclluuddee <
StringList * sslliinniitt(); int ssllaadddd(StringList *sl, char *item); void ssllffrreeee(StringList *sl, int freeall); char * ssllffiinndd(StringList *sl, char *item);> DESCRIPTION
The ssttrriinngglliisstt functions manipulate stringlists, which are lists of strings that extend automatically if necessary. The StringList structure has the following definition: typedef struct stringlist { char **slstr; sizet slmax; sizet slcur; } StringList; slstr a pointer to the base of the array containing the list. slmax the size of slstr. slcur the offset in slstr of the current element. The following stringlist manipulation functions are available: sslliinniitt() Create a stringlist. Returns a pointer to a StringList, or NULL in case of failure.ssllffrreeee() Releases memory occupied by sl and the sl->slstr array. If
freeall is non-zero, then each of the items within sl->slstr
is released as well.ssllaadddd() Add item to sl->slstr at sl->slcur, extending the size of
sl->slstr. Returns zero upon success, -1 upon failure.
ssllffiinndd() Find item in sl, returning NULL if it's not found.SEE ALSO
free(3), malloc(3) HISTORY The ssttrriinngglliisstt functions appeared in FreeBSD 2.2.6 and NetBSD 1.3. BSD November 28, 1999 BSD