summaryrefslogtreecommitdiffstats
path: root/newlib/libc/string/strsep.c
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2002-05-24 00:13:57 +0000
committerJeff Johnston <jjohnstn@redhat.com>2002-05-24 00:13:57 +0000
commit7a364eb36494dcac90196db3d93d15086d6c1bc1 (patch)
tree9df83ec6d394ab772dbcb50a69b427fe111cc697 /newlib/libc/string/strsep.c
parentbb2b4dedc6b053ee59d03cb436e937ecb9fd6571 (diff)
downloadcygnal-7a364eb36494dcac90196db3d93d15086d6c1bc1.tar.gz
cygnal-7a364eb36494dcac90196db3d93d15086d6c1bc1.tar.bz2
cygnal-7a364eb36494dcac90196db3d93d15086d6c1bc1.zip
2002-05-23 Jeff Johnston <jjohnstn@redhat.com>
* libc/string/Makefile.am: Add support for strsep.c. * libc/string/Makefile.in: Regenerated. * libc/string/strsep.c: New file. * libc/string/strtok.c: Change to call __strtok_r service routine. * libc/string/strtok_r.c: Add __strtok_r routine which takes additional flag parameter regarding whether to skip leading delimeters. Change strtok_r to call __strtok_r.
Diffstat (limited to 'newlib/libc/string/strsep.c')
-rw-r--r--newlib/libc/string/strsep.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/newlib/libc/string/strsep.c b/newlib/libc/string/strsep.c
new file mode 100644
index 000000000..d3d0ad0a9
--- /dev/null
+++ b/newlib/libc/string/strsep.c
@@ -0,0 +1,19 @@
+/* BSD strsep function */
+
+/* Copyright 2002, Red Hat Inc. */
+
+/* undef STRICT_ANSI so that strsep prototype will be defined */
+#undef __STRICT_ANSI__
+#include <string.h>
+#include <_ansi.h>
+#include <reent.h>
+
+extern char *__strtok_r (char *, const char *, char **, int);
+
+char *
+_DEFUN (strsep, (source_ptr, delim),
+ register char **source_ptr _AND
+ register const char *delim)
+{
+ return __strtok_r (*source_ptr, delim, source_ptr, 0);
+}