xref: /netbsd-src/lib/libc/locale/wcsxfrm.3 (revision 3d3c5d42cb3aa0851ce2ca1303fdf134c850987c)
1*3d3c5d42Swiz.\" $NetBSD: wcsxfrm.3,v 1.4 2010/12/16 17:42:27 wiz Exp $
265b88fc7Stnozaki.\"
365b88fc7Stnozaki.\" Copyright (c) 1990, 1991, 1993
465b88fc7Stnozaki.\"	The Regents of the University of California.  All rights reserved.
565b88fc7Stnozaki.\"
665b88fc7Stnozaki.\" This code is derived from software contributed to Berkeley by
765b88fc7Stnozaki.\" Chris Torek and the American National Standards Committee X3,
865b88fc7Stnozaki.\" on Information Processing Systems.
965b88fc7Stnozaki.\"
1065b88fc7Stnozaki.\" Redistribution and use in source and binary forms, with or without
1165b88fc7Stnozaki.\" modification, are permitted provided that the following conditions
1265b88fc7Stnozaki.\" are met:
1365b88fc7Stnozaki.\" 1. Redistributions of source code must retain the above copyright
1465b88fc7Stnozaki.\"    notice, this list of conditions and the following disclaimer.
1565b88fc7Stnozaki.\" 2. Redistributions in binary form must reproduce the above copyright
1665b88fc7Stnozaki.\"    notice, this list of conditions and the following disclaimer in the
1765b88fc7Stnozaki.\"    documentation and/or other materials provided with the distribution.
1865b88fc7Stnozaki.\" 3. All advertising materials mentioning features or use of this software
1965b88fc7Stnozaki.\"    must display the following acknowledgement:
2065b88fc7Stnozaki.\"	This product includes software developed by the University of
2165b88fc7Stnozaki.\"	California, Berkeley and its contributors.
2265b88fc7Stnozaki.\" 4. Neither the name of the University nor the names of its contributors
2365b88fc7Stnozaki.\"    may be used to endorse or promote products derived from this software
2465b88fc7Stnozaki.\"    without specific prior written permission.
2565b88fc7Stnozaki.\"
2665b88fc7Stnozaki.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2765b88fc7Stnozaki.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2865b88fc7Stnozaki.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2965b88fc7Stnozaki.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3065b88fc7Stnozaki.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3165b88fc7Stnozaki.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3265b88fc7Stnozaki.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3365b88fc7Stnozaki.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3465b88fc7Stnozaki.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3565b88fc7Stnozaki.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3665b88fc7Stnozaki.\" SUCH DAMAGE.
3765b88fc7Stnozaki.\"
3865b88fc7Stnozaki.\"     @(#)strxfrm.3	8.1 (Berkeley) 6/4/93
3965b88fc7Stnozaki.\" FreeBSD: src/lib/libc/string/strxfrm.3,v 1.16 2002/09/06 11:24:06 tjr Exp
4065b88fc7Stnozaki.\" FreeBSD: /repoman/r/ncvs/src/lib/libc/string/wcsxfrm.3,v 1.2 2002/12/09 14:04:05 ru Exp
4165b88fc7Stnozaki.\"
4265b88fc7Stnozaki.Dd October 13, 2006
4365b88fc7Stnozaki.Dt WCSXFRM 3
4465b88fc7Stnozaki.Os
4565b88fc7Stnozaki.Sh NAME
4665b88fc7Stnozaki.Nm wcsxfrm
4765b88fc7Stnozaki.Nd transform a wide string under locale
4865b88fc7Stnozaki.Sh LIBRARY
4965b88fc7Stnozaki.Lb libc
5065b88fc7Stnozaki.Sh SYNOPSIS
5165b88fc7Stnozaki.In wchar.h
5265b88fc7Stnozaki.Ft size_t
5365b88fc7Stnozaki.Fn wcsxfrm "wchar_t * restrict dst" "const wchar_t * restrict src" "size_t n"
5465b88fc7Stnozaki.Sh DESCRIPTION
5565b88fc7StnozakiThe
5665b88fc7Stnozaki.Fn wcsxfrm
57*3d3c5d42Swizfunction transforms a nul-terminated wide-character string pointed to by
5865b88fc7Stnozaki.Fa src
59f80b3487Swizaccording to the current locale collation order then copies the
60f80b3487Swiztransformed string into
6165b88fc7Stnozaki.Fa dst .
6265b88fc7StnozakiNo more than
6365b88fc7Stnozaki.Fa n
6465b88fc7Stnozakiwide characters are copied into
6565b88fc7Stnozaki.Fa dst ,
66f80b3487Swizincluding the terminating nul character added.
6765b88fc7StnozakiIf
6865b88fc7Stnozaki.Fa n
6965b88fc7Stnozakiis set to 0
70f80b3487Swiz(it helps to determine an actual size needed for transformation),
7165b88fc7Stnozaki.Fa dst
72aba3ac5cSwizis permitted to be a null pointer.
7365b88fc7Stnozaki.Pp
7465b88fc7StnozakiComparing two strings using
7565b88fc7Stnozaki.Fn wcscmp
7665b88fc7Stnozakiafter
7765b88fc7Stnozaki.Fn wcsxfrm
78f80b3487Swizis equivalent to comparing two original strings with
7965b88fc7Stnozaki.Fn wcscoll .
8065b88fc7Stnozaki.Sh RETURN VALUES
8165b88fc7StnozakiUpon successful completion,
8265b88fc7Stnozaki.Fn wcsxfrm
8365b88fc7Stnozakireturns the length of the transformed string not including
84f80b3487Swizthe terminating nul character.
8565b88fc7StnozakiIf this value is
8665b88fc7Stnozaki.Fa n
8765b88fc7Stnozakior more, the contents of
8865b88fc7Stnozaki.Fa dst
8965b88fc7Stnozakiare indeterminate.
9065b88fc7Stnozaki.Sh SEE ALSO
9165b88fc7Stnozaki.Xr setlocale 3 ,
9265b88fc7Stnozaki.Xr strxfrm 3 ,
9365b88fc7Stnozaki.Xr wcscmp 3 ,
9465b88fc7Stnozaki.Xr wcscoll 3
9565b88fc7Stnozaki.Sh STANDARDS
9665b88fc7StnozakiThe
9765b88fc7Stnozaki.Fn wcsxfrm
98f80b3487Swizfunction conforms to
9965b88fc7Stnozaki.St -isoC-99 .
10065b88fc7Stnozaki.Sh BUGS
10165b88fc7StnozakiThe current implementation of
10265b88fc7Stnozaki.Fn wcsxfrm
10365b88fc7Stnozakifunction disregards
10465b88fc7Stnozaki.Dv LC_COLLATE
10565b88fc7Stnozakilocales, and falls back to using the
10665b88fc7Stnozaki.Fn wcsncpy
10765b88fc7Stnozakifunction.
108