neon API reference NETOKEN(3)
NAME
netoken, neqtoken - string tokenizers
SYNOPSIS
#include
char *netoken (char **str, char sep);
char *neqtoken (char **str, char sep, const char *quotes);
DESCRIPTION
netoken and neqtoken tokenize the string at the location
stored in the pointer str. Each time the function is called,
it returns the next token, and modifies the str pointer to
point to the remainer of the string, or NUL if there are no
more tokens in the string. A token is delimited by the
separator character sep; if neqtoken is used any quoted
segments of the string are skipped when searching for a
separator. A quoted segment is enclosed in a pair of one of
the characters given in the quotes string.
The string being tokenized is modified each time the token-
izing function is called; replacing the next separator char-
acter with a NUL terminator.
EXAMPLES
The following function prints out each token in a
comma-separated string list, which is modified in-place:
static void splitter(char *list)
{
do {
printf("Token: %s\n", netoken(&list, ','));
while (list);
}
AUTHOR
Joe Orton .
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
neon 0.25.5 Last change: 20 January 2006 1
neon API reference NETOKEN(3)
ATRIBUTE TYPE ATRIBUTE VALUE
Availability SUNWneon
Interface Stability Volatile
NOTES
Source for Neon is available on http:/opensolaris.org.
neon 0.25.5 Last change: 20 January 2006 2
|