Debian Codegraph @

upstream/debian-trixie/man3/getwchar.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 .TH getwchar 3 2024-05-02 "Linux man-pages 6.9.1"
14 .SH NAME
15 getwchar \- read a wide character from standard input
16 .SH LIBRARY
17 Standard C library
18 .RI ( libc ", " \-lc )
19 .SH SYNOPSIS
20 .nf
21 .B #include <wchar.h>
22 .P
23 .B "wint_t getwchar(void);"
24 .fi
25 .SH DESCRIPTION
26 The
27 .BR getwchar ()
28 function is the wide-character equivalent of the
29 .BR getchar (3)
30 function.
31 It reads a wide character from
32 .I stdin
33 and returns
34 it.
35 If the end of stream is reached, or if
36 .I ferror(stdin)
37 becomes true, it returns
38 .BR WEOF .
39 If a wide-character conversion error occurs, it sets
40 .I errno
41 to
42 .B EILSEQ
43 and returns
44 .BR WEOF .
45 .P
46 For a nonlocking counterpart, see
47 .BR unlocked_stdio (3).
48 .SH RETURN VALUE
49 The
50 .BR getwchar ()
51 function returns the next wide-character from
52 standard input, or
53 .BR WEOF .
54 .SH ATTRIBUTES
55 For an explanation of the terms used in this section, see
56 .BR attributes (7).
57 .TS
58 allbox;
59 lbx lb lb
60 l l l.
61 Interface Attribute Value
62 T{
63 .na
64 .nh
65 .BR getwchar ()
66 T} Thread safety MT-Safe
67 .TE
68 .SH STANDARDS
69 C11, POSIX.1-2008.
70 .SH HISTORY
71 C99, POSIX.1-2001.
72 .SH NOTES
73 The behavior of
74 .BR getwchar ()
75 depends on the
76 .B LC_CTYPE
77 category of the
78 current locale.
79 .P
80 It is reasonable to expect that
81 .BR getwchar ()
82 will actually
83 read a multibyte sequence from standard input and then
84 convert it to a wide character.
85 .SH SEE ALSO
86 .BR fgetwc (3),
87 .BR unlocked_stdio (3)