Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | .\"*************************************************************************** |
| 2 | .\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. * |
| 3 | .\" * |
| 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 | .\" |
| 29 | .\" $Id: curs_print.3x,v 1.8 2006/02/25 21:49:19 tom Exp $ |
| 30 | .TH curs_print 3X "" |
| 31 | .SH NAME |
| 32 | \fBmcprint\fR - ship binary data to printer |
| 33 | .SH SYNOPSIS |
| 34 | \fB#include <curses.h>\fR |
| 35 | .sp |
| 36 | \fBint mcprint(char *data, int len);\fR |
| 37 | .SH DESCRIPTION |
| 38 | This function uses the \fBmc5p\fR or \fBmc4\fR and \fBmc5\fR capabilities, |
| 39 | if they are present, to ship given data to a printer attached to the terminal. |
| 40 | .PP |
| 41 | Note that the \fBmcprint\fR code has no way to do flow control with the printer |
| 42 | or to know how much buffering it has. Your application is responsible for |
| 43 | keeping 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 |
| 45 | 6-page-per-minute lasers can typically handle 80cps, so a good conservative |
| 46 | rule of thumb is to sleep for a second after shipping each 80-character line. |
| 47 | . |
| 48 | .SH RETURN VALUE |
| 49 | The \fBmcprint\fR function returns \fBERR\fR if the write operation aborted |
| 50 | for some reason. In this case, errno will contain either an error associated |
| 51 | with \fBwrite(2)\fR or one of the following: |
| 52 | .TP 5 |
| 53 | ENODEV |
| 54 | Capabilities for printer redirection do not exist. |
| 55 | .TP 5 |
| 56 | ENOMEM |
| 57 | Couldn't allocate sufficient memory to buffer the printer write. |
| 58 | .PP |
| 59 | When \fBmcprint\fR succeeds, it returns the number of characters actually |
| 60 | sent to the printer. |
| 61 | .SH PORTABILITY |
| 62 | The \fBmcprint\fR call was designed for \fBncurses\fR(3X), and is not found |
| 63 | in SVr4 curses, 4.4BSD curses, or any other previous version of curses. |
| 64 | .SH BUGS |
| 65 | Padding in the \fBmc5p\fR, \fBmc4\fR and \fBmc5\fR capabilities will not be |
| 66 | interpreted. |
| 67 | .SH SEE ALSO |
| 68 | \fBcurses\fR(3X)\fR |
| 69 | .\"# |
| 70 | .\"# The following sets edit modes for GNU EMACS |
| 71 | .\"# Local Variables: |
| 72 | .\"# mode:nroff |
| 73 | .\"# fill-column:79 |
| 74 | .\"# End: |