]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man/man3/ungetwc.3
man/, share/mk/: Move man*/ to man/
[thirdparty/man-pages.git] / man / man3 / ungetwc.3
CommitLineData
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
14ungetwc \- push back a wide character onto a FILE stream
b45eb005
AC
15.SH LIBRARY
16Standard 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
25The
26.BR ungetwc ()
27function is the wide-character equivalent of the
9daa4fb9 28.BR ungetc (3)
c13182ef 29function.
35cfd378
MK
30It pushes back a wide character onto
31.I stream
32and returns it.
c6d039a3 33.P
35cfd378
MK
34If
35.I wc
36is
37.BR WEOF ,
38it returns
39.BR WEOF .
40If
41.I wc
42is an invalid wide character,
43it sets
d8a86e74 44.I errno
35cfd378
MK
45to
46.B EILSEQ
47and returns
48.BR WEOF .
c6d039a3 49.P
35cfd378
MK
50If
51.I wc
52is a valid wide character, it is pushed back onto the stream
d0f17b57 53and thus becomes available for future wide-character read operations.
c13182ef
MK
54The file-position indicator is decremented by one or more.
55The end-of-file
56indicator is cleared.
57The backing storage of the file is not affected.
c6d039a3 58.P
35cfd378
MK
59Note:
60.I wc
61need not be the last wide-character read from the stream;
fea681da 62it can be any other valid wide character.
c6d039a3 63.P
fea681da
MK
64If the implementation supports multiple push-back operations in a row, the
65pushed-back wide characters will be read in reverse order; however, only one
66level of push-back is guaranteed.
47297adb 67.SH RETURN VALUE
60a90ecd
MK
68The
69.BR ungetwc ()
35cfd378 70function returns
d8a86e74 71.I wc
35cfd378
MK
72when successful, or
73.B WEOF
74upon
fea681da 75failure.
b611d272 76.SH ATTRIBUTES
9b4de439
PH
77For an explanation of the terms used in this section, see
78.BR attributes (7).
79.TS
80allbox;
c466875e 81lbx lb lb
9b4de439
PH
82l l l.
83Interface Attribute Value
84T{
9e54434e
BR
85.na
86.nh
b611d272 87.BR ungetwc ()
9b4de439
PH
88T} Thread safety MT-Safe
89.TE
3113c7f3 90.SH STANDARDS
4131356c
AC
91C11, POSIX.1-2008.
92.SH HISTORY
93POSIX.1-2001, C99.
fea681da 94.SH NOTES
d9bfdb9c 95The behavior of
60a90ecd 96.BR ungetwc ()
1274071a
MK
97depends on the
98.B LC_CTYPE
99category of the
fea681da 100current locale.
47297adb 101.SH SEE ALSO
e37e3282 102.BR fgetwc (3)