XgCrtMisc


Functions

static char * end_tok (char **pp_str, CONST char *p_delim, char *p_sep)
char * strsep_rs (char **pp_str, CONST char *p_delim, char *p_sep)
 Thread safe variant of strsep.
char * strsep_r (char **pp_str, CONST char *p_delim)
 Thread safe version of strsep.

Detailed Description

The functions strtok_r(), strsep_r() and strsep_rs() are intended as a replacement for the strtok() function. While the strtok() function should be preferred for portability reasons (it conforms to ISO/IEC 9899:1990 ("ISO C89")) it may not be able to be used in a multi-threaded environment (that is it is not reentrant). Functions strsep_r() and strsep_rs() can handle empty fields, (i.e. detect fields delimited by two adjacent delimiter characters). Function strsep() first appeared in 4.4BSD.

Function Documentation

static char* end_tok ( char **  pp_str,
CONST char *  p_delim,
char *  p_sep 
) [static]

Definition at line 70 of file strtok_r.c.

Referenced by strsep_rs().

char* strsep_r ( char **  pp_str,
CONST char *  p_delim 
)

Thread safe version of strsep.

This function locates, in the string referenced by *str, the first occurrence of any character in the string delim (or the terminating `\0' character) and replaces it with a `\0'. The location of the next character after the delimiter character (or NULL, if the end of the string was reached) is stored in *str. The original value of *str is returned.

An "empty" field, i.e. one caused by two adjacent delimiter characters, can be detected by comparing the location referenced by the pointer returned in *str to `\0'.

If *str is initially NULL, strsep_r() returns NULL.

If delim is NULL or the empty string, strsep_r() returns *str.

Definition at line 157 of file strtok_r.c.

References strsep_rs().

char* strsep_rs ( char **  pp_str,
CONST char *  p_delim,
char *  p_sep 
)

Thread safe variant of strsep.

This function is identical in operation to strsep_r(), except it returns the deliminating character.

Definition at line 109 of file strtok_r.c.

References end_tok().

Referenced by strsep_r().


Generated on Sun Aug 31 13:31:35 2008 for FrankenRTOS by  doxygen 1.5.6