NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | NOTE | ATTRIBUTES | SEE ALSO | STANDARDS | RESTRICTIONS
$(NUCLEUS_DIR)/lib/classix/libsys.s.a #include <string.h>char *strtok_r(char *str, const char *sep, char **last);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
The strtok_r() function is used to isolate sequential tokens in a null-terminated string, str. These tokens are separated in the string by at least one of the characters in sep. The strtok_r() function performs the same task as strtok(3STDC), except the current position in the string is recorded in *last. This parameter is used as follows: if str is null, *last is used as the starting point. Otherwise, the value of *last is unimportant. This routine can therefore be used exactly like strtok(3STDC) , except that the extra parameter last must point to proper storage for a character pointer. It can be useful for setting str to NULL and initialising *last the first time, thus making all invocations look the same. It can also be useful to modify the information returned in *last or to use it to compute the next value for the str parameter, or a combination of these methods.
When no more tokens remain, a null pointer is returned and *last is set to NULL.
This function is fully reentrant. It is the responsability of the application to protect last and str against concurrent manipulations, if necessary. The invoking stack of the invoking thread is the best place to store *last.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
The strtok_r() function conforms to POSIX.1c.
It is not always possible to get tokens from multiple strings simultaneously.
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | NOTE | ATTRIBUTES | SEE ALSO | STANDARDS | RESTRICTIONS