strtok_r

OS/161 Reference Manual

Name

strtok_r - tokenize string reentrantly

Library

Standard C Library (libc, -lc)

Synopsis

#include <string.h>

char *
strtok_r(char *string, const char *separators, char **context);

Description

strtok_r is a reentrant version of strtok. It behaves the same way, except that the internal state is kept using the context parameter rather than being global.

The value passed to the context parameter should be the address of a char * whose value is preserved between successive related calls to strtok_r. The char * need not be initialized before the first call, and its value should not be inspected.

Return Values

strtok_r returns successive components of the passed-in string, and NULL when no more remain.