]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/ungetwc.3
Add page number to xrefs
[thirdparty/man-pages.git] / man3 / ungetwc.3
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" References consulted:
9 .\" GNU glibc-2 source code and manual
10 .\" Dinkumware C library reference http://www.dinkumware.com/
11 .\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html
12 .\" ISO/IEC 9899:1999
13 .\"
14 .TH UNGETWC 3 1999-09-19 "GNU" "Linux Programmer's Manual"
15 .SH NAME
16 ungetwc \- push back a wide character onto a FILE stream
17 .SH SYNOPSIS
18 .nf
19 .B #include <wchar.h>
20 .sp
21 .BI "wint_t ungetwc(wint_t " wc ", FILE *" stream );
22 .fi
23 .SH DESCRIPTION
24 The
25 .BR ungetwc ()
26 function is the wide-character equivalent of the
27 .BR ungetc (3)
28 function.
29 It pushes back a wide character onto \fIstream\fP and returns it.
30 .PP
31 If \fIwc\fP is WEOF, it returns WEOF.
32 If \fIwc\fP is an invalid wide character,
33 it sets \fIerrno\fP to \fBEILSEQ\fP and returns WEOF.
34 .PP
35 If \fIwc\fP is a valid wide character, it is pushed back onto the stream
36 and thus becomes available for future wide-character read operations.
37 The file-position indicator is decremented by one or more.
38 The end-of-file
39 indicator is cleared.
40 The backing storage of the file is not affected.
41 .PP
42 Note: \fIwc\fP need not be the last wide-character read from the stream;
43 it can be any other valid wide character.
44 .PP
45 If the implementation supports multiple push-back operations in a row, the
46 pushed-back wide characters will be read in reverse order; however, only one
47 level of push-back is guaranteed.
48 .SH "RETURN VALUE"
49 The
50 .BR ungetwc ()
51 function returns \fIwc\fP when successful, or WEOF upon
52 failure.
53 .SH "CONFORMING TO"
54 C99.
55 .SH NOTES
56 The behavior of
57 .BR ungetwc ()
58 depends on the LC_CTYPE category of the
59 current locale.
60 .SH "SEE ALSO"
61 .BR fgetwc (3)