1FWIDE(3) Linux Programmer's Manual FWIDE(3)
2
3
4
6 fwide - set and determine the orientation of a FILE stream
7
9 #include <wchar.h>
10
11 int fwide(FILE *stream, int mode);
12
13 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15 fwide(): _XOPEN_SOURCE >= 500 || _ISOC99_SOURCE; or cc -std=c99
16
18 When mode is zero, the fwide() function determines the current orienta‐
19 tion of stream. It returns a positive value if stream is wide-charac‐
20 ter oriented, that is, if wide-character I/O is permitted but char I/O
21 is disallowed. It returns a negative value if stream is byte oriented,
22 i.e., if char I/O is permitted but wide-character I/O is disallowed.
23 It returns zero if stream has no orientation yet; in this case the next
24 I/O operation might change the orientation (to byte oriented if it is a
25 char I/O operation, or to wide-character oriented if it is a wide-char‐
26 acter I/O operation).
27
28 Once a stream has an orientation, it cannot be changed and persists
29 until the stream is closed.
30
31 When mode is non-zero, the fwide() function first attempts to set
32 stream's orientation (to wide-character oriented if mode is greater
33 than 0, or to byte oriented if mode is less than 0). It then returns a
34 value denoting the current orientation, as above.
35
37 The fwide() function returns the stream's orientation, after possibly
38 changing it. A positive return value means wide-character oriented. A
39 negative return value means byte oriented. A return value of zero
40 means undecided.
41
43 C99, POSIX.1-2001.
44
46 Wide-character output to a byte oriented stream can be performed
47 through the fprintf(3) function with the %lc and %ls directives.
48
49 Char oriented output to a wide-character oriented stream can be per‐
50 formed through the fwprintf(3) function with the %c and %s directives.
51
53 fprintf(3), fwprintf(3)
54
56 This page is part of release 3.22 of the Linux man-pages project. A
57 description of the project, and information about reporting bugs, can
58 be found at http://www.kernel.org/doc/man-pages/.
59
60
61
62GNU 2007-07-26 FWIDE(3)