PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
strtok.c
1#define SYSCLIB_DISABLE_BUILTINS
2#include <sysclib.h>
3
4char *strtok(char *restrict s, const char *restrict sep)
5{
6 static char *p;
7 if (!s && !(s = p)) return NULL;
8 s += strspn(s, sep);
9 if (!*s) return p = 0;
10 p = s + strcspn(s, sep);
11 if (*p) *p++ = 0;
12 else p = 0;
13 return s;
14}