curs_get_wstr(3x) curs_get_wstr(3x)
get_wstr, getn_wstr, wget_wstr, wgetn_wstr, mvget_wstr,
mvgetn_wstr, mvwget_wstr, mvwgetn_wstr - get an array of
wide characters from a curses terminal keyboard
- curses 端末キーボードからワイド文字の配列を取得する
#include <curses.h>
int get_wstr(wint_t *wstr);
int getn_wstr(wint_t *wstr, int n);
int wget_wstr(WINDOW *win, wint_t *wstr);
int wgetn_wstr(WINDOW *win, wint_t *wstr, int n);
int mvget_wstr(int y, int x, wint_t *wstr);
int mvgetn_wstr(int y, int x, wint_t *wstr, int n);
int mvwget_wstr(WINDOW *win, int y, int x, wint_t *wstr);
int mvwgetn_wstr(WINDOW *win, int y, int x, wint_t *wstr, int n);
The effect of get_wstr is as though a series of calls to
get_wch were made, until a newline, other end-of-line, or
end-of-file condition is processed. An end-of-file condi-
tion is represented by WEOF, as defined in <wchar.h>. The
newline and end-of-line conditions are represented by the
\n wchar_t value. In all instances, the end of the string
is terminated by a null wchar_t. The routine places re-
sulting values in the area pointed to by wstr.
get_wstr の効果は、改行、その他の行末、もしくはファイル末尾の
状態が処理されるまで、get_wch を連続して呼び出すのと同じです。
ファイル末尾の状態は <wchar.h> で定義された WEOF で表されます。
改行と行末の状態は wchar_t 型の \n で表されます。
すべての場合に、文字列の最後は wchar_t 型のヌル文字で
終端されます。
このルーチンは結果を wstr が指す領域に格納します。
The user's erase and kill characters are interpreted. If
keypad mode is on for the window, KEY_LEFT and
KEY_BACKSPACE are both considered equivalent to the user's
kill character.
消去文字 (erase) と行消去文字 (kill) は解釈されます。
ウインドウで keypad モードが有効な場合、KEY_LEFT と
KEY_BACKSPACE はともに行消去文字と同じとみなされます。
Characters input are echoed only if echo is currently on.
In that case, backspace is echoed as deletion of the pre-
vious character (typically a left motion).
入力された文字は、echo が現在有効な場合にのみ
エコーされます。
その場合、バックスペースは前の文字の削除としてエコーされます
(一般的に左への動き) 。
The effect of wget_wstr is as though a series of calls to
wget_wch were made.
wget_wstr の効果は、wget_wch を連続して呼び出すのと同じです。
The effect of mvget_wstr is as though a call to move and
then a series of calls to get_wch were made.
mvget_wstr の効果は、move を呼び出した後、get_wch を連続して
呼び出すのと同じです。
The effect of mvwget_wstr is as though a call to wmove and
then a series of calls to wget_wch were made.
mvwget_wstr の効果は、wmove を呼び出した後、wget_wch を
連続して呼び出すのと同じです。
The getn_wstr, mvgetn_wstr, mvwgetn_wstr, and wgetn_wstr
functions are identical to the get_wstr, mvget_wstr,
mvwget_wstr, and wget_wstr functions, respectively, except
that the *n_* versions read at most n characters, letting
the application prevent overflow of the input buffer.
getn_wstr, mvgetn_wstr, mvwgetn_wstr, wgetn_wstr 関数は
それぞれ get_wstr, mvget_wstr, mvwget_wstr, wget_wstr 関数と
同じですが、*n_* 関数は最大 n 文字しか読まず、入力バッファの
オーバーフローを防ぎます。
Using get_wstr, mvget_wstr, mvwget_wstr, or wget_wstr to
read a line that overflows the array pointed to by wstr
causes undefined results. The use of getn_wstr,
mvgetn_wstr, mvwgetn_wstr, or wgetn_wstr, respectively, is
recommended.
get_wstr, mvget_wstr, mvwget_wstr, wget_wstr を wstr が指す
配列がオーバーフローするような行の読み込みに使うと、未定義の
結果を引き起こします。
それぞれ getn_wstr, mvgetn_wstr, mvwgetn_wstr, wgetn_wstr の
使用を推奨します。
These functions cannot return KEY_ values because there is
no way to distinguish a KEY_ value from a valid wchar_t
value.
これらの関数は KEY_ で始まる定義済みの値を返せません。
KEY_ 値と有効な wchar_t 値を区別する方法がないからです。
All of these routines except wgetn_wstr may be macros.
wgetn_wstr 以外のすべてのルーチンは、マクロかもしれません。
All of these functions return OK upon successful comple-
tion. Otherwise, they return ERR.
これらすべての関数は、正常終了のとき OK を、その他のとき
ERR を返します。
Functions using a window parameter return an error if it
is null.
ウインドウ引数を使う関数は、ウインドウ引数がヌルのとき
エラーを返します。
wgetn_wstr
returns an error if the associated call to
wget_wch failed.
これに伴う wget_wch 呼び出しが失敗したときに
エラーを返します。
Functions with a "mv" prefix first perform a cursor move-
ment using wmove, and return an error if the position is
outside the window, or if the window pointer is null.
mv で始まる関数は、最初に wmove を使用してカーソルを移動し、
位置がウィンドウの外だった場合、またはウィンドウポインタが
ヌルの場合にエラーを返します。
These functions are described in The Single Unix Specifi-
cation, Version 2. No error conditions are defined. This
implementation returns ERR if the window pointer is null,
or if the lower-level wget_wch call returns an ERR. In
the latter case, an ERR return without other data is
treated as an end-of-file condition, and the returned ar-
ray contains a WEOF followed by a null wchar_t.
これらの関数は The Single Unix Specification, Version 2 に
記載されています。
エラーの条件は定義されていません。
この実装では、ウインドウ・ポインタがヌルのとき、または
低レベルの wget_wch 呼び出しが ERR を返したときに ERR を
返します。
後者の場合、他のデータなく ERR が返ったときは、
ファイル末尾の状態として扱われ、戻ってきた配列は WEOF と
それに続く wchar_t 型のヌル文字を含んでいます。
X/Open curses documents these functions to pass an array
of wchar_t, but all of the vendors implement this using
wint_t.
X/Open curses はこれらの関数が wchar_t 型の配列を渡すように
記述していますが、すべての供給元の実装はこの配列に
wint_t 型を使っています。
Functions: curses(3x), curs_get_wch(3x), curs_getstr(3x).
関数: curses(3x), curs_get_wch(3x), curs_getstr(3x).
訳注: echo, keypad は curs_inopts(3x)、
KEY_ 定数は curs_getch(3x) を参照。
curs_get_wstr(3x)