]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) Bruno Haible <haible@clisp.cons.org> |
2 | .\" | |
89e3ffe9 | 3 | .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA) |
fea681da MK |
4 | .\" This is free documentation; you can redistribute it and/or |
5 | .\" modify it under the terms of the GNU General Public License as | |
6 | .\" published by the Free Software Foundation; either version 2 of | |
7 | .\" the License, or (at your option) any later version. | |
fe382ebf | 8 | .\" %%%LICENSE_END |
fea681da MK |
9 | .\" |
10 | .\" References consulted: | |
11 | .\" GNU glibc-2 source code and manual | |
12 | .\" Dinkumware C library reference http://www.dinkumware.com/ | |
008f1ecc | 13 | .\" OpenGroup's Single UNIX specification |
c16f9356 | 14 | .\" http://www.UNIX-systems.org/online.html |
fea681da MK |
15 | .\" ISO/IEC 9899:1999 |
16 | .\" | |
17 | .\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon <moz@compsoc.man.ac.uk> | |
460495ca | 18 | .TH FGETWS 3 2015-08-08 "GNU" "Linux Programmer's Manual" |
fea681da | 19 | .SH NAME |
d0f17b57 | 20 | fgetws \- read a wide-character string from a FILE stream |
fea681da MK |
21 | .SH SYNOPSIS |
22 | .nf | |
23 | .B #include <wchar.h> | |
68e4db0a | 24 | .PP |
fea681da MK |
25 | .BI "wchar_t *fgetws(wchar_t *" ws ", int " n ", FILE *" stream ); |
26 | .fi | |
27 | .SH DESCRIPTION | |
60a90ecd MK |
28 | The |
29 | .BR fgetws () | |
30 | function is the wide-character equivalent | |
31 | of the | |
363a3cc9 | 32 | .BR fgets (3) |
60a90ecd | 33 | function. |
c16f9356 MK |
34 | It reads a string of at most \fIn\-1\fP wide characters into the |
35 | wide-character array pointed to by \fIws\fP, | |
e9c23bc6 | 36 | and adds a terminating null wide character (L\(aq\\0\(aq). |
c13182ef MK |
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. | |
fea681da MK |
40 | .PP |
41 | The programmer must ensure that there is room for at least \fIn\fP wide | |
42 | characters at \fIws\fP. | |
43 | .PP | |
24b74457 | 44 | For a nonlocking counterpart, see |
fea681da | 45 | .BR unlocked_stdio (3). |
47297adb | 46 | .SH RETURN VALUE |
60a90ecd MK |
47 | The |
48 | .BR fgetws () | |
49 | function, if successful, returns \fIws\fP. | |
c13182ef | 50 | If end of stream |
fea681da | 51 | was already reached or if an error occurred, it returns NULL. |
ed8b903b MS |
52 | .SH ATTRIBUTES |
53 | For an explanation of the terms used in this section, see | |
54 | .BR attributes (7). | |
55 | .TS | |
56 | allbox; | |
57 | lb lb lb | |
58 | l l l. | |
59 | Interface Attribute Value | |
60 | T{ | |
61 | .BR fgetws () | |
62 | T} Thread safety MT-Safe | |
63 | .TE | |
47297adb | 64 | .SH CONFORMING TO |
1d47c6ca | 65 | POSIX.1-2001, POSIX.1-2008, C99. |
fea681da | 66 | .SH NOTES |
d9bfdb9c | 67 | The behavior of |
60a90ecd | 68 | .BR fgetws () |
1274071a MK |
69 | depends on the |
70 | .B LC_CTYPE | |
71 | category of the | |
fea681da MK |
72 | current locale. |
73 | .PP | |
c13182ef | 74 | In the absence of additional information passed to the |
fb186734 | 75 | .BR fopen (3) |
1e321034 | 76 | call, it is |
60a90ecd MK |
77 | reasonable to expect that |
78 | .BR fgetws () | |
fbe183be | 79 | will actually read a multibyte string |
d0f17b57 | 80 | from the stream and then convert it to a wide-character string. |
fea681da | 81 | .PP |
fbe183be MK |
82 | This function is unreliable, |
83 | because it does not permit to deal properly with | |
fea681da | 84 | null wide characters that may be present in the input. |
47297adb | 85 | .SH SEE ALSO |
fea681da MK |
86 | .BR fgetwc (3), |
87 | .BR unlocked_stdio (3) |