]> git.ipfire.org Git - thirdparty/man-pages.git/blob - 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
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_ONEPARA_DOC)
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.
8 .\" %%%LICENSE_END
9 .\"
10 .\" References consulted:
11 .\" GNU glibc-2 source code and manual
12 .\" Dinkumware C library reference http://www.dinkumware.com/
13 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
14 .\" ISO/IEC 9899:1999
15 .\"
16 .TH UNGETWC 3 1999-09-19 "GNU" "Linux Programmer's Manual"
17 .SH NAME
18 ungetwc \- 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
26 The
27 .BR ungetwc ()
28 function is the wide-character equivalent of the
29 .BR ungetc (3)
30 function.
31 It pushes back a wide character onto \fIstream\fP and returns it.
32 .PP
33 If \fIwc\fP is \fBWEOF\fP, it returns \fBWEOF\fP.
34 If \fIwc\fP is an invalid wide character,
35 it sets \fIerrno\fP to \fBEILSEQ\fP and returns \fBWEOF\fP.
36 .PP
37 If \fIwc\fP is a valid wide character, it is pushed back onto the stream
38 and thus becomes available for future wide-character read operations.
39 The file-position indicator is decremented by one or more.
40 The end-of-file
41 indicator is cleared.
42 The backing storage of the file is not affected.
43 .PP
44 Note: \fIwc\fP need not be the last wide-character read from the stream;
45 it can be any other valid wide character.
46 .PP
47 If the implementation supports multiple push-back operations in a row, the
48 pushed-back wide characters will be read in reverse order; however, only one
49 level of push-back is guaranteed.
50 .SH RETURN VALUE
51 The
52 .BR ungetwc ()
53 function returns \fIwc\fP when successful, or \fBWEOF\fP upon
54 failure.
55 .SH CONFORMING TO
56 C99.
57 .SH NOTES
58 The behavior of
59 .BR ungetwc ()
60 depends on the
61 .B LC_CTYPE
62 category of the
63 current locale.
64 .SH SEE ALSO
65 .BR fgetwc (3)