1ungetwc(3) Library Functions Manual ungetwc(3)
2
3
4
6 ungetwc - push back a wide character onto a FILE stream
7
9 Standard C library (libc, -lc)
10
12 #include <wchar.h>
13
14 wint_t ungetwc(wint_t wc, FILE *stream);
15
17 The ungetwc() function is the wide-character equivalent of the
18 ungetc(3) function. It pushes back a wide character onto stream and
19 returns it.
20
21 If wc is WEOF, it returns WEOF. If wc is an invalid wide character, it
22 sets errno to EILSEQ and returns WEOF.
23
24 If wc is a valid wide character, it is pushed back onto the stream and
25 thus becomes available for future wide-character read operations. The
26 file-position indicator is decremented by one or more. The end-of-file
27 indicator is cleared. The backing storage of the file is not affected.
28
29 Note: wc need not be the last wide-character read from the stream; it
30 can be any other valid wide character.
31
32 If the implementation supports multiple push-back operations in a row,
33 the pushed-back wide characters will be read in reverse order; however,
34 only one level of push-back is guaranteed.
35
37 The ungetwc() function returns wc when successful, or WEOF upon fail‐
38 ure.
39
41 For an explanation of the terms used in this section, see at‐
42 tributes(7).
43
44 ┌────────────────────────────────────────────┬───────────────┬─────────┐
45 │Interface │ Attribute │ Value │
46 ├────────────────────────────────────────────┼───────────────┼─────────┤
47 │ungetwc() │ Thread safety │ MT-Safe │
48 └────────────────────────────────────────────┴───────────────┴─────────┘
49
51 C11, POSIX.1-2008.
52
54 POSIX.1-2001, C99.
55
57 The behavior of ungetwc() depends on the LC_CTYPE category of the cur‐
58 rent locale.
59
61 fgetwc(3)
62
63
64
65Linux man-pages 6.04 2023-03-30 ungetwc(3)