]>
Commit | Line | Data |
---|---|---|
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 |
20 | fgetwc, 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 |
30 | The |
31 | .BR fgetwc () | |
32 | function is the wide-character equivalent | |
33 | of the | |
363a3cc9 | 34 | .BR fgetc (3) |
60a90ecd | 35 | function. |
c13182ef MK |
36 | It reads a wide character from \fIstream\fP and returns it. |
37 | If the end of stream is reached, or if \fIferror(stream)\fP becomes true, | |
cab87712 MK |
38 | it returns |
39 | .BR WEOF . | |
d0f17b57 | 40 | If 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 |
44 | The |
45 | .BR getwc () | |
46 | function or macro functions identically to | |
47 | .BR fgetwc (). | |
fea681da | 48 | It may be implemented as a macro, and may evaluate its argument |
c13182ef MK |
49 | more than once. |
50 | There is no reason ever to use it. | |
fea681da | 51 | .PP |
24b74457 | 52 | For nonlocking counterparts, see |
fea681da | 53 | .BR unlocked_stdio (3). |
47297adb | 54 | .SH RETURN VALUE |
60a90ecd MK |
55 | The |
56 | .BR fgetwc () | |
57 | function returns the next wide-character | |
cab87712 MK |
58 | from the stream, or |
59 | .BR WEOF . | |
dbf51683 MK |
60 | In the event of an error, |
61 | .I errno | |
62 | is set to indicate the cause. | |
fea681da MK |
63 | .SH ERRORS |
64 | Apart from the usual ones, there is | |
65 | .TP | |
66 | .B EILSEQ | |
67 | The data obtained from the input stream does not | |
68 | form a valid character. | |
b73c480b MS |
69 | .SH ATTRIBUTES |
70 | For an explanation of the terms used in this section, see | |
71 | .BR attributes (7). | |
72 | .TS | |
73 | allbox; | |
74 | lbw17 lb lb | |
75 | l l l. | |
76 | Interface Attribute Value | |
77 | T{ | |
78 | .BR fgetwc (), | |
79 | .BR getwc () | |
80 | T} Thread safety MT-Safe | |
81 | .TE | |
47297adb | 82 | .SH CONFORMING TO |
29680d10 | 83 | POSIX.1-2001, POSIX.1-2008, C99. |
fea681da | 84 | .SH NOTES |
d9bfdb9c | 85 | The behavior of |
60a90ecd | 86 | .BR fgetwc () |
1274071a MK |
87 | depends on the |
88 | .B LC_CTYPE | |
89 | category of the | |
fea681da MK |
90 | current locale. |
91 | .PP | |
c13182ef | 92 | In the absence of additional information passed to the |
fb186734 | 93 | .BR fopen (3) |
1e321034 | 94 | call, it is |
60a90ecd MK |
95 | reasonable to expect that |
96 | .BR fgetwc () | |
35478399 | 97 | will actually read a multibyte sequence |
fea681da | 98 | from 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) |