Breaks a string into a sequence of tokens, each of which is delimited by a character from another string.
#include <unilib.h> unicode_t *unitok ( unicode_t *string, const unicode_t *sepset);
(IN) Points to the string to parse. On subsequent calls, must be set to NULL.
(IN) Points to a null-terminated set of delimiter values. This string might be different from call to call.
If a delimiter is found, returns a pointer to the first byte of a token. On subsequent iterations, if no delimiter is found, returns a NULL pointer.
If the string does not contain any of the delimiters specified in sepset, returns a pointer to the string. All of the string is considered to be a token.
The unitok function considers the string pointed to by the string parameter to consist of a sequence of zero or more text tokens, separated from the delimiter pointed to by the sepset parameter by spans of one or more characters.
The first call to unitok returns a pointer to the first character of the first token in the string parameter and writes a null-terminating character into the string parameter immediately following the returned token. The unitok function sets the string parameter to a NULL pointer, which allows unitok, on subsequent calls, to search through the string and return successive tokens, until no tokens remain. Because unitok can modify the original string, that string should be duplicated if the string is to be reused.
The unitok function corresponds to the strtok function.
NOTE:For error-free, thread-safe operation, use the unitok_r function.