libite
|
#include <errno.h>
#include <string.h>
Functions | |
int | strnmatch (const char *str, const char **list, size_t num) |
Finds matching strings from a finite list. More... | |
int | strmatch (const char *str, const char **list) |
Finds matching strings from a list. More... | |
int strmatch | ( | const char * | str, |
const char ** | list | ||
) |
Finds matching strings from a list.
str | String to look for. |
list | NUL terminated list of strings to search. |
This function searches the list
of strings for str
. If a (partial) match is found it returns the index in the list
.
Please note, the list
MUST be terminated by a NUL element. If that is not possible, we recommend using strnmatch() instead.
int strnmatch | ( | const char * | str, |
const char ** | list, | ||
size_t | num | ||
) |
Finds matching strings from a finite list.
str | String to look for |
list | List of strings to search. |
num | Number of entries in list . |
This function searches the list
of strings for str
. If a (partial) match is found it returns the index in the list
.
Very similar in function to strmatch(), but works for sets of strings that are not NUL
terminated.