]>
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 | .\" | |
14 | .TH FWIDE 3 1999-11-17 "GNU" "Linux Programmer's Manual" | |
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 | |
23 | .SH DESCRIPTION | |
e511ffb6 | 24 | When \fImode\fP is zero, the \fBfwide\fP() function determines the current |
c13182ef MK |
25 | orientation of \fIstream\fP. |
26 | It returns a value > 0 if \fIstream\fP is | |
fea681da | 27 | wide-character oriented, i.e. if wide character I/O is permitted but char |
c13182ef MK |
28 | I/O is disallowed. |
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. | |
31 | It | |
fea681da MK |
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 | |
35 | operation). | |
36 | .PP | |
37 | Once a stream has an orientation, it cannot be changed and persists until | |
38 | the stream is closed. | |
39 | .PP | |
e511ffb6 | 40 | When \fImode\fP is non-zero, the \fBfwide\fP() function first attempts to set |
fea681da | 41 | \fIstream\fP's orientation (to wide-character oriented if \fImode\fP > 0, or |
c13182ef MK |
42 | to byte oriented if \fImode\fP < 0). |
43 | It then returns a value denoting the | |
fea681da MK |
44 | current orientation, as above. |
45 | .SH "RETURN VALUE" | |
e511ffb6 | 46 | The \fBfwide\fP() function returns the stream's orientation, after possibly |
c13182ef MK |
47 | changing it. |
48 | A return value > 0 means wide-character oriented. | |
49 | A return value | |
50 | < 0 means byte oriented. | |
51 | A return value of zero means undecided. | |
fea681da | 52 | .SH "CONFORMING TO" |
8039becf | 53 | C99, POSIX.1-2001. |
fea681da MK |
54 | .SH "SEE ALSO" |
55 | .BR fprintf (3), | |
56 | .BR fwprintf (3) | |
57 | .SH NOTES | |
58 | Wide-character output to a byte oriented stream can be performed through the | |
3382bd94 | 59 | \fBfprintf\fP() function with the %lc and %ls directives. |
fea681da MK |
60 | .PP |
61 | Char oriented output to a wide-character oriented stream can be performed | |
3382bd94 | 62 | through the \fBfwprintf\fP() function with the %c and %s directives. |