]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/fwide.3
epoll_create.2, epoll_ctl.2, epoll_wait.2, eventfd.2, ioprio_set.2, signalfd.2, spu_c...
[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/
008f1ecc 11.\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
fea681da
MK
12.\" ISO/IEC 9899:1999
13.\"
38d92333 14.TH FWIDE 3 2011-09-17 "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
c865a6eb 28.ad l
cc4615cc
MK
29.sp
30.BR fwide ():
c865a6eb 31.RS 4
bef2e737 32_XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE ||
38d92333
MK
33.br
34_ISOC95_SOURCE /* Since glibc 2.12 */ ||
35.br
bef2e737 36_POSIX_C_SOURCE\ >=\ 200112L;
c865a6eb
MK
37.br
38or
cc4615cc 39.I cc\ -std=c99
bef2e737 40.RE
c865a6eb 41.ad
fea681da 42.SH DESCRIPTION
60a90ecd
MK
43When \fImode\fP is zero, the
44.BR fwide ()
45function determines the current
c13182ef 46orientation of \fIstream\fP.
ec1a3d9f 47It returns a positive value if \fIstream\fP is
75b94dc3 48wide-character oriented, that is, if wide-character I/O is permitted but char
c13182ef 49I/O is disallowed.
ec1a3d9f 50It returns a negative value if \fIstream\fP is byte oriented,
eeeffe2d 51i.e., if char I/O is permitted but wide-character I/O is disallowed.
c13182ef 52It
fea681da
MK
53returns zero if \fIstream\fP has no orientation yet; in this case the next
54I/O operation might change the orientation (to byte oriented if it is a char
d0f17b57 55I/O operation, or to wide-character oriented if it is a wide-character I/O
fea681da
MK
56operation).
57.PP
58Once a stream has an orientation, it cannot be changed and persists until
59the stream is closed.
60.PP
c7094399 61When \fImode\fP is nonzero, the
60a90ecd
MK
62.BR fwide ()
63function first attempts to set
8d998d01
MK
64\fIstream\fP's orientation (to wide-character oriented
65if \fImode\fP is greater than 0, or
66to byte oriented if \fImode\fP is less than 0).
c13182ef 67It then returns a value denoting the
fea681da 68current orientation, as above.
47297adb 69.SH RETURN VALUE
60a90ecd
MK
70The
71.BR fwide ()
72function returns the stream's orientation, after possibly
c13182ef 73changing it.
ec1a3d9f
MK
74A positive return value means wide-character oriented.
75A negative return value means byte oriented.
c13182ef 76A return value of zero means undecided.
47297adb 77.SH CONFORMING TO
8039becf 78C99, POSIX.1-2001.
fea681da
MK
79.SH NOTES
80Wide-character output to a byte oriented stream can be performed through the
60a90ecd 81.BR fprintf (3)
5adafd6d
MK
82function with the
83.B %lc
84and
85.B %ls
86directives.
fea681da
MK
87.PP
88Char oriented output to a wide-character oriented stream can be performed
60a90ecd
MK
89through the
90.BR fwprintf (3)
5adafd6d
MK
91function with the
92.B %c
93and
94.B %s
95directives.
47297adb 96.SH SEE ALSO
e37e3282
MK
97.BR fprintf (3),
98.BR fwprintf (3)