]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/fwide.3
Added/updated glibc feature test macro requirements
[thirdparty/man-pages.git] / man3 / fwide.3
CommitLineData
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
16fwide \- 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
25Feature 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
33When \fImode\fP is zero, the
34.BR fwide ()
35function determines the current
c13182ef
MK
36orientation of \fIstream\fP.
37It returns a value > 0 if \fIstream\fP is
75b94dc3 38wide-character oriented, that is, if wide-character I/O is permitted but char
c13182ef
MK
39I/O is disallowed.
40It returns a value < 0 if \fIstream\fP is byte oriented,
d0f17b57 41i.e. if char I/O is permitted but wide-character I/O is disallowed.
c13182ef 42It
fea681da
MK
43returns zero if \fIstream\fP has no orientation yet; in this case the next
44I/O operation might change the orientation (to byte oriented if it is a char
d0f17b57 45I/O operation, or to wide-character oriented if it is a wide-character I/O
fea681da
MK
46operation).
47.PP
48Once a stream has an orientation, it cannot be changed and persists until
49the stream is closed.
50.PP
60a90ecd
MK
51When \fImode\fP is non-zero, the
52.BR fwide ()
53function first attempts to set
fea681da 54\fIstream\fP's orientation (to wide-character oriented if \fImode\fP > 0, or
c13182ef
MK
55to byte oriented if \fImode\fP < 0).
56It then returns a value denoting the
fea681da
MK
57current orientation, as above.
58.SH "RETURN VALUE"
60a90ecd
MK
59The
60.BR fwide ()
61function returns the stream's orientation, after possibly
c13182ef
MK
62changing it.
63A return value > 0 means wide-character oriented.
64A return value
65< 0 means byte oriented.
66A return value of zero means undecided.
fea681da 67.SH "CONFORMING TO"
8039becf 68C99, POSIX.1-2001.
fea681da
MK
69.SH NOTES
70Wide-character output to a byte oriented stream can be performed through the
60a90ecd
MK
71.BR fprintf (3)
72function with the %lc and %ls directives.
fea681da
MK
73.PP
74Char oriented output to a wide-character oriented stream can be performed
60a90ecd
MK
75through the
76.BR fwprintf (3)
77function with the %c and %s directives.
e37e3282
MK
78.SH "SEE ALSO"
79.BR fprintf (3),
80.BR fwprintf (3)