GETWC(3C) Standard C Library Functions GETWC(3C)

getwc, getwc_l - get wide character from a stream

#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);

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.

Refer to fgetwc(3C).

Refer to fgetwc(3C).

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.

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.

fgetwc(3C), newlocale(3C), setlocale(3C), uselocale(3C), attributes(7), standards(7)

July 11, 2014 OmniOS