OSDN Git Service

(split) LDP: Update original to LDP v3.65
[linuxjm/LDP_man-pages.git] / original / 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  2013-12-09 "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 .SS Multithreading (see pthreads(7))
79 The
80 .BR ungetwc ()
81 function is thread-safe.
82 .SH CONFORMING TO
83 C99.
84 .SH NOTES
85 The behavior of
86 .BR ungetwc ()
87 depends on the
88 .B LC_CTYPE
89 category of the
90 current locale.
91 .SH SEE ALSO
92 .BR fgetwc (3)
93 .SH COLOPHON
94 This page is part of release 3.65 of the Linux
95 .I man-pages
96 project.
97 A description of the project,
98 and information about reporting bugs,
99 can be found at
100 \%http://www.kernel.org/doc/man\-pages/.