#include char *strtok(char * restrict new_s, char const * restrict separators) { static char *s = NULL; if(new_s) s = new_s; /* Skip leading delimiters */ s += strspn(s, separators); if(!*s) return NULL; /* Skip non-delimiters */ char *token = s; s += strcspn(s, separators); if(*s) *s++ = 0; return token; }