2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
|
|
|
|
.\"
|
|
|
|
.\" This is free documentation; you can redistribute it and/or
|
|
|
|
.\" modify it under the terms of the GNU General Public License as
|
|
|
|
.\" published by the Free Software Foundation; either version 2 of
|
|
|
|
.\" the License, or (at your option) any later version.
|
|
|
|
.\"
|
|
|
|
.\" References consulted:
|
|
|
|
.\" GNU glibc-2 source code and manual
|
|
|
|
.\" Dinkumware C library reference http://www.dinkumware.com/
|
|
|
|
.\" OpenGroup's Single Unix specification
|
|
|
|
.\" http://www.UNIX-systems.org/online.html
|
|
|
|
.\" ISO/IEC 9899:1999
|
|
|
|
.\"
|
|
|
|
.\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon <moz@compsoc.man.ac.uk>
|
|
|
|
.TH FGETWC 3 1999-07-25 "GNU" "Linux Programmer's Manual"
|
|
|
|
.SH NAME
|
|
|
|
fgetwc, getwc \- read a wide character from a FILE stream
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B #include <stdio.h>
|
|
|
|
.br
|
|
|
|
.B #include <wchar.h>
|
|
|
|
.sp
|
|
|
|
.BI "wint_t fgetwc(FILE *" stream );
|
|
|
|
.BI "wint_t getwc(FILE *" stream );
|
|
|
|
.fi
|
|
|
|
.SH DESCRIPTION
|
2007-05-12 09:06:04 +00:00
|
|
|
The
|
|
|
|
.BR fgetwc ()
|
|
|
|
function is the wide-character equivalent
|
|
|
|
of the
|
2007-05-21 21:23:17 +00:00
|
|
|
.BR fgetc (3)
|
2007-05-12 09:06:04 +00:00
|
|
|
function.
|
2007-04-12 22:42:49 +00:00
|
|
|
It reads a wide character from \fIstream\fP and returns it.
|
|
|
|
If the end of stream is reached, or if \fIferror(stream)\fP becomes true,
|
2007-07-09 20:43:38 +00:00
|
|
|
it returns
|
|
|
|
.BR WEOF .
|
2007-04-24 19:40:35 +00:00
|
|
|
If a wide-character conversion error occurs, it sets
|
2007-07-09 20:43:38 +00:00
|
|
|
\fIerrno\fP to \fBEILSEQ\fP and returns
|
|
|
|
.BR WEOF .
|
2004-11-03 13:51:07 +00:00
|
|
|
.PP
|
2007-05-12 09:06:04 +00:00
|
|
|
The
|
|
|
|
.BR getwc ()
|
|
|
|
function or macro functions identically to
|
|
|
|
.BR fgetwc ().
|
2004-11-03 13:51:07 +00:00
|
|
|
It may be implemented as a macro, and may evaluate its argument
|
2007-04-12 22:42:49 +00:00
|
|
|
more than once.
|
|
|
|
There is no reason ever to use it.
|
2004-11-03 13:51:07 +00:00
|
|
|
.PP
|
accept.2, access.2, acct.2, clock_nanosleep.2, mbind.2, mincore.2, remap_file_pages.2, sched_setscheduler.2, set_mempolicy.2, splice.2, stat.2, syslog.2, timer_create.2, timerfd_create.2, truncate.2, fenv.3, ferror.3, fflush.3, fgetwc.3, fgetws.3, flockfile.3, fputwc.3, fputws.3, fread.3, getopt.3, gets.3, getwchar.3, glob.3, iconv.3, longjmp.3, pow.3, printf.3, puts.3, putwchar.3, regex.3, rpc.3, scanf.3, setjmp.3, termios.3, unlocked_stdio.3, wcswidth.3, hd.4, rtc.4, st.4, core.5, dir_colors.5, elf.5, proc.5, arp.7, ascii.7, boot.7, bootparam.7, charsets.7, futex.7, ip.7, iso_8859-11.7, man-pages.7, man.7, mdoc.samples.7, path_resolution.7, pipe.7, posixoptions.7, unicode.7, unix.7, uri.7, utf-8.7, ld.so.8: s/non-/non/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 17:20:12 +00:00
|
|
|
For nonlocking counterparts, see
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR unlocked_stdio (3).
|
|
|
|
.SH "RETURN VALUE"
|
2007-05-12 09:06:04 +00:00
|
|
|
The
|
|
|
|
.BR fgetwc ()
|
|
|
|
function returns the next wide-character
|
2007-07-09 20:43:38 +00:00
|
|
|
from the stream, or
|
|
|
|
.BR WEOF .
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH ERRORS
|
|
|
|
Apart from the usual ones, there is
|
|
|
|
.TP
|
|
|
|
.B EILSEQ
|
|
|
|
The data obtained from the input stream does not
|
|
|
|
form a valid character.
|
|
|
|
.SH "CONFORMING TO"
|
2006-08-04 09:41:28 +00:00
|
|
|
C99, POSIX.1-2001.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NOTES
|
2007-06-08 09:56:56 +00:00
|
|
|
The behavior of
|
2007-05-12 09:06:04 +00:00
|
|
|
.BR fgetwc ()
|
2007-06-22 18:25:23 +00:00
|
|
|
depends on the
|
|
|
|
.B LC_CTYPE
|
|
|
|
category of the
|
2004-11-03 13:51:07 +00:00
|
|
|
current locale.
|
|
|
|
.PP
|
2007-04-12 22:42:49 +00:00
|
|
|
In the absence of additional information passed to the
|
2007-05-12 00:30:29 +00:00
|
|
|
.BR fopen (3)
|
2005-10-20 15:11:10 +00:00
|
|
|
call, it is
|
2007-05-12 09:06:04 +00:00
|
|
|
reasonable to expect that
|
|
|
|
.BR fgetwc ()
|
2006-12-27 03:54:41 +00:00
|
|
|
will actually read a multibyte sequence
|
2004-11-03 13:51:07 +00:00
|
|
|
from the stream and then convert it to a wide character.
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR fgetws (3),
|
|
|
|
.BR fputwc (3),
|
|
|
|
.BR ungetwc (3),
|
|
|
|
.BR unlocked_stdio (3)
|