]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/fwide.3
Wrapped long lines, wrapped at sentence boundaries; stripped trailing
[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.\"
14.TH FWIDE 3 1999-11-17 "GNU" "Linux Programmer's Manual"
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
23.SH DESCRIPTION
e511ffb6 24When \fImode\fP is zero, the \fBfwide\fP() function determines the current
c13182ef
MK
25orientation of \fIstream\fP.
26It returns a value > 0 if \fIstream\fP is
fea681da 27wide-character oriented, i.e. if wide character I/O is permitted but char
c13182ef
MK
28I/O is disallowed.
29It returns a value < 0 if \fIstream\fP is byte oriented,
30i.e. if char I/O is permitted but wide character I/O is disallowed.
31It
fea681da
MK
32returns zero if \fIstream\fP has no orientation yet; in this case the next
33I/O operation might change the orientation (to byte oriented if it is a char
34I/O operation, or to wide-character oriented if it is a wide character I/O
35operation).
36.PP
37Once a stream has an orientation, it cannot be changed and persists until
38the stream is closed.
39.PP
e511ffb6 40When \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
42to byte oriented if \fImode\fP < 0).
43It then returns a value denoting the
fea681da
MK
44current orientation, as above.
45.SH "RETURN VALUE"
e511ffb6 46The \fBfwide\fP() function returns the stream's orientation, after possibly
c13182ef
MK
47changing it.
48A return value > 0 means wide-character oriented.
49A return value
50< 0 means byte oriented.
51A return value of zero means undecided.
fea681da 52.SH "CONFORMING TO"
8039becf 53C99, POSIX.1-2001.
fea681da
MK
54.SH "SEE ALSO"
55.BR fprintf (3),
56.BR fwprintf (3)
57.SH NOTES
58Wide-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
61Char oriented output to a wide-character oriented stream can be performed
3382bd94 62through the \fBfwprintf\fP() function with the %c and %s directives.