fgetwsのヘルプ・マニュアル
日本語 英語
fgetws --help
man fgetws
FGETWS(3) Linux Programmer’s Manual FGETWS(3)
名前
fgetws - ワイド文字の文字列を FILE ストリームから読み込む
書式
#include
wchar_t *fgetws(wchar_t *ws, int n, FILE *stream);
説明
fgetws() 関数は fgets(3) に対応するワイド文字関数である。この関数は、最
大 n-1 文字のワイド文字を ws が示すワイド文字の配列に読み込み、終 端 の
L'\0' 文字を追加する。この関数は、ワイド文字の改行文字を見つけ、これを
格納すると読み込むのを止める。この関数はストリームの終わりに達した場 合
も読み込みを止める。
プ ログラマは、ws には少なくとも n 文字のワイド文字を格納できる領域を必
ず確保していなければならない。
これらの処理をロックせずに行いたいときは、 unlocked_stdio(3) を参照する
こと。
返り値
fgetws() は成功すると ws を返す。既にストリームの終わりに達しているか、
エラーが起きた場合には NULL を返す。
準拠
C99, POSIX.1-2001.
注意
fgetws() の動作は、現在のロケールの LC_CTYPE カテゴリに依存する。
fopen(3) システムコールに渡す追加の情報がない場合には、 fgetws() が実際
に はマルチバイトシーケンスをストリームから読み込み、これをワイド文字に
変換すると期待することは適切である。
この関数は信頼できない。なぜなら、入力に含まれるかもしれないナルワイ ド
文字を適切に処理することができないからである。
関連項目
fgetwc(3), unlocked_stdio(3)
GNU 1999-07-25 FGETWS(3)
FGETWS(3) Linux Programmer’s Manual FGETWS(3)
NAME
fgetws - read a wide-character string from a FILE stream
SYNOPSIS
#include
wchar_t *fgetws(wchar_t *ws, int n, FILE *stream);
DESCRIPTION
The fgetws() function is the wide-character equivalent of the fgets(3)
function. It reads a string of at most n-1 wide characters into the
wide-character array pointed to by ws, and adds a terminating L'\0'
character. It stops reading wide characters after it has encountered
and stored a newline wide character. It also stops when end of stream
is reached.
The programmer must ensure that there is room for at least n wide char-
acters at ws.
For a non-locking counterpart, see unlocked_stdio(3).
RETURN VALUE
The fgetws() function, if successful, returns ws. If end of stream was
already reached or if an error occurred, it returns NULL.
CONFORMING TO
C99, POSIX.1-2001.
NOTES
The behavior of fgetws() depends on the LC_CTYPE category of the cur-
rent locale.
In the absence of additional information passed to the fopen(3) call,
it is reasonable to expect that fgetws() will actually read a multibyte
string from the stream and then convert it to a wide-character string.
This function is unreliable, because it does not permit to deal prop-
erly with null wide characters that may be present in the input.
SEE ALSO
fgetwc(3), unlocked_stdio(3)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 1999-07-25 FGETWS(3)