1UNGETWC(3)                 Linux Programmer's Manual                UNGETWC(3)
2
3
4

NAME

6       ungetwc - push back a wide character onto a FILE stream
7

SYNOPSIS

9       #include <wchar.h>
10
11       wint_t ungetwc(wint_t wc, FILE *stream);
12

DESCRIPTION

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

RETURN VALUE

34       The ungetwc() function returns wc when successful, or WEOF  upon  fail‐
35       ure.
36

ATTRIBUTES

38       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
39       tributes(7).
40
41       ┌────────────────────────────────────────────┬───────────────┬─────────┐
42Interface                                   Attribute     Value   
43       ├────────────────────────────────────────────┼───────────────┼─────────┤
44ungetwc()                                   │ Thread safety │ MT-Safe │
45       └────────────────────────────────────────────┴───────────────┴─────────┘
46

CONFORMING TO

48       POSIX.1-2001, POSIX.1-2008, C99.
49

NOTES

51       The behavior of ungetwc() depends on the LC_CTYPE category of the  cur‐
52       rent locale.
53

SEE ALSO

55       fgetwc(3)
56

COLOPHON

58       This  page  is  part of release 5.13 of the Linux man-pages project.  A
59       description of the project, information about reporting bugs,  and  the
60       latest     version     of     this    page,    can    be    found    at
61       https://www.kernel.org/doc/man-pages/.
62
63
64
65GNU                               2021-03-22                        UNGETWC(3)
Impressum