clean up diction
[unix-history] / usr / src / usr.sbin / lpr / SMM.doc / 5.t
CommitLineData
9d2e3471
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
1c460ca9 5.\" @(#)5.t 6.3 (Berkeley) %G%
9d2e3471
KM
6.\"
7.NH 1
8Output filter specifications
9.PP
10The filters supplied with 4.2BSD
11handle printing and accounting for most common
12line printers, the Benson-Varian, the wide (36") and
13narrow (11") Versatec printer/plotters. For other devices or accounting
14methods, it may be necessary to create a new filter.
15.PP
16Filters are spawned by \fIlpd\fP
17with their standard input the data to be printed, and standard output
18the printer. The standard error is attached to the
19.B lf
20file for logging errors. A filter must return a 0 exit
21code if there were no errors, 1 if the job should be reprinted,
22and 2 if the job should be thrown away.
23When \fIlprm\fP
24sends a kill signal to the \fIlpd\fP process controlling
25printing, it sends a SIGINT signal
26to all filters and descendents of filters.
1c460ca9
JB
27This signal can be trapped by filters that need
28to do cleanup operations such as
9d2e3471
KM
29deleting temporary files.
30.PP
31Arguments passed to a filter depend on its type.
32The
33.B of
34filter is called with the following arguments.
35.DS
dde7aeb0 36\fIfilter\fP \fB\-w\fPwidth \fB\-l\fPlength
9d2e3471
KM
37.DE
38The \fIwidth\fP and \fIlength\fP values come from the
39.B pw
40and
41.B pl
42entries in the printcap database.
43The
44.B if
45filter is passed the following parameters.
46.DS
47\fIfilter\fP [\|\fB\-c\fP\|] \fB\-w\fPwidth \fB\-l\fPlength \fB\-i\fPindent \fB\-n\fP login \fB\-h\fP host accounting_file
48.DE
49The
50.B \-c
51flag is optional, and only supplied when control characters
1c460ca9 52are to be passed uninterpreted to the printer (when using the
9d2e3471
KM
53.B \-l
54option of
55.I lpr
1c460ca9 56to print the file).
9d2e3471
KM
57The
58.B \-w
59and
60.B \-l
61parameters are the same as for the
62.B of
63filter.
64The
65.B \-n
66and
67.B \-h
68parameters specify the login name and host name of the job owner.
69The last argument is the name of the accounting file from
70.IR printcap .
71.PP
72All other filters are called with the following arguments:
73.DS
74\fIfilter\fP \fB\-x\fPwidth \fB\-y\fPlength \fB\-n\fP login \fB\-h\fP host accounting_file
75.DE
76The
77.B \-x
78and
79.B \-y
80options specify the horizontal and vertical page
81size in pixels (from the
82.B px
83and
84.B py
85entries in the printcap file).
86The rest of the arguments are the same as for the
87.B if
88filter.