1 '\" te 2 .\" Copyright (c) 1992, X/Open Company Limited All Rights Reserved Portions 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 MBSINIT 3C "Jul 24, 2002" 11 .SH NAME 12 mbsinit \- determine conversion object status 13 .SH SYNOPSIS 14 .LP 15 .nf 16 #include <wchar.h> 17 18 \fBint\fR \fBmbsinit\fR(\fBconst mbstate_t *\fR\fIps\fR); 19 .fi 20 21 .SH DESCRIPTION 22 .sp 23 .LP 24 If \fBps\fR is not a null pointer, the \fBmbsinit()\fR function determines 25 whether the object pointed to by \fBps\fR describes an initial conversion 26 state. 27 .SH RETURN VALUES 28 .sp 29 .LP 30 The \fBmbsinit()\fR function returns non-zero if \fBps\fR is a null pointer, 31 or if the pointed-to object describes an initial conversion state; otherwise, 32 it returns \fB0\fR. 33 .sp 34 .LP 35 If an \fBmbstate_t\fR object is altered by any of the functions described as 36 "restartable", and is then used with a different character sequence, or in the 37 other conversion direction, or with a different \fBLC_CTYPE\fR category setting 38 than on earlier function calls, the behavior is undefined. See 39 \fBenviron\fR(5). 40 .SH ERRORS 41 .sp 42 .LP 43 No errors are defined. 44 .SH USAGE 45 .sp 46 .LP 47 The \fBmbstate_t\fR object is used to describe the current conversion state 48 from a particular character sequence to a wide-character sequence (or vice 49 versa) under the rules of a particular setting of the \fBLC_CTYPE\fR category 50 of the current locale. 51 .sp 52 .LP 53 The initial conversion state corresponds, for a conversion in either direction, 54 to the beginning of a new character sequence in the initial shift state. A 55 zero-valued \fBmbstate_t\fR object is at least one way to describe an initial 56 conversion state. A zero-valued \fBmbstate_t\fR object can be used to initiate 57 conversion involving any character sequence, in any \fBLC_CTYPE\fR category 58 setting. 59 .SH ATTRIBUTES 60 .sp 61 .LP 62 See \fBattributes\fR(5) for descriptions of the following attributes: 63 .sp 64 65 .sp 66 .TS 67 box; 68 c | c 69 l | l . 70 ATTRIBUTE TYPE ATTRIBUTE VALUE 71 _ 72 Interface Stability Standard 73 _ 74 MT-Level MT-Safe with exceptions 75 .TE 76 77 .SH SEE ALSO 78 .sp 79 .LP 80 \fBmbrlen\fR(3C), \fBmbrtowc\fR(3C), \fBmbsrtowcs\fR(3C), \fBsetlocale\fR(3C), 81 \fBwcrtomb\fR(3C), \fBwcsrtombs\fR(3C), \fBattributes\fR(5), \fBenviron\fR(5), 82 \fBstandards\fR(5) 83 .SH NOTES 84 .sp 85 .LP 86 The \fBmbsinit()\fR function can be used safely in multithreaded applications, 87 as long as \fBsetlocale\fR(3C) is not being called to change the locale.