summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/string/Makefile.inc32
-rw-r--r--src/lib/libc/string/wcscasecmp.377
-rw-r--r--src/lib/libc/string/wcscat.393
-rw-r--r--src/lib/libc/string/wcschr.377
-rw-r--r--src/lib/libc/string/wcscmp.382
-rw-r--r--src/lib/libc/string/wcscpy.397
-rw-r--r--src/lib/libc/string/wcscspn.375
-rw-r--r--src/lib/libc/string/wcslcpy.3139
-rw-r--r--src/lib/libc/string/wcslen.362
-rw-r--r--src/lib/libc/string/wcspbrk.373
-rw-r--r--src/lib/libc/string/wcsrchr.377
-rw-r--r--src/lib/libc/string/wcsspn.371
-rw-r--r--src/lib/libc/string/wcsstr.380
-rw-r--r--src/lib/libc/string/wmemchr.3150
-rw-r--r--src/lib/libc/string/wmemcmp.370
-rw-r--r--src/lib/libc/string/wmemcpy.377
-rw-r--r--src/lib/libc/string/wmemmove.370
-rw-r--r--src/lib/libc/string/wmemset.364
18 files changed, 1327 insertions, 139 deletions
diff --git a/src/lib/libc/string/Makefile.inc b/src/lib/libc/string/Makefile.inc
index bb285e135e..40713956e5 100644
--- a/src/lib/libc/string/Makefile.inc
+++ b/src/lib/libc/string/Makefile.inc
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile.inc,v 1.26 2011/07/04 04:37:34 nicm Exp $ 1# $OpenBSD: Makefile.inc,v 1.27 2011/07/09 16:32:11 nicm Exp $
2 2
3# string sources 3# string sources
4.PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/string ${LIBCSRCDIR}/string 4.PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/string ${LIBCSRCDIR}/string
@@ -144,7 +144,9 @@ MAN+= bm.3 bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 memccpy.3 memchr.3 \
144 strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strerror.3 \ 144 strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strerror.3 \
145 string.3 strlen.3 strmode.3 strdup.3 strpbrk.3 strrchr.3 strsep.3 \ 145 string.3 strlen.3 strmode.3 strdup.3 strpbrk.3 strrchr.3 strsep.3 \
146 strsignal.3 strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 strlcpy.3 \ 146 strsignal.3 strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 strlcpy.3 \
147 wcstok.3 wmemchr.3 wcswidth.3 wcsdup.3 147 wcscasecmp.3 wcscat.3 wcschr.3 wcscmp.3 wcscpy.3 wcscspn.3 wcsdup.3 \
148 wcslcpy.3 wcslen.3 wcspbrk.3 wcsrchr.3 wcsspn.3 wcsstr.3 wcstok.3 \
149 wcswidth.3 wmemchr.3 wmemcmp.3 wmemcpy.3 wmemmove.3 wmemset.3
148 150
149MLINKS+=bm.3 bm_comp.3 bm.3 bm_exec.3 bm.3 bm_free.3 151MLINKS+=bm.3 bm_comp.3 bm.3 bm_exec.3 bm.3 bm_free.3
150MLINKS+=memchr.3 memrchr.3 152MLINKS+=memchr.3 memrchr.3
@@ -160,25 +162,9 @@ MLINKS+=strlen.3 strnlen.3
160MLINKS+=strstr.3 strcasestr.3 162MLINKS+=strstr.3 strcasestr.3
161MLINKS+=strtok.3 strtok_r.3 163MLINKS+=strtok.3 strtok_r.3
162MLINKS+=strerror.3 strerror_r.3 164MLINKS+=strerror.3 strerror_r.3
163MLINKS+=wmemchr.3 wmemcmp.3 165MLINKS+=wcscasecmp.3 wcsncasecmp.3
164MLINKS+=wmemchr.3 wmemcpy.3 166MLINKS+=wcscat.3 wcsncat.3
165MLINKS+=wmemchr.3 wmemmove.3 167MLINKS+=wcscmp.3 wcsncmp.3
166MLINKS+=wmemchr.3 wmemset.3 168MLINKS+=wcscpy.3 wcsncpy.3
167MLINKS+=wmemchr.3 wcscat.3 169MLINKS+=wcslcpy.3 wcslcat.3
168MLINKS+=wmemchr.3 wcschr.3
169MLINKS+=wmemchr.3 wcscmp.3
170MLINKS+=wmemchr.3 wcscasecmp.3
171MLINKS+=wmemchr.3 wcscpy.3
172MLINKS+=wmemchr.3 wcscspn.3
173MLINKS+=wmemchr.3 wcslcat.3
174MLINKS+=wmemchr.3 wcslcpy.3
175MLINKS+=wmemchr.3 wcslen.3
176MLINKS+=wmemchr.3 wcsncat.3
177MLINKS+=wmemchr.3 wcsncmp.3
178MLINKS+=wmemchr.3 wcsncasecmp.3
179MLINKS+=wmemchr.3 wcsncpy.3
180MLINKS+=wmemchr.3 wcspbrk.3
181MLINKS+=wmemchr.3 wcsrchr.3
182MLINKS+=wmemchr.3 wcsspn.3
183MLINKS+=wmemchr.3 wcsstr.3
184MLINKS+=bcmp.3 timingsafe_bcmp.3 170MLINKS+=bcmp.3 timingsafe_bcmp.3
diff --git a/src/lib/libc/string/wcscasecmp.3 b/src/lib/libc/string/wcscasecmp.3
new file mode 100644
index 0000000000..d76d33bd5c
--- /dev/null
+++ b/src/lib/libc/string/wcscasecmp.3
@@ -0,0 +1,77 @@
1.\" $OpenBSD: wcscasecmp.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
2.\"
3.\" Copyright (c) 1990, 1991, 1993
4.\" The Regents of the University of California. All rights reserved.
5.\"
6.\" This code is derived from software contributed to Berkeley by
7.\" Chris Torek.
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)strcasecmp.3 8.1 (Berkeley) 6/9/93
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSCASECMP 3
36.Os
37.Sh NAME
38.Nm wcscasecmp ,
39.Nm wcsncasecmp
40.Nd compare wide strings, ignoring case
41.Sh SYNOPSIS
42.Fd #include <wchar.h>
43.Ft int
44.Fn wcscasecmp "const wchar_t *s1" "const wchar_t *s2"
45.Ft int
46.Fn wcsncasecmp "const wchar_t *s1" "const wchar_t *s2" "size_t len"
47.Sh DESCRIPTION
48The
49.Fn wcscasecmp
50and
51.Fn wcsncasecmp
52functions compare the wide strings
53.Fa s1
54and
55.Fa s2
56and return an integer greater than, equal to, or less than 0,
57according to whether
58.Fa s1
59is lexicographically greater than, equal to, or less than
60.Fa s2
61after translation of each corresponding wide character to lower case.
62The wide strings themselves are not modified.
63.Pp
64.Fn wcsncasecmp
65compares at most
66.Fa len
67wide characters.
68.Sh SEE ALSO
69.Xr wcscmp 3 ,
70.Xr wmemcmp 3
71.Sh STANDARDS
72The
73.Fn wcscasecmp
74and
75.Fn wcsncasecmp
76functions conform to
77.St -p1003.1-2008 .
diff --git a/src/lib/libc/string/wcscat.3 b/src/lib/libc/string/wcscat.3
new file mode 100644
index 0000000000..c5321d5a2a
--- /dev/null
+++ b/src/lib/libc/string/wcscat.3
@@ -0,0 +1,93 @@
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $OpenBSD: wcscat.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSCAT 3
36.Os
37.Sh NAME
38.Nm wcscat ,
39.Nm wcsncat
40.Nd concatenate wide strings
41.Sh SYNOPSIS
42.Fd #include <wchar.h>
43.Ft wchar_t *
44.Fn wcscat "wchar_t * restrict s" "const wchar_t * restrict append"
45.Ft wchar_t *
46.Fo strncat
47.Fa "wchar_t * restrict s"
48.Fa "const wchar_t * restrict append"
49.Fa "size_t count"
50.Fc
51.Sh DESCRIPTION
52The
53.Fn wcscat
54and
55.Fn wcsncat
56functions append a copy of the wide string
57.Fa append
58to the end of the wide string
59.Fa s ,
60then add a terminating null wide character (L'\e0').
61The wide string
62.Fa s
63must have sufficient space to hold the result.
64.Pp
65The
66.Fn wcsncat
67function appends not more than
68.Fa count
69wide characters where space for the terminating null wide character
70should not be included in
71.Fa count .
72.Sh RETURN VALUES
73The
74.Fn wcscat
75and
76.Fn wcsncat
77functions return the pointer
78.Fa s .
79.Sh SEE ALSO
80.Xr wcscpy 3 ,
81.Xr wcslcat 3 ,
82.Xr wcslcpy 3 ,
83.Xr wmemcpy 3 ,
84.Xr wmemmove 3
85.Sh STANDARDS
86The
87.Fn wcscat
88and
89.Fn wcsncat
90functions conform to
91.St -isoC-99
92and were first introduced in
93.St -isoC-amd1 .
diff --git a/src/lib/libc/string/wcschr.3 b/src/lib/libc/string/wcschr.3
new file mode 100644
index 0000000000..10c78f34e1
--- /dev/null
+++ b/src/lib/libc/string/wcschr.3
@@ -0,0 +1,77 @@
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $OpenBSD: wcschr.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt STRCHR 3
36.Os
37.Sh NAME
38.Nm wcschr
39.Nd locate first occurrence of a wide character in a wide string
40.Sh SYNOPSIS
41.Fd #include <wchar.h>
42.Ft wchar_t *
43.Fn wcschr "const wchar_t *s" "wchar_t c"
44.Sh DESCRIPTION
45The
46.Fn wcschr
47function locates the first occurrence of the wide character
48.Fa c
49in the wide string
50.Fa s .
51The terminating null wide character is considered part of the wide string.
52If
53.Fa c
54is the null wide character (L'\e0'),
55.Fn wcschr
56locates the terminating null wide character.
57.Sh RETURN VALUES
58The
59.Fn wcschr
60function returns a pointer to the located wide character or
61.Dv NULL
62if the wide character does not appear in the wide string.
63.Sh SEE ALSO
64.Xr wcscspn 3 ,
65.Xr wcspbrk 3 ,
66.Xr wcsrchr 3 ,
67.Xr wcsspn 3 ,
68.Xr wcsstr 3 ,
69.Xr wcstok 3 ,
70.Xr wmemchr 3
71.Sh STANDARDS
72The
73.Fn wcschr
74function conforms to
75.St -isoC-99
76and was first introduced in
77.St -isoC-amd1 .
diff --git a/src/lib/libc/string/wcscmp.3 b/src/lib/libc/string/wcscmp.3
new file mode 100644
index 0000000000..15952b9022
--- /dev/null
+++ b/src/lib/libc/string/wcscmp.3
@@ -0,0 +1,82 @@
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $OpenBSD: wcscmp.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSCMP 3
36.Os
37.Sh NAME
38.Nm wcscmp ,
39.Nm wcsncmp
40.Nd compare wide strings
41.Sh SYNOPSIS
42.Fd #include <wchar.h>
43.Ft int
44.Fn wcscmp "const wchar_t *s1" "const wchar_t *s2"
45.Ft int
46.Fn wcsncmp "const wchar_t *s1" "const wchar_t *s2" "size_t len"
47.Sh DESCRIPTION
48The
49.Fn wcscmp
50and
51.Fn wcsncmp
52functions lexicographically compare the wide strings
53.Fa s1
54and
55.Fa s2 .
56The
57.Fn wcsncmp
58compares at most
59.Fa len
60wide characters.
61.Sh RETURN VALUES
62The
63.Fn wcscmp
64and
65.Fn wcsncmp
66functions return an integer greater than, equal to, or less than 0, according
67to whether the wide string
68.Fa s1
69is greater than, equal to, or less than the wide string
70.Fa s2 .
71.Sh SEE ALSO
72.Xr wcscasecmp 3 ,
73.Xr wmemcmp 3
74.Sh STANDARDS
75The
76.Fn wcscmp
77and
78.Fn wcsncmp
79functions conform to
80.St -isoC-99
81and were first introduced in
82.St -isoC-amd1 .
diff --git a/src/lib/libc/string/wcscpy.3 b/src/lib/libc/string/wcscpy.3
new file mode 100644
index 0000000000..a71d54f886
--- /dev/null
+++ b/src/lib/libc/string/wcscpy.3
@@ -0,0 +1,97 @@
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $OpenBSD: wcscpy.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSCPY 3
36.Os
37.Sh NAME
38.Nm wcscpy ,
39.Nm wcsncpy
40.Nd copy wide strings
41.Sh SYNOPSIS
42.Fd #include <wchar.h>
43.Ft wchar_t *
44.Fn wcscpy "wchar_t * restrict dst" "const wchar_t * restrict src"
45.Ft wchar_t *
46.Fo wcsncpy
47.Fa "wchar_t * restrict dst"
48.Fa "const wchar_t * restrict src"
49.Fa "size_t len"
50.Fc
51.Sh DESCRIPTION
52The
53.Fn wcscpy
54function copies the wide string
55.Fa src
56to
57.Fa dst
58(including the terminating null wide character).
59.Pp
60The
61.Fn wcsncpy
62function copies not more than
63.Fa len
64wide characters to
65.Fa dst ,
66appending null wide characters if the length of
67.Fa src
68is less than
69.Fa len ,
70and
71.Em not
72terminating
73.Fa dst
74if the length of
75.Fa src
76is greater than or equal to
77.Fa len .
78.Sh RETURN VALUES
79The
80.Fn wcscpy
81and
82.Fn wcsncpy
83functions return
84.Fa dst .
85.Sh SEE ALSO
86.Xr wcslcpy 3 ,
87.Xr wmemcpy 3 ,
88.Xr wmemmove 3
89.Sh STANDARDS
90The
91.Fn wcscpy
92and
93.Fn wcsncpy
94functions conform to
95.St -isoC-99
96and were first introduced in
97.St -isoC-amd1 .
diff --git a/src/lib/libc/string/wcscspn.3 b/src/lib/libc/string/wcscspn.3
new file mode 100644
index 0000000000..7623e9985f
--- /dev/null
+++ b/src/lib/libc/string/wcscspn.3
@@ -0,0 +1,75 @@
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $OpenBSD: wcscspn.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSCSPN 3
36.Os
37.Sh NAME
38.Nm wcscspn
39.Nd span the complement of a wide string
40.Sh SYNOPSIS
41.Fd #include <wchar.h>
42.Ft size_t
43.Fn wcscspn "const wchar_t *s" "const wchar_t *charset"
44.Sh DESCRIPTION
45The
46.Fn wcscspn
47function spans the initial part of the wide string
48.Fa s
49as long as the wide characters from
50.Fa s
51do not occur in string
52.Fa charset
53(it spans the
54.Em complement
55of
56.Fa charset ) .
57.Sh RETURN VALUES
58The
59.Fn wcscspn
60function returns the number of wide characters spanned.
61.Sh SEE ALSO
62.Xr wcschr 3 ,
63.Xr wcspbrk 3 ,
64.Xr wcsrchr 3 ,
65.Xr wcsspn 3 ,
66.Xr wcsstr 3 ,
67.Xr wcstok 3 ,
68.Xr wmemchr 3
69.Sh STANDARDS
70The
71.Fn wcscspn
72function conforms to
73.St -isoC-99
74and was first introduced in
75.St -isoC-amd1 .
diff --git a/src/lib/libc/string/wcslcpy.3 b/src/lib/libc/string/wcslcpy.3
new file mode 100644
index 0000000000..6f068dc9df
--- /dev/null
+++ b/src/lib/libc/string/wcslcpy.3
@@ -0,0 +1,139 @@
1.\" $OpenBSD: wcslcpy.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
2.\"
3.\" Copyright (c) 1998, 2000 Todd C. Miller <Todd.Miller@courtesan.com>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: July 9 2011 $
18.Dt WCSLCPY 3
19.Os
20.Sh NAME
21.Nm wcslcpy ,
22.Nm wcslcat
23.Nd size-bounded wide string copying and concatenation
24.Sh SYNOPSIS
25.Fd #include <wchar.h>
26.Ft size_t
27.Fn wcslcpy "wchar_t *dst" "const wchar_t *src" "size_t size"
28.Ft size_t
29.Fn wcslcat "wchar_t *dst" "const wchar_t *src" "size_t size"
30.Sh DESCRIPTION
31The
32.Fn wcslcpy
33and
34.Fn wcslcat
35functions copy and concatenate wide strings respectively.
36They are designed to be safer, more consistent, and less error prone
37replacements for
38.Xr wcsncpy 3
39and
40.Xr wcsncat 3 .
41Unlike those functions,
42.Fn wcslcpy
43and
44.Fn wcslcat
45take the full size of the buffer (not just the length) and guarantee to
46terminate the result with a null wide character (as long as
47.Fa size
48is larger than 0 or, in the case of
49.Fn wcslcat ,
50as long as there is at least one wide character free in
51.Fa dst ) .
52Note that a wide character for the null wide character should be included in
53.Fa size .
54Also note that
55.Fn wcslcpy
56and
57.Fn wcslcat
58only operate on wide strings that are terminated with a null wide character
59(L'\e0').
60This means that for
61.Fn wcslcpy
62.Fa src
63must be terminated with a null wide character and for
64.Fn wcslcat
65both
66.Fa src
67and
68.Fa dst
69must be terminated with a null wide character.
70.Pp
71The
72.Fn wcslcpy
73function copies up to
74.Fa size
75\(mi 1 wide characters from the wide string
76.Fa src
77to
78.Fa dst ,
79terminating the result with a null wide character.
80.Pp
81The
82.Fn wcslcat
83function appends the wide string
84.Fa src
85to the end of
86.Fa dst .
87It will append at most
88.Fa size
89\(mi wcslen(dst) \(mi 1 wide characters, terminating the result with a null
90wide character.
91.Sh RETURN VALUES
92The
93.Fn wcslcpy
94and
95.Fn wcslcat
96functions return the total length of the wide string they tried to create.
97For
98.Fn wcslcpy
99that means the length of
100.Fa src .
101For
102.Fn wcslcat
103that means the initial length of
104.Fa dst
105plus
106the length of
107.Fa src .
108While this may seem somewhat confusing, it was done to make
109truncation detection simple.
110.Pp
111Note, however, that if
112.Fn wcslcat
113traverses
114.Fa size
115wide characters without finding a null wide character, the length of the
116string is considered to be
117.Fa size
118and the destination wide string will not be terminated with a null wide
119character (since there was no space for it).
120This keeps
121.Fn wcslcat
122from running off the end of a wide string.
123In practice this should not happen (as it means that either
124.Fa size
125is incorrect or that
126.Fa dst
127is not terminated with a null wide character).
128The check exists to prevent potential security problems in incorrect code.
129.Sh SEE ALSO
130.Xr swprintf 3 ,
131.Xr wcsncat 3 ,
132.Xr wcsncpy 3
133.Sh HISTORY
134The
135.Fn wcslcpy
136and
137.Fn wcslcat
138functions first appeared in
139.Ox 3.8 .
diff --git a/src/lib/libc/string/wcslen.3 b/src/lib/libc/string/wcslen.3
new file mode 100644
index 0000000000..cf4813c4a4
--- /dev/null
+++ b/src/lib/libc/string/wcslen.3
@@ -0,0 +1,62 @@
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $OpenBSD: wcslen.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSLEN 3
36.Os
37.Sh NAME
38.Nm wcslen
39.Nd find length of a wide string
40.Sh SYNOPSIS
41.Fd #include <wchar.h>
42.Ft size_t
43.Fn wcslen "const wchar_t *s"
44.Sh DESCRIPTION
45The
46.Fn wcslen
47function computes the length of the wide string
48.Fa s .
49.Sh RETURN VALUES
50The
51.Fn wcslen
52function returns the number of wide characters that precede the terminating
53null wide character.
54.Sh SEE ALSO
55.Xr wcswidth 3
56.Sh STANDARDS
57The
58.Fn wcslen
59function conforms to
60.St -isoC-99
61and was first introduced in
62.St -isoC-amd1 .
diff --git a/src/lib/libc/string/wcspbrk.3 b/src/lib/libc/string/wcspbrk.3
new file mode 100644
index 0000000000..81f08a8f1e
--- /dev/null
+++ b/src/lib/libc/string/wcspbrk.3
@@ -0,0 +1,73 @@
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $OpenBSD: wcspbrk.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSPBRK 3
36.Os
37.Sh NAME
38.Nm wcspbrk
39.Nd locate multiple wide characters in a wide string
40.Sh SYNOPSIS
41.Fd #include <wchar.h>
42.Ft wchar_t *
43.Fn wcspbrk "const wchar_t *s" "const wchar_t *charset"
44.Sh DESCRIPTION
45The
46.Fn wcspbrk
47function locates in the wide string
48.Fa s
49the first occurrence of any wide character in the wide string
50.Fa charset
51and returns a pointer to this wide character.
52If no wide characters from
53.Fa charset
54occur anywhere in
55.Fa s ,
56.Fn wcspbrk
57returns
58.Dv NULL .
59.Sh SEE ALSO
60.Xr wmemchr 3 ,
61.Xr wcschr 3 ,
62.Xr wcscspn 3 ,
63.Xr wcsrchr 3 ,
64.Xr wcsspn 3 ,
65.Xr wcsstr 3 ,
66.Xr wcstok 3
67.Sh STANDARDS
68The
69.Fn wcspbrk
70function conforms to
71.St -isoC-99
72and was first introduced in
73.St -isoC-amd1 .
diff --git a/src/lib/libc/string/wcsrchr.3 b/src/lib/libc/string/wcsrchr.3
new file mode 100644
index 0000000000..5e0c1f8835
--- /dev/null
+++ b/src/lib/libc/string/wcsrchr.3
@@ -0,0 +1,77 @@
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $OpenBSD: wcsrchr.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSRCHR 3
36.Os
37.Sh NAME
38.Nm wcsrchr
39.Nd locate last occurrence of a wide character in a wide string
40.Sh SYNOPSIS
41.Fd #include <wchar.h>
42.Ft wchar_t *
43.Fn wcsrchr "const wchar_t *s" "wchar_t c"
44.Sh DESCRIPTION
45The
46.Fn wcsrchr
47function locates the last occurrence of the wide character
48.Fa c
49in the wide string
50.Fa s .
51The terminating null wide character is considered part of the wide string.
52If
53.Fa c
54is the null wide character (L'\e0'),
55.Fn wcsrchr
56locates the terminating null wide character.
57.Sh RETURN VALUES
58The
59.Fn wcsrchr
60function returns a pointer to the located wide character or
61.Dv NULL
62if the wide character does not appear in the wide string.
63.Sh SEE ALSO
64.Xr wcschr 3 ,
65.Xr wcscspn 3 ,
66.Xr wcspbrk 3 ,
67.Xr wcsspn 3 ,
68.Xr wcsstr 3 ,
69.Xr wcstok 3 ,
70.Xr wmemchr 3
71.Sh STANDARDS
72The
73.Fn wcsrchr
74function conforms to
75.St -isoC-99
76and was first introduced in
77.St -isoC-amd1 .
diff --git a/src/lib/libc/string/wcsspn.3 b/src/lib/libc/string/wcsspn.3
new file mode 100644
index 0000000000..c73e13076e
--- /dev/null
+++ b/src/lib/libc/string/wcsspn.3
@@ -0,0 +1,71 @@
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $OpenBSD: wcsspn.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSSPN 3
36.Os
37.Sh NAME
38.Nm wcsspn
39.Nd span a wide string
40.Sh SYNOPSIS
41.Fd #include <wchar.h>
42.Ft size_t
43.Fn wcsspn "const wchar_t *s" "const wchar_t *charset"
44.Sh DESCRIPTION
45The
46.Fn wcsspn
47function spans the initial part of the wide string
48.Fa s
49as long as the wide characters from
50.Fa s
51occur in the wide string
52.Fa charset .
53.Sh RETURN VALUES
54The
55.Fn wcsspn
56function returns the number of wide characters spanned.
57.Sh SEE ALSO
58.Xr wcschr 3 ,
59.Xr wcscspn 3 ,
60.Xr wcspbrk 3 ,
61.Xr wcsrchr 3 ,
62.Xr wcsstr 3 ,
63.Xr wcstok 3 ,
64.Xr wmemchr 3
65.Sh STANDARDS
66The
67.Fn wcsspn
68function conforms to
69.St -isoC-99
70and was first introduced in
71.St -isoC-amd1 .
diff --git a/src/lib/libc/string/wcsstr.3 b/src/lib/libc/string/wcsstr.3
new file mode 100644
index 0000000000..dc99b70667
--- /dev/null
+++ b/src/lib/libc/string/wcsstr.3
@@ -0,0 +1,80 @@
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $OpenBSD: wcsstr.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WCSSTR 3
36.Os
37.Sh NAME
38.Nm wcsstr
39.Nd locate a wide substring in a wide string
40.Sh SYNOPSIS
41.Fd #include <wchar.h>
42.Ft wchar_t *
43.Fn wcsstr "const wchar_t *big" "const wchar_t *little"
44.Sh DESCRIPTION
45The
46.Fn wcsstr
47function locates the first occurrence of the wide string
48.Fa little
49in the wide string
50.Fa big .
51.Pp
52If
53.Fa little
54is an empty wide string,
55.Fa big
56is returned;
57if
58.Fa little
59occurs nowhere in
60.Fa big ,
61.Dv NULL
62is returned;
63otherwise a pointer to the first wide character of the first occurrence of
64.Fa little
65is returned.
66.Sh SEE ALSO
67.Xr wcschr 3 ,
68.Xr wcscspn 3 ,
69.Xr wcspbrk 3 ,
70.Xr wcsrchr 3 ,
71.Xr wcsspn 3 ,
72.Xr wcstok 3 ,
73.Xr wmemchr 3 ,
74.Sh STANDARDS
75The
76.Fn wcsstr
77function conforms to
78.St -isoC-99
79and was first introduced in
80.St -isoC-amd1 .
diff --git a/src/lib/libc/string/wmemchr.3 b/src/lib/libc/string/wmemchr.3
index 529f27b05b..40a68bf28d 100644
--- a/src/lib/libc/string/wmemchr.3
+++ b/src/lib/libc/string/wmemchr.3
@@ -1,9 +1,5 @@
1.\" $OpenBSD: wmemchr.3,v 1.6 2011/05/28 17:12:43 jmc Exp $ 1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" 2.\" All rights reserved.
3.\" $NetBSD: wmemchr.3,v 1.9 2003/09/08 17:54:33 wiz Exp $
4.\"
5.\" Copyright (c) 1990, 1991, 1993
6.\" The Regents of the University of California. All rights reserved.
7.\" 3.\"
8.\" This code is derived from software contributed to Berkeley by 4.\" This code is derived from software contributed to Berkeley by
9.\" Chris Torek and the American National Standards Committee X3, 5.\" Chris Torek and the American National Standards Committee X3,
@@ -33,123 +29,45 @@
33.\" 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
34.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
35.\" 31.\"
36.\" from: @(#)strcpy.3 8.1 (Berkeley) 6/4/93 32.\" $OpenBSD: wmemchr.3,v 1.7 2011/07/09 16:32:11 nicm Exp $
37.\" 33.\"
38.Dd $Mdocdate: May 28 2011 $ 34.Dd $Mdocdate: July 9 2011 $
39.Dt WMEMCHR 3 35.Dt WMEMCHR 3
40.Os 36.Os
41.Sh NAME 37.Sh NAME
42.Nm wmemchr , 38.Nm wmemchr
43.Nm wmemcmp , 39.Nd locate wide character in wide string
44.Nm wmemcpy ,
45.Nm wmemmove ,
46.Nm wmemset ,
47.Nm wcscat ,
48.Nm wcschr ,
49.Nm wcscmp ,
50.Nm wcscasecmp ,
51.Nm wcscpy ,
52.Nm wcscspn ,
53.Nm wcslcat ,
54.Nm wcslcpy ,
55.Nm wcslen ,
56.Nm wcsncat ,
57.Nm wcsncmp ,
58.Nm wcsncasecmp ,
59.Nm wcsncpy ,
60.Nm wcspbrk ,
61.Nm wcsrchr ,
62.Nm wcsspn ,
63.Nm wcsstr
64.Nd wide-character string manipulation operations
65.Sh SYNOPSIS 40.Sh SYNOPSIS
66.In wchar.h 41.Fd #include <wchar.h>
67.Ft wchar_t *
68.Fn wmemchr "const wchar_t *s" "wchar_t c" "size_t n"
69.Ft int
70.Fn wmemcmp "const wchar_t *s1" "const wchar_t *s2" "size_t n"
71.Ft wchar_t *
72.Fn wmemcpy "wchar_t * restrict s1" "const wchar_t * restrict s2" "size_t n"
73.Ft wchar_t *
74.Fn wmemmove "wchar_t *s1" "const wchar_t *s2" "size_t n"
75.Ft wchar_t *
76.Fn wmemset "wchar_t *s" "wchar_t c" "size_t n"
77.Ft wchar_t *
78.Fn wcscat "wchar_t * restrict s1" "const wchar_t * restrict s2"
79.Ft wchar_t *
80.Fn wcschr "const wchar_t *s" "wchar_t c"
81.Ft int
82.Fn wcscmp "const wchar_t *s1" "const wchar_t *s2"
83.Ft int
84.Fn wcscasecmp "const wchar_t *s1" "const wchar_t *s2"
85.Ft wchar_t *
86.Fn wcscpy "wchar_t * restrict s1" "const wchar_t * restrict s2"
87.Ft size_t
88.Fn wcscspn "const wchar_t *s1" "const wchar_t *s2"
89.Ft size_t
90.Fn wcslcat "wchar_t *s1" "const wchar_t *s2" "size_t n"
91.Ft size_t
92.Fn wcslcpy "wchar_t *s1" "const wchar_t *s2" "size_t n"
93.Ft size_t
94.Fn wcslen "const wchar_t *s"
95.Ft wchar_t *
96.Fn wcsncat "wchar_t * restrict s1" "const wchar_t * restrict s2" "size_t n"
97.Ft int
98.Fn wcsncmp "const wchar_t *s1" "const wchar_t * s2" "size_t n"
99.Ft int
100.Fn wcsncasecmp "const wchar_t *s1" "const wchar_t * s2" "size_t n"
101.Ft wchar_t *
102.Fn wcsncpy "wchar_t * restrict s1" "const wchar_t * restrict s2" "size_t n"
103.Ft wchar_t *
104.Fn wcspbrk "const wchar_t *s1" "const wchar_t *s2"
105.Ft wchar_t *
106.Fn wcsrchr "const wchar_t *s" "wchar_t c"
107.Ft size_t
108.Fn wcsspn "const wchar_t *s1" "const wchar_t *s2"
109.Ft wchar_t * 42.Ft wchar_t *
110.Fn wcsstr "const wchar_t *s1" "const wchar_t *s2" 43.Fn memchr "const wchar_t *b" "wchar_t c" "size_t len"
111.Sh DESCRIPTION 44.Sh DESCRIPTION
112These functions implement string manipulation operations over wide-character 45The
113strings. 46.Fn wmemchr
114For a detailed description, refer to documents for the respective single-byte 47function locates the first occurrence of
115counterpart, such as 48.Fa c
116.Xr memchr 3 . 49in wide string
50.Fa b .
51.Sh RETURN VALUES
52The
53.Fn wmemchr
54function returns a pointer to the wide character located, or
55.Dv NULL
56if no such wide character exists within
57.Fa len
58wide characters.
117.Sh SEE ALSO 59.Sh SEE ALSO
118.Xr memchr 3 , 60.Xr wcschr 3 ,
119.Xr memcmp 3 , 61.Xr wcscspn 3 ,
120.Xr memcpy 3 , 62.Xr wcspbrk 3 ,
121.Xr memmove 3 , 63.Xr wcsrchr 3 ,
122.Xr memset 3 , 64.Xr wcsspn 3 ,
123.Xr strcasecmp 3 , 65.Xr wcsstr 3 ,
124.Xr strcat 3 , 66.Xr wcstok 3
125.Xr strchr 3 ,
126.Xr strcmp 3 ,
127.Xr strcpy 3 ,
128.Xr strcspn 3 ,
129.Xr strlcat 3 ,
130.Xr strlcpy 3 ,
131.Xr strlen 3 ,
132.Xr strncasecmp 3 ,
133.Xr strncat 3 ,
134.Xr strncmp 3 ,
135.Xr strncpy 3 ,
136.Xr strpbrk 3 ,
137.Xr strrchr 3 ,
138.Xr strspn 3 ,
139.Xr strstr 3
140.Sh STANDARDS 67.Sh STANDARDS
141These functions conform to 68The
69.Fn memchr
70function conforms to
142.St -isoC-99 71.St -isoC-99
143and were first introduced in 72and was first introduced in
144.St -isoC-amd1 , 73.St -isoC-amd1 .
145except for
146.Fn wcscasecmp
147and
148.Fn wcsncasecmp ,
149which conform to
150.St -p1003.1-2008 ,
151and
152.Fn wcslcat
153and
154.Fn wcslcpy ,
155which are extensions.
diff --git a/src/lib/libc/string/wmemcmp.3 b/src/lib/libc/string/wmemcmp.3
new file mode 100644
index 0000000000..e1d56ec30e
--- /dev/null
+++ b/src/lib/libc/string/wmemcmp.3
@@ -0,0 +1,70 @@
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $OpenBSD: wmemcmp.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WMEMCMP 3
36.Os
37.Sh NAME
38.Nm wmemcmp
39.Nd compare wide strings
40.Sh SYNOPSIS
41.Fd #include <wchar.h>
42.Ft int
43.Fn wmemcmp "const wchar_t *s1" "const wchar_t *s2" "size_t len"
44.Sh DESCRIPTION
45The
46.Fn wmemcmp
47function compares the wide string
48.Fa s1
49against the wide string
50.Fa s2 .
51Both wide strings are assumed to be
52.Fa len
53wide characters long.
54.Sh RETURN VALUES
55The
56.Fn wmemcmp
57function returns zero if the two wide strings are identical,
58otherwise the difference between the first two differing wide characters is
59returned.
60Zero-length wide strings are always identical.
61.Sh SEE ALSO
62.Xr wcscasecmp 3 ,
63.Xr wcscmp 3 ,
64.Sh STANDARDS
65The
66.Fn wmemcmp
67function conforms to
68.St -isoC-99
69and was first introduced in
70.St -isoC-amd1 .
diff --git a/src/lib/libc/string/wmemcpy.3 b/src/lib/libc/string/wmemcpy.3
new file mode 100644
index 0000000000..8f4293c979
--- /dev/null
+++ b/src/lib/libc/string/wmemcpy.3
@@ -0,0 +1,77 @@
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $OpenBSD: wmemcpy.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt MEMCPY 3
36.Os
37.Sh NAME
38.Nm wmemcpy
39.Nd copy wide characters
40.Sh SYNOPSIS
41.Fd #include <wchar.h>
42.Ft wchar_t *
43.Fn memcpy "wchar_t * restrict dst" "const wchar_t * restrict src" "size_t len"
44.Sh DESCRIPTION
45The
46.Fn wmemcpy
47function copies
48.Fa len
49wide characters from buffer
50.Fa src
51to buffer
52.Fa dst .
53.Sh RETURN VALUES
54The
55.Fn wmemcpy
56function returns the original value of
57.Fa dst .
58.Sh SEE ALSO
59.Xr wcscpy 3 ,
60.Xr wcslcpy 3 ,
61.Xr wmemmove 3
62.Sh STANDARDS
63The
64.Fn wmemcpy
65function conforms to
66.St -isoC-99
67and was first introduced in
68.St -isoC-amd1 .
69.Sh BUGS
70In this implementation
71.Fn wmemcpy
72is implemented using
73.Xr bcopy 3 ,
74and therefore the buffers may overlap.
75On other systems, copying overlapping buffers may produce surprises.
76A simpler solution is to not use
77.Fn wmemcpy .
diff --git a/src/lib/libc/string/wmemmove.3 b/src/lib/libc/string/wmemmove.3
new file mode 100644
index 0000000000..b018bd5cbc
--- /dev/null
+++ b/src/lib/libc/string/wmemmove.3
@@ -0,0 +1,70 @@
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $OpenBSD: wmemmove.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WMEMMOVE 3
36.Os
37.Sh NAME
38.Nm wmemmove
39.Nd copy wide characters
40.Sh SYNOPSIS
41.Fd #include <wchar.h>
42.Ft wchar_t *
43.Fn wmemmove "wchar_t *dst" "const wchar_t *src" "size_t len"
44.Sh DESCRIPTION
45The
46.Fn wmemmove
47function copies
48.Fa len
49wide characters from buffer
50.Fa src
51to buffer
52.Fa dst .
53The two buffers may overlap;
54the copy is always done in a non-destructive manner.
55.Sh RETURN VALUES
56The
57.Fn wmemmove
58function returns the original value of
59.Fa dst .
60.Sh SEE ALSO
61.Xr wcscpy 3 ,
62.Xr wcslcpy 3 ,
63.Xr wmemcpy 3
64.Sh STANDARDS
65The
66.Fn wmemmove
67function conforms to
68.St -isoC-99
69and was first introduced in
70.St -isoC-amd1 .
diff --git a/src/lib/libc/string/wmemset.3 b/src/lib/libc/string/wmemset.3
new file mode 100644
index 0000000000..c43fc1079f
--- /dev/null
+++ b/src/lib/libc/string/wmemset.3
@@ -0,0 +1,64 @@
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $OpenBSD: wmemset.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
33.\"
34.Dd $Mdocdate: July 9 2011 $
35.Dt WMEMSET 3
36.Os
37.Sh NAME
38.Nm wmemset
39.Nd write a wide string
40.Sh SYNOPSIS
41.Fd #include <wchar.h>
42.Ft wchar_t *
43.Fn wmemset "wchar_t *s" "wchar_t c" "size_t len"
44.Sh DESCRIPTION
45The
46.Fn wmemset
47function writes
48.Fa len
49wide characters of value
50.Fa c
51to the wide string
52.Fa s .
53.Sh RETURN VALUES
54The
55.Fn wmemset
56function returns the original value of
57.Fa s .
58.Sh STANDARDS
59The
60.Fn memset
61function conforms to
62.St -isoC-99
63and was first introduced in
64.St -isoC-amd1 .