1#include <string.h>23#undef strtok45char *6strtok(char * restrict s1, const char * restrict s2)7{8 static char *line;910 if (s1)11 line = s1;12 else if (!line)13 return NULL;1415 s1 = line + strspn(line, s2);16 if (*s1 == '\0')17 return line = NULL;1819 line = s1 + strcspn(s1, s2);20 if (*line == '\0')21 line = NULL;22 else23 *line++ = '\0';2425 return s1;26}