OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[linuxjm/LDP_man-pages.git] / release / 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 .SH 名前
27 fgetws \- ワイド文字の文字列を FILE ストリームから読み込む
28 .SH 書式
29 .nf
30 .B #include <wchar.h>
31 .sp
32 .BI "wchar_t *fgetws(wchar_t *" ws ", int " n ", FILE *" stream );
33 .fi
34 .SH 説明
35 .BR fgetws ()
36 関数は
37 .BR fgets (3)
38 に対応するワイド文字関数である。
39 この関数は、最大 \fIn\-1\fP 文字のワイド文字を
40 \fIws\fP が示すワイド文字の配列に読み込み、
41 終端の NULL ワイド文字 (L\(aq\\0\(aq) を追加する。
42 この関数は、ワイド文字の改行文字を見つけ、これを格納すると読み込むのを止める。
43 この関数はストリームの終わりに達した場合も読み込みを止める。
44 .PP
45 プログラマは、\fIws\fP には少なくとも \fIn\fP 文字のワイド文字を
46 格納できる領域を必ず確保していなければならない。
47 .PP
48 これらの処理をロックせずに行いたいときは、
49 .BR unlocked_stdio (3)
50 を参照すること。
51 .SH 返り値
52 .BR fgetws ()
53 は成功すると \fIws\fP を返す。
54 既にストリームの終わりに達しているか、エラーが起きた場合には NULL を返す。
55 .SH 準拠
56 C99, POSIX.1-2001.
57 .SH 注意
58 .BR fgetws ()
59 の動作は、現在のロケールの
60 .B LC_CTYPE
61 カテゴリに依存する。
62 .PP
63 .BR fopen (3)
64 システムコールに渡す追加の情報がない場合には、
65 .BR fgetws ()
66 が実際にはマルチバイトシーケンスをストリームから読み込み、
67 これをワイド文字に変換すると期待することは適切である。
68 .PP
69 この関数は信頼できない。なぜなら、入力に含まれるかもしれない
70 ナルワイド文字を適切に処理することができないからである。
71 .SH 関連項目
72 .BR fgetwc (3),
73 .BR unlocked_stdio (3)