1 #include <msvcrt/mbstring.h>
6 unsigned char * _mbstok(unsigned char *s
, unsigned char *delim
)
8 const unsigned char *spanp
;
11 static unsigned char *last
;
14 if (s
== NULL
&& (s
= last
) == NULL
)
18 * Skip (span) leading delimiters (s += strspn(s, delim), sort of).
24 for (spanp
= delim
; (sc
= *spanp
) != 0; spanp
= _mbsinc(spanp
)) {
29 if (c
== 0) { /* no non-delimiter characters */
36 * Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
37 * Note that delim must have one NUL; we stop if we see that, too.
44 if ((sc
= *spanp
) == c
) {
52 spanp
= _mbsinc(spanp
);