Debian Codegraph @

upstream/debian-trixie/man3/fgetwc.3

raw
1 '\" t
2 .\" Copyright (c) Bruno Haible <[email protected]>
3 .\"
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\"
6 .\" References consulted:
7 .\" GNU glibc-2 source code and manual
8 .\" Dinkumware C library reference http://www.dinkumware.com/
9 .\" OpenGroup's Single UNIX specification
10 .\" http://www.UNIX-systems.org/online.html
11 .\" ISO/IEC 9899:1999
12 .\"
13 .\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon <[email protected]>
14 .TH fgetwc 3 2024-05-02 "Linux man-pages 6.9.1"
15 .SH NAME
16 fgetwc, getwc \- read a wide character from a FILE stream
17 .SH LIBRARY
18 Standard C library
19 .RI ( libc ", " \-lc )
20 .SH SYNOPSIS
21 .nf
22 .B #include <stdio.h>
23 .B #include <wchar.h>
24 .P
25 .BI "wint_t fgetwc(FILE *" stream );
26 .BI "wint_t getwc(FILE *" stream );
27 .fi
28 .SH DESCRIPTION
29 The
30 .BR fgetwc ()
31 function is the wide-character equivalent
32 of the
33 .BR fgetc (3)
34 function.
35 It reads a wide character from \fIstream\fP and returns it.
36 If the end of stream is reached, or if \fIferror(stream)\fP becomes true,
37 it returns
38 .BR WEOF .
39 If a wide-character conversion error occurs, it sets
40 \fIerrno\fP to \fBEILSEQ\fP and returns
41 .BR WEOF .
42 .P
43 The
44 .BR getwc ()
45 function or macro functions identically to
46 .BR fgetwc ().
47 It may be implemented as a macro, and may evaluate its argument
48 more than once.
49 There is no reason ever to use it.
50 .P
51 For nonlocking counterparts, see
52 .BR unlocked_stdio (3).
53 .SH RETURN VALUE
54 On success,
55 .BR fgetwc ()
56 returns the next wide-character from the stream.
57 Otherwise,
58 .B WEOF
59 is returned, and
60 .I errno
61 is set to indicate the error.
62 .SH ERRORS
63 Apart from the usual ones, there is
64 .TP
65 .B EILSEQ
66 The data obtained from the input stream does not
67 form a valid character.
68 .SH ATTRIBUTES
69 For an explanation of the terms used in this section, see
70 .BR attributes (7).
71 .TS
72 allbox;
73 lbx lb lb
74 l l l.
75 Interface Attribute Value
76 T{
77 .na
78 .nh
79 .BR fgetwc (),
80 .BR getwc ()
81 T} Thread safety MT-Safe
82 .TE
83 .SH STANDARDS
84 C11, POSIX.1-2008.
85 .SH HISTORY
86 POSIX.1-2001, C99.
87 .SH NOTES
88 The behavior of
89 .BR fgetwc ()
90 depends on the
91 .B LC_CTYPE
92 category of the
93 current locale.
94 .P
95 In the absence of additional information passed to the
96 .BR fopen (3)
97 call, it is
98 reasonable to expect that
99 .BR fgetwc ()
100 will actually read a multibyte sequence
101 from the stream and then convert it to a wide character.
102 .SH SEE ALSO
103 .BR fgetws (3),
104 .BR fputwc (3),
105 .BR ungetwc (3),
106 .BR unlocked_stdio (3)