]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_print.3x
ncurses 4.1
[ncurses.git] / man / curs_print.3x
1 .TH curs_print 3X ""
2 .SH NAME
3 \fBmcprint\fR - ship binary data to printer
4 .SH SYNOPSIS
5 \fB#include <curses.h>\fR
6
7 \fBint mcprint(char *data, int len);\fR
8 .SH DESCRIPTION
9 This function uses the \fBmc5p\fR or \fBmc4\fR and \fBmc5\fR capabilities,
10 if they are present, to ship given data to a printer attached to the terminal.
11
12 Note that the \fBmcprint\fR code has no way to do flow control with the printer
13 or to know how much buffering it has.  Your application is responsible for
14 keeping the rate of writes to the printer below its continuous throughput rate
15 (typically about half of its nominal cps rating).  Dot-matrix printers and
16 6-page-per-minute lasers can typically handle 80cps, so a good conservative
17 rule of thumb is to sleep for a second after shipping each 80-character line.
18
19 .SH RETURN VALUE
20 The \fBmcprint\fR function returns \fBERR\fR if the write operation aborted 
21 for some reason.  In this case, errno will contain either an error associated
22 with \fBwrite(2)\fR or one of the following:
23 .TP 5
24 ENODEV
25 Capabilities for printer redirection don't exist.
26 .TP 5
27 ENOMEM
28 Couldn't allocate sufficient memory to buffer the printer write.
29
30 When \fBmcprint\fR succeeds, it returns the number of characters actually
31 sent to the printer.
32 .SH PORTABILITY
33 The \fBmcprint\fR call was designed for \fBncurses\fR(3x), and is not found
34 in SVr4 curses, 4.4BSD curses, or any other previous version of curses.
35 .SH BUGS
36 Padding in the \fBmc5p\fR, \fBmc4\fR and \fBmc5\fR capabilities will not be
37 interpreted.
38 .SH SEE ALSO
39 \fBcurses\fR(3X)\fR
40 .\"#
41 .\"# The following sets edit modes for GNU EMACS
42 .\"# Local Variables:
43 .\"# mode:nroff
44 .\"# fill-column:79
45 .\"# End: