]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/ungetwc.3
membarrier.2: Remove redundant mention of return value of MEMBARRIER_CMD_SHARED
[thirdparty/man-pages.git] / man3 / ungetwc.3
CommitLineData
fea681da
MK
1.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2.\"
89e3ffe9 3.\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
fea681da
MK
4.\" This is free documentation; you can redistribute it and/or
5.\" modify it under the terms of the GNU General Public License as
6.\" published by the Free Software Foundation; either version 2 of
7.\" the License, or (at your option) any later version.
fe382ebf 8.\" %%%LICENSE_END
fea681da
MK
9.\"
10.\" References consulted:
11.\" GNU glibc-2 source code and manual
12.\" Dinkumware C library reference http://www.dinkumware.com/
008f1ecc 13.\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
fea681da
MK
14.\" ISO/IEC 9899:1999
15.\"
460495ca 16.TH UNGETWC 3 2015-08-08 "GNU" "Linux Programmer's Manual"
fea681da
MK
17.SH NAME
18ungetwc \- push back a wide character onto a FILE stream
19.SH SYNOPSIS
20.nf
21.B #include <wchar.h>
22.sp
23.BI "wint_t ungetwc(wint_t " wc ", FILE *" stream );
24.fi
25.SH DESCRIPTION
60a90ecd
MK
26The
27.BR ungetwc ()
28function is the wide-character equivalent of the
9daa4fb9 29.BR ungetc (3)
c13182ef 30function.
35cfd378
MK
31It pushes back a wide character onto
32.I stream
33and returns it.
fea681da 34.PP
35cfd378
MK
35If
36.I wc
37is
38.BR WEOF ,
39it returns
40.BR WEOF .
41If
42.I wc
43is an invalid wide character,
44it sets
51700fd7 45.IR errno
35cfd378
MK
46to
47.B EILSEQ
48and returns
49.BR WEOF .
fea681da 50.PP
35cfd378
MK
51If
52.I wc
53is a valid wide character, it is pushed back onto the stream
d0f17b57 54and thus becomes available for future wide-character read operations.
c13182ef
MK
55The file-position indicator is decremented by one or more.
56The end-of-file
57indicator is cleared.
58The backing storage of the file is not affected.
fea681da 59.PP
35cfd378
MK
60Note:
61.I wc
62need not be the last wide-character read from the stream;
fea681da
MK
63it can be any other valid wide character.
64.PP
65If the implementation supports multiple push-back operations in a row, the
66pushed-back wide characters will be read in reverse order; however, only one
67level of push-back is guaranteed.
47297adb 68.SH RETURN VALUE
60a90ecd
MK
69The
70.BR ungetwc ()
35cfd378 71function returns
51700fd7 72.IR wc
35cfd378
MK
73when successful, or
74.B WEOF
75upon
fea681da 76failure.
b611d272 77.SH ATTRIBUTES
9b4de439
PH
78For an explanation of the terms used in this section, see
79.BR attributes (7).
80.TS
81allbox;
82lb lb lb
83l l l.
84Interface Attribute Value
85T{
b611d272 86.BR ungetwc ()
9b4de439
PH
87T} Thread safety MT-Safe
88.TE
47297adb 89.SH CONFORMING TO
088942c9 90POSIX.1-2001, POSIX.1-2008, C99.
fea681da 91.SH NOTES
d9bfdb9c 92The behavior of
60a90ecd 93.BR ungetwc ()
1274071a
MK
94depends on the
95.B LC_CTYPE
96category of the
fea681da 97current locale.
47297adb 98.SH SEE ALSO
e37e3282 99.BR fgetwc (3)