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