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