]>
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 http://www.UNIX-systems.org/online.html |
fea681da MK |
14 | .\" ISO/IEC 9899:1999 |
15 | .\" | |
460495ca | 16 | .TH UNGETWC 3 2015-08-08 "GNU" "Linux Programmer's Manual" |
fea681da MK |
17 | .SH NAME |
18 | ungetwc \- push back a wide character onto a FILE stream | |
19 | .SH SYNOPSIS | |
20 | .nf | |
21 | .B #include <wchar.h> | |
68e4db0a | 22 | .PP |
fea681da MK |
23 | .BI "wint_t ungetwc(wint_t " wc ", FILE *" stream ); |
24 | .fi | |
25 | .SH DESCRIPTION | |
60a90ecd MK |
26 | The |
27 | .BR ungetwc () | |
28 | function is the wide-character equivalent of the | |
9daa4fb9 | 29 | .BR ungetc (3) |
c13182ef | 30 | function. |
35cfd378 MK |
31 | It pushes back a wide character onto |
32 | .I stream | |
33 | and returns it. | |
fea681da | 34 | .PP |
35cfd378 MK |
35 | If |
36 | .I wc | |
37 | is | |
38 | .BR WEOF , | |
39 | it returns | |
40 | .BR WEOF . | |
41 | If | |
42 | .I wc | |
43 | is an invalid wide character, | |
44 | it sets | |
51700fd7 | 45 | .IR errno |
35cfd378 MK |
46 | to |
47 | .B EILSEQ | |
48 | and returns | |
49 | .BR WEOF . | |
fea681da | 50 | .PP |
35cfd378 MK |
51 | If |
52 | .I wc | |
53 | is a valid wide character, it is pushed back onto the stream | |
d0f17b57 | 54 | and thus becomes available for future wide-character read operations. |
c13182ef MK |
55 | The file-position indicator is decremented by one or more. |
56 | The end-of-file | |
57 | indicator is cleared. | |
58 | The backing storage of the file is not affected. | |
fea681da | 59 | .PP |
35cfd378 MK |
60 | Note: |
61 | .I wc | |
62 | need not be the last wide-character read from the stream; | |
fea681da MK |
63 | it can be any other valid wide character. |
64 | .PP | |
65 | If the implementation supports multiple push-back operations in a row, the | |
66 | pushed-back wide characters will be read in reverse order; however, only one | |
67 | level of push-back is guaranteed. | |
47297adb | 68 | .SH RETURN VALUE |
60a90ecd MK |
69 | The |
70 | .BR ungetwc () | |
35cfd378 | 71 | function returns |
51700fd7 | 72 | .IR wc |
35cfd378 MK |
73 | when successful, or |
74 | .B WEOF | |
75 | upon | |
fea681da | 76 | failure. |
b611d272 | 77 | .SH ATTRIBUTES |
9b4de439 PH |
78 | For an explanation of the terms used in this section, see |
79 | .BR attributes (7). | |
80 | .TS | |
81 | allbox; | |
82 | lb lb lb | |
83 | l l l. | |
84 | Interface Attribute Value | |
85 | T{ | |
b611d272 | 86 | .BR ungetwc () |
9b4de439 PH |
87 | T} Thread safety MT-Safe |
88 | .TE | |
47297adb | 89 | .SH CONFORMING TO |
088942c9 | 90 | POSIX.1-2001, POSIX.1-2008, C99. |
fea681da | 91 | .SH NOTES |
d9bfdb9c | 92 | The behavior of |
60a90ecd | 93 | .BR ungetwc () |
1274071a MK |
94 | depends on the |
95 | .B LC_CTYPE | |
96 | category of the | |
fea681da | 97 | current locale. |
47297adb | 98 | .SH SEE ALSO |
e37e3282 | 99 | .BR fgetwc (3) |