get a wide character string from a stream
cc . . . -lc
wchar_t *fgetws(wchar_t *ws, int n, FILE *stream);
converts characters read from the input stream, stream,
to their corresponding wide-character codes.
It places these wide-character codes in the wchar_t
array pointed to by ws.
At most, n-1 characters are read and converted;
a newline character or an end-of-file condition signals the end of the
input, although the newline character is still converted and
transferred to ws.
The wide-character string, ws,
is then null-terminated and returned.
The file position indicator is also advanced appropriately.
The resulting value of the file position indicator is meaningless
if an error occurs.
of the file associated with stream
is marked for update by the first successful
if the input data was
not pushed back to stream by a prior call to
or a call to
All subsequent calls of
may also update the
st_atime field if a
operation on stream is needed to fill the stdio buffer.
returns the converted string ws.
If the stream is at end-of-file when
is called, the
end of file indicator for the stream is set and
returns a null pointer. If a read error
returns a null pointer and sets
to indicate the error. fgetws also sets the error indicator
for the stream in this case.
will fail if data needs to be read and:
Cannot read the input stream immediately without blocking the process,
and the O_NONBLOCK flag is set for the file descriptor
associated with stream.
Not a valid file descriptor open for reading.
The read operation was terminated by a signal before any data was read.
Cannot read from the controlling terminal.
This happens when the process is in a background process group
and the attempt by the process to read from its controlling terminal fails,
either because the process group is orphaned, or
because the process is ignoring or blocking the SIGTTIN signal.
Not enough storage space available.
Attempt to read from a non-existent device, or from a device
whose capabilities are exceeded.
is conformant with:
X/Open CAE Specification, System Interfaces and Headers,
Issue 4, 1992.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003