summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2011-07-25 00:38:53 +0000
committerschwarze <>2011-07-25 00:38:53 +0000
commit339c056f856313e215baab8ddc4bc0ce064b4571 (patch)
tree7c0511efd76ae46bc18c0955627ddf69509014c6
parent3ad0ccfe078fe407c711a9d1fb21b9b79aa67f2c (diff)
downloadopenbsd-339c056f856313e215baab8ddc4bc0ce064b4571.tar.gz
openbsd-339c056f856313e215baab8ddc4bc0ce064b4571.tar.bz2
openbsd-339c056f856313e215baab8ddc4bc0ce064b4571.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
-rw-r--r--src/lib/libc/string/bcmp.36
-rw-r--r--src/lib/libc/string/bcopy.38
-rw-r--r--src/lib/libc/string/bm.312
-rw-r--r--src/lib/libc/string/bstring.330
-rw-r--r--src/lib/libc/string/bzero.310
-rw-r--r--src/lib/libc/string/ffs.38
-rw-r--r--src/lib/libc/string/memccpy.38
-rw-r--r--src/lib/libc/string/memchr.316
-rw-r--r--src/lib/libc/string/memcmp.316
-rw-r--r--src/lib/libc/string/memcpy.322
-rw-r--r--src/lib/libc/string/memmove.314
-rw-r--r--src/lib/libc/string/memset.316
-rw-r--r--src/lib/libc/string/strcasecmp.316
-rw-r--r--src/lib/libc/string/strcat.318
-rw-r--r--src/lib/libc/string/strchr.320
-rw-r--r--src/lib/libc/string/strcmp.326
-rw-r--r--src/lib/libc/string/strcoll.39
-rw-r--r--src/lib/libc/string/strcpy.321
-rw-r--r--src/lib/libc/string/strcspn.316
-rw-r--r--src/lib/libc/string/strdup.319
-rw-r--r--src/lib/libc/string/strerror.313
-rw-r--r--src/lib/libc/string/strlcpy.314
-rw-r--r--src/lib/libc/string/strlen.312
-rw-r--r--src/lib/libc/string/strmode.36
-rw-r--r--src/lib/libc/string/strpbrk.316
-rw-r--r--src/lib/libc/string/strrchr.320
-rw-r--r--src/lib/libc/string/strsep.316
-rw-r--r--src/lib/libc/string/strsignal.311
-rw-r--r--src/lib/libc/string/strspn.316
-rw-r--r--src/lib/libc/string/strstr.318
-rw-r--r--src/lib/libc/string/strtok.338
-rw-r--r--src/lib/libc/string/strxfrm.39
-rw-r--r--src/lib/libc/string/swab.38
-rw-r--r--src/lib/libc/string/wcscasecmp.321
-rw-r--r--src/lib/libc/string/wcscat.332
-rw-r--r--src/lib/libc/string/wcschr.316
-rw-r--r--src/lib/libc/string/wcscmp.318
-rw-r--r--src/lib/libc/string/wcscpy.334
-rw-r--r--src/lib/libc/string/wcscspn.314
-rw-r--r--src/lib/libc/string/wcsdup.329
-rw-r--r--src/lib/libc/string/wcslcpy.312
-rw-r--r--src/lib/libc/string/wcslen.314
-rw-r--r--src/lib/libc/string/wcspbrk.318
-rw-r--r--src/lib/libc/string/wcsrchr.314
-rw-r--r--src/lib/libc/string/wcsspn.314
-rw-r--r--src/lib/libc/string/wcsstr.316
-rw-r--r--src/lib/libc/string/wcstok.325
-rw-r--r--src/lib/libc/string/wcswidth.315
-rw-r--r--src/lib/libc/string/wmemchr.314
-rw-r--r--src/lib/libc/string/wmemcmp.316
-rw-r--r--src/lib/libc/string/wmemcpy.320
-rw-r--r--src/lib/libc/string/wmemmove.314
-rw-r--r--src/lib/libc/string/wmemset.315
53 files changed, 642 insertions, 237 deletions
diff --git a/src/lib/libc/string/bcmp.3 b/src/lib/libc/string/bcmp.3
index 1a77750627..1660b4356b 100644
--- a/src/lib/libc/string/bcmp.3
+++ b/src/lib/libc/string/bcmp.3
@@ -27,9 +27,9 @@
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE. 28.\" SUCH DAMAGE.
29.\" 29.\"
30.\" $OpenBSD: bcmp.3,v 1.8 2010/09/24 13:33:00 matthew Exp $ 30.\" $OpenBSD: bcmp.3,v 1.9 2011/07/25 00:38:52 schwarze Exp $
31.\" 31.\"
32.Dd $Mdocdate: September 24 2010 $ 32.Dd $Mdocdate: July 25 2011 $
33.Dt BCMP 3 33.Dt BCMP 3
34.Os 34.Os
35.Sh NAME 35.Sh NAME
@@ -77,7 +77,7 @@ making it vulnerable to timing attacks.
77.Xr strcoll 3 , 77.Xr strcoll 3 ,
78.Xr strxfrm 3 78.Xr strxfrm 3
79.Sh HISTORY 79.Sh HISTORY
80A 80The
81.Fn bcmp 81.Fn bcmp
82function first appeared in 82function first appeared in
83.Bx 4.2 . 83.Bx 4.2 .
diff --git a/src/lib/libc/string/bcopy.3 b/src/lib/libc/string/bcopy.3
index 3d3c8ee958..3beaf09aca 100644
--- a/src/lib/libc/string/bcopy.3
+++ b/src/lib/libc/string/bcopy.3
@@ -28,9 +28,9 @@
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE. 29.\" SUCH DAMAGE.
30.\" 30.\"
31.\" $OpenBSD: bcopy.3,v 1.9 2007/05/31 19:19:32 jmc Exp $ 31.\" $OpenBSD: bcopy.3,v 1.10 2011/07/25 00:38:52 schwarze Exp $
32.\" 32.\"
33.Dd $Mdocdate: May 31 2007 $ 33.Dd $Mdocdate: July 25 2011 $
34.Dt BCOPY 3 34.Dt BCOPY 3
35.Os 35.Os
36.Sh NAME 36.Sh NAME
@@ -61,7 +61,7 @@ is zero, no bytes are copied.
61.Xr strlcpy 3 , 61.Xr strlcpy 3 ,
62.Xr strncpy 3 62.Xr strncpy 3
63.Sh HISTORY 63.Sh HISTORY
64A 64The
65.Fn bcopy 65.Fn bcopy
66function appeared in 66function first appeared in
67.Bx 4.2 . 67.Bx 4.2 .
diff --git a/src/lib/libc/string/bm.3 b/src/lib/libc/string/bm.3
index 749ffc9b74..6c74848ecc 100644
--- a/src/lib/libc/string/bm.3
+++ b/src/lib/libc/string/bm.3
@@ -28,9 +28,9 @@
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE. 29.\" SUCH DAMAGE.
30.\" 30.\"
31.\" $OpenBSD: bm.3,v 1.9 2007/05/31 19:19:32 jmc Exp $ 31.\" $OpenBSD: bm.3,v 1.10 2011/07/25 00:38:52 schwarze Exp $
32.\" 32.\"
33.Dd $Mdocdate: May 31 2007 $ 33.Dd $Mdocdate: July 25 2011 $
34.Dt BM 3 34.Dt BM 3
35.Os 35.Os
36.Sh NAME 36.Sh NAME
@@ -110,3 +110,11 @@ is
110.%V Volume 21, 11 (November 1991) 110.%V Volume 21, 11 (November 1991)
111.%P 1221-48 111.%P 1221-48
112.Re 112.Re
113.Sh HISTORY
114The
115.Fn bm_comp ,
116.Fn bm_exec ,
117and
118.Fn bm_free
119functions first appeared in
120.Nx 1.0 .
diff --git a/src/lib/libc/string/bstring.3 b/src/lib/libc/string/bstring.3
index cd16ab022d..c44c5386c6 100644
--- a/src/lib/libc/string/bstring.3
+++ b/src/lib/libc/string/bstring.3
@@ -27,9 +27,9 @@
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE. 28.\" SUCH DAMAGE.
29.\" 29.\"
30.\" $OpenBSD: bstring.3,v 1.8 2007/05/31 19:19:32 jmc Exp $ 30.\" $OpenBSD: bstring.3,v 1.9 2011/07/25 00:38:52 schwarze Exp $
31.\" 31.\"
32.Dd $Mdocdate: May 31 2007 $ 32.Dd $Mdocdate: July 25 2011 $
33.Dt BSTRING 3 33.Dt BSTRING 3
34.Os 34.Os
35.Sh NAME 35.Sh NAME
@@ -85,14 +85,24 @@ conform to
85.St -ansiC . 85.St -ansiC .
86.Sh HISTORY 86.Sh HISTORY
87The 87The
88.Fn bzero 88.Fn bcmp ,
89.Fn bcopy ,
89and 90and
90.Fn memccpy 91.Fn bzero
91functions appeared in 92functions first appeared in
92.Bx 4.3 . 93.Bx 4.2 .
93The 94The
94.Fn bcmp 95.Fn memchr ,
96.Fn memcmp ,
97.Fn memccpy ,
98.Fn memcpy ,
95and 99and
96.Fn bcopy 100.Fn memset
97functions appeared in 101functions first appeared in
98.Bx 4.2 . 102.At V
103and were reimplemented for
104.Bx 4.3 Tahoe .
105The
106.Fn memmove
107function first appeared in
108.Bx 4.3 Reno .
diff --git a/src/lib/libc/string/bzero.3 b/src/lib/libc/string/bzero.3
index c5ca32f4d2..c79470377f 100644
--- a/src/lib/libc/string/bzero.3
+++ b/src/lib/libc/string/bzero.3
@@ -27,9 +27,9 @@
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE. 28.\" SUCH DAMAGE.
29.\" 29.\"
30.\" $OpenBSD: bzero.3,v 1.7 2007/05/31 19:19:32 jmc Exp $ 30.\" $OpenBSD: bzero.3,v 1.8 2011/07/25 00:38:52 schwarze Exp $
31.\" 31.\"
32.Dd $Mdocdate: May 31 2007 $ 32.Dd $Mdocdate: July 25 2011 $
33.Dt BZERO 3 33.Dt BZERO 3
34.Os 34.Os
35.Sh NAME 35.Sh NAME
@@ -55,7 +55,7 @@ does nothing.
55.Xr memset 3 , 55.Xr memset 3 ,
56.Xr swab 3 56.Xr swab 3
57.Sh HISTORY 57.Sh HISTORY
58A 58The
59.Fn bzero 59.Fn bzero
60function appeared in 60function first appeared in
61.Bx 4.3 . 61.Bx 4.2 .
diff --git a/src/lib/libc/string/ffs.3 b/src/lib/libc/string/ffs.3
index 27b26969e5..6f150c46c4 100644
--- a/src/lib/libc/string/ffs.3
+++ b/src/lib/libc/string/ffs.3
@@ -27,9 +27,9 @@
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE. 28.\" SUCH DAMAGE.
29.\" 29.\"
30.\" $OpenBSD: ffs.3,v 1.5 2007/05/31 19:19:32 jmc Exp $ 30.\" $OpenBSD: ffs.3,v 1.6 2011/07/25 00:38:52 schwarze Exp $
31.\" 31.\"
32.Dd $Mdocdate: May 31 2007 $ 32.Dd $Mdocdate: July 25 2011 $
33.Dt FFS 3 33.Dt FFS 3
34.Os 34.Os
35.Sh NAME 35.Sh NAME
@@ -52,5 +52,5 @@ A return value of 0 means that the argument was zero.
52.Sh HISTORY 52.Sh HISTORY
53The 53The
54.Fn ffs 54.Fn ffs
55function appeared in 55function first appeared in
56.Bx 4.3 . 56.Bx 4.2 .
diff --git a/src/lib/libc/string/memccpy.3 b/src/lib/libc/string/memccpy.3
index ef53d95645..f8f880e3b1 100644
--- a/src/lib/libc/string/memccpy.3
+++ b/src/lib/libc/string/memccpy.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: memccpy.3,v 1.9 2007/05/31 19:19:32 jmc Exp $ 1.\" $OpenBSD: memccpy.3,v 1.10 2011/07/25 00:38:52 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 1990, 1991, 1993 3.\" Copyright (c) 1990, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
29.\" 29.\"
30.\" @(#)memccpy.3 8.1 (Berkeley) 6/9/93 30.\" @(#)memccpy.3 8.1 (Berkeley) 6/9/93
31.\" 31.\"
32.Dd $Mdocdate: May 31 2007 $ 32.Dd $Mdocdate: July 25 2011 $
33.Dt MEMCCPY 3 33.Dt MEMCCPY 3
34.Os 34.Os
35.Sh NAME 35.Sh NAME
@@ -70,4 +70,6 @@ bytes are copied, and a null pointer is returned.
70The 70The
71.Fn memccpy 71.Fn memccpy
72function first appeared in 72function first appeared in
73.Bx 4.4 . 73.At V
74and was reimplemented for
75.Bx 4.3 Tahoe .
diff --git a/src/lib/libc/string/memchr.3 b/src/lib/libc/string/memchr.3
index 558848ac23..56a4e4780e 100644
--- a/src/lib/libc/string/memchr.3
+++ b/src/lib/libc/string/memchr.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: memchr.3,v 1.10 2011/07/25 00:38:52 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: memchr.3,v 1.9 2007/09/03 16:50:14 jmc Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: September 3 2007 $
35.Dt MEMCHR 3 35.Dt MEMCHR 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -79,7 +79,8 @@ bytes.
79.Xr strsep 3 , 79.Xr strsep 3 ,
80.Xr strspn 3 , 80.Xr strspn 3 ,
81.Xr strstr 3 , 81.Xr strstr 3 ,
82.Xr strtok 3 82.Xr strtok 3 ,
83.Xr wmemchr 3
83.Sh STANDARDS 84.Sh STANDARDS
84The 85The
85.Fn memchr 86.Fn memchr
@@ -91,3 +92,10 @@ The
91function is an 92function is an
92.Ox 93.Ox
93extension. 94extension.
95.Sh HISTORY
96The
97.Fn memchr
98function first appeared in
99.At V
100and was reimplemented for
101.Bx 4.3 Tahoe .
diff --git a/src/lib/libc/string/memcmp.3 b/src/lib/libc/string/memcmp.3
index 8c35f388f2..951a04ed8a 100644
--- a/src/lib/libc/string/memcmp.3
+++ b/src/lib/libc/string/memcmp.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: memcmp.3,v 1.7 2011/07/25 00:38:52 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: memcmp.3,v 1.6 2007/05/31 19:19:32 jmc Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: May 31 2007 $
35.Dt MEMCMP 3 35.Dt MEMCMP 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -69,9 +69,17 @@ Zero-length strings are always identical.
69.Xr strcasecmp 3 , 69.Xr strcasecmp 3 ,
70.Xr strcmp 3 , 70.Xr strcmp 3 ,
71.Xr strcoll 3 , 71.Xr strcoll 3 ,
72.Xr strxfrm 3 72.Xr strxfrm 3 ,
73.Xr wmemcmp 3
73.Sh STANDARDS 74.Sh STANDARDS
74The 75The
75.Fn memcmp 76.Fn memcmp
76function conforms to 77function conforms to
77.St -ansiC . 78.St -ansiC .
79.Sh HISTORY
80The
81.Fn memcmp
82function first appeared in
83.At V
84and was reimplemented for
85.Bx 4.3 Tahoe .
diff --git a/src/lib/libc/string/memcpy.3 b/src/lib/libc/string/memcpy.3
index 1deb03631b..e95d670ad9 100644
--- a/src/lib/libc/string/memcpy.3
+++ b/src/lib/libc/string/memcpy.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: memcpy.3,v 1.8 2011/07/25 00:38:52 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: memcpy.3,v 1.7 2007/05/31 19:19:32 jmc Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: May 31 2007 $
35.Dt MEMCPY 3 35.Dt MEMCPY 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -60,18 +60,26 @@ function returns the original value of
60.Xr memccpy 3 , 60.Xr memccpy 3 ,
61.Xr memmove 3 , 61.Xr memmove 3 ,
62.Xr strcpy 3 , 62.Xr strcpy 3 ,
63.Xr strlcpy 3 63.Xr strlcpy 3 ,
64.Xr wmemcpy 3
64.Sh STANDARDS 65.Sh STANDARDS
65The 66The
66.Fn memcpy 67.Fn memcpy
67function conforms to 68function conforms to
68.St -ansiC . 69.St -ansiC .
69.Sh BUGS 70.Sh HISTORY
71The
72.Fn memcpy
73function first appeared in
74.At V
75and was reimplemented for
76.Bx 4.3 Tahoe .
77.Sh CAVEATS
70In this implementation 78In this implementation
71.Fn memcpy 79.Fn memcpy
72is implemented using 80is implemented using
73.Xr bcopy 3 , 81.Xr bcopy 3 ,
74and therefore the buffers may overlap. 82and therefore the buffers may overlap.
75On other systems, copying overlapping buffers may produce surprises. 83On other systems, copying overlapping buffers may produce surprises.
76A simpler solution is to not use 84A portable, safe solution is to use
77.Fn memcpy . 85.Xr memmove 3 .
diff --git a/src/lib/libc/string/memmove.3 b/src/lib/libc/string/memmove.3
index c6e3912669..ae8569a1c7 100644
--- a/src/lib/libc/string/memmove.3
+++ b/src/lib/libc/string/memmove.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: memmove.3,v 1.8 2011/07/25 00:38:52 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: memmove.3,v 1.7 2007/05/31 19:19:32 jmc Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: May 31 2007 $
35.Dt MEMMOVE 3 35.Dt MEMMOVE 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -62,9 +62,15 @@ function returns the original value of
62.Xr memccpy 3 , 62.Xr memccpy 3 ,
63.Xr memcpy 3 , 63.Xr memcpy 3 ,
64.Xr strcpy 3 , 64.Xr strcpy 3 ,
65.Xr strlcpy 3 65.Xr strlcpy 3 ,
66.Xr wmemmove 3
66.Sh STANDARDS 67.Sh STANDARDS
67The 68The
68.Fn memmove 69.Fn memmove
69function conforms to 70function conforms to
70.St -ansiC . 71.St -ansiC .
72.Sh HISTORY
73The
74.Fn memmove
75function first appeared in
76.Bx 4.3 Reno .
diff --git a/src/lib/libc/string/memset.3 b/src/lib/libc/string/memset.3
index 7799b5e2d2..db94cb9ba6 100644
--- a/src/lib/libc/string/memset.3
+++ b/src/lib/libc/string/memset.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: memset.3,v 1.7 2011/07/25 00:38:52 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: memset.3,v 1.6 2007/05/31 19:19:32 jmc Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: May 31 2007 $
35.Dt MEMSET 3 35.Dt MEMSET 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -59,9 +59,17 @@ function returns the original value of
59.Fa b . 59.Fa b .
60.Sh SEE ALSO 60.Sh SEE ALSO
61.Xr bzero 3 , 61.Xr bzero 3 ,
62.Xr swab 3 62.Xr swab 3 ,
63.Xr wmemset 3
63.Sh STANDARDS 64.Sh STANDARDS
64The 65The
65.Fn memset 66.Fn memset
66function conforms to 67function conforms to
67.St -ansiC . 68.St -ansiC .
69.Sh HISTORY
70The
71.Fn memset
72function first appeared in
73.At V
74and was reimplemented for
75.Bx 4.3 Tahoe .
diff --git a/src/lib/libc/string/strcasecmp.3 b/src/lib/libc/string/strcasecmp.3
index c17aa694d1..0900c8a97a 100644
--- a/src/lib/libc/string/strcasecmp.3
+++ b/src/lib/libc/string/strcasecmp.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: strcasecmp.3,v 1.10 2007/05/31 19:19:32 jmc Exp $ 1.\" $OpenBSD: strcasecmp.3,v 1.11 2011/07/25 00:38:52 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 1990, 1991, 1993 3.\" Copyright (c) 1990, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -31,7 +31,7 @@
31.\" 31.\"
32.\" @(#)strcasecmp.3 8.1 (Berkeley) 6/9/93 32.\" @(#)strcasecmp.3 8.1 (Berkeley) 6/9/93
33.\" 33.\"
34.Dd $Mdocdate: May 31 2007 $ 34.Dd $Mdocdate: July 25 2011 $
35.Dt STRCASECMP 3 35.Dt STRCASECMP 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -74,11 +74,19 @@ characters.
74.Xr memcmp 3 , 74.Xr memcmp 3 ,
75.Xr strcmp 3 , 75.Xr strcmp 3 ,
76.Xr strcoll 3 , 76.Xr strcoll 3 ,
77.Xr strxfrm 3 77.Xr strxfrm 3 ,
78.Xr wcscasecmp 3
79.Sh STANDARDS
80The
81.Fn strcasecmp
82and
83.Fn strncasecmp
84functions conform to
85.St -p1003.1-2008 .
78.Sh HISTORY 86.Sh HISTORY
79The 87The
80.Fn strcasecmp 88.Fn strcasecmp
81and 89and
82.Fn strncasecmp 90.Fn strncasecmp
83functions first appeared in 91functions first appeared in
84.Bx 4.4 . 92.Bx 4.3 Tahoe .
diff --git a/src/lib/libc/string/strcat.3 b/src/lib/libc/string/strcat.3
index 4068db752c..81aae19a63 100644
--- a/src/lib/libc/string/strcat.3
+++ b/src/lib/libc/string/strcat.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: strcat.3,v 1.13 2011/07/25 00:38:52 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: strcat.3,v 1.12 2007/05/31 19:19:32 jmc Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: May 31 2007 $
35.Dt STRCAT 3 35.Dt STRCAT 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -122,8 +122,9 @@ functions are a better choice, as shown below.
122.Xr memcpy 3 , 122.Xr memcpy 3 ,
123.Xr memmove 3 , 123.Xr memmove 3 ,
124.Xr strcpy 3 , 124.Xr strcpy 3 ,
125.Xr strlcat 3 , 125.Xr strlcpy 3 ,
126.Xr strlcpy 3 126.Xr wcscat 3 ,
127.Xr wcslcpy 3
127.Sh STANDARDS 128.Sh STANDARDS
128The 129The
129.Fn strcat 130.Fn strcat
@@ -131,3 +132,10 @@ and
131.Fn strncat 132.Fn strncat
132functions conform to 133functions conform to
133.St -ansiC . 134.St -ansiC .
135.Sh HISTORY
136The
137.Fn strcat
138and
139.Fn strncat
140functions first appeared in
141.At v7 .
diff --git a/src/lib/libc/string/strchr.3 b/src/lib/libc/string/strchr.3
index 6a9de9604e..d3194dffab 100644
--- a/src/lib/libc/string/strchr.3
+++ b/src/lib/libc/string/strchr.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: strchr.3,v 1.10 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: strchr.3,v 1.9 2007/05/31 19:19:32 jmc Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: May 31 2007 $
35.Dt STRCHR 3 35.Dt STRCHR 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -90,7 +90,8 @@ p = strchr(s, 'o');
90.Xr strsep 3 , 90.Xr strsep 3 ,
91.Xr strspn 3 , 91.Xr strspn 3 ,
92.Xr strstr 3 , 92.Xr strstr 3 ,
93.Xr strtok 3 93.Xr strtok 3 ,
94.Xr wcschr 3
94.Sh STANDARDS 95.Sh STANDARDS
95The 96The
96.Fn strchr 97.Fn strchr
@@ -100,3 +101,14 @@ function conforms to
100The 101The
101.Fn index 102.Fn index
102function is deprecated and shouldn't be used in new code. 103function is deprecated and shouldn't be used in new code.
104.Sh HISTORY
105The
106.Fn index
107function first appeared in
108.At v7 .
109The
110.Fn strchr
111function first appeared in
112.At III
113and was reimplemented for
114.Bx 4.3 Tahoe .
diff --git a/src/lib/libc/string/strcmp.3 b/src/lib/libc/string/strcmp.3
index 8b63772bdc..aea2023b7b 100644
--- a/src/lib/libc/string/strcmp.3
+++ b/src/lib/libc/string/strcmp.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: strcmp.3,v 1.11 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: strcmp.3,v 1.10 2009/12/05 07:45:48 jmc Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: December 5 2009 $
35.Dt STRCMP 3 35.Dt STRCMP 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -53,6 +53,11 @@ functions lexicographically compare the NUL-terminated strings
53.Fa s1 53.Fa s1
54and 54and
55.Fa s2 . 55.Fa s2 .
56The
57.Fn strncmp
58function compares at most
59.Fa len
60characters.
56.Sh RETURN VALUES 61.Sh RETURN VALUES
57The 62The
58.Fn strcmp 63.Fn strcmp
@@ -67,17 +72,13 @@ The comparison is done using unsigned characters, so that
67.Ql \e200 72.Ql \e200
68is greater than 73is greater than
69.Ql \e0 . 74.Ql \e0 .
70.Pp
71.Fn strncmp
72compares at most
73.Fa len
74characters.
75.Sh SEE ALSO 75.Sh SEE ALSO
76.Xr bcmp 3 , 76.Xr bcmp 3 ,
77.Xr memcmp 3 , 77.Xr memcmp 3 ,
78.Xr strcasecmp 3 , 78.Xr strcasecmp 3 ,
79.Xr strcoll 3 , 79.Xr strcoll 3 ,
80.Xr strxfrm 3 80.Xr strxfrm 3 ,
81.Xr wcscmp
81.Sh STANDARDS 82.Sh STANDARDS
82The 83The
83.Fn strcmp 84.Fn strcmp
@@ -85,3 +86,10 @@ and
85.Fn strncmp 86.Fn strncmp
86functions conform to 87functions conform to
87.St -ansiC . 88.St -ansiC .
89.Sh HISTORY
90The
91.Fn strcmp
92and
93.Fn strncmp
94functions first appeared in
95.At v7 .
diff --git a/src/lib/libc/string/strcoll.3 b/src/lib/libc/string/strcoll.3
index ea7452a749..72e398c44c 100644
--- a/src/lib/libc/string/strcoll.3
+++ b/src/lib/libc/string/strcoll.3
@@ -29,9 +29,9 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
31.\" 31.\"
32.\" $OpenBSD: strcoll.3,v 1.7 2007/05/31 19:19:32 jmc Exp $ 32.\" $OpenBSD: strcoll.3,v 1.8 2011/07/25 00:38:53 schwarze Exp $
33.\" 33.\"
34.Dd $Mdocdate: May 31 2007 $ 34.Dd $Mdocdate: July 25 2011 $
35.Dt STRCOLL 3 35.Dt STRCOLL 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -66,3 +66,8 @@ The
66.Fn strcoll 66.Fn strcoll
67function conforms to 67function conforms to
68.St -ansiC . 68.St -ansiC .
69.Sh HISTORY
70The
71.Fn strcoll
72function first appeared in
73.Bx 4.3 Reno .
diff --git a/src/lib/libc/string/strcpy.3 b/src/lib/libc/string/strcpy.3
index 428e474d43..400eeee622 100644
--- a/src/lib/libc/string/strcpy.3
+++ b/src/lib/libc/string/strcpy.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: strcpy.3,v 1.16 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: strcpy.3,v 1.15 2007/05/31 19:19:32 jmc Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: May 31 2007 $
35.Dt STRCPY 3 35.Dt STRCPY 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -57,8 +57,9 @@ to
57.Ql \e0 57.Ql \e0
58character). 58character).
59.Pp 59.Pp
60The
60.Fn strncpy 61.Fn strncpy
61copies not more than 62function copies not more than
62.Fa len 63.Fa len
63characters into 64characters into
64.Fa dst , 65.Fa dst ,
@@ -141,7 +142,10 @@ is simply:
141.Xr memccpy 3 , 142.Xr memccpy 3 ,
142.Xr memcpy 3 , 143.Xr memcpy 3 ,
143.Xr memmove 3 , 144.Xr memmove 3 ,
144.Xr strlcpy 3 145.Xr strcat 3 ,
146.Xr strlcpy 3 ,
147.Xr wcscpy 3 ,
148.Xr wcslcpy 3
145.Sh STANDARDS 149.Sh STANDARDS
146The 150The
147.Fn strcpy 151.Fn strcpy
@@ -149,3 +153,10 @@ and
149.Fn strncpy 153.Fn strncpy
150functions conform to 154functions conform to
151.St -ansiC . 155.St -ansiC .
156.Sh HISTORY
157The
158.Fn strcpy
159and
160.Fn strncpy
161functions first appeared in
162.At v7 .
diff --git a/src/lib/libc/string/strcspn.3 b/src/lib/libc/string/strcspn.3
index 21c727344d..70c8ef7612 100644
--- a/src/lib/libc/string/strcspn.3
+++ b/src/lib/libc/string/strcspn.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: strcspn.3,v 1.10 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: strcspn.3,v 1.9 2007/08/08 07:20:45 ray Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: August 8 2007 $
35.Dt STRCSPN 3 35.Dt STRCSPN 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -92,9 +92,17 @@ if (fgets(line, sizeof(line), fp) != NULL)
92.Xr strsep 3 , 92.Xr strsep 3 ,
93.Xr strspn 3 , 93.Xr strspn 3 ,
94.Xr strstr 3 , 94.Xr strstr 3 ,
95.Xr strtok 3 95.Xr strtok 3 ,
96.Xr wcscspn 3
96.Sh STANDARDS 97.Sh STANDARDS
97The 98The
98.Fn strcspn 99.Fn strcspn
99function conforms to 100function conforms to
100.St -ansiC . 101.St -ansiC .
102.Sh HISTORY
103The
104.Fn strcspn
105function first appeared in
106.At III
107and was reimplemented for
108.Bx 4.3 Tahoe .
diff --git a/src/lib/libc/string/strdup.3 b/src/lib/libc/string/strdup.3
index 42a578b913..02d5666a9c 100644
--- a/src/lib/libc/string/strdup.3
+++ b/src/lib/libc/string/strdup.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: strdup.3,v 1.17 2010/05/19 06:32:43 jmc Exp $ 1.\" $OpenBSD: strdup.3,v 1.18 2011/07/25 00:38:53 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 1990, 1991, 1993 3.\" Copyright (c) 1990, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
29.\" 29.\"
30.\" @(#)strdup.3 8.1 (Berkeley) 6/9/93 30.\" @(#)strdup.3 8.1 (Berkeley) 6/9/93
31.\" 31.\"
32.Dd $Mdocdate: May 19 2010 $ 32.Dd $Mdocdate: July 25 2011 $
33.Dt STRDUP 3 33.Dt STRDUP 3
34.Os 34.Os
35.Sh NAME 35.Sh NAME
@@ -73,10 +73,8 @@ to an allocated area of memory containing the NUL-terminated string
73char *p; 73char *p;
74 74
75p = strdup("foobar"); 75p = strdup("foobar");
76if (p == NULL) { 76if (p == NULL)
77 fprintf(stderr, "Out of memory.\en"); 77 err(1, NULL);
78 exit(1);
79}
80.Ed 78.Ed
81.Sh ERRORS 79.Sh ERRORS
82The 80The
@@ -90,7 +88,8 @@ for any of the errors specified for the library function
90.Xr malloc 3 , 88.Xr malloc 3 ,
91.Xr strcpy 3 , 89.Xr strcpy 3 ,
92.Xr strlcpy 3 , 90.Xr strlcpy 3 ,
93.Xr strlen 3 91.Xr strlen 3 ,
92.Xr wcsdup 3
94.Sh STANDARDS 93.Sh STANDARDS
95The 94The
96.Fn strdup 95.Fn strdup
@@ -102,8 +101,10 @@ functions conform to
102The 101The
103.Fn strdup 102.Fn strdup
104function first appeared in 103function first appeared in
105.Bx 4.4 . 104.Bx 4.3 Reno .
106The 105The
107.Fn strndup 106.Fn strndup
108function first appeared in 107function appeared in glibc 2.0, was reimplemented for
108.Nx 4.0 ,
109and ported to
109.Ox 4.8 . 110.Ox 4.8 .
diff --git a/src/lib/libc/string/strerror.3 b/src/lib/libc/string/strerror.3
index 84c64c10bb..f3f80432c3 100644
--- a/src/lib/libc/string/strerror.3
+++ b/src/lib/libc/string/strerror.3
@@ -29,9 +29,9 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
31.\" 31.\"
32.\" $OpenBSD: strerror.3,v 1.9 2007/05/31 19:19:32 jmc Exp $ 32.\" $OpenBSD: strerror.3,v 1.10 2011/07/25 00:38:53 schwarze Exp $
33.\" 33.\"
34.Dd $Mdocdate: May 31 2007 $ 34.Dd $Mdocdate: July 25 2011 $
35.Dt STRERROR 3 35.Dt STRERROR 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -111,3 +111,12 @@ The
111.Fn strerror_r 111.Fn strerror_r
112function conforms to 112function conforms to
113.St -p1003.1 . 113.St -p1003.1 .
114.Sh HISTORY
115The
116.Fn strerror
117function first appeared in
118.Bx 4.3 Reno .
119The
120.Fn strerror_r
121function first appeared in
122.Ox 3.3 .
diff --git a/src/lib/libc/string/strlcpy.3 b/src/lib/libc/string/strlcpy.3
index feda63fae7..ead54ec438 100644
--- a/src/lib/libc/string/strlcpy.3
+++ b/src/lib/libc/string/strlcpy.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: strlcpy.3,v 1.19 2007/05/31 19:19:32 jmc Exp $ 1.\" $OpenBSD: strlcpy.3,v 1.20 2011/07/25 00:38:53 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 1998, 2000 Todd C. Miller <Todd.Miller@courtesan.com> 3.\" Copyright (c) 1998, 2000 Todd C. Miller <Todd.Miller@courtesan.com>
4.\" 4.\"
@@ -14,7 +14,7 @@
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\" 16.\"
17.Dd $Mdocdate: May 31 2007 $ 17.Dd $Mdocdate: July 25 2011 $
18.Dt STRLCPY 3 18.Dt STRLCPY 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -176,7 +176,8 @@ As a matter of fact, the first version of this manual page got it wrong.
176.Sh SEE ALSO 176.Sh SEE ALSO
177.Xr snprintf 3 , 177.Xr snprintf 3 ,
178.Xr strncat 3 , 178.Xr strncat 3 ,
179.Xr strncpy 3 179.Xr strncpy 3 ,
180.Xr wcslcpy 3
180.Sh HISTORY 181.Sh HISTORY
181The 182The
182.Fn strlcpy 183.Fn strlcpy
@@ -184,3 +185,10 @@ and
184.Fn strlcat 185.Fn strlcat
185functions first appeared in 186functions first appeared in
186.Ox 2.4 . 187.Ox 2.4 .
188.Sh AUTHORS
189The
190.Fn strlcpy
191and
192.Fn strlcat
193functions were created by
194.An Todd C. Miller Aq Todd.Miller@courtesan.com .
diff --git a/src/lib/libc/string/strlen.3 b/src/lib/libc/string/strlen.3
index 3607fde515..9187496a00 100644
--- a/src/lib/libc/string/strlen.3
+++ b/src/lib/libc/string/strlen.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: strlen.3,v 1.10 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: strlen.3,v 1.9 2010/05/24 21:27:25 millert Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: May 24 2010 $
35.Dt STRLEN 3 35.Dt STRLEN 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -78,7 +78,8 @@ or
78.Fa maxlen , 78.Fa maxlen ,
79whichever is smaller. 79whichever is smaller.
80.Sh SEE ALSO 80.Sh SEE ALSO
81.Xr string 3 81.Xr string 3 ,
82.Xr wcslen 3
82.Sh STANDARDS 83.Sh STANDARDS
83The 84The
84.Fn strlen 85.Fn strlen
@@ -98,5 +99,6 @@ function first appeared in
98.At v7 . 99.At v7 .
99The 100The
100.Fn strnlen 101.Fn strnlen
101function first appeared in 102function appeared in glibc 2.0
103and was reimplemented for
102.Ox 4.8 . 104.Ox 4.8 .
diff --git a/src/lib/libc/string/strmode.3 b/src/lib/libc/string/strmode.3
index ebeafcaf6e..5d371b38c8 100644
--- a/src/lib/libc/string/strmode.3
+++ b/src/lib/libc/string/strmode.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: strmode.3,v 1.14 2007/05/31 19:19:32 jmc Exp $ 1.\" $OpenBSD: strmode.3,v 1.15 2011/07/25 00:38:53 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 1990, 1991, 1993 3.\" Copyright (c) 1990, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
29.\" 29.\"
30.\" @(#)strmode.3 8.3 (Berkeley) 7/28/94 30.\" @(#)strmode.3 8.3 (Berkeley) 7/28/94
31.\" 31.\"
32.Dd $Mdocdate: May 31 2007 $ 32.Dd $Mdocdate: July 25 2011 $
33.Dt STRMODE 3 33.Dt STRMODE 3
34.Os 34.Os
35.Sh NAME 35.Sh NAME
@@ -154,4 +154,4 @@ function always returns 0.
154The 154The
155.Fn strmode 155.Fn strmode
156function first appeared in 156function first appeared in
157.Bx 4.4 . 157.Bx 4.3 Reno .
diff --git a/src/lib/libc/string/strpbrk.3 b/src/lib/libc/string/strpbrk.3
index 9d6c676c8d..9e13c42ad0 100644
--- a/src/lib/libc/string/strpbrk.3
+++ b/src/lib/libc/string/strpbrk.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: strpbrk.3,v 1.9 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: strpbrk.3,v 1.8 2007/05/31 19:19:32 jmc Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: May 31 2007 $
35.Dt STRPBRK 3 35.Dt STRPBRK 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -64,9 +64,17 @@ returns
64.Xr strsep 3 , 64.Xr strsep 3 ,
65.Xr strspn 3 , 65.Xr strspn 3 ,
66.Xr strstr 3 , 66.Xr strstr 3 ,
67.Xr strtok 3 67.Xr strtok 3 ,
68.Xr wcspbrk 3
68.Sh STANDARDS 69.Sh STANDARDS
69The 70The
70.Fn strpbrk 71.Fn strpbrk
71function conforms to 72function conforms to
72.St -ansiC . 73.St -ansiC .
74.Sh HISTORY
75The
76.Fn strpbrk
77function first appeared in
78.At III
79and was reimplemented for
80.Bx 4.3 Tahoe .
diff --git a/src/lib/libc/string/strrchr.3 b/src/lib/libc/string/strrchr.3
index 0d1f4be971..9eea08b0a9 100644
--- a/src/lib/libc/string/strrchr.3
+++ b/src/lib/libc/string/strrchr.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: strrchr.3,v 1.9 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: strrchr.3,v 1.8 2007/05/31 19:19:32 jmc Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: May 31 2007 $
35.Dt STRRCHR 3 35.Dt STRRCHR 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -92,7 +92,8 @@ p = strrchr(s, 'o');
92.Xr strsep 3 , 92.Xr strsep 3 ,
93.Xr strspn 3 , 93.Xr strspn 3 ,
94.Xr strstr 3 , 94.Xr strstr 3 ,
95.Xr strtok 3 95.Xr strtok 3 ,
96.Xr wcsrchr 3
96.Sh STANDARDS 97.Sh STANDARDS
97The 98The
98.Fn strrchr 99.Fn strrchr
@@ -102,3 +103,14 @@ function conforms to
102The 103The
103.Fn rindex 104.Fn rindex
104function is deprecated and shouldn't be used in new code. 105function is deprecated and shouldn't be used in new code.
106.Sh HISTORY
107The
108.Fn rindex
109function first appeared in
110.At v7 .
111The
112.Fn strrchr
113function first appeared in
114.At III
115and was reimplemented for
116.Bx 4.3 Tahoe .
diff --git a/src/lib/libc/string/strsep.3 b/src/lib/libc/string/strsep.3
index cceeda7577..63cdf2333a 100644
--- a/src/lib/libc/string/strsep.3
+++ b/src/lib/libc/string/strsep.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: strsep.3,v 1.12 2007/05/31 19:19:32 jmc Exp $ 1.\" $OpenBSD: strsep.3,v 1.13 2011/07/25 00:38:53 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 1990, 1991, 1993 3.\" Copyright (c) 1990, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -32,7 +32,7 @@
32.\" 32.\"
33.\" @(#)strsep.3 8.1 (Berkeley) 6/9/93 33.\" @(#)strsep.3 8.1 (Berkeley) 6/9/93
34.\" 34.\"
35.Dd $Mdocdate: May 31 2007 $ 35.Dd $Mdocdate: July 25 2011 $
36.Dt STRSEP 3 36.Dt STRSEP 3
37.Os 37.Os
38.Sh NAME 38.Sh NAME
@@ -96,17 +96,15 @@ for (ap = argv; ap < &argv[9] &&
96.Sh HISTORY 96.Sh HISTORY
97The 97The
98.Fn strsep 98.Fn strsep
99function is intended as a replacement for the 99function first appeared in
100.Fn strtok 100.Bx 4.3 Reno .
101It is intended as a replacement for the
102.Xr strtok 3
101function. 103function.
102While the 104While the
103.Fn strtok 105.Xr strtok 3
104function should be preferred for portability reasons (it conforms to 106function should be preferred for portability reasons (it conforms to
105.St -ansiC ) 107.St -ansiC )
106it is unable to handle empty fields, i.e., detect fields delimited by 108it is unable to handle empty fields, i.e., detect fields delimited by
107two adjacent delimiter characters, or to be used for more than a single 109two adjacent delimiter characters, or to be used for more than a single
108string at a time. 110string at a time.
109The
110.Fn strsep
111function first appeared in
112.Bx 4.4 .
diff --git a/src/lib/libc/string/strsignal.3 b/src/lib/libc/string/strsignal.3
index 839402dcb1..1f9cfc7ef5 100644
--- a/src/lib/libc/string/strsignal.3
+++ b/src/lib/libc/string/strsignal.3
@@ -29,9 +29,9 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
31.\" 31.\"
32.\" $OpenBSD: strsignal.3,v 1.5 2007/05/31 19:19:32 jmc Exp $ 32.\" $OpenBSD: strsignal.3,v 1.6 2011/07/25 00:38:53 schwarze Exp $
33.\" 33.\"
34.Dd $Mdocdate: May 31 2007 $ 34.Dd $Mdocdate: July 25 2011 $
35.Dt STRSIGNAL 3 35.Dt STRSIGNAL 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -54,3 +54,10 @@ overwritten by subsequent calls to
54.Xr intro 2 , 54.Xr intro 2 ,
55.Xr psignal 3 , 55.Xr psignal 3 ,
56.Xr setlocale 3 56.Xr setlocale 3
57.Sh HISTORY
58The
59.Fn strsignal
60function first appeared in
61.At V.4
62and was reimplemented for
63.Nx 1.0 .
diff --git a/src/lib/libc/string/strspn.3 b/src/lib/libc/string/strspn.3
index f902ca35d2..b1a2ae3014 100644
--- a/src/lib/libc/string/strspn.3
+++ b/src/lib/libc/string/strspn.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: strspn.3,v 1.10 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: strspn.3,v 1.9 2007/05/31 19:19:32 jmc Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: May 31 2007 $
35.Dt STRSPN 3 35.Dt STRSPN 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -76,9 +76,17 @@ span = strspn(s, charset);
76.Xr strrchr 3 , 76.Xr strrchr 3 ,
77.Xr strsep 3 , 77.Xr strsep 3 ,
78.Xr strstr 3 , 78.Xr strstr 3 ,
79.Xr strtok 3 79.Xr strtok 3 ,
80.Xr wcsspn 3
80.Sh STANDARDS 81.Sh STANDARDS
81The 82The
82.Fn strspn 83.Fn strspn
83function conforms to 84function conforms to
84.St -ansiC . 85.St -ansiC .
86.Sh HISTORY
87The
88.Fn strspn
89function first appeared in
90.At III
91and was reimplemented for
92.Bx 4.3 Tahoe .
diff --git a/src/lib/libc/string/strstr.3 b/src/lib/libc/string/strstr.3
index 38bd207727..4069d55ed2 100644
--- a/src/lib/libc/string/strstr.3
+++ b/src/lib/libc/string/strstr.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: strstr.3,v 1.11 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: strstr.3,v 1.10 2007/09/19 16:06:45 jmc Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: September 19 2007 $
35.Dt STRSTR 3 35.Dt STRSTR 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -79,7 +79,8 @@ is returned.
79.Xr strrchr 3 , 79.Xr strrchr 3 ,
80.Xr strsep 3 , 80.Xr strsep 3 ,
81.Xr strspn 3 , 81.Xr strspn 3 ,
82.Xr strtok 3 82.Xr strtok 3 ,
83.Xr wcsstr 3
83.Sh STANDARDS 84.Sh STANDARDS
84The 85The
85.Fn strstr 86.Fn strstr
@@ -87,6 +88,13 @@ function conforms to
87.St -ansiC . 88.St -ansiC .
88.Sh HISTORY 89.Sh HISTORY
89The 90The
90.Fn strcasestr 91.Fn strstr
91function first appeared in 92function first appeared in
93.Bx 4.3 Reno .
94The
95.Fn strcasestr
96function appeared in glibc 2.1,
97was reimplemented for
98.Fx 4.5
99and ported to
92.Ox 3.8 . 100.Ox 3.8 .
diff --git a/src/lib/libc/string/strtok.3 b/src/lib/libc/string/strtok.3
index ed7d5158ed..fbf0abfc26 100644
--- a/src/lib/libc/string/strtok.3
+++ b/src/lib/libc/string/strtok.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: strtok.3,v 1.20 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1988, 1991 The Regents of the University of California. 3.\" Copyright (c) 1988, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: strtok.3,v 1.19 2007/05/31 19:19:32 jmc Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: May 31 2007 $
35.Dt STRTOK 3 35.Dt STRTOK 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -73,6 +73,14 @@ function is a version of
73.Fn strtok 73.Fn strtok
74that takes an explicit context argument and is reentrant. 74that takes an explicit context argument and is reentrant.
75.Pp 75.Pp
76Since
77.Fn strtok
78and
79.Fn strtok_r
80modify the string,
81.Fa str
82should not point to an area in the initialized data segment.
83.Sh RETURN VALUES
76The 84The
77.Fn strtok 85.Fn strtok
78and 86and
@@ -82,14 +90,6 @@ in the string, after replacing the separator character itself with an
82.Tn ASCII NUL 90.Tn ASCII NUL
83character. 91character.
84When no more tokens remain, a null pointer is returned. 92When no more tokens remain, a null pointer is returned.
85.Pp
86Since
87.Fn strtok
88and
89.Fn strtok_r
90modify the string,
91.Fa str
92should not point to an area in the initialized data segment.
93.Sh EXAMPLES 93.Sh EXAMPLES
94The following will construct an array of pointers to each individual word in 94The following will construct an array of pointers to each individual word in
95the string 95the string
@@ -133,12 +133,26 @@ will point to
133.Xr strrchr 3 , 133.Xr strrchr 3 ,
134.Xr strsep 3 , 134.Xr strsep 3 ,
135.Xr strspn 3 , 135.Xr strspn 3 ,
136.Xr strstr 3 136.Xr strstr 3 ,
137.Xr wcstok 3
137.Sh STANDARDS 138.Sh STANDARDS
138The 139The
139.Fn strtok 140.Fn strtok
140function conforms to 141function conforms to
141.St -ansiC . 142.St -ansiC .
143.Sh HISTORY
144The
145.Fn strtok
146function first appeared in
147.At III
148and was reimplemented for
149.Bx 4.3 Tahoe .
150The
151.Fn strtok_r
152function first appeared in
153.Nx 1.3
154and was reimplemented for
155.Ox 2.7 .
142.Sh BUGS 156.Sh BUGS
143The System V 157The System V
144.Fn strtok , 158.Fn strtok ,
diff --git a/src/lib/libc/string/strxfrm.3 b/src/lib/libc/string/strxfrm.3
index 73ce135191..e4472946be 100644
--- a/src/lib/libc/string/strxfrm.3
+++ b/src/lib/libc/string/strxfrm.3
@@ -29,9 +29,9 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
31.\" 31.\"
32.\" $OpenBSD: strxfrm.3,v 1.8 2007/05/31 19:19:32 jmc Exp $ 32.\" $OpenBSD: strxfrm.3,v 1.9 2011/07/25 00:38:53 schwarze Exp $
33.\" 33.\"
34.Dd $Mdocdate: May 31 2007 $ 34.Dd $Mdocdate: July 25 2011 $
35.Dt STRXFRM 3 35.Dt STRXFRM 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -67,6 +67,11 @@ The
67.Fn strxfrm 67.Fn strxfrm
68function conforms to 68function conforms to
69.St -ansiC . 69.St -ansiC .
70.Sh HISTORY
71The
72.Fn strxfrm
73function first appeared in
74.Bx 4.3 Reno .
70.Sh BUGS 75.Sh BUGS
71Since locales are not fully implemented on 76Since locales are not fully implemented on
72.Ox , 77.Ox ,
diff --git a/src/lib/libc/string/swab.3 b/src/lib/libc/string/swab.3
index 56def1ec88..5ebaa485e9 100644
--- a/src/lib/libc/string/swab.3
+++ b/src/lib/libc/string/swab.3
@@ -25,9 +25,9 @@
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE. 26.\" SUCH DAMAGE.
27.\" 27.\"
28.\" $OpenBSD: swab.3,v 1.6 2007/05/31 19:19:32 jmc Exp $ 28.\" $OpenBSD: swab.3,v 1.7 2011/07/25 00:38:53 schwarze Exp $
29.\" 29.\"
30.Dd $Mdocdate: May 31 2007 $ 30.Dd $Mdocdate: July 25 2011 $
31.Dt SWAB 3 31.Dt SWAB 3
32.Os 32.Os
33.Sh NAME 33.Sh NAME
@@ -55,7 +55,7 @@ must be an even number.
55.Xr bzero 3 , 55.Xr bzero 3 ,
56.Xr memset 3 56.Xr memset 3
57.Sh HISTORY 57.Sh HISTORY
58A 58The
59.Fn swab 59.Fn swab
60function appeared in 60function first appeared in
61.At v7 . 61.At v7 .
diff --git a/src/lib/libc/string/wcscasecmp.3 b/src/lib/libc/string/wcscasecmp.3
index d76d33bd5c..94cd6e0c38 100644
--- a/src/lib/libc/string/wcscasecmp.3
+++ b/src/lib/libc/string/wcscasecmp.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: wcscasecmp.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ 1.\" $OpenBSD: wcscasecmp.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 1990, 1991, 1993 3.\" Copyright (c) 1990, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -31,7 +31,7 @@
31.\" 31.\"
32.\" @(#)strcasecmp.3 8.1 (Berkeley) 6/9/93 32.\" @(#)strcasecmp.3 8.1 (Berkeley) 6/9/93
33.\" 33.\"
34.Dd $Mdocdate: July 9 2011 $ 34.Dd $Mdocdate: July 25 2011 $
35.Dt WCSCASECMP 3 35.Dt WCSCASECMP 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -66,6 +66,7 @@ compares at most
66.Fa len 66.Fa len
67wide characters. 67wide characters.
68.Sh SEE ALSO 68.Sh SEE ALSO
69.Xr strcasecmp 3 ,
69.Xr wcscmp 3 , 70.Xr wcscmp 3 ,
70.Xr wmemcmp 3 71.Xr wmemcmp 3
71.Sh STANDARDS 72.Sh STANDARDS
@@ -75,3 +76,19 @@ and
75.Fn wcsncasecmp 76.Fn wcsncasecmp
76functions conform to 77functions conform to
77.St -p1003.1-2008 . 78.St -p1003.1-2008 .
79.Sh HISTORY
80The
81.Fn wcscasecmp
82and
83.Fn wcsncasecmp
84functions first appeared in
85.Ox 5.0 .
86.Sh AUTHORS
87The
88.Ox
89versions of
90.Fn wcscasecmp
91and
92.Fn wcsncasecmp
93were implemented by
94.An Marc Espie Aq espie@openbsd.org .
diff --git a/src/lib/libc/string/wcscat.3 b/src/lib/libc/string/wcscat.3
index c5321d5a2a..d0281b8bd1 100644
--- a/src/lib/libc/string/wcscat.3
+++ b/src/lib/libc/string/wcscat.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: wcscat.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: wcscat.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSCAT 3 35.Dt WCSCAT 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -43,7 +43,7 @@
43.Ft wchar_t * 43.Ft wchar_t *
44.Fn wcscat "wchar_t * restrict s" "const wchar_t * restrict append" 44.Fn wcscat "wchar_t * restrict s" "const wchar_t * restrict append"
45.Ft wchar_t * 45.Ft wchar_t *
46.Fo strncat 46.Fo wcsncat
47.Fa "wchar_t * restrict s" 47.Fa "wchar_t * restrict s"
48.Fa "const wchar_t * restrict append" 48.Fa "const wchar_t * restrict append"
49.Fa "size_t count" 49.Fa "size_t count"
@@ -77,8 +77,9 @@ and
77functions return the pointer 77functions return the pointer
78.Fa s . 78.Fa s .
79.Sh SEE ALSO 79.Sh SEE ALSO
80.Xr strcat 3 ,
81.Xr strlcpy 3 ,
80.Xr wcscpy 3 , 82.Xr wcscpy 3 ,
81.Xr wcslcat 3 ,
82.Xr wcslcpy 3 , 83.Xr wcslcpy 3 ,
83.Xr wmemcpy 3 , 84.Xr wmemcpy 3 ,
84.Xr wmemmove 3 85.Xr wmemmove 3
@@ -91,3 +92,24 @@ functions conform to
91.St -isoC-99 92.St -isoC-99
92and were first introduced in 93and were first introduced in
93.St -isoC-amd1 . 94.St -isoC-amd1 .
95.Sh HISTORY
96The
97.Fn wcscat
98and
99.Fn wcsncat
100functions were ported from
101.Nx
102and first appeared in
103.Ox 3.8 .
104.Sh CAVEATS
105Using the functions
106.Fn wcscat
107and
108.Fn wcsncat
109is very error-prone with respect to buffer overflows;
110see the EXAMPLES section in
111.Xr strcat 3
112for correct usage.
113Using
114.Xr wcslcat 3
115is a better choice in most cases.
diff --git a/src/lib/libc/string/wcschr.3 b/src/lib/libc/string/wcschr.3
index 10c78f34e1..ffe42f7ae6 100644
--- a/src/lib/libc/string/wcschr.3
+++ b/src/lib/libc/string/wcschr.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: wcschr.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,10 +31,8 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: wcschr.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\" 35.Dt WCSCHR 3
34.Dd $Mdocdate: July 9 2011 $
35.Dt STRCHR 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
38.Nm wcschr 38.Nm wcschr
@@ -61,6 +61,7 @@ function returns a pointer to the located wide character or
61.Dv NULL 61.Dv NULL
62if the wide character does not appear in the wide string. 62if the wide character does not appear in the wide string.
63.Sh SEE ALSO 63.Sh SEE ALSO
64.Xr strchr 3 ,
64.Xr wcscspn 3 , 65.Xr wcscspn 3 ,
65.Xr wcspbrk 3 , 66.Xr wcspbrk 3 ,
66.Xr wcsrchr 3 , 67.Xr wcsrchr 3 ,
@@ -75,3 +76,10 @@ function conforms to
75.St -isoC-99 76.St -isoC-99
76and was first introduced in 77and was first introduced in
77.St -isoC-amd1 . 78.St -isoC-amd1 .
79.Sh HISTORY
80The
81.Fn wcschr
82function was ported from
83.Nx
84and first appeared in
85.Ox 3.8 .
diff --git a/src/lib/libc/string/wcscmp.3 b/src/lib/libc/string/wcscmp.3
index 15952b9022..b34e5c2168 100644
--- a/src/lib/libc/string/wcscmp.3
+++ b/src/lib/libc/string/wcscmp.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: wcscmp.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: wcscmp.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSCMP 3 35.Dt WCSCMP 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -55,7 +55,7 @@ and
55.Fa s2 . 55.Fa s2 .
56The 56The
57.Fn wcsncmp 57.Fn wcsncmp
58compares at most 58function compares at most
59.Fa len 59.Fa len
60wide characters. 60wide characters.
61.Sh RETURN VALUES 61.Sh RETURN VALUES
@@ -69,6 +69,7 @@ to whether the wide string
69is greater than, equal to, or less than the wide string 69is greater than, equal to, or less than the wide string
70.Fa s2 . 70.Fa s2 .
71.Sh SEE ALSO 71.Sh SEE ALSO
72.Xr strcmp 3 ,
72.Xr wcscasecmp 3 , 73.Xr wcscasecmp 3 ,
73.Xr wmemcmp 3 74.Xr wmemcmp 3
74.Sh STANDARDS 75.Sh STANDARDS
@@ -80,3 +81,12 @@ functions conform to
80.St -isoC-99 81.St -isoC-99
81and were first introduced in 82and were first introduced in
82.St -isoC-amd1 . 83.St -isoC-amd1 .
84.Sh HISTORY
85The
86.Fn wcscmp
87and
88.Fn wcsncmp
89functions were ported from
90.Nx
91and first appeared in
92.Ox 3.8 .
diff --git a/src/lib/libc/string/wcscpy.3 b/src/lib/libc/string/wcscpy.3
index a71d54f886..dcc375acbf 100644
--- a/src/lib/libc/string/wcscpy.3
+++ b/src/lib/libc/string/wcscpy.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: wcscpy.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: wcscpy.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSCPY 3 35.Dt WCSCPY 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -51,7 +51,9 @@
51.Sh DESCRIPTION 51.Sh DESCRIPTION
52The 52The
53.Fn wcscpy 53.Fn wcscpy
54function copies the wide string 54and
55.Fn wcsncpy
56functions copy the wide string
55.Fa src 57.Fa src
56to 58to
57.Fa dst 59.Fa dst
@@ -83,6 +85,9 @@ and
83functions return 85functions return
84.Fa dst . 86.Fa dst .
85.Sh SEE ALSO 87.Sh SEE ALSO
88.Xr strcpy 3 ,
89.Xr strlcpy 3 ,
90.Xr wcscat 3 ,
86.Xr wcslcpy 3 , 91.Xr wcslcpy 3 ,
87.Xr wmemcpy 3 , 92.Xr wmemcpy 3 ,
88.Xr wmemmove 3 93.Xr wmemmove 3
@@ -95,3 +100,24 @@ functions conform to
95.St -isoC-99 100.St -isoC-99
96and were first introduced in 101and were first introduced in
97.St -isoC-amd1 . 102.St -isoC-amd1 .
103.Sh HISTORY
104The
105.Fn wcscpy
106and
107.Fn wcsncpy
108functions were ported from
109.Nx
110and first appeared in
111.Ox 3.8 .
112.Sh CAVEATS
113Using the functions
114.Fn wcscpy
115and
116.Fn wcsncpy
117is very error-prone with respect to buffer overflows;
118see the EXAMPLES section in
119.Xr strcpy 3
120for correct usage.
121Using
122.Xr wcslcpy 3
123is a better choice in most cases.
diff --git a/src/lib/libc/string/wcscspn.3 b/src/lib/libc/string/wcscspn.3
index 7623e9985f..c17992501f 100644
--- a/src/lib/libc/string/wcscspn.3
+++ b/src/lib/libc/string/wcscspn.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: wcscspn.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: wcscspn.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSCSPN 3 35.Dt WCSCSPN 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -59,6 +59,7 @@ The
59.Fn wcscspn 59.Fn wcscspn
60function returns the number of wide characters spanned. 60function returns the number of wide characters spanned.
61.Sh SEE ALSO 61.Sh SEE ALSO
62.Xr strcspn 3 ,
62.Xr wcschr 3 , 63.Xr wcschr 3 ,
63.Xr wcspbrk 3 , 64.Xr wcspbrk 3 ,
64.Xr wcsrchr 3 , 65.Xr wcsrchr 3 ,
@@ -73,3 +74,10 @@ function conforms to
73.St -isoC-99 74.St -isoC-99
74and was first introduced in 75and was first introduced in
75.St -isoC-amd1 . 76.St -isoC-amd1 .
77.Sh HISTORY
78The
79.Fn wcscspn
80function was ported from
81.Nx
82and first appeared in
83.Ox 3.8 .
diff --git a/src/lib/libc/string/wcsdup.3 b/src/lib/libc/string/wcsdup.3
index 6588f14988..588a2571db 100644
--- a/src/lib/libc/string/wcsdup.3
+++ b/src/lib/libc/string/wcsdup.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: wcsdup.3,v 1.3 2011/07/08 17:46:45 nicm Exp $ 1.\" $OpenBSD: wcsdup.3,v 1.4 2011/07/25 00:38:53 schwarze Exp $
2.\" $NetBSD: wcsdup.3,v 1.3 2010/12/16 17:42:28 wiz Exp $ 2.\" $NetBSD: wcsdup.3,v 1.3 2010/12/16 17:42:28 wiz Exp $
3.\" 3.\"
4.\" Copyright (c) 1990, 1991, 1993 4.\" Copyright (c) 1990, 1991, 1993
@@ -28,14 +28,14 @@
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE. 29.\" SUCH DAMAGE.
30.\" 30.\"
31.\" from: @(#)strdup.3 8.1 (Berkeley) 6/9/93 31.\" @(#)strdup.3 8.1 (Berkeley) 6/9/93
32.\" 32.\"
33.Dd $Mdocdate: July 8 2011 $ 33.Dd $Mdocdate: July 25 2011 $
34.Dt WCSDUP 3 34.Dt WCSDUP 3
35.Os 35.Os
36.Sh NAME 36.Sh NAME
37.Nm wcsdup 37.Nm wcsdup
38.Nd save a copy of a string 38.Nd save a copy of a wide string
39.Sh SYNOPSIS 39.Sh SYNOPSIS
40.In wchar.h 40.In wchar.h
41.Ft wchar_t * 41.Ft wchar_t *
@@ -66,15 +66,11 @@ wchar_t *p, b[32];
66size_t blen; 66size_t blen;
67 67
68blen = sizeof(b) / sizeof(b[0]); 68blen = sizeof(b) / sizeof(b[0]);
69if (mbstowcs(b, o, blen) == (size_t)-1) { 69if (mbstowcs(b, o, blen) == (size_t)-1)
70 fprintf(stderr, "Failed to convert string.\en"); 70 err(1, NULL);
71 exit(1);
72}
73b[blen - 1] = 0; 71b[blen - 1] = 0;
74if ((p = wcsdup(b)) == NULL) { 72if ((p = wcsdup(b)) == NULL)
75 fprintf(stderr, "Out of memory.\en"); 73 err(1, NULL);
76 exit(1);
77}
78.Ed 74.Ed
79.Sh ERRORS 75.Sh ERRORS
80The 76The
@@ -87,8 +83,15 @@ for any of the errors specified for the library function
87.Xr free 3 , 83.Xr free 3 ,
88.Xr malloc 3 , 84.Xr malloc 3 ,
89.Xr strdup 3 85.Xr strdup 3
86.Sh STANDARDS
87The
88.Fn wcsdup
89function conforms to
90.St -p1003.1-2008 .
90.Sh HISTORY 91.Sh HISTORY
91The 92The
92.Fn wcsdup 93.Fn wcsdup
93function first appeared in 94function was ported from
95.Nx
96and first appeared in
94.Ox 5.0 . 97.Ox 5.0 .
diff --git a/src/lib/libc/string/wcslcpy.3 b/src/lib/libc/string/wcslcpy.3
index 6f068dc9df..ed6de07cbe 100644
--- a/src/lib/libc/string/wcslcpy.3
+++ b/src/lib/libc/string/wcslcpy.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: wcslcpy.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ 1.\" $OpenBSD: wcslcpy.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 1998, 2000 Todd C. Miller <Todd.Miller@courtesan.com> 3.\" Copyright (c) 1998, 2000 Todd C. Miller <Todd.Miller@courtesan.com>
4.\" 4.\"
@@ -14,7 +14,7 @@
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\" 16.\"
17.Dd $Mdocdate: July 9 2011 $ 17.Dd $Mdocdate: July 25 2011 $
18.Dt WCSLCPY 3 18.Dt WCSLCPY 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -127,6 +127,7 @@ is incorrect or that
127is not terminated with a null wide character). 127is not terminated with a null wide character).
128The check exists to prevent potential security problems in incorrect code. 128The check exists to prevent potential security problems in incorrect code.
129.Sh SEE ALSO 129.Sh SEE ALSO
130.Xr strlcpy 3 ,
130.Xr swprintf 3 , 131.Xr swprintf 3 ,
131.Xr wcsncat 3 , 132.Xr wcsncat 3 ,
132.Xr wcsncpy 3 133.Xr wcsncpy 3
@@ -137,3 +138,10 @@ and
137.Fn wcslcat 138.Fn wcslcat
138functions first appeared in 139functions first appeared in
139.Ox 3.8 . 140.Ox 3.8 .
141.Sh AUTHORS
142The
143.Fn wcslcpy
144and
145.Fn wcslcat
146functions are based on code by
147.An Todd C. Miller Aq Todd.Miller@courtesan.com .
diff --git a/src/lib/libc/string/wcslen.3 b/src/lib/libc/string/wcslen.3
index cf4813c4a4..1b2eceab93 100644
--- a/src/lib/libc/string/wcslen.3
+++ b/src/lib/libc/string/wcslen.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: wcslen.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: wcslen.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSLEN 3 35.Dt WCSLEN 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -52,6 +52,7 @@ The
52function returns the number of wide characters that precede the terminating 52function returns the number of wide characters that precede the terminating
53null wide character. 53null wide character.
54.Sh SEE ALSO 54.Sh SEE ALSO
55.Xr strlen 3 ,
55.Xr wcswidth 3 56.Xr wcswidth 3
56.Sh STANDARDS 57.Sh STANDARDS
57The 58The
@@ -60,3 +61,10 @@ function conforms to
60.St -isoC-99 61.St -isoC-99
61and was first introduced in 62and was first introduced in
62.St -isoC-amd1 . 63.St -isoC-amd1 .
64.Sh HISTORY
65The
66.Fn wcslen
67function was ported from
68.Nx
69and first appeared in
70.Ox 3.8 .
diff --git a/src/lib/libc/string/wcspbrk.3 b/src/lib/libc/string/wcspbrk.3
index 81f08a8f1e..6589e83c83 100644
--- a/src/lib/libc/string/wcspbrk.3
+++ b/src/lib/libc/string/wcspbrk.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: wcspbrk.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: wcspbrk.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSPBRK 3 35.Dt WCSPBRK 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -57,13 +57,14 @@ occur anywhere in
57returns 57returns
58.Dv NULL . 58.Dv NULL .
59.Sh SEE ALSO 59.Sh SEE ALSO
60.Xr wmemchr 3 , 60.Xr strpbrk 3 ,
61.Xr wcschr 3 , 61.Xr wcschr 3 ,
62.Xr wcscspn 3 , 62.Xr wcscspn 3 ,
63.Xr wcsrchr 3 , 63.Xr wcsrchr 3 ,
64.Xr wcsspn 3 , 64.Xr wcsspn 3 ,
65.Xr wcsstr 3 , 65.Xr wcsstr 3 ,
66.Xr wcstok 3 66.Xr wcstok 3 ,
67.Xr wmemchr 3
67.Sh STANDARDS 68.Sh STANDARDS
68The 69The
69.Fn wcspbrk 70.Fn wcspbrk
@@ -71,3 +72,10 @@ function conforms to
71.St -isoC-99 72.St -isoC-99
72and was first introduced in 73and was first introduced in
73.St -isoC-amd1 . 74.St -isoC-amd1 .
75.Sh HISTORY
76The
77.Fn wcspbrk
78function was ported from
79.Nx
80and first appeared in
81.Ox 3.8 .
diff --git a/src/lib/libc/string/wcsrchr.3 b/src/lib/libc/string/wcsrchr.3
index 5e0c1f8835..d65caa4292 100644
--- a/src/lib/libc/string/wcsrchr.3
+++ b/src/lib/libc/string/wcsrchr.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: wcsrchr.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: wcsrchr.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSRCHR 3 35.Dt WCSRCHR 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -61,6 +61,7 @@ function returns a pointer to the located wide character or
61.Dv NULL 61.Dv NULL
62if the wide character does not appear in the wide string. 62if the wide character does not appear in the wide string.
63.Sh SEE ALSO 63.Sh SEE ALSO
64.Xr strrchr 3 ,
64.Xr wcschr 3 , 65.Xr wcschr 3 ,
65.Xr wcscspn 3 , 66.Xr wcscspn 3 ,
66.Xr wcspbrk 3 , 67.Xr wcspbrk 3 ,
@@ -75,3 +76,10 @@ function conforms to
75.St -isoC-99 76.St -isoC-99
76and was first introduced in 77and was first introduced in
77.St -isoC-amd1 . 78.St -isoC-amd1 .
79.Sh HISTORY
80The
81.Fn wcsrchr
82function was ported from
83.Nx
84and first appeared in
85.Ox 3.8 .
diff --git a/src/lib/libc/string/wcsspn.3 b/src/lib/libc/string/wcsspn.3
index c73e13076e..66505c59d1 100644
--- a/src/lib/libc/string/wcsspn.3
+++ b/src/lib/libc/string/wcsspn.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: wcsspn.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: wcsspn.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSSPN 3 35.Dt WCSSPN 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -55,6 +55,7 @@ The
55.Fn wcsspn 55.Fn wcsspn
56function returns the number of wide characters spanned. 56function returns the number of wide characters spanned.
57.Sh SEE ALSO 57.Sh SEE ALSO
58.Xr strspn 3 ,
58.Xr wcschr 3 , 59.Xr wcschr 3 ,
59.Xr wcscspn 3 , 60.Xr wcscspn 3 ,
60.Xr wcspbrk 3 , 61.Xr wcspbrk 3 ,
@@ -69,3 +70,10 @@ function conforms to
69.St -isoC-99 70.St -isoC-99
70and was first introduced in 71and was first introduced in
71.St -isoC-amd1 . 72.St -isoC-amd1 .
73.Sh HISTORY
74The
75.Fn wcsspn
76function was ported from
77.Nx
78and first appeared in
79.Ox 3.8 .
diff --git a/src/lib/libc/string/wcsstr.3 b/src/lib/libc/string/wcsstr.3
index dc99b70667..73f85c3504 100644
--- a/src/lib/libc/string/wcsstr.3
+++ b/src/lib/libc/string/wcsstr.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: wcsstr.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: wcsstr.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSSTR 3 35.Dt WCSSTR 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -64,13 +64,14 @@ otherwise a pointer to the first wide character of the first occurrence of
64.Fa little 64.Fa little
65is returned. 65is returned.
66.Sh SEE ALSO 66.Sh SEE ALSO
67.Xr strstr 3 ,
67.Xr wcschr 3 , 68.Xr wcschr 3 ,
68.Xr wcscspn 3 , 69.Xr wcscspn 3 ,
69.Xr wcspbrk 3 , 70.Xr wcspbrk 3 ,
70.Xr wcsrchr 3 , 71.Xr wcsrchr 3 ,
71.Xr wcsspn 3 , 72.Xr wcsspn 3 ,
72.Xr wcstok 3 , 73.Xr wcstok 3 ,
73.Xr wmemchr 3 , 74.Xr wmemchr 3
74.Sh STANDARDS 75.Sh STANDARDS
75The 76The
76.Fn wcsstr 77.Fn wcsstr
@@ -78,3 +79,10 @@ function conforms to
78.St -isoC-99 79.St -isoC-99
79and was first introduced in 80and was first introduced in
80.St -isoC-amd1 . 81.St -isoC-amd1 .
82.Sh HISTORY
83The
84.Fn wcsstr
85function was ported from
86.Nx
87and first appeared in
88.Ox 3.8 .
diff --git a/src/lib/libc/string/wcstok.3 b/src/lib/libc/string/wcstok.3
index 945ec9b990..33ba1318a1 100644
--- a/src/lib/libc/string/wcstok.3
+++ b/src/lib/libc/string/wcstok.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: wcstok.3,v 1.6 2010/09/10 18:38:20 jmc Exp $ 1.\" $OpenBSD: wcstok.3,v 1.7 2011/07/25 00:38:53 schwarze Exp $
2.\" 2.\"
3.\" $NetBSD: wcstok.3,v 1.3 2003/09/08 17:54:33 wiz Exp $ 3.\" $NetBSD: wcstok.3,v 1.3 2003/09/08 17:54:33 wiz Exp $
4.\" 4.\"
@@ -54,7 +54,7 @@
54.\" Original version ID: 54.\" Original version ID:
55.\" FreeBSD: src/lib/libc/string/wcstok.3,v 1.4 2002/10/15 09:49:54 tjr Exp 55.\" FreeBSD: src/lib/libc/string/wcstok.3,v 1.4 2002/10/15 09:49:54 tjr Exp
56.\" 56.\"
57.Dd $Mdocdate: September 10 2010 $ 57.Dd $Mdocdate: July 25 2011 $
58.Dt WCSTOK 3 58.Dt WCSTOK 3
59.Os 59.Os
60.Sh NAME 60.Sh NAME
@@ -90,8 +90,14 @@ must be provided on each call.
90The 90The
91.Fn wcstok 91.Fn wcstok
92function is the wide-character counterpart of the 92function is the wide-character counterpart of the
93.Fn strtok_r 93.Xr strtok_r 3
94function. 94function.
95.Pp
96Since
97.Fn wcstok
98modifies the string,
99.Fa str
100should not point to an area in the initialized data segment.
95.Sh RETURN VALUES 101.Sh RETURN VALUES
96The 102The
97.Fn wcstok 103.Fn wcstok
@@ -118,7 +124,9 @@ for (tok = wcstok(text, seps, &last); tok != NULL;
118.Xr wcscspn 3 , 124.Xr wcscspn 3 ,
119.Xr wcspbrk 3 , 125.Xr wcspbrk 3 ,
120.Xr wcsrchr 3 , 126.Xr wcsrchr 3 ,
121.Xr wcsspn 3 127.Xr wcsspn 3 ,
128.Xr wcsstr 3 ,
129.Xr wmemchr 3
122.Sh STANDARDS 130.Sh STANDARDS
123The 131The
124.Fn wcstok 132.Fn wcstok
@@ -126,11 +134,18 @@ function
126conforms to 134conforms to
127.St -isoC-99 . 135.St -isoC-99 .
128.Sh HISTORY 136.Sh HISTORY
137The
138.Fn wcstok
139function was ported from
140.Nx
141and first appeared in
142.Ox 3.8 .
143.Pp
129Some early implementations of 144Some early implementations of
130.Fn wcstok 145.Fn wcstok
131omit the 146omit the
132context pointer argument, 147context pointer argument,
133.Fa last , 148.Fa last ,
134and maintain state across calls in a static variable like 149and maintain state across calls in a static variable like
135.Fn strtok 150.Xr strtok 3
136does. 151does.
diff --git a/src/lib/libc/string/wcswidth.3 b/src/lib/libc/string/wcswidth.3
index a68ec33cad..a2a5b2df86 100644
--- a/src/lib/libc/string/wcswidth.3
+++ b/src/lib/libc/string/wcswidth.3
@@ -1,4 +1,5 @@
1.\" $OpenBSD: wcswidth.3,v 1.1 2011/04/04 18:16:24 stsp Exp $ 1.\" $OpenBSD: wcswidth.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
2.\"
2.\" Copyright (c) 2002 Tim J. Robbins 3.\" Copyright (c) 2002 Tim J. Robbins
3.\" All rights reserved. 4.\" All rights reserved.
4.\" 5.\"
@@ -23,8 +24,7 @@
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE. 25.\" SUCH DAMAGE.
25.\" 26.\"
26.\" 27.Dd $Mdocdate: July 25 2011 $
27.Dd $Mdocdate: April 4 2011 $
28.Dt WCSWIDTH 3 28.Dt WCSWIDTH 3
29.Os 29.Os
30.Sh NAME 30.Sh NAME
@@ -52,9 +52,18 @@ is an empty string (L""),
52otherwise it returns the number of column positions occupied. 52otherwise it returns the number of column positions occupied.
53.Sh SEE ALSO 53.Sh SEE ALSO
54.Xr iswprint 3 , 54.Xr iswprint 3 ,
55.Xr strlen 3 ,
56.Xr wcslen 3 ,
55.Xr wcwidth 3 57.Xr wcwidth 3
56.Sh STANDARDS 58.Sh STANDARDS
57The 59The
58.Fn wcswidth 60.Fn wcswidth
59function conforms to 61function conforms to
60.St -p1003.1-2001 . 62.St -p1003.1-2001 .
63.Sh HISTORY
64The
65.Fn wcswidth
66function was ported from
67.Nx
68and first appeared in
69.Ox 3.8 .
diff --git a/src/lib/libc/string/wmemchr.3 b/src/lib/libc/string/wmemchr.3
index 9d95015468..21df1aaa88 100644
--- a/src/lib/libc/string/wmemchr.3
+++ b/src/lib/libc/string/wmemchr.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: wmemchr.3,v 1.9 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: wmemchr.3,v 1.8 2011/07/09 16:46:58 nicm Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WMEMCHR 3 35.Dt WMEMCHR 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -57,6 +57,7 @@ if no such wide character exists within
57.Fa len 57.Fa len
58wide characters. 58wide characters.
59.Sh SEE ALSO 59.Sh SEE ALSO
60.Xr memchr 3 ,
60.Xr wcschr 3 , 61.Xr wcschr 3 ,
61.Xr wcscspn 3 , 62.Xr wcscspn 3 ,
62.Xr wcspbrk 3 , 63.Xr wcspbrk 3 ,
@@ -71,3 +72,10 @@ function conforms to
71.St -isoC-99 72.St -isoC-99
72and was first introduced in 73and was first introduced in
73.St -isoC-amd1 . 74.St -isoC-amd1 .
75.Sh HISTORY
76The
77.Fn wmemchr
78function was ported from
79.Nx
80and first appeared in
81.Ox 3.8 .
diff --git a/src/lib/libc/string/wmemcmp.3 b/src/lib/libc/string/wmemcmp.3
index e1d56ec30e..6006b4e5c1 100644
--- a/src/lib/libc/string/wmemcmp.3
+++ b/src/lib/libc/string/wmemcmp.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: wmemcmp.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: wmemcmp.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WMEMCMP 3 35.Dt WMEMCMP 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -59,8 +59,9 @@ otherwise the difference between the first two differing wide characters is
59returned. 59returned.
60Zero-length wide strings are always identical. 60Zero-length wide strings are always identical.
61.Sh SEE ALSO 61.Sh SEE ALSO
62.Xr memcmp 3 ,
62.Xr wcscasecmp 3 , 63.Xr wcscasecmp 3 ,
63.Xr wcscmp 3 , 64.Xr wcscmp 3
64.Sh STANDARDS 65.Sh STANDARDS
65The 66The
66.Fn wmemcmp 67.Fn wmemcmp
@@ -68,3 +69,10 @@ function conforms to
68.St -isoC-99 69.St -isoC-99
69and was first introduced in 70and was first introduced in
70.St -isoC-amd1 . 71.St -isoC-amd1 .
72.Sh HISTORY
73The
74.Fn wmemcmp
75function was ported from
76.Nx
77and first appeared in
78.Ox 3.8 .
diff --git a/src/lib/libc/string/wmemcpy.3 b/src/lib/libc/string/wmemcpy.3
index 9147bb7964..1102640ad4 100644
--- a/src/lib/libc/string/wmemcpy.3
+++ b/src/lib/libc/string/wmemcpy.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: wmemcpy.3,v 1.3 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: wmemcpy.3,v 1.2 2011/07/09 16:46:58 nicm Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WMEMCPY 3 35.Dt WMEMCPY 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -56,6 +56,7 @@ The
56function returns the original value of 56function returns the original value of
57.Fa dst . 57.Fa dst .
58.Sh SEE ALSO 58.Sh SEE ALSO
59.Xr memcpy 3 ,
59.Xr wcscpy 3 , 60.Xr wcscpy 3 ,
60.Xr wcslcpy 3 , 61.Xr wcslcpy 3 ,
61.Xr wmemmove 3 62.Xr wmemmove 3
@@ -66,12 +67,19 @@ function conforms to
66.St -isoC-99 67.St -isoC-99
67and was first introduced in 68and was first introduced in
68.St -isoC-amd1 . 69.St -isoC-amd1 .
69.Sh BUGS 70.Sh HISTORY
71The
72.Fn wmemcpy
73function was ported from
74.Nx
75and first appeared in
76.Ox 3.8 .
77.Sh CAVEATS
70In this implementation 78In this implementation
71.Fn wmemcpy 79.Fn wmemcpy
72is implemented using 80is implemented using
73.Xr bcopy 3 , 81.Xr bcopy 3 ,
74and therefore the buffers may overlap. 82and therefore the buffers may overlap.
75On other systems, copying overlapping buffers may produce surprises. 83On other systems, copying overlapping buffers may produce surprises.
76A simpler solution is to not use 84A portable, safe solution is to use
77.Fn wmemcpy . 85.Xr wmemmove 3 .
diff --git a/src/lib/libc/string/wmemmove.3 b/src/lib/libc/string/wmemmove.3
index b018bd5cbc..45daa854ba 100644
--- a/src/lib/libc/string/wmemmove.3
+++ b/src/lib/libc/string/wmemmove.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: wmemmove.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: wmemmove.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WMEMMOVE 3 35.Dt WMEMMOVE 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -58,6 +58,7 @@ The
58function returns the original value of 58function returns the original value of
59.Fa dst . 59.Fa dst .
60.Sh SEE ALSO 60.Sh SEE ALSO
61.Xr memmove 3 ,
61.Xr wcscpy 3 , 62.Xr wcscpy 3 ,
62.Xr wcslcpy 3 , 63.Xr wcslcpy 3 ,
63.Xr wmemcpy 3 64.Xr wmemcpy 3
@@ -68,3 +69,10 @@ function conforms to
68.St -isoC-99 69.St -isoC-99
69and was first introduced in 70and was first introduced in
70.St -isoC-amd1 . 71.St -isoC-amd1 .
72.Sh HISTORY
73The
74.Fn wmemmove
75function was ported from
76.Nx
77and first appeared in
78.Ox 3.8 .
diff --git a/src/lib/libc/string/wmemset.3 b/src/lib/libc/string/wmemset.3
index f1e52e6a8d..1b840762ec 100644
--- a/src/lib/libc/string/wmemset.3
+++ b/src/lib/libc/string/wmemset.3
@@ -1,3 +1,5 @@
1.\" $OpenBSD: wmemset.3,v 1.3 2011/07/25 00:38:53 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved. 4.\" All rights reserved.
3.\" 5.\"
@@ -29,9 +31,7 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
31.\" 33.\"
32.\" $OpenBSD: wmemset.3,v 1.2 2011/07/09 16:46:58 nicm Exp $ 34.Dd $Mdocdate: July 25 2011 $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WMEMSET 3 35.Dt WMEMSET 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -55,6 +55,8 @@ The
55.Fn wmemset 55.Fn wmemset
56function returns the original value of 56function returns the original value of
57.Fa s . 57.Fa s .
58.Sh SEE ALSO
59.Xr memset 3
58.Sh STANDARDS 60.Sh STANDARDS
59The 61The
60.Fn wmemset 62.Fn wmemset
@@ -62,3 +64,10 @@ function conforms to
62.St -isoC-99 64.St -isoC-99
63and was first introduced in 65and was first introduced in
64.St -isoC-amd1 . 66.St -isoC-amd1 .
67.Sh HISTORY
68The
69.Fn wmemset
70function was ported from
71.Nx
72and first appeared in
73.Ox 3.8 .