"Fossies" - the Fresh Open Source Software Archive

Member "neon-0.31.2/doc/man/ne_token.3" (20 Jun 2020, 2651 Bytes) of package /linux/www/neon-0.31.2.tar.gz:


Caution: As a special service "Fossies" has tried to format the requested manual source page into HTML format but links to other man pages may be missing or even erroneous. Alternatively you can here view or download the uninterpreted manual source code. A member file download can also be achieved by clicking within a package contents listing on the according byte size field. See also the latest Fossies "Diffs" side-by-side code changes report for "ne_token.3": 0.31.1_vs_0.31.2.

NE_TOKEN

NAME
SYNOPSIS
DESCRIPTION
EXAMPLES
AUTHOR
COPYRIGHT

NAME

ne_token, ne_qtoken − string tokenizers

SYNOPSIS

#include <ne_string.h>

char *ne_token(char **str, char sep);

char *ne_qtoken(char **str, char sep, const char *quotes);

DESCRIPTION

ne_token and ne_qtoken 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 remainder of the string, or NULL if there are no more tokens in the string. A token is delimited by the separator character sep; if ne_qtoken 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 tokenizing function is called; replacing the next separator character 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", ne_token(&list, ','));
while (list);
}

AUTHOR

Joe Orton <neon@lists.manyfish.co.uk>

Author.

COPYRIGHT