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