1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
10 .\" References consulted:
11 .\" GNU glibc-2 source code and manual
12 .\" Dinkumware C library reference http://www.dinkumware.com/
13 .\" OpenGroup's Single UNIX specification
14 .\" http://www.UNIX-systems.org/online.html
17 .\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon <moz@compsoc.man.ac.uk>
18 .TH FGETWS 3 2021-03-22 "GNU" "Linux Programmer's Manual"
20 fgetws \- read a wide-character string from a FILE stream
25 .BI "wchar_t *fgetws(wchar_t *restrict " ws ", int " n \
26 ", FILE *restrict " stream );
31 function is the wide-character equivalent
35 It reads a string of at most \fIn\-1\fP wide characters into the
36 wide-character array pointed to by \fIws\fP,
37 and adds a terminating null wide character (L\(aq\e0\(aq).
38 It stops reading wide characters after it has encountered and
39 stored a newline wide character.
40 It also stops when end of stream is reached.
42 The programmer must ensure that there is room for at least \fIn\fP wide
43 characters at \fIws\fP.
45 For a nonlocking counterpart, see
46 .BR unlocked_stdio (3).
50 function, if successful, returns \fIws\fP.
52 was already reached or if an error occurred, it returns NULL.
54 For an explanation of the terms used in this section, see
62 Interface Attribute Value
65 T} Thread safety MT-Safe
71 POSIX.1-2001, POSIX.1-2008, C99.
80 In the absence of additional information passed to the
83 reasonable to expect that
85 will actually read a multibyte string
86 from the stream and then convert it to a wide-character string.
88 This function is unreliable,
89 because it does not permit to deal properly with
90 null wide characters that may be present in the input.
93 .BR unlocked_stdio (3)