Blame man3/ungetwc.3

Packit 7cfc04
.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
Packit 7cfc04
.\"
Packit 7cfc04
.\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
Packit 7cfc04
.\" This is free documentation; you can redistribute it and/or
Packit 7cfc04
.\" modify it under the terms of the GNU General Public License as
Packit 7cfc04
.\" published by the Free Software Foundation; either version 2 of
Packit 7cfc04
.\" the License, or (at your option) any later version.
Packit 7cfc04
.\" %%%LICENSE_END
Packit 7cfc04
.\"
Packit 7cfc04
.\" References consulted:
Packit 7cfc04
.\"   GNU glibc-2 source code and manual
Packit 7cfc04
.\"   Dinkumware C library reference http://www.dinkumware.com/
Packit 7cfc04
.\"   OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
Packit 7cfc04
.\"   ISO/IEC 9899:1999
Packit 7cfc04
.\"
Packit 7cfc04
.TH UNGETWC 3  2015-08-08 "GNU" "Linux Programmer's Manual"
Packit 7cfc04
.SH NAME
Packit 7cfc04
ungetwc \- push back a wide character onto a FILE stream
Packit 7cfc04
.SH SYNOPSIS
Packit 7cfc04
.nf
Packit 7cfc04
.B #include <wchar.h>
Packit 7cfc04
.PP
Packit 7cfc04
.BI "wint_t ungetwc(wint_t " wc ", FILE *" stream );
Packit 7cfc04
.fi
Packit 7cfc04
.SH DESCRIPTION
Packit 7cfc04
The
Packit 7cfc04
.BR ungetwc ()
Packit 7cfc04
function is the wide-character equivalent of the
Packit 7cfc04
.BR ungetc (3)
Packit 7cfc04
function.
Packit 7cfc04
It pushes back a wide character onto
Packit 7cfc04
.I stream
Packit 7cfc04
and returns it.
Packit 7cfc04
.PP
Packit 7cfc04
If
Packit 7cfc04
.I wc
Packit 7cfc04
is
Packit 7cfc04
.BR WEOF ,
Packit 7cfc04
it returns
Packit 7cfc04
.BR WEOF .
Packit 7cfc04
If
Packit 7cfc04
.I wc
Packit 7cfc04
is an invalid wide character,
Packit 7cfc04
it sets
Packit 7cfc04
.IR errno
Packit 7cfc04
to
Packit 7cfc04
.B EILSEQ
Packit 7cfc04
and returns
Packit 7cfc04
.BR WEOF .
Packit 7cfc04
.PP
Packit 7cfc04
If
Packit 7cfc04
.I wc
Packit 7cfc04
is a valid wide character, it is pushed back onto the stream
Packit 7cfc04
and thus becomes available for future wide-character read operations.
Packit 7cfc04
The file-position indicator is decremented by one or more.
Packit 7cfc04
The end-of-file
Packit 7cfc04
indicator is cleared.
Packit 7cfc04
The backing storage of the file is not affected.
Packit 7cfc04
.PP
Packit 7cfc04
Note:
Packit 7cfc04
.I wc
Packit 7cfc04
need not be the last wide-character read from the stream;
Packit 7cfc04
it can be any other valid wide character.
Packit 7cfc04
.PP
Packit 7cfc04
If the implementation supports multiple push-back operations in a row, the
Packit 7cfc04
pushed-back wide characters will be read in reverse order; however, only one
Packit 7cfc04
level of push-back is guaranteed.
Packit 7cfc04
.SH RETURN VALUE
Packit 7cfc04
The
Packit 7cfc04
.BR ungetwc ()
Packit 7cfc04
function returns
Packit 7cfc04
.IR wc
Packit 7cfc04
when successful, or
Packit 7cfc04
.B WEOF
Packit 7cfc04
upon
Packit 7cfc04
failure.
Packit 7cfc04
.SH ATTRIBUTES
Packit 7cfc04
For an explanation of the terms used in this section, see
Packit 7cfc04
.BR attributes (7).
Packit 7cfc04
.TS
Packit 7cfc04
allbox;
Packit 7cfc04
lb lb lb
Packit 7cfc04
l l l.
Packit 7cfc04
Interface	Attribute	Value
Packit 7cfc04
T{
Packit 7cfc04
.BR ungetwc ()
Packit 7cfc04
T}	Thread safety	MT-Safe
Packit 7cfc04
.TE
Packit 7cfc04
.SH CONFORMING TO
Packit 7cfc04
POSIX.1-2001, POSIX.1-2008, C99.
Packit 7cfc04
.SH NOTES
Packit 7cfc04
The behavior of
Packit 7cfc04
.BR ungetwc ()
Packit 7cfc04
depends on the
Packit 7cfc04
.B LC_CTYPE
Packit 7cfc04
category of the
Packit 7cfc04
current locale.
Packit 7cfc04
.SH SEE ALSO
Packit 7cfc04
.BR fgetwc (3)
Packit 7cfc04
.SH COLOPHON
Packit 7cfc04
This page is part of release 4.15 of the Linux
Packit 7cfc04
.I man-pages
Packit 7cfc04
project.
Packit 7cfc04
A description of the project,
Packit 7cfc04
information about reporting bugs,
Packit 7cfc04
and the latest version of this page,
Packit 7cfc04
can be found at
Packit 7cfc04
\%https://www.kernel.org/doc/man\-pages/.