summaryrefslogtreecommitdiff
path: root/libc/string/strtok.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/string/strtok.c')
-rw-r--r--libc/string/strtok.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/libc/string/strtok.c b/libc/string/strtok.c
new file mode 100644
index 000000000..4b8aef6b5
--- /dev/null
+++ b/libc/string/strtok.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2002 Manuel Novoa III
+ * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include "_string.h"
+
+#if 0 /*def WANT_WIDE*/
+# define Wstrtok wcstok
+# define Wstrtok_r __wcstok_r
+#else
+# define Wstrtok strtok
+# define Wstrtok_r __strtok_r
+#endif
+
+Wchar *Wstrtok(Wchar * __restrict s1, const Wchar * __restrict s2)
+{
+ static Wchar *next_start; /* Initialized to 0 since in bss. */
+ return Wstrtok_r(s1, s2, &next_start);
+}