Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sl_find(3) [netbsd man page]

STRINGLIST(3)						   BSD Library Functions Manual 					     STRINGLIST(3)

NAME
stringlist, sl_init, sl_add, sl_free, sl_find, sl_delete -- stringlist manipulation functions LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stringlist.h> StringList * sl_init(); 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); DESCRIPTION
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: sl_str is a pointer to the base of the array containing the list, sl_max is the size of sl_str, and sl_cur is the offset in sl_str of the current element. The following stringlist manipulation functions are available: sl_init() Create a stringlist. Returns a pointer to a StringList, or NULL in case of failure. sl_free() Releases memory occupied by sl and the sl->sl_str array. If freeall is non-zero, then each of the items within sl->sl_str is released as well. sl_add() Add item to sl->sl_str at sl->sl_cur, extending the size of sl->sl_str. Returns zero upon success, -1 upon failure. sl_find() Find item in sl, returning NULL if it's not found. sl_delete() Remove item from the list. If freeit is non-zero, the string is freed. Returns 0 if the name is found and -1 if the name is not found. SEE ALSO
free(3), malloc(3) HISTORY
The stringlist functions appeared in NetBSD 1.3. BSD
May 6, 2010 BSD

Check Out this Related Man Page

STRINGLIST(3)						   BSD Library Functions Manual 					     STRINGLIST(3)

NAME
stringlist, sl_init, sl_add, sl_free, sl_find, sl_delete -- stringlist manipulation functions LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stringlist.h> StringList * sl_init(); 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); DESCRIPTION
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: sl_str is a pointer to the base of the array containing the list, sl_max is the size of sl_str, and sl_cur is the offset in sl_str of the current element. The following stringlist manipulation functions are available: sl_init() Create a stringlist. Returns a pointer to a StringList, or NULL in case of failure. sl_free() Releases memory occupied by sl and the sl->sl_str array. If freeall is non-zero, then each of the items within sl->sl_str is released as well. sl_add() Add item to sl->sl_str at sl->sl_cur, extending the size of sl->sl_str. Returns zero upon success, -1 upon failure. sl_find() Find item in sl, returning NULL if it's not found. sl_delete() Remove item from the list. If freeit is non-zero, the string is freed. Returns 0 if the name is found and -1 if the name is not found. SEE ALSO
free(3), malloc(3) HISTORY
The stringlist functions appeared in NetBSD 1.3. BSD
May 6, 2010 BSD
Man Page

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find with name not working from crontab

find without -name works fine. find with -name '*' works from interactive bash, but not from cron. mgr@someplace:~$ crontab -l | grep wsl 17 09 * * * /usr/bin/find /wsbj/logs/mgr/webServiceLogs -type f -mtime +30 > /home/mgr/wsl_find.out 17 09 * * * /usr/bin/find /wsbj/logs/mgr/webServiceLogs... (11 Replies)
Discussion started by: CarloM
11 Replies

2. Shell Programming and Scripting

How to pre-check scrutinize all my shell scripts?

I have a few shell scripts. I need to run them on Flavors of Unix and Linux OS. The problem occurs that a set of commands in the script fail on one Operating System or the other. Below are a list of few commands that did not work on all operating systems i tested specifically becoz they... (15 Replies)
Discussion started by: mohtashims
15 Replies