1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
8 .\" References consulted:
9 .\" GNU glibc-2 source code and manual
10 .\" Dinkumware C library reference http://www.dinkumware.com/
11 .\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html
14 .TH FWIDE 3 1999-11-17 "GNU" "Linux Programmer's Manual"
16 fwide \- set and determine the orientation of a FILE stream
21 .BI "int fwide(FILE *" stream ", int " mode );
24 When \fImode\fP is zero, the \fBfwide\fP() function determines the current
25 orientation of \fIstream\fP.
26 It returns a value > 0 if \fIstream\fP is
27 wide-character oriented, i.e. if wide character I/O is permitted but char
29 It returns a value < 0 if \fIstream\fP is byte oriented,
30 i.e. if char I/O is permitted but wide character I/O is disallowed.
32 returns zero if \fIstream\fP has no orientation yet; in this case the next
33 I/O operation might change the orientation (to byte oriented if it is a char
34 I/O operation, or to wide-character oriented if it is a wide character I/O
37 Once a stream has an orientation, it cannot be changed and persists until
40 When \fImode\fP is non-zero, the \fBfwide\fP() function first attempts to set
41 \fIstream\fP's orientation (to wide-character oriented if \fImode\fP > 0, or
42 to byte oriented if \fImode\fP < 0).
43 It then returns a value denoting the
44 current orientation, as above.
46 The \fBfwide\fP() function returns the stream's orientation, after possibly
48 A return value > 0 means wide-character oriented.
50 < 0 means byte oriented.
51 A return value of zero means undecided.
58 Wide-character output to a byte oriented stream can be performed through the
59 \fBfprintf\fP() function with the %lc and %ls directives.
61 Char oriented output to a wide-character oriented stream can be performed
62 through the \fBfwprintf\fP() function with the %c and %s directives.