]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/ungetwc.3
MB_CUR_MAX.3, MB_LEN_MAX.3, btowc.3, fgetwc.3, fgetws.3, fputwc.3, fputws.3, fwide...
[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.\"
16.TH UNGETWC 3 1999-09-19 "GNU" "Linux Programmer's Manual"
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
MK
30function.
31It pushes back a wide character onto \fIstream\fP and returns it.
fea681da 32.PP
f3fef736 33If \fIwc\fP is \fBWEOF\fP, it returns \fBWEOF\fP.
c13182ef 34If \fIwc\fP is an invalid wide character,
f3fef736 35it sets \fIerrno\fP to \fBEILSEQ\fP and returns \fBWEOF\fP.
fea681da
MK
36.PP
37If \fIwc\fP is a valid wide character, it is pushed back onto the stream
d0f17b57 38and thus becomes available for future wide-character read operations.
c13182ef
MK
39The file-position indicator is decremented by one or more.
40The end-of-file
41indicator is cleared.
42The backing storage of the file is not affected.
fea681da 43.PP
d0f17b57 44Note: \fIwc\fP need not be the last wide-character read from the stream;
fea681da
MK
45it can be any other valid wide character.
46.PP
47If the implementation supports multiple push-back operations in a row, the
48pushed-back wide characters will be read in reverse order; however, only one
49level of push-back is guaranteed.
47297adb 50.SH RETURN VALUE
60a90ecd
MK
51The
52.BR ungetwc ()
f3fef736 53function returns \fIwc\fP when successful, or \fBWEOF\fP upon
fea681da 54failure.
47297adb 55.SH CONFORMING TO
1eb85d14 56C99.
fea681da 57.SH NOTES
d9bfdb9c 58The behavior of
60a90ecd 59.BR ungetwc ()
1274071a
MK
60depends on the
61.B LC_CTYPE
62category of the
fea681da 63current locale.
47297adb 64.SH SEE ALSO
e37e3282 65.BR fgetwc (3)