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