OSDN Git Service

f8af5042ebc7b02096fc80abab069cf0ed1457f2
[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)