1UNGETWC(3) Linux Programmer's Manual UNGETWC(3)
2
3
4
6 ungetwc - push back a wide character onto a FILE stream
7
9 #include <wchar.h>
10
11 wint_t ungetwc(wint_t wc, FILE *stream);
12
14 The ungetwc() function is the wide-character equivalent of the
15 ungetc(3) function. It pushes back a wide character onto stream and
16 returns it.
17
18 If wc is WEOF, it returns WEOF. If wc is an invalid wide character, it
19 sets errno to EILSEQ and returns WEOF.
20
21 If wc is a valid wide character, it is pushed back onto the stream and
22 thus becomes available for future wide-character read operations. The
23 file-position indicator is decremented by one or more. The end-of-file
24 indicator is cleared. The backing storage of the file is not affected.
25
26 Note: wc need not be the last wide-character read from the stream; it
27 can be any other valid wide character.
28
29 If the implementation supports multiple push-back operations in a row,
30 the pushed-back wide characters will be read in reverse order; however,
31 only one level of push-back is guaranteed.
32
34 The ungetwc() function returns wc when successful, or WEOF upon fail‐
35 ure.
36
38 For an explanation of the terms used in this section, see at‐
39 tributes(7).
40
41 ┌──────────┬───────────────┬─────────┐
42 │Interface │ Attribute │ Value │
43 ├──────────┼───────────────┼─────────┤
44 │ungetwc() │ Thread safety │ MT-Safe │
45 └──────────┴───────────────┴─────────┘
47 POSIX.1-2001, POSIX.1-2008, C99.
48
50 The behavior of ungetwc() depends on the LC_CTYPE category of the cur‐
51 rent locale.
52
54 fgetwc(3)
55
57 This page is part of release 5.10 of the Linux man-pages project. A
58 description of the project, information about reporting bugs, and the
59 latest version of this page, can be found at
60 https://www.kernel.org/doc/man-pages/.
61
62
63
64GNU 2015-08-08 UNGETWC(3)