summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/strtok.3
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2011-07-25 00:38:52 +0000
committerschwarze <schwarze@openbsd.org>2011-07-25 00:38:52 +0000
commit8c40de08f9d12a182e23e357bcca21c5be683dd9 (patch)
treedf554e154d9ded444e70f01eb8a84b1212071f78 /lib/libc/string/strtok.3
parentoccured -> occurred; (diff)
downloadwireguard-openbsd-8c40de08f9d12a182e23e357bcca21c5be683dd9.tar.xz
wireguard-openbsd-8c40de08f9d12a182e23e357bcca21c5be683dd9.zip
update HISTORY and SEE ALSO for all of string(3), together with various
smaller improvements; jmc@ and nicm@ both ask me to get this in because further tweaking will be easier in-tree
Diffstat (limited to 'lib/libc/string/strtok.3')
-rw-r--r--lib/libc/string/strtok.338
1 files changed, 26 insertions, 12 deletions
diff --git a/lib/libc/string/strtok.3 b/lib/libc/string/strtok.3
index ed7d5158eda..fbf0abfc269 100644
--- a/lib/libc/string/strtok.3
+++ b/lib/libc/string/strtok.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: strtok.3,v 1.20 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1988, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strtok.3,v 1.19 2007/05/31 19:19:32 jmc Exp $
-.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRTOK 3
.Os
.Sh NAME
@@ -73,6 +73,14 @@ function is a version of
.Fn strtok
that takes an explicit context argument and is reentrant.
.Pp
+Since
+.Fn strtok
+and
+.Fn strtok_r
+modify the string,
+.Fa str
+should not point to an area in the initialized data segment.
+.Sh RETURN VALUES
The
.Fn strtok
and
@@ -82,14 +90,6 @@ in the string, after replacing the separator character itself with an
.Tn ASCII NUL
character.
When no more tokens remain, a null pointer is returned.
-.Pp
-Since
-.Fn strtok
-and
-.Fn strtok_r
-modify the string,
-.Fa str
-should not point to an area in the initialized data segment.
.Sh EXAMPLES
The following will construct an array of pointers to each individual word in
the string
@@ -133,12 +133,26 @@ will point to
.Xr strrchr 3 ,
.Xr strsep 3 ,
.Xr strspn 3 ,
-.Xr strstr 3
+.Xr strstr 3 ,
+.Xr wcstok 3
.Sh STANDARDS
The
.Fn strtok
function conforms to
.St -ansiC .
+.Sh HISTORY
+The
+.Fn strtok
+function first appeared in
+.At III
+and was reimplemented for
+.Bx 4.3 Tahoe .
+The
+.Fn strtok_r
+function first appeared in
+.Nx 1.3
+and was reimplemented for
+.Ox 2.7 .
.Sh BUGS
The System V
.Fn strtok ,