41 char*
__strtok_r(
char* ,
const char* ,
char** );
43 char*
__strtok_r(
char* s,
const char* delim,
char** last)
60 for(spanp = (
char*)(uintptr_t)delim; (sc = *spanp++) != 0;)
84 spanp = (
char*)(uintptr_t)delim;
87 if((sc = *spanp++) == c)
122 char blah[80], test[80];
123 char *brkb, *brkt, *phrase, *sep, *
word;
128 printf(
"String tokenizer test:\n");
129 strcpy(test,
"This;is.a:test:of=the/string\\tokenizer-function.");
131 printf(
"Next word is \"%s\".\n",
word);
132 strcpy(test,
"This;is.a:test:of=the/string\\tokenizer-function.");
134 for(
word = strtok_r(test, sep, &brkt);
word;
word = strtok_r(
NULL, sep, &brkt))
136 strcpy(blah,
"blah:blat:blab:blag");
138 for(phrase = strtok_r(blah, sep, &brkb); phrase; phrase = strtok_r(
NULL, sep, &brkb))
139 printf(
"So far we're at %s:%s\n",
word, phrase);
char * strtok(char *s, const char *delim)
Finds the next token in a null-terminated byte string pointed to by s.
char * __strtok_r(char *, const char *, char **)
char * strcpy(char *__restrict dst, const char *__restrict src)
Copies the null-terminated byte string pointed to by src to the character array whose first element i...