2 ** Copyright 2001, Travis Geiselbrecht.
3 ** Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de>
4 ** All rights reserved. Distributed under the terms of the NewOS License.
8 #include <wchar_private.h>
12 __wcstok(wchar_t* wcs
, const wchar_t* delim
, wchar_t** savePtr
)
14 wchar_t *wcsBegin
, *wcsEnd
;
16 if (wcs
== NULL
&& savePtr
== NULL
)
19 wcsBegin
= wcs
? wcs
: *savePtr
;
23 wcsBegin
+= wcsspn(wcsBegin
, delim
);
24 if (*wcsBegin
== '\0') {
30 wcsEnd
= wcspbrk(wcsBegin
, delim
);
31 if (wcsEnd
&& *wcsEnd
!= '\0')
40 B_DEFINE_WEAK_ALIAS(__wcstok
, wcstok
);