The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

fgetws - get a wide-character string from a stream

 SYNOPSIS



#include <stdio.h>
#include <wchar.h>

wchar_t *fgetws(wchar_t *ws, int n, FILE *stream);

 DESCRIPTION

The fgetws() function reads characters from the stream, converts these to the corresponding wide-character codes, places them in the wchar_t array pointed to by ws, until n-1 characters are read, or a newline character is read, converted and transferred to ws, or an end-of-file condition is encountered. The wide-character string, ws, is then terminated with a null wide-character code.

If an error occurs, the resulting value of the file position indicator for the stream is indeterminate.

The fgetws() function may mark the st_atime field of the file associated with stream for update. The st_atime field will be marked for update by the first successful execution of fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(), getc(), getchar(), gets() or scanf() using stream that returns data not supplied by a prior call to ungetc() or ungetwc().

 RETURN VALUE

Upon successful completion, fgetws() returns ws. If the stream is at end-of-file, the end-of-file indicator for the stream is set and fgetws() returns a null pointer. If a read error occurs, the error indicator for the stream is set, fgetws() returns a null pointer and sets errno to indicate the error.

 ERRORS

Refer to fgetwc().

 EXAMPLES

None.

 APPLICATION USAGE

None.

 FUTURE DIRECTIONS

None.

 SEE ALSO

fopen(), fread(), <stdio.h>, <wchar.h>.

DERIVATION

Derived from the MSE working draft.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]