1curs_print(3X) curs_print(3X)
2
3
4
6 mcprint - ship binary data to printer
7
9 #include <curses.h>
10
11 int mcprint(char *data, int len);
12
14 This function uses the mc5p or mc4 and mc5 capabilities, if they are
15 present, to ship given data to a printer attached to the terminal.
16
17 Note that the mcprint code has no way to do flow control with the
18 printer or to know how much buffering it has. Your application is
19 responsible for keeping the rate of writes to the printer below its
20 continuous throughput rate (typically about half of its nominal cps
21 rating). Dot-matrix printers and 6-page-per-minute lasers can typi‐
22 cally handle 80cps, so a good conservative rule of thumb is to sleep
23 for a second after shipping each 80-character line.
24
26 The mcprint function returns ERR if the write operation aborted for
27 some reason. In this case, errno will contain either an error associ‐
28 ated with write(2) or one of the following:
29
30 ENODEV
31 Capabilities for printer redirection do not exist.
32
33 ENOMEM
34 Couldn't allocate sufficient memory to buffer the printer write.
35
36 When mcprint succeeds, it returns the number of characters actually
37 sent to the printer.
38
40 The mcprint call was designed for ncurses(3X), and is not found in SVr4
41 curses, 4.4BSD curses, or any other previous version of curses.
42
44 Padding in the mc5p, mc4 and mc5 capabilities will not be interpreted.
45
47 curses(3X)
48
49
50
51 curs_print(3X)