strsep()

get next token from string 

Function


SYNOPSIS

#include <string.h>

char *strsep(char **stringp, const char *delim);


DESCRIPTION

The strsep() function gets the next token from string *stringp, where tokens are strings separated by characters from delim.

The function strsep() writes nulls into the string at *stringp to separate tokens. On return, if there are more tokens, then *stringp points past the last null written. Contiguous delimiter characters are indicated when strsep() returns a pointer to a null character (that is, a character with the value '\0'). When there are no remaining tokens, strsep() returns a null pointer.

The string delim need not remain constant from call to call.

This function is intended to replace strtok(). It offers improved handling of contiguous delimiter characters.


PARAMETERS

stringp 

Points to a character string from which to extract tokens.

delim 

Points to a null-terminated string of delimiter characters.


RETURN VALUES

A pointer to the next token from stringp, as delimited by delim. When there are no more tokens, strsep() returns NULL.


CONFORMANCE

4.4BSD.


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:
strtok(), strtok_r()


PTC MKS Toolkit 10.4 Documentation Build 39.