curs_scr_dump(3x) curs_scr_dump(3x)
scr_dump, scr_restore, scr_init, scr_set - read (write) a
curses screen from (to) a file
- curses 画面をファイルから読み出す/ファイルに書き込む
#include <curses.h>
int scr_dump(const char *filename);
int scr_restore(const char *filename);
int scr_init(const char *filename);
int scr_set(const char *filename);
The scr_dump routine dumps the current contents of the
virtual screen to the file filename.
scr_dump ルーチンは、仮想画面の現在の内容をファイル
filename にダンプします。
The scr_restore routine sets the virtual screen to the
contents of filename, which must have been written using
scr_dump. The next call to doupdate restores the screen
to the way it looked in the dump file.
scr_restore ルーチンは、filename の内容を仮想画面に
出力します。
ファイルは scr_dump で書き込まれていなければなりません。
画面は次の doupdate 呼び出しでダンプファイルの内容どおりに
復元されます。
The scr_init routine reads in the contents of filename and
uses them to initialize the curses data structures about
what the terminal currently has on its screen. If the da-
ta is determined to be valid, curses bases its next update
of the screen on this information rather than clearing the
screen and starting from scratch. scr_init is used after
initscr or a system call to share the screen with another
process which has done a scr_dump after its endwin call.
The data is declared invalid if the terminfo capabilities
rmcup and nrrmc exist; also if the terminal has been writ-
ten to since the preceding scr_dump call.
scr_init ルーチンは、filename の内容を読み込み、それらを
用いて、端末が画面上に現在何を持っているかについての
curses のデータ構造を初期化します。
データが有効と判定されると curses は、画面をクリアして
初期状態から開始する代わりに、この情報に基づいて
画面の次の更新を行います。
scr_init は initscr、または endwin 呼び出しの後に
scr_dump を完了した他のプロセスと画面を共有するための
system 呼び出しの後に使います。
terminfo 機能項目 rmcup と nrrmc が存在する場合と、
前回の scr_dump 呼び出しの後に端末に書き込みがあった場合に
データは無効と判定されます。
The scr_set routine is a combination of scr_restore and
scr_init. It tells the program that the information in
filename is what is currently on the screen, and also what
the program wants on the screen. This can be thought of
as a screen inheritance function.
scr_set ルーチンは scr_restore と scr_init を組み合わせた
ものです。
これは filename 内の情報が、画面に現在あるものは何か、そして
プログラムが画面に出力しようとしているものが何か、であることを
プログラムに知らせます。
これは画面を継承する機能と考えることもできます。
To read (write) a window from (to) a file, use the getwin
and putwin routines [see curs_util(3x)].
ウインドウをファイルから読み出す/ファイルに書き込むには、
getwin と putwin ルーチンを使ってください[curs_util(3x) 参照]。
All routines return the integer ERR upon failure and OK
upon success.
すべてのルーチンは、失敗のとき整数 ERR を、成功のとき OK を
返します。
X/Open defines no error conditions. In this implementa-
tion, each will return an error if the file cannot be
opened.
X/Open はエラーの条件を何も定義していません。
この実装では、各ルーチンはファイルがオープンできないときに
エラーを返します。
Note that scr_init, scr_set, and scr_restore may be
macros.
scr_init, scr_set, scr_restore はマクロであるかもしれない
ことに注意してください。
The XSI Curses standard, Issue 4, describes these func-
tions (adding the const qualifiers).
これらの関数は (const 修飾子を付けて) XSI Curses standard,
Issue 4 に記載されています。
The SVr4 docs merely say under scr_init that the dump data
is also considered invalid "if the time-stamp of the tty
is old" but do not define "old".
SVr4 の説明書には単に、scr_init のもとで「tty の
タイムスタンプが古いとき」にもダンプデータが無効とみなす、
と書かれていますが、「古い」とはどういうことかを
定義していません。
curses(3x), curs_initscr(3x), curs_refresh(3x),
curs_util(3x), system(3)
curs_scr_dump(3x)