Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ strtok_r(3) — Reliant UNIX 5.44c4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

strtok(3C)

string(5)

strtok_r(3)                                                     strtok_r(3)

NAME
     strtokr - split string into tokens

SYNOPSIS
     #include <string.h>

     char *strtokr(char *s, const char *sep, char **lasts);

DESCRIPTION
     The strtokr() function is the thread-safe version of strtok().

     The function strtokr() considers the null-terminated string s as a
     sequence of zero or more text tokens separated by spans of one or more
     characters from the separator string sep. The argument lasts points to
     a user-provided pointer which points to stored information necessary
     for strtokr() to continue scanning the same string.

     In the first call to strtokr(), s points to a null-terminated string,
     sep to a null-terminated string of separator characters and the value
     pointed to by lasts is ignored. The function strtokr() returns a
     pointer to the first character of the first token, writes a null char-
     acter into s immediately following the returned token, and updates the
     pointer to which lasts points.

     In subsequent calls, s is a NULL pointer and lasts will be unchanged
     from the previous call so that subsequent calls will move through the
     string s, returning successive tokens until no tokens remain. The
     separator string sep may be different from call to call. When no token
     remains in s, a NULL pointer is returned.

RETURN VALUE
     The function strtokr() returns a pointer to the token found, or a
     NULL pointer when no token is found.

ERRORS
     No errors are defined.

SEE ALSO
     strtok(3C), string(5).
















Page 1                       Reliant UNIX 5.44                Printed 11/98

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026