1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
10 .\" References consulted:
11 .\" GNU glibc-2 source code and manual
12 .\" Dinkumware C library reference http://www.dinkumware.com/
13 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
16 .TH FWIDE 3 2016-03-15 "GNU" "Linux Programmer's Manual"
18 fwide \- set and determine the orientation of a FILE stream
23 .BI "int fwide(FILE *" stream ", int " mode );
27 Feature Test Macro Requirements for glibc (see
28 .BR feature_test_macros (7)):
34 _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE ||
36 _POSIX_C_SOURCE\ >=\ 200112L
40 When \fImode\fP is zero, the
42 function determines the current
43 orientation of \fIstream\fP.
44 It returns a positive value if \fIstream\fP is
45 wide-character oriented, that is, if wide-character I/O is permitted but char
47 It returns a negative value if \fIstream\fP is byte oriented\(emthat is,
48 if char I/O is permitted but wide-character I/O is disallowed.
50 returns zero if \fIstream\fP has no orientation yet; in this case the next
51 I/O operation might change the orientation (to byte oriented if it is a char
52 I/O operation, or to wide-character oriented if it is a wide-character I/O
55 Once a stream has an orientation, it cannot be changed and persists until
58 When \fImode\fP is nonzero, the
60 function first attempts to set
61 \fIstream\fP's orientation (to wide-character oriented
62 if \fImode\fP is greater than 0, or
63 to byte oriented if \fImode\fP is less than 0).
64 It then returns a value denoting the
65 current orientation, as above.
69 function returns the stream's orientation, after possibly
71 A positive return value means wide-character oriented.
72 A negative return value means byte oriented.
73 A return value of zero means undecided.
75 POSIX.1-2001, POSIX.1-2008, C99.
77 Wide-character output to a byte oriented stream can be performed through the
85 Char oriented output to a wide-character oriented stream can be performed