]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/fgetwc.3
signbit.3: ffix
[thirdparty/man-pages.git] / man3 / fgetwc.3
CommitLineData
fea681da
MK
1.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2.\"
89e3ffe9 3.\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
fea681da
MK
4.\" This is free documentation; you can redistribute it and/or
5.\" modify it under the terms of the GNU General Public License as
6.\" published by the Free Software Foundation; either version 2 of
7.\" the License, or (at your option) any later version.
fe382ebf 8.\" %%%LICENSE_END
fea681da
MK
9.\"
10.\" References consulted:
11.\" GNU glibc-2 source code and manual
12.\" Dinkumware C library reference http://www.dinkumware.com/
008f1ecc 13.\" OpenGroup's Single UNIX specification
fea681da
MK
14.\" http://www.UNIX-systems.org/online.html
15.\" ISO/IEC 9899:1999
16.\"
17.\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon <moz@compsoc.man.ac.uk>
460495ca 18.TH FGETWC 3 2015-08-08 "GNU" "Linux Programmer's Manual"
fea681da
MK
19.SH NAME
20fgetwc, getwc \- read a wide character from a FILE stream
21.SH SYNOPSIS
22.nf
23.B #include <stdio.h>
fea681da 24.B #include <wchar.h>
68e4db0a 25.PP
fea681da
MK
26.BI "wint_t fgetwc(FILE *" stream );
27.BI "wint_t getwc(FILE *" stream );
28.fi
29.SH DESCRIPTION
60a90ecd
MK
30The
31.BR fgetwc ()
32function is the wide-character equivalent
33of the
363a3cc9 34.BR fgetc (3)
60a90ecd 35function.
c13182ef
MK
36It reads a wide character from \fIstream\fP and returns it.
37If the end of stream is reached, or if \fIferror(stream)\fP becomes true,
cab87712
MK
38it returns
39.BR WEOF .
d0f17b57 40If a wide-character conversion error occurs, it sets
cab87712
MK
41\fIerrno\fP to \fBEILSEQ\fP and returns
42.BR WEOF .
fea681da 43.PP
60a90ecd
MK
44The
45.BR getwc ()
46function or macro functions identically to
47.BR fgetwc ().
fea681da 48It may be implemented as a macro, and may evaluate its argument
c13182ef
MK
49more than once.
50There is no reason ever to use it.
fea681da 51.PP
24b74457 52For nonlocking counterparts, see
fea681da 53.BR unlocked_stdio (3).
47297adb 54.SH RETURN VALUE
60a90ecd
MK
55The
56.BR fgetwc ()
57function returns the next wide-character
cab87712
MK
58from the stream, or
59.BR WEOF .
dbf51683
MK
60In the event of an error,
61.I errno
62is set to indicate the cause.
fea681da
MK
63.SH ERRORS
64Apart from the usual ones, there is
65.TP
66.B EILSEQ
67The data obtained from the input stream does not
68form a valid character.
b73c480b
MS
69.SH ATTRIBUTES
70For an explanation of the terms used in this section, see
71.BR attributes (7).
72.TS
73allbox;
74lbw17 lb lb
75l l l.
76Interface Attribute Value
77T{
78.BR fgetwc (),
79.BR getwc ()
80T} Thread safety MT-Safe
81.TE
47297adb 82.SH CONFORMING TO
29680d10 83POSIX.1-2001, POSIX.1-2008, C99.
fea681da 84.SH NOTES
d9bfdb9c 85The behavior of
60a90ecd 86.BR fgetwc ()
1274071a
MK
87depends on the
88.B LC_CTYPE
89category of the
fea681da
MK
90current locale.
91.PP
c13182ef 92In the absence of additional information passed to the
fb186734 93.BR fopen (3)
1e321034 94call, it is
60a90ecd
MK
95reasonable to expect that
96.BR fgetwc ()
35478399 97will actually read a multibyte sequence
fea681da 98from the stream and then convert it to a wide character.
47297adb 99.SH SEE ALSO
fea681da
MK
100.BR fgetws (3),
101.BR fputwc (3),
102.BR ungetwc (3),
103.BR unlocked_stdio (3)