On Wed, 06 Jul 2011 18:03:18 +0200, Todd C. Miller wrote:
> On Tue, 05 Jul 2011 20:03:14 BST, Nicholas Marriott wrote:
>
> > I think they would be better as separate pages but I'm not volunteering
> > to do it, at least not right now ;-). FreeBSD and NetBSD look to have a
> > few split out.
>
> Me neither :-) This would be a easy project for someone with a
> little bit of time on their hands.
>
> - todd
Here is a diff for that. The new manual pages are based on their
single-byte counterparts.
Regards,
Tim
Index: Makefile.inc
===================================================================
RCS file: /cvs/src/lib/libc/string/Makefile.inc,v
retrieving revision 1.26
diff -N -u Makefile.inc
--- Makefile.inc 4 Jul 2011 04:37:34 -0000 1.26
+++ Makefile.inc 9 Jul 2011 11:05:09 -0000
@@ -144,7 +144,9 @@
strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strerror.3 \
string.3 strlen.3 strmode.3 strdup.3 strpbrk.3 strrchr.3 strsep.3 \
strsignal.3 strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 strlcpy.3 \
- wcstok.3 wmemchr.3 wcswidth.3 wcsdup.3
+ wcscasecmp.3 wcscat.3 wcschr.3 wcscmp.3 wcscpy.3 wcscspn.3 wcsdup.3 \
+ wcslcpy.3 wcslen.3 wcspbrk.3 wcsrchr.3 wcsspn.3 wcsstr.3 wcstok.3 \
+ wcswidth.3 wmemchr.3 wmemcmp.3 wmemcpy.3 wmemmove.3 wmemset.3
MLINKS+=bm.3 bm_comp.3 bm.3 bm_exec.3 bm.3 bm_free.3
MLINKS+=memchr.3 memrchr.3
@@ -160,25 +162,9 @@
MLINKS+=strstr.3 strcasestr.3
MLINKS+=strtok.3 strtok_r.3
MLINKS+=strerror.3 strerror_r.3
-MLINKS+=wmemchr.3 wmemcmp.3
-MLINKS+=wmemchr.3 wmemcpy.3
-MLINKS+=wmemchr.3 wmemmove.3
-MLINKS+=wmemchr.3 wmemset.3
-MLINKS+=wmemchr.3 wcscat.3
-MLINKS+=wmemchr.3 wcschr.3
-MLINKS+=wmemchr.3 wcscmp.3
-MLINKS+=wmemchr.3 wcscasecmp.3
-MLINKS+=wmemchr.3 wcscpy.3
-MLINKS+=wmemchr.3 wcscspn.3
-MLINKS+=wmemchr.3 wcslcat.3
-MLINKS+=wmemchr.3 wcslcpy.3
-MLINKS+=wmemchr.3 wcslen.3
-MLINKS+=wmemchr.3 wcsncat.3
-MLINKS+=wmemchr.3 wcsncmp.3
-MLINKS+=wmemchr.3 wcsncasecmp.3
-MLINKS+=wmemchr.3 wcsncpy.3
-MLINKS+=wmemchr.3 wcspbrk.3
-MLINKS+=wmemchr.3 wcsrchr.3
-MLINKS+=wmemchr.3 wcsspn.3
-MLINKS+=wmemchr.3 wcsstr.3
+MLINKS+=wcscasecmp.3 wcsncasecmp.3
+MLINKS+=wcscat.3 wcsncat.3
+MLINKS+=wcscmp.3 wcsncmp.3
+MLINKS+=wcscpy.3 wcsncpy.3
+MLINKS+=wcslcpy.3 wcslcat.3
MLINKS+=bcmp.3 timingsafe_bcmp.3
Index: wcscasecmp.3
===================================================================
RCS file: wcscasecmp.3
diff -N -u wcscasecmp.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wcscasecmp.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,77 @@
+.\" $OpenBSD: strcasecmp.3,v 1.10 2007/05/31 19:19:32 jmc Exp $
+.\"
+.\" Copyright (c) 1990, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek.
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)strcasecmp.3 8.1 (Berkeley) 6/9/93
+.\"
+.Dd $Mdocdate$
+.Dt WCSCASECMP 3
+.Os
+.Sh NAME
+.Nm wcscasecmp ,
+.Nm wcsncasecmp
+.Nd compare wide strings, ignoring case
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft int
+.Fn wcscasecmp "const wchar_t *s1" "const wchar_t *s2"
+.Ft int
+.Fn wcsncasecmp "const wchar_t *s1" "const wchar_t *s2" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn wcscasecmp
+and
+.Fn wcsncasecmp
+functions compare the wide strings
+.Fa s1
+and
+.Fa s2
+and return an integer greater than, equal to, or less than 0,
+according to whether
+.Fa s1
+is lexicographically greater than, equal to, or less than
+.Fa s2
+after translation of each corresponding wide character to lower case.
+The wide strings themselves are not modified.
+.Pp
+.Fn wcsncasecmp
+compares at most
+.Fa len
+wide characters.
+.Sh SEE ALSO
+.Xr wcscmp 3 ,
+.Xr wmemcmp 3
+.Sh STANDARDS
+The
+.Fn wcscasecmp
+and
+.Fn wcsncasecmp
+functions conform to
+.St -p1003.1-2008 .
Index: wcscat.3
===================================================================
RCS file: wcscat.3
diff -N -u wcscat.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wcscat.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,93 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $OpenBSD: strcat.3,v 1.12 2007/05/31 19:19:32 jmc Exp $
+.\"
+.Dd $Mdocdate$
+.Dt WCSCAT 3
+.Os
+.Sh NAME
+.Nm wcscat ,
+.Nm wcsncat
+.Nd concatenate wide strings
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft wchar_t *
+.Fn wcscat "wchar_t * restrict s" "const wchar_t * restrict append"
+.Ft wchar_t *
+.Fo strncat
+.Fa "wchar_t * restrict s"
+.Fa "const wchar_t * restrict append"
+.Fa "size_t count"
+.Fc
+.Sh DESCRIPTION
+The
+.Fn wcscat
+and
+.Fn wcsncat
+functions append a copy of the wide string
+.Fa append
+to the end of the wide string
+.Fa s ,
+then add a terminating null wide character (L'\e0').
+The wide string
+.Fa s
+must have sufficient space to hold the result.
+.Pp
+The
+.Fn wcsncat
+function appends not more than
+.Fa count
+wide characters where space for the terminating null wide character
+should not be included in
+.Fa count .
+.Sh RETURN VALUES
+The
+.Fn wcscat
+and
+.Fn wcsncat
+functions return the pointer
+.Fa s .
+.Sh SEE ALSO
+.Xr wcscpy 3 ,
+.Xr wcslcat 3 ,
+.Xr wcslcpy 3 ,
+.Xr wmemcpy 3 ,
+.Xr wmemmove 3
+.Sh STANDARDS
+The
+.Fn wcscat
+and
+.Fn wcsncat
+functions conform to
+.St -isoC-99
+and were first introduced in
+.St -isoC-amd1 .
Index: wcschr.3
===================================================================
RCS file: wcschr.3
diff -N -u wcschr.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wcschr.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,77 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $OpenBSD: strchr.3,v 1.9 2007/05/31 19:19:32 jmc Exp $
+.\"
+.Dd $Mdocdate$
+.Dt STRCHR 3
+.Os
+.Sh NAME
+.Nm wcschr
+.Nd locate first occurrence of a wide character in a wide string
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft wchar_t *
+.Fn wcschr "const wchar_t *s" "wchar_t c"
+.Sh DESCRIPTION
+The
+.Fn wcschr
+function locates the first occurrence of the wide character
+.Fa c
+in the wide string
+.Fa s .
+The terminating null wide character is considered part of the wide string.
+If
+.Fa c
+is the null wide character (L'\e0'),
+.Fn wcschr
+locates the terminating null wide character.
+.Sh RETURN VALUES
+The
+.Fn wcschr
+function returns a pointer to the located wide character or
+.Dv NULL
+if the wide character does not appear in the wide string.
+.Sh SEE ALSO
+.Xr wcscspn 3 ,
+.Xr wcspbrk 3 ,
+.Xr wcsrchr 3 ,
+.Xr wcsspn 3 ,
+.Xr wcsstr 3 ,
+.Xr wcstok 3 ,
+.Xr wmemchr 3
+.Sh STANDARDS
+The
+.Fn wcschr
+function conforms to
+.St -isoC-99
+and was first introduced in
+.St -isoC-amd1 .
Index: wcscmp.3
===================================================================
RCS file: wcscmp.3
diff -N -u wcscmp.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wcscmp.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,82 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $OpenBSD: strcmp.3,v 1.10 2009/12/05 07:45:48 jmc Exp $
+.\"
+.Dd $Mdocdate$
+.Dt WCSCMP 3
+.Os
+.Sh NAME
+.Nm wcscmp ,
+.Nm wcsncmp
+.Nd compare wide strings
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft int
+.Fn wcscmp "const wchar_t *s1" "const wchar_t *s2"
+.Ft int
+.Fn wcsncmp "const wchar_t *s1" "const wchar_t *s2" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn wcscmp
+and
+.Fn wcsncmp
+functions lexicographically compare the wide strings
+.Fa s1
+and
+.Fa s2 .
+The
+.Fn wcsncmp
+compares at most
+.Fa len
+wide characters.
+.Sh RETURN VALUES
+The
+.Fn wcscmp
+and
+.Fn wcsncmp
+functions return an integer greater than, equal to, or less than 0, according
+to whether the wide string
+.Fa s1
+is greater than, equal to, or less than the wide string
+.Fa s2 .
+.Sh SEE ALSO
+.Xr wcscasecmp 3 ,
+.Xr wmemcmp 3
+.Sh STANDARDS
+The
+.Fn wcscmp
+and
+.Fn wcsncmp
+functions conform to
+.St -isoC-99
+and were first introduced in
+.St -isoC-amd1 .
Index: wcscpy.3
===================================================================
RCS file: wcscpy.3
diff -N -u wcscpy.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wcscpy.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,97 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $OpenBSD: strcpy.3,v 1.15 2007/05/31 19:19:32 jmc Exp $
+.\"
+.Dd $Mdocdate$
+.Dt WCSCPY 3
+.Os
+.Sh NAME
+.Nm wcscpy ,
+.Nm wcsncpy
+.Nd copy wide strings
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft wchar_t *
+.Fn wcscpy "wchar_t * restrict dst" "const wchar_t * restrict src"
+.Ft wchar_t *
+.Fo wcsncpy
+.Fa "wchar_t * restrict dst"
+.Fa "const wchar_t * restrict src"
+.Fa "size_t len"
+.Fc
+.Sh DESCRIPTION
+The
+.Fn wcscpy
+function copies the wide string
+.Fa src
+to
+.Fa dst
+(including the terminating null wide character).
+.Pp
+The
+.Fn wcsncpy
+function copies not more than
+.Fa len
+wide characters to
+.Fa dst ,
+appending null wide characters if the length of
+.Fa src
+is less than
+.Fa len ,
+and
+.Em not
+terminating
+.Fa dst
+if the length of
+.Fa src
+is greater than or equal to
+.Fa len .
+.Sh RETURN VALUES
+The
+.Fn wcscpy
+and
+.Fn wcsncpy
+functions return
+.Fa dst .
+.Sh SEE ALSO
+.Xr wcslcpy 3 ,
+.Xr wmemcpy 3 ,
+.Xr wmemmove 3
+.Sh STANDARDS
+The
+.Fn wcscpy
+and
+.Fn wcsncpy
+functions conform to
+.St -isoC-99
+and were first introduced in
+.St -isoC-amd1 .
Index: wcscspn.3
===================================================================
RCS file: wcscspn.3
diff -N -u wcscspn.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wcscspn.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,75 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $OpenBSD: strcspn.3,v 1.9 2007/08/08 07:20:45 ray Exp $
+.\"
+.Dd $Mdocdate$
+.Dt WCSCSPN 3
+.Os
+.Sh NAME
+.Nm wcscspn
+.Nd span the complement of a wide string
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft size_t
+.Fn wcscspn "const wchar_t *s" "const wchar_t *charset"
+.Sh DESCRIPTION
+The
+.Fn wcscspn
+function spans the initial part of the wide string
+.Fa s
+as long as the wide characters from
+.Fa s
+do not occur in string
+.Fa charset
+(it spans the
+.Em complement
+of
+.Fa charset ) .
+.Sh RETURN VALUES
+The
+.Fn wcscspn
+function returns the number of wide characters spanned.
+.Sh SEE ALSO
+.Xr wcschr 3 ,
+.Xr wcspbrk 3 ,
+.Xr wcsrchr 3 ,
+.Xr wcsspn 3 ,
+.Xr wcsstr 3 ,
+.Xr wcstok 3 ,
+.Xr wmemchr 3
+.Sh STANDARDS
+The
+.Fn wcscspn
+function conforms to
+.St -isoC-99
+and was first introduced in
+.St -isoC-amd1 .
Index: wcslcpy.3
===================================================================
RCS file: wcslcpy.3
diff -N -u wcslcpy.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wcslcpy.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,139 @@
+.\" $OpenBSD: strlcpy.3,v 1.19 2007/05/31 19:19:32 jmc Exp $
+.\"
+.\" Copyright (c) 1998, 2000 Todd C. Miller <[email protected]>
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd $Mdocdate$
+.Dt WCSLCPY 3
+.Os
+.Sh NAME
+.Nm wcslcpy ,
+.Nm wcslcat
+.Nd size-bounded wide string copying and concatenation
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft size_t
+.Fn wcslcpy "wchar_t *dst" "const wchar_t *src" "size_t size"
+.Ft size_t
+.Fn wcslcat "wchar_t *dst" "const wchar_t *src" "size_t size"
+.Sh DESCRIPTION
+The
+.Fn wcslcpy
+and
+.Fn wcslcat
+functions copy and concatenate wide strings respectively.
+They are designed to be safer, more consistent, and less error prone
+replacements for
+.Xr wcsncpy 3
+and
+.Xr wcsncat 3 .
+Unlike those functions,
+.Fn wcslcpy
+and
+.Fn wcslcat
+take the full size of the buffer (not just the length) and guarantee to
+terminate the result with a null wide character (as long as
+.Fa size
+is larger than 0 or, in the case of
+.Fn wcslcat ,
+as long as there is at least one wide character free in
+.Fa dst ) .
+Note that a wide character for the null wide character should be included in
+.Fa size .
+Also note that
+.Fn wcslcpy
+and
+.Fn wcslcat
+only operate on wide strings that are terminated with a null wide character
+(L'\e0').
+This means that for
+.Fn wcslcpy
+.Fa src
+must be terminated with a null wide character and for
+.Fn wcslcat
+both
+.Fa src
+and
+.Fa dst
+must be terminated with a null wide character.
+.Pp
+The
+.Fn wcslcpy
+function copies up to
+.Fa size
+\(mi 1 wide characters from the wide string
+.Fa src
+to
+.Fa dst ,
+terminating the result with a null wide character.
+.Pp
+The
+.Fn wcslcat
+function appends the wide string
+.Fa src
+to the end of
+.Fa dst .
+It will append at most
+.Fa size
+\(mi wcslen(dst) \(mi 1 wide characters, terminating the result with a null
+wide character.
+.Sh RETURN VALUES
+The
+.Fn wcslcpy
+and
+.Fn wcslcat
+functions return the total length of the wide string they tried to create.
+For
+.Fn wcslcpy
+that means the length of
+.Fa src .
+For
+.Fn wcslcat
+that means the initial length of
+.Fa dst
+plus
+the length of
+.Fa src .
+While this may seem somewhat confusing, it was done to make
+truncation detection simple.
+.Pp
+Note, however, that if
+.Fn wcslcat
+traverses
+.Fa size
+wide characters without finding a null wide character, the length of the
+string is considered to be
+.Fa size
+and the destination wide string will not be terminated with a null wide
+character (since there was no space for it).
+This keeps
+.Fn wcslcat
+from running off the end of a wide string.
+In practice this should not happen (as it means that either
+.Fa size
+is incorrect or that
+.Fa dst
+is not terminated with a null wide character).
+The check exists to prevent potential security problems in incorrect code.
+.Sh SEE ALSO
+.Xr swprintf 3 ,
+.Xr wcsncat 3 ,
+.Xr wcsncpy 3
+.Sh HISTORY
+The
+.Fn wcslcpy
+and
+.Fn wcslcat
+functions first appeared in
+.Ox 3.8 .
Index: wcslen.3
===================================================================
RCS file: wcslen.3
diff -N -u wcslen.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wcslen.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,62 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $OpenBSD: strlen.3,v 1.9 2010/05/24 21:27:25 millert Exp $
+.\"
+.Dd $Mdocdate$
+.Dt WCSLEN 3
+.Os
+.Sh NAME
+.Nm wcslen
+.Nd find length of a wide string
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft size_t
+.Fn wcslen "const wchar_t *s"
+.Sh DESCRIPTION
+The
+.Fn wcslen
+function computes the length of the wide string
+.Fa s .
+.Sh RETURN VALUES
+The
+.Fn wcslen
+function returns the number of wide characters that precede the terminating
+null wide character.
+.Sh SEE ALSO
+.Xr wcswidth 3
+.Sh STANDARDS
+The
+.Fn wcslen
+function conforms to
+.St -isoC-99
+and was first introduced in
+.St -isoC-amd1 .
Index: wcspbrk.3
===================================================================
RCS file: wcspbrk.3
diff -N -u wcspbrk.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wcspbrk.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,73 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $OpenBSD: strpbrk.3,v 1.8 2007/05/31 19:19:32 jmc Exp $
+.\"
+.Dd $Mdocdate$
+.Dt WCSPBRK 3
+.Os
+.Sh NAME
+.Nm wcspbrk
+.Nd locate multiple wide characters in a wide string
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft wchar_t *
+.Fn wcspbrk "const wchar_t *s" "const wchar_t *charset"
+.Sh DESCRIPTION
+The
+.Fn wcspbrk
+function locates in the wide string
+.Fa s
+the first occurrence of any wide character in the wide string
+.Fa charset
+and returns a pointer to this wide character.
+If no wide characters from
+.Fa charset
+occur anywhere in
+.Fa s ,
+.Fn wcspbrk
+returns
+.Dv NULL .
+.Sh SEE ALSO
+.Xr wmemchr 3 ,
+.Xr wcschr 3 ,
+.Xr wcscspn 3 ,
+.Xr wcsrchr 3 ,
+.Xr wcsspn 3 ,
+.Xr wcsstr 3 ,
+.Xr wcstok 3
+.Sh STANDARDS
+The
+.Fn wcspbrk
+function conforms to
+.St -isoC-99
+and was first introduced in
+.St -isoC-amd1 .
Index: wcsrchr.3
===================================================================
RCS file: wcsrchr.3
diff -N -u wcsrchr.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wcsrchr.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,77 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $OpenBSD: strrchr.3,v 1.8 2007/05/31 19:19:32 jmc Exp $
+.\"
+.Dd $Mdocdate$
+.Dt WCSRCHR 3
+.Os
+.Sh NAME
+.Nm wcsrchr
+.Nd locate last occurrence of a wide character in a wide string
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft wchar_t *
+.Fn wcsrchr "const wchar_t *s" "wchar_t c"
+.Sh DESCRIPTION
+The
+.Fn wcsrchr
+function locates the last occurrence of the wide character
+.Fa c
+in the wide string
+.Fa s .
+The terminating null wide character is considered part of the wide string.
+If
+.Fa c
+is the null wide character (L'\e0'),
+.Fn wcsrchr
+locates the terminating null wide character.
+.Sh RETURN VALUES
+The
+.Fn wcsrchr
+function returns a pointer to the located wide character or
+.Dv NULL
+if the wide character does not appear in the wide string.
+.Sh SEE ALSO
+.Xr wcschr 3 ,
+.Xr wcscspn 3 ,
+.Xr wcspbrk 3 ,
+.Xr wcsspn 3 ,
+.Xr wcsstr 3 ,
+.Xr wcstok 3 ,
+.Xr wmemchr 3
+.Sh STANDARDS
+The
+.Fn wcsrchr
+function conforms to
+.St -isoC-99
+and was first introduced in
+.St -isoC-amd1 .
Index: wcsspn.3
===================================================================
RCS file: wcsspn.3
diff -N -u wcsspn.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wcsspn.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,71 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $OpenBSD: strspn.3,v 1.9 2007/05/31 19:19:32 jmc Exp $
+.\"
+.Dd $Mdocdate$
+.Dt WCSSPN 3
+.Os
+.Sh NAME
+.Nm wcsspn
+.Nd span a wide string
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft size_t
+.Fn wcsspn "const wchar_t *s" "const wchar_t *charset"
+.Sh DESCRIPTION
+The
+.Fn wcsspn
+function spans the initial part of the wide string
+.Fa s
+as long as the wide characters from
+.Fa s
+occur in the wide string
+.Fa charset .
+.Sh RETURN VALUES
+The
+.Fn wcsspn
+function returns the number of wide characters spanned.
+.Sh SEE ALSO
+.Xr wcschr 3 ,
+.Xr wcscspn 3 ,
+.Xr wcspbrk 3 ,
+.Xr wcsrchr 3 ,
+.Xr wcsstr 3 ,
+.Xr wcstok 3 ,
+.Xr wmemchr 3
+.Sh STANDARDS
+The
+.Fn wcsspn
+function conforms to
+.St -isoC-99
+and was first introduced in
+.St -isoC-amd1 .
Index: wcsstr.3
===================================================================
RCS file: wcsstr.3
diff -N -u wcsstr.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wcsstr.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,80 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $OpenBSD: strstr.3,v 1.10 2007/09/19 16:06:45 jmc Exp $
+.\"
+.Dd $Mdocdate$
+.Dt WCSSTR 3
+.Os
+.Sh NAME
+.Nm wcsstr
+.Nd locate a wide substring in a wide string
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft wchar_t *
+.Fn wcsstr "const wchar_t *big" "const wchar_t *little"
+.Sh DESCRIPTION
+The
+.Fn wcsstr
+function locates the first occurrence of the wide string
+.Fa little
+in the wide string
+.Fa big .
+.Pp
+If
+.Fa little
+is an empty wide string,
+.Fa big
+is returned;
+if
+.Fa little
+occurs nowhere in
+.Fa big ,
+.Dv NULL
+is returned;
+otherwise a pointer to the first wide character of the first occurrence of
+.Fa little
+is returned.
+.Sh SEE ALSO
+.Xr wcschr 3 ,
+.Xr wcscspn 3 ,
+.Xr wcspbrk 3 ,
+.Xr wcsrchr 3 ,
+.Xr wcsspn 3 ,
+.Xr wcstok 3 ,
+.Xr wmemchr 3 ,
+.Sh STANDARDS
+The
+.Fn wcsstr
+function conforms to
+.St -isoC-99
+and was first introduced in
+.St -isoC-amd1 .
Index: wmemchr.3
===================================================================
RCS file: /cvs/src/lib/libc/string/wmemchr.3,v
retrieving revision 1.6
diff -N -u wmemchr.3
--- wmemchr.3 28 May 2011 17:12:43 -0000 1.6
+++ wmemchr.3 9 Jul 2011 11:05:09 -0000
@@ -1,10 +1,6 @@
-.\" $OpenBSD: wmemchr.3,v 1.6 2011/05/28 17:12:43 jmc Exp $
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
.\"
-.\" $NetBSD: wmemchr.3,v 1.9 2003/09/08 17:54:33 wiz Exp $
-.\"
-.\" Copyright (c) 1990, 1991, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
.\" This code is derived from software contributed to Berkeley by
.\" Chris Torek and the American National Standards Committee X3,
.\" on Information Processing Systems.
@@ -33,123 +29,45 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)strcpy.3 8.1 (Berkeley) 6/4/93
+.\" $OpenBSD: memchr.3,v 1.9 2007/09/03 16:50:14 jmc Exp $
.\"
-.Dd $Mdocdate: May 28 2011 $
+.Dd $Mdocdate$
.Dt WMEMCHR 3
.Os
.Sh NAME
-.Nm wmemchr ,
-.Nm wmemcmp ,
-.Nm wmemcpy ,
-.Nm wmemmove ,
-.Nm wmemset ,
-.Nm wcscat ,
-.Nm wcschr ,
-.Nm wcscmp ,
-.Nm wcscasecmp ,
-.Nm wcscpy ,
-.Nm wcscspn ,
-.Nm wcslcat ,
-.Nm wcslcpy ,
-.Nm wcslen ,
-.Nm wcsncat ,
-.Nm wcsncmp ,
-.Nm wcsncasecmp ,
-.Nm wcsncpy ,
-.Nm wcspbrk ,
-.Nm wcsrchr ,
-.Nm wcsspn ,
-.Nm wcsstr
-.Nd wide-character string manipulation operations
+.Nm wmemchr
+.Nd locate wide character in wide string
.Sh SYNOPSIS
-.In wchar.h
+.Fd #include <wchar.h>
.Ft wchar_t *
-.Fn wmemchr "const wchar_t *s" "wchar_t c" "size_t n"
-.Ft int
-.Fn wmemcmp "const wchar_t *s1" "const wchar_t *s2" "size_t n"
-.Ft wchar_t *
-.Fn wmemcpy "wchar_t * restrict s1" "const wchar_t * restrict s2" "size_t n"
-.Ft wchar_t *
-.Fn wmemmove "wchar_t *s1" "const wchar_t *s2" "size_t n"
-.Ft wchar_t *
-.Fn wmemset "wchar_t *s" "wchar_t c" "size_t n"
-.Ft wchar_t *
-.Fn wcscat "wchar_t * restrict s1" "const wchar_t * restrict s2"
-.Ft wchar_t *
-.Fn wcschr "const wchar_t *s" "wchar_t c"
-.Ft int
-.Fn wcscmp "const wchar_t *s1" "const wchar_t *s2"
-.Ft int
-.Fn wcscasecmp "const wchar_t *s1" "const wchar_t *s2"
-.Ft wchar_t *
-.Fn wcscpy "wchar_t * restrict s1" "const wchar_t * restrict s2"
-.Ft size_t
-.Fn wcscspn "const wchar_t *s1" "const wchar_t *s2"
-.Ft size_t
-.Fn wcslcat "wchar_t *s1" "const wchar_t *s2" "size_t n"
-.Ft size_t
-.Fn wcslcpy "wchar_t *s1" "const wchar_t *s2" "size_t n"
-.Ft size_t
-.Fn wcslen "const wchar_t *s"
-.Ft wchar_t *
-.Fn wcsncat "wchar_t * restrict s1" "const wchar_t * restrict s2" "size_t n"
-.Ft int
-.Fn wcsncmp "const wchar_t *s1" "const wchar_t * s2" "size_t n"
-.Ft int
-.Fn wcsncasecmp "const wchar_t *s1" "const wchar_t * s2" "size_t n"
-.Ft wchar_t *
-.Fn wcsncpy "wchar_t * restrict s1" "const wchar_t * restrict s2" "size_t n"
-.Ft wchar_t *
-.Fn wcspbrk "const wchar_t *s1" "const wchar_t *s2"
-.Ft wchar_t *
-.Fn wcsrchr "const wchar_t *s" "wchar_t c"
-.Ft size_t
-.Fn wcsspn "const wchar_t *s1" "const wchar_t *s2"
-.Ft wchar_t *
-.Fn wcsstr "const wchar_t *s1" "const wchar_t *s2"
+.Fn memchr "const wchar_t *b" "wchar_t c" "size_t len"
.Sh DESCRIPTION
-These functions implement string manipulation operations over wide-character
-strings.
-For a detailed description, refer to documents for the respective single-byte
-counterpart, such as
-.Xr memchr 3 .
+The
+.Fn wmemchr
+function locates the first occurrence of
+.Fa c
+in wide string
+.Fa b .
+.Sh RETURN VALUES
+The
+.Fn wmemchr
+function returns a pointer to the wide character located, or
+.Dv NULL
+if no such wide character exists within
+.Fa len
+wide characters.
.Sh SEE ALSO
-.Xr memchr 3 ,
-.Xr memcmp 3 ,
-.Xr memcpy 3 ,
-.Xr memmove 3 ,
-.Xr memset 3 ,
-.Xr strcasecmp 3 ,
-.Xr strcat 3 ,
-.Xr strchr 3 ,
-.Xr strcmp 3 ,
-.Xr strcpy 3 ,
-.Xr strcspn 3 ,
-.Xr strlcat 3 ,
-.Xr strlcpy 3 ,
-.Xr strlen 3 ,
-.Xr strncasecmp 3 ,
-.Xr strncat 3 ,
-.Xr strncmp 3 ,
-.Xr strncpy 3 ,
-.Xr strpbrk 3 ,
-.Xr strrchr 3 ,
-.Xr strspn 3 ,
-.Xr strstr 3
+.Xr wcschr 3 ,
+.Xr wcscspn 3 ,
+.Xr wcspbrk 3 ,
+.Xr wcsrchr 3 ,
+.Xr wcsspn 3 ,
+.Xr wcsstr 3 ,
+.Xr wcstok 3
.Sh STANDARDS
-These functions conform to
+The
+.Fn memchr
+function conforms to
.St -isoC-99
-and were first introduced in
-.St -isoC-amd1 ,
-except for
-.Fn wcscasecmp
-and
-.Fn wcsncasecmp ,
-which conform to
-.St -p1003.1-2008 ,
-and
-.Fn wcslcat
-and
-.Fn wcslcpy ,
-which are extensions.
+and was first introduced in
+.St -isoC-amd1 .
Index: wmemcmp.3
===================================================================
RCS file: wmemcmp.3
diff -N -u wmemcmp.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wmemcmp.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,70 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $OpenBSD: memcmp.3,v 1.6 2007/05/31 19:19:32 jmc Exp $
+.\"
+.Dd $Mdocdate$
+.Dt WMEMCMP 3
+.Os
+.Sh NAME
+.Nm wmemcmp
+.Nd compare wide strings
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft int
+.Fn wmemcmp "const wchar_t *s1" "const wchar_t *s2" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn wmemcmp
+function compares the wide string
+.Fa s1
+against the wide string
+.Fa s2 .
+Both wide strings are assumed to be
+.Fa len
+wide characters long.
+.Sh RETURN VALUES
+The
+.Fn wmemcmp
+function returns zero if the two wide strings are identical,
+otherwise the difference between the first two differing wide characters is
+returned.
+Zero-length wide strings are always identical.
+.Sh SEE ALSO
+.Xr wcscasecmp 3 ,
+.Xr wcscmp 3 ,
+.Sh STANDARDS
+The
+.Fn wmemcmp
+function conforms to
+.St -isoC-99
+and was first introduced in
+.St -isoC-amd1 .
Index: wmemcpy.3
===================================================================
RCS file: wmemcpy.3
diff -N -u wmemcpy.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wmemcpy.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,77 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $OpenBSD: memcpy.3,v 1.7 2007/05/31 19:19:32 jmc Exp $
+.\"
+.Dd $Mdocdate$
+.Dt MEMCPY 3
+.Os
+.Sh NAME
+.Nm wmemcpy
+.Nd copy wide characters
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft wchar_t *
+.Fn memcpy "wchar_t * restrict dst" "const wchar_t * restrict src" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn wmemcpy
+function copies
+.Fa len
+wide characters from buffer
+.Fa src
+to buffer
+.Fa dst .
+.Sh RETURN VALUES
+The
+.Fn wmemcpy
+function returns the original value of
+.Fa dst .
+.Sh SEE ALSO
+.Xr wcscpy 3 ,
+.Xr wcslcpy 3 ,
+.Xr wmemmove 3
+.Sh STANDARDS
+The
+.Fn wmemcpy
+function conforms to
+.St -isoC-99
+and was first introduced in
+.St -isoC-amd1 .
+.Sh BUGS
+In this implementation
+.Fn wmemcpy
+is implemented using
+.Xr bcopy 3 ,
+and therefore the buffers may overlap.
+On other systems, copying overlapping buffers may produce surprises.
+A simpler solution is to not use
+.Fn wmemcpy .
Index: wmemmove.3
===================================================================
RCS file: wmemmove.3
diff -N -u wmemmove.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wmemmove.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,70 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $OpenBSD: memmove.3,v 1.7 2007/05/31 19:19:32 jmc Exp $
+.\"
+.Dd $Mdocdate$
+.Dt WMEMMOVE 3
+.Os
+.Sh NAME
+.Nm wmemmove
+.Nd copy wide characters
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft wchar_t *
+.Fn wmemmove "wchar_t *dst" "const wchar_t *src" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn wmemmove
+function copies
+.Fa len
+wide characters from buffer
+.Fa src
+to buffer
+.Fa dst .
+The two buffers may overlap;
+the copy is always done in a non-destructive manner.
+.Sh RETURN VALUES
+The
+.Fn wmemmove
+function returns the original value of
+.Fa dst .
+.Sh SEE ALSO
+.Xr wcscpy 3 ,
+.Xr wcslcpy 3 ,
+.Xr wmemcpy 3
+.Sh STANDARDS
+The
+.Fn wmemmove
+function conforms to
+.St -isoC-99
+and was first introduced in
+.St -isoC-amd1 .
Index: wmemset.3
===================================================================
RCS file: wmemset.3
diff -N -u wmemset.3
--- /dev/null 9 Jul 2011 05:05:10 -0000
+++ wmemset.3 9 Jul 2011 11:05:09 -0000
@@ -0,0 +1,64 @@
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $OpenBSD: memset.3,v 1.6 2007/05/31 19:19:32 jmc Exp $
+.\"
+.Dd $Mdocdate$
+.Dt WMEMSET 3
+.Os
+.Sh NAME
+.Nm wmemset
+.Nd write a wide string
+.Sh SYNOPSIS
+.Fd #include <wchar.h>
+.Ft wchar_t *
+.Fn wmemset "wchar_t *s" "wchar_t c" "size_t len"
+.Sh DESCRIPTION
+The
+.Fn wmemset
+function writes
+.Fa len
+wide characters of value
+.Fa c
+to the wide string
+.Fa s .
+.Sh RETURN VALUES
+The
+.Fn wmemset
+function returns the original value of
+.Fa s .
+.Sh STANDARDS
+The
+.Fn memset
+function conforms to
+.St -isoC-99
+and was first introduced in
+.St -isoC-amd1 .