GETWC(3C) Standard C Library Functions GETWC(3C)
NAME
getwc, getwc_l - get wide character from a stream
SYNOPSIS
#include <stdio.h>
#include <wchar.h>
wint_t getwc(
FILE *stream);
#include <stdio.h>
#include <wchar.h>
#include <xlocale.h>
wint_t getwc_l(
FILE *stream,
locale_t loc);
DESCRIPTION
The
getwc() function is equivalent to
fgetwc(3C), except that if it is
implemented as a macro it may evaluate
stream more than once, so the
argument should never be an expression with side effects.
The
getwc_l() function is similar to
getwc(), except instead of acting on
the current locale, it uses the locale specified by
loc.
RETURN VALUES
Refer to
fgetwc(3C).
ERRORS
Refer to
fgetwc(3C).
USAGE
This interface is provided to align with some current implementations and
with possible future
ISO standards.
Because they may be implemented as macros, these functions may treat
incorrectly a
stream argument with side effects. In particular,
getwc(*
f++) may not work as expected. Therefore, use of these functions
is not recommended;
fgetwc(3C) and
fgetwc_l(3C) should be used instead.
ATTRIBUTES
See
attributes(7) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Interface Stability | See below. |
+--------------------+-----------------+
|MT-Level | MT-Safe |
+--------------------+-----------------+
The
getwc() function is Standard. The
getwc_l() function is Uncommitted.
SEE ALSO
fgetwc(3C),
newlocale(3C),
setlocale(3C),
uselocale(3C),
attributes(7),
standards(7) July 11, 2014
GETWC(3C)