HP-UX Reference (11i v2 04/09) - 3 Library Functions N-Z (vol 7)
p
putwc(3C) putwc(3C)
NAME
putwc(), putwchar(), fputwc(), putwc_unlocked(), putwchar_unlocked(), fputwc_unlocked() - put a wide
character on a stream file
SYNOPSIS
#include <wchar.h>
wint_t putwc(wint_t wc, FILE *stream);
wint_t putwchar(wint_t wc);
wint_t fputwc(wint_t wc, FILE *stream);
_INCLUDE__STDC_A1_SOURCE only
wint_t putwc(wchar_t wc, FILE *stream);
wint_t putwchar(wchar_t wc);
wint_t fputwc(wchar_t wc, FILE *stream);
Obsolescent Interfaces
wint_t putwc_unlocked(wint_t wc, FILE *stream);
wint_t putwchar_unlocked(wint_t wc);
wint_t fputwc_unlocked(wint_t wc, FILE *stream);
Remarks
These functions are compliant with the XPG4 Worldwide Portability Interface wide-character I/O func-
tions. They parallel the 8-bit character I/O functions defined in putc(3S).
DESCRIPTION
putwc() Writes the character corresponding to the wide character wc onto the output stream at
the position where the file pointer is pointing.
putwchar(wc) is defined as
putwc(wc, stdout). putwc() and putwchar() are defined both as macros and as
functions.
fputwc() Behaves like putwc(), but is a function rather than a macro, and can therefore be used
as an argument.
Output streams, with the exception of the standard error stream
stderr, are by default buffered if the
output refers to a file and line-buffered if the output refers to a terminal. The standard error output
stream, stderr, is by default unbuffered, but use of freopen() (see fopen(3S)) causes it to become
buffered or line-buffered. setbuf() or setvbuf() (see setbuf(3S)) can be used to change the stream’s
buffering strategy.
Definitions for these functions, the type wint_t and the value WEOF are provided in the
<wchar.h>
header.
Obsolescent Interfaces
putwc_unlocked(), putwchar_unlocked()
, and fputwc_unlocked() put a wide character on
a stream file.
Application Usage
To use the
_INCLUDE__STDC_A1_SOURCE prototype, the _INCLUDE__STDC_A1_SOURCE
flag must
be passed as a compiler option or defined as a macro in source files.
After
fputwc(), putwc(),orputwchar() is applied to a stream, the stream becomes byte-oriented
(see orientation (5)).
EXTERNAL INFLUENCES
Environment Variables
LC_CTYPE determines how wide character conversions are done.
International Code Set Support
Single- and multibyte character code sets are supported.
Section 3−−850 Hewlett-Packard Company − 1 − HP-UX 11i Version 2: September 2004