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