8999 SMBIOS: cleanup 32-bit specific code
[unleashed.git] / usr / src / man / man3c / iconv_open.3c
blob98a223df9579f602611d3d0f47f0ddb5dd2f8aed
1 '\" te
2 .\" Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
3 .\" Portions Copyright (c) 2001, Sun Microsystems, Inc.  All Rights Reserved
4 .\" 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
5 .\" http://www.opengroup.org/bookstore/.
6 .\" 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.
7 .\"  This notice shall appear on any product containing this material.
8 .\" 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.
9 .\" 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.
10 .\" 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]
11 .TH ICONV_OPEN 3C "Oct 2, 2001"
12 .SH NAME
13 iconv_open \- code conversion allocation function
14 .SH SYNOPSIS
15 .LP
16 .nf
17 #include <iconv.h>
19 \fBiconv_t\fR \fBiconv_open\fR(\fBconst char *\fR\fItocode\fR, \fBconst char *\fR\fIfromcode\fR);
20 .fi
22 .SH DESCRIPTION
23 .sp
24 .LP
25 The \fBiconv_open()\fR function returns a conversion descriptor that describes
26 a conversion from the codeset specified by the string pointed to by the
27 \fIfromcode\fR argument to the codeset specified by the string pointed to by
28 the \fItocode\fR argument. For state-dependent encodings, the conversion
29 descriptor will be in  a codeset-dependent initial shift state, ready for
30 immediate use with the  \fBiconv\fR(3C) function.
31 .sp
32 .LP
33 Settings of \fIfromcode\fR and \fItocode\fR and their permitted combinations
34 are implementation-dependent.
35 .sp
36 .LP
37 The \fBiconv_open()\fR function supports the alias of the encoding name
38 specified in \fItocode\fR and \fIfromcode\fR.  The alias table of the encoding
39 name is described in the file \fB/usr/lib/iconv/alias\fR. See \fBalias\fR(4).
40 .sp
41 .LP
42 A conversion descriptor remains valid in a process until that process closes
43 it.
44 .sp
45 .LP
46 For examples using the  \fBiconv_open()\fR function, see \fBiconv\fR(3C).
47 .SH RETURN VALUES
48 .sp
49 .LP
50 Upon successful completion  \fBiconv_open()\fR returns a conversion descriptor
51 for use on subsequent calls to  \fBiconv()\fR. Otherwise, \fBiconv_open()\fR
52 returns \fB(iconv_t)\fR \fB\(mi1\fR and sets \fBerrno\fR to indicate the error.
53 .SH ERRORS
54 .sp
55 .LP
56 The  \fBiconv_open\fR function may fail if:
57 .sp
58 .ne 2
59 .na
60 \fB\fBEMFILE\fR\fR
61 .ad
62 .RS 10n
63 \fB{OPEN_MAX}\fR files descriptors are currently open in the calling process.
64 .RE
66 .sp
67 .ne 2
68 .na
69 \fB\fBENFILE\fR\fR
70 .ad
71 .RS 10n
72 Too many files are currently open in the system.
73 .RE
75 .sp
76 .ne 2
77 .na
78 \fB\fBENOMEM\fR\fR
79 .ad
80 .RS 10n
81 Insufficient storage space is available.
82 .RE
84 .sp
85 .ne 2
86 .na
87 \fB\fBEINVAL\fR\fR
88 .ad
89 .RS 10n
90 The conversion specified by \fIfromcode\fR and \fItocode\fR is not supported by
91 the implementation.
92 .RE
94 .SH FILES
95 .sp
96 .ne 2
97 .na
98 \fB\fB/usr/lib/iconv/alias\fR\fR
99 .ad
100 .RS 24n
101 alias table file of the encoding name
104 .SH ATTRIBUTES
107 See \fBattributes\fR(5) for descriptions of the following attributes:
112 box;
113 c | c
114 l | l .
115 ATTRIBUTE TYPE  ATTRIBUTE VALUE
117 Interface Stability     Standard
119 MT-Level        MT-Safe
122 .SH SEE ALSO
125 \fBexec\fR(2), \fBiconv\fR(3C), \fBiconv_close\fR(3C), \fBmalloc\fR(3C),
126 \fBalias\fR(4), \fBattributes\fR(5)
127 .SH NOTES
130 The \fBiconv_open()\fR function uses \fBmalloc\fR(3C) to allocate space for
131 internal buffer areas. \fBiconv_open()\fR may fail if there is insufficient
132 storage space to accommodate these buffers.
135 Portable applications must assume that conversion descriptors are not valid
136 after a call to one of the \fBexec\fR functions (see \fBexec\fR(2)).