description
sequence calls to this function split str into tokens
tokens are sequences of contiguous characters separated by any of characters that are part of delimiters
how to call
first call, str = C string, start positon = first character of "C string"
subsequent call, str = NULL, start position = position after the end of the last token
if terminating null character of str is found, all subsequent calls return a null pointer
position of token
starting position = first character not contained in delimiter, from starting location
ending position = first character contained in delimiter.
end of the token = null-character
beginning of the token is returned by the function
others
the point of position of last token is kept internally
parameters
str
c string
"str" is modified
if str == null, this function continues scanning, start position = previous successful call end position
delimiters
c string
contains delimiter characters
these characters can be different from one call to another
return value
a pointer to the beginning of the token, if a token is found
null, otherwise