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