1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\" References consulted:
6 .\" GNU glibc-2 source code and manual
7 .\" Dinkumware C library reference http://www.dinkumware.com/
8 .\" OpenGroup's Single UNIX specification
9 .\" http://www.UNIX-systems.org/online.html
12 .\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon <moz@compsoc.man.ac.uk>
13 .TH FGETWS 3 2021-03-22 "Linux man-pages (unreleased)"
15 fgetws \- read a wide-character string from a FILE stream
18 .RI ( libc ", " \-lc )
23 .BI "wchar_t *fgetws(wchar_t *restrict " ws ", int " n \
24 ", FILE *restrict " stream );
29 function is the wide-character equivalent
33 It reads a string of at most \fIn\-1\fP wide characters into the
34 wide-character array pointed to by \fIws\fP,
35 and adds a terminating null wide character (L\(aq\e0\(aq).
36 It stops reading wide characters after it has encountered and
37 stored a newline wide character.
38 It also stops when end of stream is reached.
40 The programmer must ensure that there is room for at least \fIn\fP wide
41 characters at \fIws\fP.
43 For a nonlocking counterpart, see
44 .BR unlocked_stdio (3).
48 function, if successful, returns \fIws\fP.
50 was already reached or if an error occurred, it returns NULL.
52 For an explanation of the terms used in this section, see
60 Interface Attribute Value
63 T} Thread safety MT-Safe
69 POSIX.1-2001, POSIX.1-2008, C99.
78 In the absence of additional information passed to the
81 reasonable to expect that
83 will actually read a multibyte string
84 from the stream and then convert it to a wide-character string.
86 This function is unreliable,
87 because it does not permit to deal properly with
88 null wide characters that may be present in the input.
91 .BR unlocked_stdio (3)