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