1FGETWS(3)                  Linux Programmer's Manual                 FGETWS(3)
2
3
4

NAME

6       fgetws - read a wide-character string from a FILE stream
7

SYNOPSIS

9       #include <wchar.h>
10
11       wchar_t *fgetws(wchar_t *ws, int n, FILE *stream);
12

DESCRIPTION

14       The  fgetws() function is the wide-character equivalent of the fgets(3)
15       function.  It reads a string of at most n-1 wide  characters  into  the
16       wide-character  array  pointed  to  by ws, and adds a terminating L'\0'
17       character.  It stops reading wide characters after it  has  encountered
18       and  stored a newline wide character.  It also stops when end of stream
19       is reached.
20
21       The programmer must ensure that there is room for at least n wide char‐
22       acters at ws.
23
24       For a nonlocking counterpart, see unlocked_stdio(3).
25

RETURN VALUE

27       The fgetws() function, if successful, returns ws.  If end of stream was
28       already reached or if an error occurred, it returns NULL.
29

CONFORMING TO

31       C99, POSIX.1-2001.
32

NOTES

34       The behavior of fgetws() depends on the LC_CTYPE category of  the  cur‐
35       rent locale.
36
37       In  the  absence of additional information passed to the fopen(3) call,
38       it is reasonable to expect that fgetws() will actually read a multibyte
39       string from the stream and then convert it to a wide-character string.
40
41       This  function  is unreliable, because it does not permit to deal prop‐
42       erly with null wide characters that may be present in the input.
43

SEE ALSO

45       fgetwc(3), unlocked_stdio(3)
46

COLOPHON

48       This page is part of release 3.25 of the Linux  man-pages  project.   A
49       description  of  the project, and information about reporting bugs, can
50       be found at http://www.kernel.org/doc/man-pages/.
51
52
53
54GNU                               1999-07-25                         FGETWS(3)
Impressum