Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
fgetws(3) OSS Library Calls Reference Manual
NAME
fgetws - Gets a wide character string from a stream
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <wchar.h>
wchar_t *fgetws(
wchar_t *string,
int number,
FILE *stream);
PARAMETERS
wstring Points to a string to receive characters.
stream Points to the FILE structure of an open file.
number Specifies an upper bound on the number of characters to read.
DESCRIPTION
The fgetws( ) function reads characters from the stream, converts them into the corresponding
wide character codes, and stores them in the wchar_t array pointed to by the wstring parameter.
It reads until number-1 characters have been read, it has read and stored in the buffer the ’\n’
newline character, or it has encountered the end of file condition. It appends a null wide character
code to wstring.
This function parallels the fgets( ) function.
RETURN VALUE
If the end of the file is encountered and no characters were read, no characters are transferred to
the wstring parameter and a null pointer is returned. If a read error occurs or the function cannot
convert the character to a wide character code, a NULL pointer is returned. Otherwise, wstring is
returned.
ERRORS
If any of the following conditions occur, the fgetws( ) function fails and sets errno to the
corresponding value.
[EILSEQ] The data obtained from the stream did not contain valid characters in the current
locale.
[EOVERFLOW]
The application attempted to read beyond the file offset maximum.
RELATED INFORMATION
Functions: clearerr(3), feof(3), ferror(3), fileno(3), fopen(3), fopen64(3), fread(3), getc(3),
gets(3), getwc(3), getws(3), mbtowc(3), puts(3), putws(3), scanf(3).
2−72 Hewlett-Packard Company 527187-017