nightly: remove unused BINARCHIVE
[unleashed.git] / share / man / man3c / mbsinit.3c
blob4f7257c7fa8703281da59cceae1f86a7a9ffd869
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 .\" Portions Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved
45 .\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
46 .\"
47 .TH MBSINIT 3C "Jun 23, 2014"
48 .SH NAME
49 mbsinit,mbsinit_l \- determine conversion object status
50 .SH SYNOPSIS
51 .LP
52 .nf
53 #include <wchar.h>
55 \fBint\fR \fBmbsinit\fR(\fBconst mbstate_t *\fR\fIps\fR);
56 .fi
57 .LP
58 .nf
59 #include <wchar.h>
60 #include <xlocale.h>
62 \fBint\fR \fBmbsinit_l\fR(\fBconst mbstate_t *\fR\fIps\fR, \fBlocale_t\fR \fIloc\fR);
63 .fi
64 .SH DESCRIPTION
65 .LP
66 If \fBps\fR is not a null pointer, the \fBmbsinit()\fR function determines
67 whether the object pointed to by \fBps\fR describes an initial conversion state.
68 .LP
69 The function \fBmbsinit_l()\fR behaves identically to \fBmbsinit()\fR except the
70 current locale is ignored and the locale \fIloc\fR is used instead.
71 .SH RETURN VALUES
72 .LP
73 The \fBmbsinit()\fR function returns non-zero if  \fBps\fR is a null pointer,
74 or if the pointed-to object describes an initial conversion state; otherwise,
75 it returns \fB0\fR.
76 .LP
77 If an \fBmbstate_t\fR object is altered by any of the functions described as
78 "restartable", and is then used with a different character sequence, or in the
79 other conversion direction, or with a different \fBLC_CTYPE\fR category setting
80 than on earlier function calls, the behavior is undefined.  See
81 \fBenviron\fR(5).
82 .SH ERRORS
83 .LP
84 No errors are defined.
85 .SH USAGE
86 .LP
87 The \fBmbstate_t\fR object is used to describe the current conversion state
88 from a particular character sequence to a wide-character sequence (or vice
89 versa) under the rules of a particular setting of the \fBLC_CTYPE\fR category
90 of the current locale.
91 .LP
92 The initial conversion state corresponds, for a conversion in either direction,
93 to the beginning of a new character sequence in the initial shift state.  A
94 zero-valued \fBmbstate_t\fR object is at least one way to describe an initial
95 conversion state.  A zero-valued \fBmbstate_t\fR object can be used to initiate
96 conversion involving any character sequence, in any \fBLC_CTYPE\fR category
97 setting.
98 .SH ATTRIBUTES
99 .LP
100 See \fBattributes\fR(5) for descriptions of the following attributes:
102 box;
103 c | c
104 l | l .
105 ATTRIBUTE TYPE  ATTRIBUTE VALUE
107 Interface Stability     See below.
109 MT-Level        MT-Safe
114 .B mbsinit()
115 function is Standard.  The
116 .B mbsinit_l()
117 function is Uncommitted.
118 .SH SEE ALSO
120 \fBmbrlen\fR(3C), \fBmbrtowc\fR(3C), \fBmbsrtowcs\fR(3C),
121 \fBnewlocale\fR(3C), \fBsetlocale\fR(3C),
122 \fBwcrtomb\fR(3C), \fBwcsrtombs\fR(3C), \fBuselocale\fR(), \fBattributes\fR(5), \fBenviron\fR(5),
123 \fBstandards\fR(5)