1FGETWS(3) Linux Programmer's Manual FGETWS(3)
2
3
4
6 fgetws - read a wide-character string from a FILE stream
7
9 #include <wchar.h>
10
11 wchar_t *fgetws(wchar_t *ws, int n, FILE *stream);
12
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 null wide
17 character (L'\0'). It stops reading wide characters after it has
18 encountered and stored a newline wide character. It also stops when
19 end of stream 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
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
31 C99, POSIX.1-2001.
32
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
45 fgetwc(3), unlocked_stdio(3)
46
48 This page is part of release 3.53 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 2011-09-28 FGETWS(3)