]>
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 http://www.UNIX-systems.org/online.html |
fea681da MK |
9 | .\" ISO/IEC 9899:1999 |
10 | .\" | |
4c1c5274 | 11 | .TH ungetwc 3 (date) "Linux man-pages (unreleased)" |
fea681da MK |
12 | .SH NAME |
13 | ungetwc \- push back a wide character onto a FILE stream | |
b45eb005 AC |
14 | .SH LIBRARY |
15 | Standard C library | |
8fc3b2cf | 16 | .RI ( libc ", " \-lc ) |
fea681da MK |
17 | .SH SYNOPSIS |
18 | .nf | |
19 | .B #include <wchar.h> | |
68e4db0a | 20 | .PP |
fea681da MK |
21 | .BI "wint_t ungetwc(wint_t " wc ", FILE *" stream ); |
22 | .fi | |
23 | .SH DESCRIPTION | |
60a90ecd MK |
24 | The |
25 | .BR ungetwc () | |
26 | function is the wide-character equivalent of the | |
9daa4fb9 | 27 | .BR ungetc (3) |
c13182ef | 28 | function. |
35cfd378 MK |
29 | It pushes back a wide character onto |
30 | .I stream | |
31 | and returns it. | |
fea681da | 32 | .PP |
35cfd378 MK |
33 | If |
34 | .I wc | |
35 | is | |
36 | .BR WEOF , | |
37 | it returns | |
38 | .BR WEOF . | |
39 | If | |
40 | .I wc | |
41 | is an invalid wide character, | |
42 | it sets | |
d8a86e74 | 43 | .I errno |
35cfd378 MK |
44 | to |
45 | .B EILSEQ | |
46 | and returns | |
47 | .BR WEOF . | |
fea681da | 48 | .PP |
35cfd378 MK |
49 | If |
50 | .I wc | |
51 | is a valid wide character, it is pushed back onto the stream | |
d0f17b57 | 52 | and thus becomes available for future wide-character read operations. |
c13182ef MK |
53 | The file-position indicator is decremented by one or more. |
54 | The end-of-file | |
55 | indicator is cleared. | |
56 | The backing storage of the file is not affected. | |
fea681da | 57 | .PP |
35cfd378 MK |
58 | Note: |
59 | .I wc | |
60 | need not be the last wide-character read from the stream; | |
fea681da MK |
61 | it can be any other valid wide character. |
62 | .PP | |
63 | If the implementation supports multiple push-back operations in a row, the | |
64 | pushed-back wide characters will be read in reverse order; however, only one | |
65 | level of push-back is guaranteed. | |
47297adb | 66 | .SH RETURN VALUE |
60a90ecd MK |
67 | The |
68 | .BR ungetwc () | |
35cfd378 | 69 | function returns |
d8a86e74 | 70 | .I wc |
35cfd378 MK |
71 | when successful, or |
72 | .B WEOF | |
73 | upon | |
fea681da | 74 | failure. |
b611d272 | 75 | .SH ATTRIBUTES |
9b4de439 PH |
76 | For an explanation of the terms used in this section, see |
77 | .BR attributes (7). | |
c466875e MK |
78 | .ad l |
79 | .nh | |
9b4de439 PH |
80 | .TS |
81 | allbox; | |
c466875e | 82 | lbx lb lb |
9b4de439 PH |
83 | l l l. |
84 | Interface Attribute Value | |
85 | T{ | |
b611d272 | 86 | .BR ungetwc () |
9b4de439 PH |
87 | T} Thread safety MT-Safe |
88 | .TE | |
c466875e MK |
89 | .hy |
90 | .ad | |
91 | .sp 1 | |
3113c7f3 | 92 | .SH STANDARDS |
088942c9 | 93 | POSIX.1-2001, POSIX.1-2008, 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) |