OSDN Git Service

(split) Apply minor changes from v3.32 to v3.35 in the upstream.
[linuxjm/LDP_man-pages.git] / draft / man3 / fgetws.3
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" References consulted:
9 .\"   GNU glibc-2 source code and manual
10 .\"   Dinkumware C library reference http://www.dinkumware.com/
11 .\"   OpenGroup's Single UNIX specification
12 .\"     http://www.UNIX-systems.org/online.html
13 .\"   ISO/IEC 9899:1999
14 .\"
15 .\" Modified Tue Oct 16 23:18:40 BST 2001 by John Levon <moz@compsoc.man.ac.uk>
16 .\"
17 .\" About this Japanese page, please contact to JM Project <JM@linux.or.jp>
18 .\" Translated Sun Aug 29 15:03:42 JST 1999
19 .\"           by FUJIWARA Teruyoshi <fujiwara@linux.or.jp>
20 .\" Updated Sat Oct 27 09:01:41 JST 2001
21 .\"           by Yuichi SATO <ysato@h4.dion.ne.jp>
22 .\"
23 .\" WORD: null wide characters  ¥Ê¥ë¥ï¥¤¥Éʸ»ú
24 .\"
25 .TH FGETWS 3  2011-09-28 "GNU" "Linux Programmer's Manual"
26 .\"O .SH NAME
27 .SH Ì¾Á°
28 .\"O fgetws \- read a wide-character string from a FILE stream
29 fgetws \- ¥ï¥¤¥Éʸ»ú¤Îʸ»úÎó¤ò FILE ¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤à
30 .\"O .SH SYNOPSIS
31 .SH ½ñ¼°
32 .nf
33 .B #include <wchar.h>
34 .sp
35 .BI "wchar_t *fgetws(wchar_t *" ws ", int " n ", FILE *" stream );
36 .fi
37 .\"O .SH DESCRIPTION
38 .SH ÀâÌÀ
39 .\"O The
40 .\"O .BR fgetws ()
41 .\"O function is the wide-character equivalent
42 .\"O of the
43 .\"O .BR fgets (3)
44 .\"O function.
45 .\"O It reads a string of at most \fIn\-1\fP wide characters into the
46 .\"O wide-character array pointed to by \fIws\fP,
47 .\"O and adds a terminating null wide character (L\(aq\\0\(aq).
48 .\"O It stops reading wide characters after it has encountered and
49 .\"O stored a newline wide character.
50 .\"O It also stops when end of stream is reached.
51 .BR fgetws ()
52 ´Ø¿ô¤Ï
53 .BR fgets (3)
54 ¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ç¤¢¤ë¡£
55 ¤³¤Î´Ø¿ô¤Ï¡¢ºÇÂç \fIn\-1\fP Ê¸»ú¤Î¥ï¥¤¥Éʸ»ú¤ò
56 \fIws\fP ¤¬¼¨¤¹¥ï¥¤¥Éʸ»ú¤ÎÇÛÎó¤ËÆɤ߹þ¤ß¡¢
57 ½ªÃ¼¤Î NULL ¥ï¥¤¥Éʸ»ú (L\(aq\\0\(aq) ¤òÄɲ乤롣
58 ¤³¤Î´Ø¿ô¤Ï¡¢¥ï¥¤¥Éʸ»ú¤Î²þ¹Ôʸ»ú¤ò¸«¤Ä¤±¡¢¤³¤ì¤ò³ÊǼ¤¹¤ë¤ÈÆɤ߹þ¤à¤Î¤ò»ß¤á¤ë¡£
59 ¤³¤Î´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤Î½ª¤ï¤ê¤Ë㤷¤¿¾ì¹ç¤âÆɤ߹þ¤ß¤ò»ß¤á¤ë¡£
60 .PP
61 .\"O The programmer must ensure that there is room for at least \fIn\fP wide
62 .\"O characters at \fIws\fP.
63 ¥×¥í¥°¥é¥Þ¤Ï¡¢\fIws\fP ¤Ë¤Ï¾¯¤Ê¤¯¤È¤â \fIn\fP Ê¸»ú¤Î¥ï¥¤¥Éʸ»ú¤ò
64 ³ÊǼ¤Ç¤­¤ëÎΰè¤òɬ¤º³ÎÊݤ·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
65 .PP
66 .\"O For a nonlocking counterpart, see
67 .\"O .BR unlocked_stdio (3).
68 ¤³¤ì¤é¤Î½èÍý¤ò¥í¥Ã¥¯¤»¤º¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï¡¢
69 .BR unlocked_stdio (3)
70 ¤ò»²¾È¤¹¤ë¤³¤È¡£
71 .\"O .SH "RETURN VALUE"
72 .SH ÊÖ¤êÃÍ
73 .\"O The
74 .\"O .BR fgetws ()
75 .\"O function, if successful, returns \fIws\fP.
76 .\"O If end of stream
77 .\"O was already reached or if an error occurred, it returns NULL.
78 .BR fgetws ()
79 ¤ÏÀ®¸ù¤¹¤ë¤È \fIws\fP ¤òÊÖ¤¹¡£
80 ´û¤Ë¥¹¥È¥ê¡¼¥à¤Î½ª¤ï¤ê¤Ë㤷¤Æ¤¤¤ë¤«¡¢¥¨¥é¡¼¤¬µ¯¤­¤¿¾ì¹ç¤Ë¤Ï NULL ¤òÊÖ¤¹¡£
81 .\"O .SH "CONFORMING TO"
82 .SH ½àµò
83 C99, POSIX.1-2001.
84 .\"O .SH NOTES
85 .SH Ãí°Õ
86 .\"O The behavior of
87 .\"O .BR fgetws ()
88 .\"O depends on the
89 .\"O .B LC_CTYPE
90 .\"O category of the
91 .\"O current locale.
92 .BR fgetws ()
93 ¤ÎÆ°ºî¤Ï¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î
94 .B LC_CTYPE
95 ¥«¥Æ¥´¥ê¤Ë°Í¸¤¹¤ë¡£
96 .PP
97 .\"O In the absence of additional information passed to the
98 .\"O .BR fopen (3)
99 .\"O call, it is
100 .\"O reasonable to expect that
101 .\"O .BR fgetws ()
102 .\"O will actually read a multibyte string
103 .\"O from the stream and then convert it to a wide-character string.
104 .BR fopen (3)
105 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÅϤ¹ÄɲäξðÊ󤬤ʤ¤¾ì¹ç¤Ë¤Ï¡¢
106 .BR fgetws ()
107 ¤¬¼ÂºÝ¤Ë¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹¤ò¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤ß¡¢
108 ¤³¤ì¤ò¥ï¥¤¥Éʸ»ú¤ËÊÑ´¹¤¹¤ë¤È´üÂÔ¤¹¤ë¤³¤È¤ÏŬÀڤǤ¢¤ë¡£
109 .PP
110 .\"O This function is unreliable,
111 .\"O because it does not permit to deal properly with
112 .\"O null wide characters that may be present in the input.
113 ¤³¤Î´Ø¿ô¤Ï¿®Íê¤Ç¤­¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¡¢ÆþÎϤ˴ޤޤì¤ë¤«¤â¤·¤ì¤Ê¤¤
114 ¥Ê¥ë¥ï¥¤¥Éʸ»ú¤òŬÀڤ˽èÍý¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¤«¤é¤Ç¤¢¤ë¡£
115 .\"O .SH "SEE ALSO"
116 .SH ´ØÏ¢¹àÌÜ
117 .BR fgetwc (3),
118 .BR unlocked_stdio (3)