Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/lib/libc/string Pull up rev. 1.11 (approved by thorpej):



details:   https://anonhg.NetBSD.org/src/rev/66bba6bc9713
branches:  netbsd-1-5
changeset: 488599:66bba6bc9713
user:      kleink <kleink%NetBSD.org@localhost>
date:      Thu Jul 20 14:21:37 2000 +0000

description:
Pull up rev. 1.11 (approved by thorpej):
Describe strtok_r(3).

diffstat:

 lib/libc/string/strtok.3 |  22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diffs (46 lines):

diff -r 5fac2a8f0180 -r 66bba6bc9713 lib/libc/string/strtok.3
--- a/lib/libc/string/strtok.3  Thu Jul 20 00:30:15 2000 +0000
+++ b/lib/libc/string/strtok.3  Thu Jul 20 14:21:37 2000 +0000
@@ -34,7 +34,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     from: @(#)strtok.3     8.2 (Berkeley) 2/3/94
-.\"    $NetBSD: strtok.3,v 1.10 1999/03/22 19:44:59 garbled Exp $
+.\"    $NetBSD: strtok.3,v 1.10.10.1 2000/07/20 14:21:37 kleink Exp $
 .\"
 .Dd February 3, 1994
 .Dt STRTOK 3
@@ -51,11 +51,6 @@
 .Ft char *
 .Fn strtok_r "char *str" "const char *sep" "char **lasts"
 .Sh DESCRIPTION
-.Bf -symbolic
-This interface is obsoleted by
-.Xr strsep 3 .
-.Ef
-.Pp
 The
 .Fn strtok
 function
@@ -82,6 +77,21 @@
 .Dv NUL
 character.
 When no more tokens remain, a null pointer is returned.
+.Pp
+The
+.Fn strtok_r
+function implements the functionality of
+.Fn strtok
+but is passed an additional argument,
+.Fa lasts ,
+which points to a user-provided pointer which is used by
+.Fn strtok_r
+to store state which needs to be kept between calls to scan the same string;
+unlike
+.Fn strtok ,
+it is not necessary to delineate tokenizing to a single string at a time
+when using
+.Fn strtok_r .
 .Sh SEE ALSO
 .Xr index 3 ,
 .Xr memchr 3 ,



Home | Main Index | Thread Index | Old Index