Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/string Add a description of strtok_r(3), and rip ou...



details:   https://anonhg.NetBSD.org/src/rev/664646f513e9
branches:  trunk
changeset: 495051:664646f513e9
user:      kleink <kleink%NetBSD.org@localhost>
date:      Thu Jul 20 14:06:23 2000 +0000

description:
Add a description of strtok_r(3), and rip out the obsoleteness claim.

diffstat:

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

diffs (46 lines):

diff -r 0a255b99f09f -r 664646f513e9 lib/libc/string/strtok.3
--- a/lib/libc/string/strtok.3  Thu Jul 20 13:28:39 2000 +0000
+++ b/lib/libc/string/strtok.3  Thu Jul 20 14:06:23 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.11 2000/07/20 14:06:23 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