HP-UX Reference (11i v2 07/12) - 3 Library Functions N-Z (vol 7)

p
putws(3C) putws(3C)
NAME
putws(), fputws(), putws_unlocked(), fputws_unlocked() - put a wide-character string on a stream file
SYNOPSIS
#include <wchar.h>
int putws(const wchar_t *ws);
int fputws(const wchar_t *ws, FILE *stream);
Obsolescent Interfaces
int putws_unlocked(const wchar_t *ws);
int fputws_unlocked(const wchar_t *ws, FILE *stream);
Remarks
fputws is compliant with the XPG4 Worldwide Portability Interface wide-character I/O functions. These
functions parallel the 8-bit character I/O functions defined in puts(3S).
DESCRIPTION
putws() writes a character string corresponding to the null-terminated wide-character string pointed to
by ws followed by a newline character, to the standard output stream stdout.
fputws() writes a character string corresponding to the null-terminated wide-character string pointed to
by ws to the named output stream, but does not append a newline character or a terminating null charac-
ter.
Neither function writes a terminating null character.
The definition for these functions, the type wchar_t and the value WEOF are provided in the
<wchar.h> header.
Obsolescent Interfaces
putws_unlocked()
and fputws_unlocked() put a wide-character string on a stream file.
Application Usage
After
putws() or fputws() is applied to a stream, the stream becomes wide-oriented (see orienta-
tion(5)).
EXTERNAL INFLUENCES
Locale
The
LC_CTYPE category determines how wide-character conversions are done.
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
Upon successful completion, putws(), putws_unlocked()
, fputws(), and
fputws_unlocked() return a non-negative number. Otherwise they return WEOF, set the error indi-
cator for the stream, and set errno to indicate the error.
ERRORS
putws(), putws_unlocked(), fputws(), and fputws_unlocked()
fail if either the stream is
unbuffered, or stream’s buffer needed to be flushed causing an underlying
write() call to be invoked,
and:
[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 max-
imum file size (see ulimit(2)).
[EINTR] A signal was caught during the write() system call.
[EIO] The process is in a background process group and is attempting to write to its controlling
terminal, TOSTOP is set, the process is neither ignoring nor blocking the SIGTTOU signal,
284 Hewlett-Packard Company 1 HP-UX 11i Version 2: December 2007 Update