]>
Commit | Line | Data |
---|---|---|
a1eaacb1 | 1 | '\" t |
fea681da MK |
2 | .\" Copyright (c) Bruno Haible <haible@clisp.cons.org> |
3 | .\" | |
e4a74ca8 | 4 | .\" SPDX-License-Identifier: GPL-2.0-or-later |
fea681da MK |
5 | .\" |
6 | .\" References consulted: | |
7 | .\" GNU glibc-2 source code and manual | |
8 | .\" Dinkumware C library reference http://www.dinkumware.com/ | |
008f1ecc | 9 | .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html |
fea681da MK |
10 | .\" ISO/IEC 9899:1999 |
11 | .\" | |
4c1c5274 | 12 | .TH ungetwc 3 (date) "Linux man-pages (unreleased)" |
fea681da MK |
13 | .SH NAME |
14 | ungetwc \- push back a wide character onto a FILE stream | |
b45eb005 AC |
15 | .SH LIBRARY |
16 | Standard C library | |
8fc3b2cf | 17 | .RI ( libc ", " \-lc ) |
fea681da MK |
18 | .SH SYNOPSIS |
19 | .nf | |
20 | .B #include <wchar.h> | |
c6d039a3 | 21 | .P |
fea681da MK |
22 | .BI "wint_t ungetwc(wint_t " wc ", FILE *" stream ); |
23 | .fi | |
24 | .SH DESCRIPTION | |
60a90ecd MK |
25 | The |
26 | .BR ungetwc () | |
27 | function is the wide-character equivalent of the | |
9daa4fb9 | 28 | .BR ungetc (3) |
c13182ef | 29 | function. |
35cfd378 MK |
30 | It pushes back a wide character onto |
31 | .I stream | |
32 | and returns it. | |
c6d039a3 | 33 | .P |
35cfd378 MK |
34 | If |
35 | .I wc | |
36 | is | |
37 | .BR WEOF , | |
38 | it returns | |
39 | .BR WEOF . | |
40 | If | |
41 | .I wc | |
42 | is an invalid wide character, | |
43 | it sets | |
d8a86e74 | 44 | .I errno |
35cfd378 MK |
45 | to |
46 | .B EILSEQ | |
47 | and returns | |
48 | .BR WEOF . | |
c6d039a3 | 49 | .P |
35cfd378 MK |
50 | If |
51 | .I wc | |
52 | is a valid wide character, it is pushed back onto the stream | |
d0f17b57 | 53 | and thus becomes available for future wide-character read operations. |
c13182ef MK |
54 | The file-position indicator is decremented by one or more. |
55 | The end-of-file | |
56 | indicator is cleared. | |
57 | The backing storage of the file is not affected. | |
c6d039a3 | 58 | .P |
35cfd378 MK |
59 | Note: |
60 | .I wc | |
61 | need not be the last wide-character read from the stream; | |
fea681da | 62 | it can be any other valid wide character. |
c6d039a3 | 63 | .P |
fea681da MK |
64 | If the implementation supports multiple push-back operations in a row, the |
65 | pushed-back wide characters will be read in reverse order; however, only one | |
66 | level of push-back is guaranteed. | |
47297adb | 67 | .SH RETURN VALUE |
60a90ecd MK |
68 | The |
69 | .BR ungetwc () | |
35cfd378 | 70 | function returns |
d8a86e74 | 71 | .I wc |
35cfd378 MK |
72 | when successful, or |
73 | .B WEOF | |
74 | upon | |
fea681da | 75 | failure. |
b611d272 | 76 | .SH ATTRIBUTES |
9b4de439 PH |
77 | For an explanation of the terms used in this section, see |
78 | .BR attributes (7). | |
79 | .TS | |
80 | allbox; | |
c466875e | 81 | lbx lb lb |
9b4de439 PH |
82 | l l l. |
83 | Interface Attribute Value | |
84 | T{ | |
9e54434e BR |
85 | .na |
86 | .nh | |
b611d272 | 87 | .BR ungetwc () |
9b4de439 PH |
88 | T} Thread safety MT-Safe |
89 | .TE | |
3113c7f3 | 90 | .SH STANDARDS |
4131356c AC |
91 | C11, POSIX.1-2008. |
92 | .SH HISTORY | |
93 | POSIX.1-2001, C99. | |
fea681da | 94 | .SH NOTES |
d9bfdb9c | 95 | The behavior of |
60a90ecd | 96 | .BR ungetwc () |
1274071a MK |
97 | depends on the |
98 | .B LC_CTYPE | |
99 | category of the | |
fea681da | 100 | current locale. |
47297adb | 101 | .SH SEE ALSO |
e37e3282 | 102 | .BR fgetwc (3) |