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
21
23 The fgetws() function shall read characters from the stream, convert
24 these to the corresponding wide-character codes, place them in the
25 wchar_t array pointed to by ws, until n-1 characters are read, or a
26 <newline> is read, converted, and transferred to ws, or an end-of-file
27 condition is encountered. The wide-character string, ws, shall then be
28 terminated with a null wide-character code.
29
30 If an error occurs, the resulting value of the file position indicator
31 for the stream is unspecified.
32
33 The fgetws() function may mark the st_atime field of the file associā
34 ated with stream for update. The st_atime field shall be marked for
35 update by the first successful execution of fgetc(), fgets(), fgetwc(),
36 fgetws(), fread(), fscanf(), getc(), getchar(), gets(), or scanf()
37 using stream that returns data not supplied by a prior call to ungetc()
38 or ungetwc().
39
41 Upon successful completion, fgetws() shall return ws. If the stream is
42 at end-of-file, the end-of-file indicator for the stream shall be set
43 and fgetws() shall return a null pointer. If a read error occurs, the
44 error indicator for the stream shall be set, fgetws() shall return a
45 null pointer, and shall set errno to indicate the error.
46
48 Refer to fgetwc().
49
50 The following sections are informative.
51
53 None.
54
56 None.
57
59 None.
60
62 None.
63
65 fopen(), fread(), the Base Definitions volume of IEEE Std 1003.1-2001,
66 <stdio.h>, <wchar.h>
67
69 Portions of this text are reprinted and reproduced in electronic form
70 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
71 -- Portable Operating System Interface (POSIX), The Open Group Base
72 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
73 Electrical and Electronics Engineers, Inc and The Open Group. In the
74 event of any discrepancy between this version and the original IEEE and
75 The Open Group Standard, the original IEEE and The Open Group Standard
76 is the referee document. The original Standard can be obtained online
77 at http://www.opengroup.org/unix/online.html .
78
79
80
81IEEE/The Open Group 2003 FGETWS(3P)