]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) Bruno Haible <haible@clisp.cons.org> |
2 | .\" | |
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. | |
7 | .\" | |
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 | |
12 | .\" ISO/IEC 9899:1999 | |
13 | .\" | |
cc4615cc | 14 | .TH FWIDE 3 2007-07-26 "GNU" "Linux Programmer's Manual" |
fea681da MK |
15 | .SH NAME |
16 | fwide \- set and determine the orientation of a FILE stream | |
17 | .SH SYNOPSIS | |
18 | .nf | |
19 | .B #include <wchar.h> | |
20 | .sp | |
21 | .BI "int fwide(FILE *" stream ", int " mode ); | |
22 | .fi | |
cc4615cc MK |
23 | .sp |
24 | .in -4n | |
25 | Feature Test Macro Requirements for glibc (see | |
26 | .BR feature_test_macros (7)): | |
27 | .in | |
28 | .sp | |
29 | .BR fwide (): | |
30 | _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or | |
31 | .I cc\ -std=c99 | |
fea681da | 32 | .SH DESCRIPTION |
60a90ecd MK |
33 | When \fImode\fP is zero, the |
34 | .BR fwide () | |
35 | function determines the current | |
c13182ef MK |
36 | orientation of \fIstream\fP. |
37 | It returns a value > 0 if \fIstream\fP is | |
75b94dc3 | 38 | wide-character oriented, that is, if wide-character I/O is permitted but char |
c13182ef MK |
39 | I/O is disallowed. |
40 | It returns a value < 0 if \fIstream\fP is byte oriented, | |
d0f17b57 | 41 | i.e. if char I/O is permitted but wide-character I/O is disallowed. |
c13182ef | 42 | It |
fea681da MK |
43 | returns zero if \fIstream\fP has no orientation yet; in this case the next |
44 | I/O operation might change the orientation (to byte oriented if it is a char | |
d0f17b57 | 45 | I/O operation, or to wide-character oriented if it is a wide-character I/O |
fea681da MK |
46 | operation). |
47 | .PP | |
48 | Once a stream has an orientation, it cannot be changed and persists until | |
49 | the stream is closed. | |
50 | .PP | |
60a90ecd MK |
51 | When \fImode\fP is non-zero, the |
52 | .BR fwide () | |
53 | function first attempts to set | |
fea681da | 54 | \fIstream\fP's orientation (to wide-character oriented if \fImode\fP > 0, or |
c13182ef MK |
55 | to byte oriented if \fImode\fP < 0). |
56 | It then returns a value denoting the | |
fea681da MK |
57 | current orientation, as above. |
58 | .SH "RETURN VALUE" | |
60a90ecd MK |
59 | The |
60 | .BR fwide () | |
61 | function returns the stream's orientation, after possibly | |
c13182ef MK |
62 | changing it. |
63 | A return value > 0 means wide-character oriented. | |
64 | A return value | |
65 | < 0 means byte oriented. | |
66 | A return value of zero means undecided. | |
fea681da | 67 | .SH "CONFORMING TO" |
8039becf | 68 | C99, POSIX.1-2001. |
fea681da MK |
69 | .SH NOTES |
70 | Wide-character output to a byte oriented stream can be performed through the | |
60a90ecd MK |
71 | .BR fprintf (3) |
72 | function with the %lc and %ls directives. | |
fea681da MK |
73 | .PP |
74 | Char oriented output to a wide-character oriented stream can be performed | |
60a90ecd MK |
75 | through the |
76 | .BR fwprintf (3) | |
77 | function with the %c and %s directives. | |
e37e3282 MK |
78 | .SH "SEE ALSO" |
79 | .BR fprintf (3), | |
80 | .BR fwprintf (3) |