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