1FGETWS(3P) POSIX Programmer's Manual FGETWS(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 fgetws — get a wide-character string from a stream
13
15 #include <stdio.h>
16 #include <wchar.h>
17
18 wchar_t *fgetws(wchar_t *restrict ws, int n,
19 FILE *restrict stream);
20
22 The functionality described on this reference page is aligned with the
23 ISO C standard. Any conflict between the requirements described here
24 and the ISO C standard is unintentional. This volume of POSIX.1‐2017
25 defers to the ISO C standard.
26
27 The fgetws() function shall read characters from the stream, convert
28 these to the corresponding wide-character codes, place them in the
29 wchar_t array pointed to by ws, until n-1 characters are read, or a
30 <newline> is read, converted, and transferred to ws, or an end-of-file
31 condition is encountered. The wide-character string, ws, shall then be
32 terminated with a null wide-character code.
33
34 If an error occurs, the resulting value of the file position indicator
35 for the stream is unspecified.
36
37 The fgetws() function may mark the last data access timestamp of the
38 file associated with stream for update. The last data access timestamp
39 shall be marked for update by the first successful execution of
40 fgetwc(), fgetws(), fwscanf(), getwc(), getwchar(), vfwscanf(), vws‐
41 canf(), or wscanf() using stream that returns data not supplied by a
42 prior call to ungetwc().
43
45 Upon successful completion, fgetws() shall return ws. If the end-of-
46 file indicator for the stream is set, or if the stream is at end-of-
47 file, the end-of-file indicator for the stream shall be set and
48 fgetws() shall return a null pointer. If a read error occurs, the error
49 indicator for the stream shall be set, fgetws() shall return a null
50 pointer, and shall set errno to indicate the error.
51
53 Refer to fgetwc().
54
55 The following sections are informative.
56
58 None.
59
61 None.
62
64 None.
65
67 None.
68
70 Section 2.5, Standard I/O Streams, fopen(), fread()
71
72 The Base Definitions volume of POSIX.1‐2017, <stdio.h>, <wchar.h>
73
75 Portions of this text are reprinted and reproduced in electronic form
76 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
77 table Operating System Interface (POSIX), The Open Group Base Specifi‐
78 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
79 Electrical and Electronics Engineers, Inc and The Open Group. In the
80 event of any discrepancy between this version and the original IEEE and
81 The Open Group Standard, the original IEEE and The Open Group Standard
82 is the referee document. The original Standard can be obtained online
83 at http://www.opengroup.org/unix/online.html .
84
85 Any typographical or formatting errors that appear in this page are
86 most likely to have been introduced during the conversion of the source
87 files to man page format. To report such errors, see https://www.ker‐
88 nel.org/doc/man-pages/reporting_bugs.html .
89
90
91
92IEEE/The Open Group 2017 FGETWS(3P)