NWLstrtok_r
Finds the next token in a specified string
#include <nwlocale.h>
pnstr N_API NWLstrtok_r (
pnstr parse,
const nstr N_FAR *delim,
ppnstr last);
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 parse does not contain any of the delimiters specified in delim, returns a pointer to parse, and all of parse is considered to be a token.
Every time NWLstrtok_r is called, it modifies the parse parameter by substituting a NULL character for each delimiter that is found.
The first call to NWLstrtok_r returns a pointer to the first character of the first token in the string parameter and writes a NULL character into the string parameter immediately following the returned token. On subsequent calls, the parse parameter must be set to NULL, and NWLstrtok_r uses the value in the last parameter to search through the string and return successive tokens.
Because the NWLstrtok_r function can modify the string by writing a NULL character to terminate a token, the string should be duplicated if the string is to be reused.