summaryrefslogtreecommitdiff
path: root/lib/libc/include/plstr.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/include/plstr.h')
-rw-r--r--lib/libc/include/plstr.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/libc/include/plstr.h b/lib/libc/include/plstr.h
index b619a934..551567e4 100644
--- a/lib/libc/include/plstr.h
+++ b/lib/libc/include/plstr.h
@@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
+ * Roland Mainz <roland mainz@informatik.med.uni-giessen.de>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
@@ -434,7 +435,29 @@ PR_EXTERN(char *)
PL_strncaserstr(const char *big, const char *little, PRUint32 max);
/*
- * Things not (yet?) included: strspn/strcspn, strtok/strtok_r, strsep.
+ * PL_strtok_r
+ *
+ * Splits the string s1 into tokens, separated by one or more characters
+ * from the separator string s2. The argument lasts points to a
+ * user-supplied char * pointer in which PL_strtok_r stores information
+ * for it to continue scanning the same string.
+ *
+ * In the first call to PL_strtok_r, s1 points to a string and the value
+ * of *lasts is ignored. PL_strtok_r returns a pointer to the first
+ * token, writes '\0' into the character following the first token, and
+ * updates *lasts.
+ *
+ * In subsequent calls, s1 is null and lasts must stay unchanged from the
+ * previous call. The separator string s2 may be different from call to
+ * call. PL_strtok_r returns a pointer to the next token in s1. When no
+ * token remains in s1, PL_strtok_r returns null.
+ */
+
+PR_EXTERN(char *)
+PL_strtok_r(char *s1, const char *s2, char **lasts);
+
+/*
+ * Things not (yet?) included: strspn/strcspn, strsep.
* memchr, memcmp, memcpy, memccpy, index, rindex, bcmp, bcopy, bzero.
* Any and all i18n/l10n stuff.
*/