NWLstrtok_r

Finds the next token in a specified string

NetWare Server:4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98
Library:Cross-Platform Localization (LOC*.*)
Service:Internationalization

Syntax

  #include <nwlocale.h> 
   
  pnstr N_API NWLstrtok_r  ( 
     pnstr              parse,  
     const nstr N_FAR  *delim,
     ppnstr             last); 
  
  

Parameters

parse
(IN/OUT) Points to the string containing the tokens.
delim
(IN) Points to the string containing delimiters, which can include double-byte characters.
last
(IN/OUT) Points to a value used to record the progress through the string specified by the parse parameter.

Return Values

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.

Remarks

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.

See Also

NWLstrspn, NWLstrcspn, NWLstrtok