[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS shishi/gl
From: |
shishi-commit |
Subject: |
CVS shishi/gl |
Date: |
Fri, 19 Nov 2004 15:07:14 +0100 |
Update of /home/cvs/shishi/gl
In directory dopio:/tmp/cvs-serv7004/gl
Modified Files:
strtok_r.c strtok_r.h
Log Message:
Update.
--- /home/cvs/shishi/gl/strtok_r.c 2004/11/19 14:04:23 1.4
+++ /home/cvs/shishi/gl/strtok_r.c 2004/11/19 14:07:14 1.5
@@ -41,17 +41,6 @@
x = strtok_r(NULL, "-=", &sp); // x = "def", sp = NULL
x = strtok_r(NULL, "=", &sp); // x = NULL
// s = "abc\0-def\0"
-
- For the POSIX documentation for this function, see:
- http://www.opengroup.org/onlinepubs/009695399/functions/strtok.html
-
- Caveat: It modifies the original string.
- Caveat: These functions cannot be used on constant strings.
- Caveat: The identity of the delimiting character is lost.
- Caveat: It doesn't work with multibyte strings unless all of the delimiter
- characters are ASCII characters < 0x30.
-
- See also strsep().
*/
char *
__strtok_r (char *s, const char *delim, char **save_ptr)
--- /home/cvs/shishi/gl/strtok_r.h 2004/11/11 18:59:35 1.1
+++ /home/cvs/shishi/gl/strtok_r.h 2004/11/19 14:07:14 1.2
@@ -22,9 +22,32 @@
/* Get strtok_r declaration, if available. */
#include <string.h>
+/* Parse S into tokens separated by characters in DELIM.
+ If S is NULL, the saved pointer in SAVE_PTR is used as
+ the next starting point. For example:
+ char s[] = "-abc-=-def";
+ char *sp;
+ x = strtok_r(s, "-", &sp); // x = "abc", sp = "=-def"
+ x = strtok_r(NULL, "-=", &sp); // x = "def", sp = NULL
+ x = strtok_r(NULL, "=", &sp); // x = NULL
+ // s = "abc\0-def\0"
+
+ This is a variant of strtok() that is multithread-safe.
+
+ For the POSIX documentation for this function, see:
+ http://www.opengroup.org/onlinepubs/009695399/functions/strtok.html
+
+ Caveat: It modifies the original string.
+ Caveat: These functions cannot be used on constant strings.
+ Caveat: The identity of the delimiting character is lost.
+ Caveat: It doesn't work with multibyte strings unless all of the delimiter
+ characters are ASCII characters < 0x30.
+
+ See also strsep().
+*/
#if defined HAVE_DECL_STRTOK_R && !HAVE_DECL_STRTOK_R
-char *strtok_r(char *restrict s, const char *restrict sep,
- char **restrict lasts);
+extern char *strtok_r(char *restrict s, const char *restrict sep,
+ char **restrict lasts);
#endif
#endif /* STRTOK_R_H */
- CVS shishi/gl, shishi-commit, 2004/11/08
- CVS shishi/gl, shishi-commit, 2004/11/09
- CVS shishi/gl, shishi-commit, 2004/11/10
- CVS shishi/gl, shishi-commit, 2004/11/11
- CVS shishi/gl, shishi-commit, 2004/11/11
- CVS shishi/gl, shishi-commit, 2004/11/11
- CVS shishi/gl, shishi-commit, 2004/11/11
- CVS shishi/gl, shishi-commit, 2004/11/11
- CVS shishi/gl, shishi-commit, 2004/11/12
- CVS shishi/gl, shishi-commit, 2004/11/19
- CVS shishi/gl,
shishi-commit <=
- CVS shishi/gl, shishi-commit, 2004/11/21
- CVS shishi/gl, shishi-commit, 2004/11/28