4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
28 * Use is subject to license terms.
42 _NO_MODE
, /* not bound */
43 _BYTE_MODE
, /* Byte orientation */
44 _WC_MODE
/* Wide orientation */
49 * This function gets the pointer to the mbstate_t structure associated
50 * with the specified iop.
53 * If the associated mbstate_t found, the pointer to the mbstate_t is
54 * returned. Otherwise, (mbstate_t *)NULL is returned.
57 #define _getmbstate(iop) (&(iop)->_state)
59 extern mbstate_t *_getmbstate(FILE *);
64 * This function/macro gets the orientation bound to the specified iop.
67 * _WC_MODE if iop has been bound to Wide orientation
68 * _BYTE_MODE if iop has been bound to Byte orientation
69 * _NO_MODE if iop has been bound to neither Wide nor Byte
71 extern _IOP_orientation_t
_getorientation(FILE *);
75 * This function/macro sets the orientation to the specified iop.
78 * flag may take one of the following:
79 * _WC_MODE Wide orientation
80 * _BYTE_MODE Byte orientation
83 extern void _setorientation(FILE *, _IOP_orientation_t
);
86 * From page 32 of XSH5
87 * Once a wide-character I/O function has been applied
88 * to a stream without orientation, the stream becomes
89 * wide-oriented. Similarly, once a byte I/O function
90 * has been applied to a stream without orientation,
91 * the stream becomes byte-oriented. Only a call to
92 * the freopen() function or the fwide() function can
93 * otherwise alter the orientation of a stream.
96 #define _SET_ORIENTATION_BYTE(iop) \
98 if (GET_NO_MODE(iop)) \
99 _setorientation(iop, _BYTE_MODE); \