Back to index

php5  5.3.10
Functions
tsrm_strtok_r.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

char * tsrm_strtok_r (char *s, const char *delim, char **last)

Function Documentation

char* tsrm_strtok_r ( char *  s,
const char *  delim,
char **  last 
)

Definition at line 17 of file tsrm_strtok_r.c.

{
       char *token;

       if (s == NULL) {
              s = *last;
       }

       while (*s && in_character_class(*s, delim)) {
              s++;
       }
       if (!*s) {
              return NULL;
       }

       token = s;

       while (*s && !in_character_class(*s, delim)) {
              s++;
       }
       if (!*s) {
              *last = s;
       } else {
              *s = '\0';
              *last = s + 1;
       }
       return token;
}

Here is the call graph for this function: