curs_print(3x) curs_print(3x)
mcprint - ship binary data to printer
- バイナリデータをプリンタに出力する
#include <curses.h>
int mcprint(char *data, int len);
This function uses the mc5p or mc4 and mc5 capabilities,
if they are present, to ship given data to a printer
attached to the terminal.
この関数は、mc5p または mc4 と mc5 機能項目 (ケーパビリティ)
があればそれらを使って、与えられたデータを端末に接続された
プリンタへ送ります。
Note that the mcprint code has no way to do flow control
with the printer or to know how much buffering it has.
Your application is responsible for keeping the rate of
writes to the printer below its continuous throughput rate
(typically about half of its nominal cps rating). Dot-
matrix printers and 6-page-per-minute lasers can typically
handle 80cps, so a good conservative rule of thumb is to
sleep for a second after shipping each 80-character line.
mcprint のコードには、プリンタのフロー制御をしたり、
プリンタがどれだけバッファを使うかを知る手段がないことに
注意してください。
アプリケーションはプリンタへの出力速度をプリンタの連続的な
処理能力以下に保つ責任があります。(一般的に、プリンタの
公称定格 CPS (文字数/秒) の半分くらい。)
ドットマトリクス・プリンタと毎分 6 ページのレーザプリンタは
一般的に 80 CPS を処理するので、手堅い見積りとしては、
80 字の行を出力するごとに 1 秒間休止することです。
The mcprint function returns ERR if the write operation
aborted for some reason. In this case, errno will contain
either an error associated with write(2) or one of the
following:
mcprint 関数は、なんらかの理由で書き込み動作を中止したとき
ERR を返します。
この場合、errno には write(2) に関連したエラーか、次のうち
1 つを含むでしょう。
ENODEV
Capabilities for printer redirection do not exist.
出力をプリンタへ切り替える機能がありません
ENOMEM
Couldn't allocate sufficient memory to buffer the
printer write.
プリンタ書き込みバッファのために十分なメモリを
確保できませんでした
When mcprint succeeds, it returns the number of characters
actually sent to the printer.
mcprint が成功すると、実際にプリンタへ出力した文字数を
返します。
The mcprint call was designed for ncurses(3x), and is not
found in SVr4 curses, 4.4BSD curses, or any other previous
version of curses.
mcprint 呼び出しは ncurses(3x) のために設計されており、
SVr4 curses, 4.4BSD curses, その他 curses の以前の
バージョンにはありません。
Padding in the mc5p, mc4 and mc5 capabilities will not be
interpreted.
mc5p, mc4, mc5 機能項目のパディングは解釈されません。
curses(3x)
curs_print(3x)