9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man3c / wcsxfrm.3c
blob9aaeca0ceed8e387246453aa975c20eaef4e19ca
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
44 .\" Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved.
45 .\"
46 .TH WCSXFRM 3C "Nov 1, 2003"
47 .SH NAME
48 wcsxfrm, wsxfrm \- wide character string transformation
49 .SH SYNOPSIS
50 .LP
51 .nf
52 #include <wchar.h>
54 \fBsize_t\fR \fBwcsxfrm\fR(\fBwchar_t *\fR\fIws1\fR, \fBconst wchar_t *\fR\fIws2\fR, \fBsize_t\fR \fIn\fR);
55 .fi
57 .LP
58 .nf
59 \fBsize_t\fR \fBwsxfrm\fR(\fBwchar_t *\fR\fIws1\fR, \fBconst wchar_t *\fR\fIws2\fR, \fBsize_t\fR \fIn\fR);
60 .fi
62 .SH DESCRIPTION
63 .sp
64 .LP
65 The \fBwcsxfrm()\fR and \fBwcsxfrm()\fR functions transform the wide character
66 string pointed to by \fIws2\fR and place the resulting wide character string
67 into the array pointed to by \fIws1\fR. The transformation is such that if
68 either the \fBwcscmp\fR(3C) or \fBwscmp\fR(3C) functions are applied to two
69 transformed wide strings, they return a value greater than, equal to, or less
70 than 0, corresponding to the result of the  \fBwcscoll\fR(3C) or
71 \fBwscoll\fR(3C) function applied to the same two original wide character
72 strings. No more than  \fIn\fR wide-character codes are placed into the
73 resulting array pointed to by \fIws1\fR, including the terminating null
74 wide-character code. If \fIn\fR is 0, \fIws1\fR is permitted to be a null
75 pointer. If copying takes place between objects that overlap, the behavior is
76 undefined.
77 .sp
78 .LP
79 The \fBwcsxfrm()\fR and \fBwsxfrm()\fR functions do not change the setting of
80 \fBerrno\fR if successful.
81 .sp
82 .LP
83 Since no return value is reserved to indicate an error, an application wishing
84 to check for error situations should set \fBerrno\fR to 0, then call
85 \fBwcsxfrm()\fR or \fBwsxfrm()\fR, then check \fBerrno\fR.
86 .SH RETURN VALUES
87 .sp
88 .LP
89 The \fBwcsxfrm()\fR and \fBwsxfrm()\fR functions return the length of the
90 transformed wide character string (not including the terminating null
91 wide-character code). If the value returned is \fIn\fR or more, the contents of
92 the array pointed to by \fIws1\fR are indeterminate.
93 .sp
94 .LP
95 On error, \fBwcsxfrm()\fR and \fBwsxfrm()\fR may set \fBerrno\fR but no return
96 value is reserved to indicate an error.
97 .SH ERRORS
98 .sp
99 .LP
100 The \fBwcsxfrm()\fR and \fBwsxfrm()\fR functions may fail if:
102 .ne 2
104 \fB\fBEINVAL\fR\fR
106 .RS 10n
107 The wide character string pointed to by \fIws2\fR contains wide-character codes
108 outside the domain of the collating sequence.
111 .SH USAGE
114 The transformation function is such that  two transformed wide character
115 strings can be ordered by the \fBwcscmp()\fR or \fBwscmp()\fR functions as
116 appropriate to collating sequence information in the program's locale (category
117 \fBLC_COLLATE\fR).
120 The fact that when  \fIn\fR is 0, \fIws1\fR is permitted to be a null pointer,
121 is useful to determine the size of the  \fIws1\fR array prior to making the
122 transformation.
123 .SH ATTRIBUTES
126 See \fBattributes\fR(5) for descriptions of the following attributes:
131 box;
132 l | l
133 l | l .
134 ATTRIBUTE TYPE  ATTRIBUTE VALUE
136 CSI     Enabled
138 Interface Stability     \fBwcsxfrm()\fR is Standard
140 MT-Level        MT-Safe with exceptions
145 The \fBwcsxfrm()\fR and \fBwsxfrm()\fR functions can be used safely in
146 multithreaded applications as long as \fBsetlocale\fR(3C) is not being called
147 to change the locale.
148 .SH SEE ALSO
151 \fBsetlocale\fR(3C), \fBwcscmp\fR(3C), \fBwcscoll\fR(3C), \fBwscmp\fR(3C),
152 \fBwscoll\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)