individual pages (based on the existing string man pages). By Tim van der Molen (tbvdm at xs4all dot nl) after a suggestion by millert@. ok deraadtOPENBSD_5_0
@ -0,0 +1,77 @@ | |||
.\" $OpenBSD: wcscasecmp.3,v 1.1 2011/07/09 16:32:11 nicm 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: July 9 2011 $ | |||
.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 . |
@ -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: wcscat.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ | |||
.\" | |||
.Dd $Mdocdate: July 9 2011 $ | |||
.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 . |
@ -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: wcschr.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ | |||
.\" | |||
.Dd $Mdocdate: July 9 2011 $ | |||
.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 . |
@ -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: wcscmp.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ | |||
.\" | |||
.Dd $Mdocdate: July 9 2011 $ | |||
.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 . |
@ -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: wcscpy.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ | |||
.\" | |||
.Dd $Mdocdate: July 9 2011 $ | |||
.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 . |
@ -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: wcscspn.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ | |||
.\" | |||
.Dd $Mdocdate: July 9 2011 $ | |||
.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 . |
@ -0,0 +1,139 @@ | |||
.\" $OpenBSD: wcslcpy.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ | |||
.\" | |||
.\" Copyright (c) 1998, 2000 Todd C. Miller <Todd.Miller@courtesan.com> | |||
.\" | |||
.\" 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: July 9 2011 $ | |||
.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 . |
@ -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: wcslen.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ | |||
.\" | |||
.Dd $Mdocdate: July 9 2011 $ | |||
.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 . |
@ -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: wcspbrk.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ | |||
.\" | |||
.Dd $Mdocdate: July 9 2011 $ | |||
.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 . |
@ -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: wcsrchr.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ | |||
.\" | |||
.Dd $Mdocdate: July 9 2011 $ | |||
.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 . |
@ -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: wcsspn.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ | |||
.\" | |||
.Dd $Mdocdate: July 9 2011 $ | |||
.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 . |
@ -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: wcsstr.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ | |||
.\" | |||
.Dd $Mdocdate: July 9 2011 $ | |||
.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 . |
@ -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: wmemcmp.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ | |||
.\" | |||
.Dd $Mdocdate: July 9 2011 $ | |||
.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 . |
@ -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: wmemcpy.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ | |||
.\" | |||
.Dd $Mdocdate: July 9 2011 $ | |||
.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 . |
@ -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: wmemmove.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ | |||
.\" | |||
.Dd $Mdocdate: July 9 2011 $ | |||
.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 . |
@ -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: wmemset.3,v 1.1 2011/07/09 16:32:11 nicm Exp $ | |||
.\" | |||
.Dd $Mdocdate: July 9 2011 $ | |||
.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 . |