2 * Copyright (C) 2002 Manuel Novoa III
3 * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
5 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
11 # define Wstrtok_r wcstok
12 # define Wstrspn wcsspn
13 # define Wstrpbrk wcspbrk
15 # define Wstrtok_r strtok_r
16 # define Wstrspn strspn
17 # define Wstrpbrk strpbrk
20 Wchar
*Wstrtok_r(Wchar
* __restrict s1
, const Wchar
* __restrict s2
,
21 Wchar
** __restrict next_start
)
27 if (((s
= s1
) != NULL
) || ((s
= *next_start
) != NULL
)) {
28 if (*(s
+= Wstrspn(s
, s2
))) {
29 if ((p
= Wstrpbrk(s
, s2
)) != NULL
) {
42 if (s
&& *(s
+= Wstrspn(s
, s2
))) {
43 if (*(p
= s
+ Wstrcspn(s
, s2
))) {
49 return NULL
; /* TODO: set *next_start = NULL for safety? */
54 libc_hidden_def(strtok_r
)