|HP-UX Reference > P
putws(3C)HP-UX 11i Version 3: February 2007
putws(), fputws() — put a wide character string on a stream file
int putws(const wchar_t *ws);
int fputws(const wchar_t *__restrict ws, FILE *__restrict stream);
int putws_unlocked(const wchar_t *ws);
int fputws_unlocked(const wchar_t *ws, FILE *stream);
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).
putws() writes a character string corresponding to the null-terminated wide-character string pointed to by ws followed by a new-line 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 new-line character or a terminating null character.
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.
After putws() or fputws() is applied to a stream, the stream becomes wide-oriented (see orientation(5)).
Upon successful completion, putws(), putws_unlocked(), fputws(), and fputws_unlocked() return a non-negative number. Otherwise they return WEOF, set the error indicator for the stream, and set errno to indicate the error.
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:
Additional errno values may be set by the underlying write() function (see write(2)).
putws_unlocked() and fputws_unlocked() are obsolescent interfaces supported only for compatibility with existing DCE applications. New multithreaded applications should use putws() and fputws().
ferror(3S), flockfile(3S), fopen(3S), fread(3S), printf(3S), putwc(3C), orientation(5), thread_safety(5), glossary(9).