PageRenderTime 37ms CodeModel.GetById 18ms app.highlight 16ms RepoModel.GetById 1ms app.codeStats 0ms

/share/doc/smm/07.lpd/5.t

https://bitbucket.org/freebsd/freebsd-head/
Unknown | 116 lines | 116 code | 0 blank | 0 comment | 0 complexity | 8b96675637842c0672589862c5dd9fbe MD5 | raw file
  1.\" Copyright (c) 1983, 1993
  2.\"	The Regents of the University of California.  All rights reserved.
  3.\"
  4.\" Redistribution and use in source and binary forms, with or without
  5.\" modification, are permitted provided that the following conditions
  6.\" are met:
  7.\" 1. Redistributions of source code must retain the above copyright
  8.\"    notice, this list of conditions and the following disclaimer.
  9.\" 2. Redistributions in binary form must reproduce the above copyright
 10.\"    notice, this list of conditions and the following disclaimer in the
 11.\"    documentation and/or other materials provided with the distribution.
 12.\" 3. All advertising materials mentioning features or use of this software
 13.\"    must display the following acknowledgement:
 14.\"	This product includes software developed by the University of
 15.\"	California, Berkeley and its contributors.
 16.\" 4. Neither the name of the University nor the names of its contributors
 17.\"    may be used to endorse or promote products derived from this software
 18.\"    without specific prior written permission.
 19.\"
 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 30.\" SUCH DAMAGE.
 31.\"
 32.\"	@(#)5.t	8.1 (Berkeley) 6/8/93
 33.\"
 34.NH 1
 35Output filter specifications
 36.PP
 37The filters supplied with 4.3BSD
 38handle printing and accounting for most common
 39line printers, the Benson-Varian, the wide (36") and
 40narrow (11") Versatec printer/plotters. For other devices or accounting
 41methods, it may be necessary to create a new filter.
 42.PP
 43Filters are spawned by \fIlpd\fP
 44with their standard input the data to be printed, and standard output
 45the printer.  The standard error is attached to the
 46.B lf
 47file for logging errors or \fIsyslogd\fP may be used for logging errors.
 48A filter must return a 0 exit
 49code if there were no errors, 1 if the job should be reprinted,
 50and 2 if the job should be thrown away.
 51When \fIlprm\fP
 52sends a kill signal to the \fIlpd\fP process controlling
 53printing, it sends a SIGINT signal 
 54to all filters and descendents of filters.
 55This signal can be trapped by filters that need
 56to do cleanup operations such as
 57deleting temporary files.
 58.PP
 59Arguments passed to a filter depend on its type.
 60The
 61.B of
 62filter is called with the following arguments.
 63.DS
 64\fIfilter\fP \fB\-w\fPwidth \fB\-l\fPlength
 65.DE
 66The \fIwidth\fP and \fIlength\fP values come from the
 67.B pw
 68and
 69.B pl
 70entries in the printcap database.
 71The
 72.B if
 73filter is passed the following parameters.
 74.DS
 75\fIfilter\fP [\|\fB\-c\fP\|] \fB\-w\fPwidth \fB\-l\fPlength \fB\-i\fPindent \fB\-n\fP login \fB\-h\fP host accounting_file
 76.DE
 77The
 78.B \-c
 79flag is optional, and only supplied when control characters
 80are to be passed uninterpreted to the printer (when using the
 81.B \-l
 82option of
 83.I lpr
 84to print the file).
 85The
 86.B \-w
 87and
 88.B \-l
 89parameters are the same as for the
 90.B of
 91filter.
 92The
 93.B \-n
 94and
 95.B \-h
 96parameters specify the login name and host name of the job owner.
 97The last argument is the name of the accounting file from
 98.IR printcap .
 99.PP
100All other filters are called with the following arguments:
101.DS
102\fIfilter\fP \fB\-x\fPwidth \fB\-y\fPlength \fB\-n\fP login \fB\-h\fP host accounting_file
103.DE
104The
105.B \-x
106and
107.B \-y
108options specify the horizontal and vertical page
109size in pixels (from the
110.B px
111and
112.B py
113entries in the printcap file).
114The rest of the arguments are the same as for the
115.B if
116filter.