OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / fgetws.3
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
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.
8 .\" %%%LICENSE_END
9 .\"
10 .\" References consulted:
11 .\"   GNU glibc-2 source code and manual
12 .\"   Dinkumware C library reference http://www.dinkumware.com/
13 .\"   OpenGroup's Single UNIX specification
14 .\"     http://www.UNIX-systems.org/online.html
15 .\"   ISO/IEC 9899:1999
16 .\"
17 .\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon <moz@compsoc.man.ac.uk>
18 .TH FGETWS 3  2011-09-28 "GNU" "Linux Programmer's Manual"
19 .SH NAME
20 fgetws \- read a wide-character string from a FILE stream
21 .SH SYNOPSIS
22 .nf
23 .B #include <wchar.h>
24 .sp
25 .BI "wchar_t *fgetws(wchar_t *" ws ", int " n ", FILE *" stream );
26 .fi
27 .SH DESCRIPTION
28 The
29 .BR fgetws ()
30 function is the wide-character equivalent
31 of the
32 .BR fgets (3)
33 function.
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\\0\(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.
40 .PP
41 The programmer must ensure that there is room for at least \fIn\fP wide
42 characters at \fIws\fP.
43 .PP
44 For a nonlocking counterpart, see
45 .BR unlocked_stdio (3).
46 .SH RETURN VALUE
47 The
48 .BR fgetws ()
49 function, if successful, returns \fIws\fP.
50 If end of stream
51 was already reached or if an error occurred, it returns NULL.
52 .SH CONFORMING TO
53 C99, POSIX.1-2001.
54 .SH NOTES
55 The behavior of
56 .BR fgetws ()
57 depends on the
58 .B LC_CTYPE
59 category of the
60 current locale.
61 .PP
62 In the absence of additional information passed to the
63 .BR fopen (3)
64 call, it is
65 reasonable to expect that
66 .BR fgetws ()
67 will actually read a multibyte string
68 from the stream and then convert it to a wide-character string.
69 .PP
70 This function is unreliable,
71 because it does not permit to deal properly with
72 null wide characters that may be present in the input.
73 .SH SEE ALSO
74 .BR fgetwc (3),
75 .BR unlocked_stdio (3)
76 .SH COLOPHON
77 This page is part of release 3.79 of the Linux
78 .I man-pages
79 project.
80 A description of the project,
81 information about reporting bugs,
82 and the latest version of this page,
83 can be found at
84 \%http://www.kernel.org/doc/man\-pages/.