2 .\" Copyright (c) 1992, X/Open Company Limited. All Rights Reserved. Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4 .\" http://www.opengroup.org/bookstore/.
5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
6 .\" This notice shall appear on any product containing this material.
7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
10 .TH WCSXFRM 3C "Nov 1, 2003"
12 wcsxfrm, wsxfrm \- wide character string transformation
18 \fBsize_t\fR \fBwcsxfrm\fR(\fBwchar_t *\fR\fIws1\fR, \fBconst wchar_t *\fR\fIws2\fR, \fBsize_t\fR \fIn\fR);
23 \fBsize_t\fR \fBwsxfrm\fR(\fBwchar_t *\fR\fIws1\fR, \fBconst wchar_t *\fR\fIws2\fR, \fBsize_t\fR \fIn\fR);
29 The \fBwcsxfrm()\fR and \fBwcsxfrm()\fR functions transform the wide character
30 string pointed to by \fIws2\fR and place the resulting wide character string
31 into the array pointed to by \fIws1\fR. The transformation is such that if
32 either the \fBwcscmp\fR(3C) or \fBwscmp\fR(3C) functions are applied to two
33 transformed wide strings, they return a value greater than, equal to, or less
34 than 0, corresponding to the result of the \fBwcscoll\fR(3C) or
35 \fBwscoll\fR(3C) function applied to the same two original wide character
36 strings. No more than \fIn\fR wide-character codes are placed into the
37 resulting array pointed to by \fIws1\fR, including the terminating null
38 wide-character code. If \fIn\fR is 0, \fIws1\fR is permitted to be a null
39 pointer. If copying takes place between objects that overlap, the behavior is
43 The \fBwcsxfrm()\fR and \fBwsxfrm()\fR functions do not change the setting of
44 \fBerrno\fR if successful.
47 Since no return value is reserved to indicate an error, an application wishing
48 to check for error situations should set \fBerrno\fR to 0, then call
49 \fBwcsxfrm()\fR or \fBwsxfrm()\fR, then check \fBerrno\fR.
53 The \fBwcsxfrm()\fR and \fBwsxfrm()\fR functions return the length of the
54 transformed wide character string (not including the terminating null
55 wide-character code). If the value returned is \fIn\fR or more, the contents of
56 the array pointed to by \fIws1\fR are indeterminate.
59 On error, \fBwcsxfrm()\fR and \fBwsxfrm()\fR may set \fBerrno\fR but no return
60 value is reserved to indicate an error.
64 The \fBwcsxfrm()\fR and \fBwsxfrm()\fR functions may fail if:
71 The wide character string pointed to by \fIws2\fR contains wide-character codes
72 outside the domain of the collating sequence.
78 The transformation function is such that two transformed wide character
79 strings can be ordered by the \fBwcscmp()\fR or \fBwscmp()\fR functions as
80 appropriate to collating sequence information in the program's locale (category
84 The fact that when \fIn\fR is 0, \fIws1\fR is permitted to be a null pointer,
85 is useful to determine the size of the \fIws1\fR array prior to making the
90 See \fBattributes\fR(5) for descriptions of the following attributes:
98 ATTRIBUTE TYPE ATTRIBUTE VALUE
102 Interface Stability \fBwcsxfrm()\fR is Standard
104 MT-Level MT-Safe with exceptions
109 The \fBwcsxfrm()\fR and \fBwsxfrm()\fR functions can be used safely in
110 multithreaded applications as long as \fBsetlocale\fR(3C) is not being called
111 to change the locale.
115 \fBsetlocale\fR(3C), \fBwcscmp\fR(3C), \fBwcscoll\fR(3C), \fBwscmp\fR(3C),
116 \fBwscoll\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)