]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_print.3x
ncurses 6.4 - patch 20240414
[ncurses.git] / man / curs_print.3x
1 .\"***************************************************************************
2 .\" Copyright 2018-2020,2021 Thomas E. Dickey                                *
3 .\" Copyright 1998-2010,2017 Free Software Foundation, Inc.                  *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: curs_print.3x,v 1.18 2021/12/25 21:41:58 tom Exp $
31 .TH curs_print 3X ""
32 .SH NAME
33 \fBmcprint\fP \- ship binary data to printer
34 .SH SYNOPSIS
35 \fB#include <curses.h>\fP
36 .sp
37 \fBint mcprint(char *\fP\fIdata\fP\fB, int \fP\fIlen\fP\fB);\fP
38 .SH DESCRIPTION
39 This function uses the \fBmc5p\fP or \fBmc4\fP and \fBmc5\fP capabilities,
40 if they are present, to ship given data to a printer attached to the terminal.
41 .PP
42 Note that the \fBmcprint\fP code has no way to do flow control with the printer
43 or to know how much buffering it has.
44 Your application is responsible for
45 keeping the rate of writes to the printer below its continuous throughput rate
46 (typically about half of its nominal cps rating).
47 Dot-matrix printers and
48 6-page-per-minute lasers can typically handle 80cps, so a good conservative
49 rule of thumb is to sleep for a second after shipping each 80-character line.
50 .
51 .SH RETURN VALUE
52 The \fBmcprint\fP function returns \fBERR\fP if the write operation aborted
53 for some reason.
54 In this case, \fBerrno\fP will contain either an error associated
55 with \fBwrite\fP(2) or one of the following:
56 .TP 5
57 ENODEV
58 Capabilities for printer redirection do not exist.
59 .TP 5
60 ENOMEM
61 Couldn't allocate sufficient memory to buffer the printer write.
62 .PP
63 When \fBmcprint\fP succeeds, it returns the number of characters actually
64 sent to the printer.
65 .SH PORTABILITY
66 The \fBmcprint\fP call was designed for \fBncurses\fP(3X), and is not found
67 in SVr4 curses, 4.4BSD curses, or any other previous version of curses.
68 .SH BUGS
69 Padding in the \fBmc5p\fP, \fBmc4\fP and \fBmc5\fP capabilities will not be
70 interpreted.
71 .SH SEE ALSO
72 \fBcurses\fP(3X)