]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) Bruno Haible <haible@clisp.cons.org> |
2 | .\" | |
89e3ffe9 | 3 | .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA) |
fea681da MK |
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. | |
fe382ebf | 8 | .\" %%%LICENSE_END |
fea681da MK |
9 | .\" |
10 | .\" References consulted: | |
11 | .\" GNU glibc-2 source code and manual | |
12 | .\" Dinkumware C library reference http://www.dinkumware.com/ | |
008f1ecc | 13 | .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html |
fea681da MK |
14 | .\" ISO/IEC 9899:1999 |
15 | .\" | |
97986708 | 16 | .TH FWIDE 3 2016-03-15 "GNU" "Linux Programmer's Manual" |
fea681da MK |
17 | .SH NAME |
18 | fwide \- set and determine the orientation of a FILE stream | |
19 | .SH SYNOPSIS | |
20 | .nf | |
21 | .B #include <wchar.h> | |
68e4db0a | 22 | .PP |
fea681da MK |
23 | .BI "int fwide(FILE *" stream ", int " mode ); |
24 | .fi | |
68e4db0a | 25 | .PP |
cc4615cc MK |
26 | .in -4n |
27 | Feature Test Macro Requirements for glibc (see | |
28 | .BR feature_test_macros (7)): | |
29 | .in | |
c865a6eb | 30 | .ad l |
68e4db0a | 31 | .PP |
cc4615cc | 32 | .BR fwide (): |
c865a6eb | 33 | .RS 4 |
bef2e737 | 34 | _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE || |
38d92333 | 35 | .br |
cd2d5ec1 | 36 | _POSIX_C_SOURCE\ >=\ 200112L |
bef2e737 | 37 | .RE |
c865a6eb | 38 | .ad |
fea681da | 39 | .SH DESCRIPTION |
60a90ecd MK |
40 | When \fImode\fP is zero, the |
41 | .BR fwide () | |
42 | function determines the current | |
c13182ef | 43 | orientation of \fIstream\fP. |
ec1a3d9f | 44 | It returns a positive value if \fIstream\fP is |
75b94dc3 | 45 | wide-character oriented, that is, if wide-character I/O is permitted but char |
c13182ef | 46 | I/O is disallowed. |
88879aeb MK |
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. | |
c13182ef | 49 | It |
fea681da MK |
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 | |
d0f17b57 | 52 | I/O operation, or to wide-character oriented if it is a wide-character I/O |
fea681da MK |
53 | operation). |
54 | .PP | |
55 | Once a stream has an orientation, it cannot be changed and persists until | |
56 | the stream is closed. | |
57 | .PP | |
c7094399 | 58 | When \fImode\fP is nonzero, the |
60a90ecd MK |
59 | .BR fwide () |
60 | function first attempts to set | |
8d998d01 MK |
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). | |
c13182ef | 64 | It then returns a value denoting the |
fea681da | 65 | current orientation, as above. |
47297adb | 66 | .SH RETURN VALUE |
60a90ecd MK |
67 | The |
68 | .BR fwide () | |
69 | function returns the stream's orientation, after possibly | |
c13182ef | 70 | changing it. |
ec1a3d9f MK |
71 | A positive return value means wide-character oriented. |
72 | A negative return value means byte oriented. | |
c13182ef | 73 | A return value of zero means undecided. |
47297adb | 74 | .SH CONFORMING TO |
f96366d1 | 75 | POSIX.1-2001, POSIX.1-2008, C99. |
fea681da MK |
76 | .SH NOTES |
77 | Wide-character output to a byte oriented stream can be performed through the | |
60a90ecd | 78 | .BR fprintf (3) |
5adafd6d MK |
79 | function with the |
80 | .B %lc | |
81 | and | |
82 | .B %ls | |
83 | directives. | |
fea681da MK |
84 | .PP |
85 | Char oriented output to a wide-character oriented stream can be performed | |
60a90ecd MK |
86 | through the |
87 | .BR fwprintf (3) | |
5adafd6d MK |
88 | function with the |
89 | .B %c | |
90 | and | |
91 | .B %s | |
92 | directives. | |
47297adb | 93 | .SH SEE ALSO |
e37e3282 MK |
94 | .BR fprintf (3), |
95 | .BR fwprintf (3) |