]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/ungetwc.3
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man3 / ungetwc.3
CommitLineData
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
13ungetwc \- push back a wide character onto a FILE stream
b45eb005
AC
14.SH LIBRARY
15Standard 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
24The
25.BR ungetwc ()
26function is the wide-character equivalent of the
9daa4fb9 27.BR ungetc (3)
c13182ef 28function.
35cfd378
MK
29It pushes back a wide character onto
30.I stream
31and returns it.
fea681da 32.PP
35cfd378
MK
33If
34.I wc
35is
36.BR WEOF ,
37it returns
38.BR WEOF .
39If
40.I wc
41is an invalid wide character,
42it sets
d8a86e74 43.I errno
35cfd378
MK
44to
45.B EILSEQ
46and returns
47.BR WEOF .
fea681da 48.PP
35cfd378
MK
49If
50.I wc
51is a valid wide character, it is pushed back onto the stream
d0f17b57 52and thus becomes available for future wide-character read operations.
c13182ef
MK
53The file-position indicator is decremented by one or more.
54The end-of-file
55indicator is cleared.
56The backing storage of the file is not affected.
fea681da 57.PP
35cfd378
MK
58Note:
59.I wc
60need not be the last wide-character read from the stream;
fea681da
MK
61it can be any other valid wide character.
62.PP
63If the implementation supports multiple push-back operations in a row, the
64pushed-back wide characters will be read in reverse order; however, only one
65level of push-back is guaranteed.
47297adb 66.SH RETURN VALUE
60a90ecd
MK
67The
68.BR ungetwc ()
35cfd378 69function returns
d8a86e74 70.I wc
35cfd378
MK
71when successful, or
72.B WEOF
73upon
fea681da 74failure.
b611d272 75.SH ATTRIBUTES
9b4de439
PH
76For 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
81allbox;
c466875e 82lbx lb lb
9b4de439
PH
83l l l.
84Interface Attribute Value
85T{
b611d272 86.BR ungetwc ()
9b4de439
PH
87T} Thread safety MT-Safe
88.TE
c466875e
MK
89.hy
90.ad
91.sp 1
3113c7f3 92.SH STANDARDS
088942c9 93POSIX.1-2001, POSIX.1-2008, 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)