]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/ungetwc.3
mmap.2, a64l.3, abort.3, abs.3, acos.3, acosh.3, addseverity.3, adjtime.3, aio_cancel...
[thirdparty/man-pages.git] / man3 / ungetwc.3
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
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 2015-03-02 "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
32 .I stream
33 and returns it.
34 .PP
35 If
36 .I wc
37 is
38 .BR WEOF ,
39 it returns
40 .BR WEOF .
41 If
42 .I wc
43 is an invalid wide character,
44 it sets
45 .IR errno
46 to
47 .B EILSEQ
48 and returns
49 .BR WEOF .
50 .PP
51 If
52 .I wc
53 is a valid wide character, it is pushed back onto the stream
54 and thus becomes available for future wide-character read operations.
55 The file-position indicator is decremented by one or more.
56 The end-of-file
57 indicator is cleared.
58 The backing storage of the file is not affected.
59 .PP
60 Note:
61 .I wc
62 need not be the last wide-character read from the stream;
63 it can be any other valid wide character.
64 .PP
65 If the implementation supports multiple push-back operations in a row, the
66 pushed-back wide characters will be read in reverse order; however, only one
67 level of push-back is guaranteed.
68 .SH RETURN VALUE
69 The
70 .BR ungetwc ()
71 function returns
72 .IR wc
73 when successful, or
74 .B WEOF
75 upon
76 failure.
77 .SH ATTRIBUTES
78 For an explanation of the terms used in this section, see
79 .BR attributes (7).
80 .TS
81 allbox;
82 lb lb lb
83 l l l.
84 Interface Attribute Value
85 T{
86 .BR ungetwc ()
87 T} Thread safety MT-Safe
88 .TE
89 .SH CONFORMING TO
90 C99.
91 .SH NOTES
92 The behavior of
93 .BR ungetwc ()
94 depends on the
95 .B LC_CTYPE
96 category of the
97 current locale.
98 .SH SEE ALSO
99 .BR fgetwc (3)