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