Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ putwchar(3) — OSF/1 3.0 αXP

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getc(3)

getwc(3)

printf(3)

putc(3)

puts(3)

wctomb(3)

putwc(3)  —  Subroutines

NAME

putwc, putwchar, fputwc − Write a character to a stream

LIBRARY

Standard C Library (libc.a)

SYNOPSIS

#include <wchar.h>
wint_t putwc(
wint_t c,
FILE ∗stream);
wint_t putwchar(
wint_t c );
wint_t fputwc(
wint_t c;
FILE ∗stream);

PARAMETERS

cSpecifies the wide character to be written. 

streamPoints to the output data. 

DESCRIPTION

The putwc() function converts the wchar_t specified by the c parameter to its equivalent multibyte character and then writes the multibyte character to the stream parameter. 

The putwchar() macro works like the putwc() function, except that putwchar() writes the character to the standard output. 

The fputwc() function works the same as putwc(). 

With the exception of stderr, output streams are, by default, buffered if they refer to files, or line buffered if they refer to terminals. The standard error output stream, stderr, is unbuffered by default, but using the freopen() function causes it to become buffered or line buffered. Use the setbuf() function to change the stream’s buffering strategy. 

RETURN VALUES

Upon successful completion, these functions each return the value written. If these functions fail, they return the constant WEOF. 

ERRORS

If any of the following conditions occur, the putwc(), fputwc(), and putwchar() functions set errno to the corresponding value. 

[EAGAIN]The O_NONBLOCK flag is set for the file descriptor underlying stream and the process would be delayed in the write operation. 

[EBADF]The file descriptor underlying stream is not a valid file descriptor open for writing. 

[EFBIG]An attempt was made to write to a file that exceeds the process’s file size limit or the maximum file size. 

[EINTR]The read operation was interrupted by a signal that was caught, and no data was transferred. 

[EIO]The implementation supports job control; the process is a member of a background process group attempting to write to its controlling terminal; TOSTOP is set; the process is neither ignoring nor blocking SIGTTOU; and the process group of the process is orphaned. 

[ENOSPC]There was no free space remaining on the device containing the file. 

[EPIPE]An attempt was made to write to a pipe or FIFO that is not open for reading by any process.  A SIGPIPE signal will also be sent to the process. 

[EILSEQ]The wide character code specified by the c parameter does not correspond to a valid character. 

RELATED INFORMATION

Functions: getc(3), getwc(3), printf(3), putc(3), puts(3), wctomb(3). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026