strtok_r()

get next token from string (reentrant) 

Function


SYNOPSIS

#include <string.h>

char *strtok_r(char *s1, const char *s2, char **s3);


DESCRIPTION

The strtok_r() function is a reentrant version of strtok(). It gets the next token from string s1, where tokens are strings separated by characters from s2. To get the first token from s1, strtok_r() is called with s1 as its first parameter. Remaining tokens from s1 are obtained by calling strtok_r() with a null pointer for the first parameter. The string of delimiters, s2, can differ from call to call.

Note that the function strtok_r() writes null characters into the buffer pointed to by s1.

If the character buffer s1 is in dynamic memory, strtok_r() is thread-safe.


PARAMETERS

s1 

Points to the string from which to extract tokens.

s2 

Points to a null-terminated set of delimiter characters.

s3 

Is a value-return parameter used by strtok_r() to record its progress through s1.


RETURN VALUES

The strtok_r() function returns a pointer to the next token in s1. If there are no remaining tokens, it returns a null pointer.


CONFORMANCE

POSIX.1 (1996).


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
strsep(), strtok()


PTC MKS Toolkit 10.4 Documentation Build 39.