OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / original / man3 / fgetwc.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
14 .\"      http://www.UNIX-systems.org/online.html
15 .\"   ISO/IEC 9899:1999
16 .\"
17 .\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon <moz@compsoc.man.ac.uk>
18 .TH FGETWC 3  2013-04-19 "GNU" "Linux Programmer's Manual"
19 .SH NAME
20 fgetwc, getwc \- read a wide character from a FILE stream
21 .SH SYNOPSIS
22 .nf
23 .B #include <stdio.h>
24 .br
25 .B #include <wchar.h>
26 .sp
27 .BI "wint_t fgetwc(FILE *" stream );
28 .BI "wint_t getwc(FILE *" stream );
29 .fi
30 .SH DESCRIPTION
31 The
32 .BR fgetwc ()
33 function is the wide-character equivalent
34 of the
35 .BR fgetc (3)
36 function.
37 It reads a wide character from \fIstream\fP and returns it.
38 If the end of stream is reached, or if \fIferror(stream)\fP becomes true,
39 it returns
40 .BR WEOF .
41 If a wide-character conversion error occurs, it sets
42 \fIerrno\fP to \fBEILSEQ\fP and returns
43 .BR WEOF .
44 .PP
45 The
46 .BR getwc ()
47 function or macro functions identically to
48 .BR fgetwc ().
49 It may be implemented as a macro, and may evaluate its argument
50 more than once.
51 There is no reason ever to use it.
52 .PP
53 For nonlocking counterparts, see
54 .BR unlocked_stdio (3).
55 .SH RETURN VALUE
56 The
57 .BR fgetwc ()
58 function returns the next wide-character
59 from the stream, or
60 .BR WEOF .
61 In the event of an error,
62 .I errno
63 is set to indicate the cause.
64 .SH ERRORS
65 Apart from the usual ones, there is
66 .TP
67 .B EILSEQ
68 The data obtained from the input stream does not
69 form a valid character.
70 .SH CONFORMING TO
71 C99, POSIX.1-2001.
72 .SH NOTES
73 The behavior of
74 .BR fgetwc ()
75 depends on the
76 .B LC_CTYPE
77 category of the
78 current locale.
79 .PP
80 In the absence of additional information passed to the
81 .BR fopen (3)
82 call, it is
83 reasonable to expect that
84 .BR fgetwc ()
85 will actually read a multibyte sequence
86 from the stream and then convert it to a wide character.
87 .SH SEE ALSO
88 .BR fgetws (3),
89 .BR fputwc (3),
90 .BR ungetwc (3),
91 .BR unlocked_stdio (3)
92 .SH COLOPHON
93 This page is part of release 3.79 of the Linux
94 .I man-pages
95 project.
96 A description of the project,
97 information about reporting bugs,
98 and the latest version of this page,
99 can be found at
100 \%http://www.kernel.org/doc/man\-pages/.