]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/fgetwc.3
getent.1, intro.1, time.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, adjtimex...
[thirdparty/man-pages.git] / man3 / fgetwc.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
fea681da
MK
12.\" http://www.UNIX-systems.org/online.html
13.\" ISO/IEC 9899:1999
14.\"
15.\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon <moz@compsoc.man.ac.uk>
16.TH FGETWC 3 1999-07-25 "GNU" "Linux Programmer's Manual"
17.SH NAME
18fgetwc, getwc \- read a wide character from a FILE stream
19.SH SYNOPSIS
20.nf
21.B #include <stdio.h>
22.br
23.B #include <wchar.h>
24.sp
25.BI "wint_t fgetwc(FILE *" stream );
26.BI "wint_t getwc(FILE *" stream );
27.fi
28.SH DESCRIPTION
60a90ecd
MK
29The
30.BR fgetwc ()
31function is the wide-character equivalent
32of the
363a3cc9 33.BR fgetc (3)
60a90ecd 34function.
c13182ef
MK
35It reads a wide character from \fIstream\fP and returns it.
36If the end of stream is reached, or if \fIferror(stream)\fP becomes true,
cab87712
MK
37it returns
38.BR WEOF .
d0f17b57 39If a wide-character conversion error occurs, it sets
cab87712
MK
40\fIerrno\fP to \fBEILSEQ\fP and returns
41.BR WEOF .
fea681da 42.PP
60a90ecd
MK
43The
44.BR getwc ()
45function or macro functions identically to
46.BR fgetwc ().
fea681da 47It may be implemented as a macro, and may evaluate its argument
c13182ef
MK
48more than once.
49There is no reason ever to use it.
fea681da 50.PP
24b74457 51For nonlocking counterparts, see
fea681da 52.BR unlocked_stdio (3).
47297adb 53.SH RETURN VALUE
60a90ecd
MK
54The
55.BR fgetwc ()
56function returns the next wide-character
cab87712
MK
57from the stream, or
58.BR WEOF .
fea681da
MK
59.SH ERRORS
60Apart from the usual ones, there is
61.TP
62.B EILSEQ
63The data obtained from the input stream does not
64form a valid character.
47297adb 65.SH CONFORMING TO
9d9dc1e8 66C99, POSIX.1-2001.
fea681da 67.SH NOTES
d9bfdb9c 68The behavior of
60a90ecd 69.BR fgetwc ()
1274071a
MK
70depends on the
71.B LC_CTYPE
72category of the
fea681da
MK
73current locale.
74.PP
c13182ef 75In the absence of additional information passed to the
fb186734 76.BR fopen (3)
1e321034 77call, it is
60a90ecd
MK
78reasonable to expect that
79.BR fgetwc ()
35478399 80will actually read a multibyte sequence
fea681da 81from the stream and then convert it to a wide character.
47297adb 82.SH SEE ALSO
fea681da
MK
83.BR fgetws (3),
84.BR fputwc (3),
85.BR ungetwc (3),
86.BR unlocked_stdio (3)