forgot permissions
[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.\"
772c33c0
KB
4.\" Redistribution and use in source and binary forms are permitted
5.\" provided that the above copyright notice and this paragraph are
6.\" duplicated in all such forms and that any documentation,
7.\" advertising materials, and other materials related to such
8.\" distribution and use acknowledge that the software was developed
9.\" by the University of California, Berkeley. The name of the
10.\" University may not be used to endorse or promote products derived
11.\" from this software without specific prior written permission.
12.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15.\"
16.\" @(#)5.t 6.5 (Berkeley) %G%
9d2e3471
KM
17.\"
18.NH 1
19Output filter specifications
20.PP
98c1ea89 21The filters supplied with 4.3BSD
9d2e3471
KM
22handle printing and accounting for most common
23line printers, the Benson-Varian, the wide (36") and
24narrow (11") Versatec printer/plotters. For other devices or accounting
25methods, it may be necessary to create a new filter.
26.PP
27Filters are spawned by \fIlpd\fP
28with their standard input the data to be printed, and standard output
29the printer. The standard error is attached to the
30.B lf
98c1ea89
JB
31file for logging errors or \fIsyslogd\fP may be used for logging errors.
32A filter must return a 0 exit
9d2e3471
KM
33code if there were no errors, 1 if the job should be reprinted,
34and 2 if the job should be thrown away.
35When \fIlprm\fP
36sends a kill signal to the \fIlpd\fP process controlling
37printing, it sends a SIGINT signal
38to all filters and descendents of filters.
1c460ca9
JB
39This signal can be trapped by filters that need
40to do cleanup operations such as
9d2e3471
KM
41deleting temporary files.
42.PP
43Arguments passed to a filter depend on its type.
44The
45.B of
46filter is called with the following arguments.
47.DS
dde7aeb0 48\fIfilter\fP \fB\-w\fPwidth \fB\-l\fPlength
9d2e3471
KM
49.DE
50The \fIwidth\fP and \fIlength\fP values come from the
51.B pw
52and
53.B pl
54entries in the printcap database.
55The
56.B if
57filter is passed the following parameters.
58.DS
59\fIfilter\fP [\|\fB\-c\fP\|] \fB\-w\fPwidth \fB\-l\fPlength \fB\-i\fPindent \fB\-n\fP login \fB\-h\fP host accounting_file
60.DE
61The
62.B \-c
63flag is optional, and only supplied when control characters
1c460ca9 64are to be passed uninterpreted to the printer (when using the
9d2e3471
KM
65.B \-l
66option of
67.I lpr
1c460ca9 68to print the file).
9d2e3471
KM
69The
70.B \-w
71and
72.B \-l
73parameters are the same as for the
74.B of
75filter.
76The
77.B \-n
78and
79.B \-h
80parameters specify the login name and host name of the job owner.
81The last argument is the name of the accounting file from
82.IR printcap .
83.PP
84All other filters are called with the following arguments:
85.DS
86\fIfilter\fP \fB\-x\fPwidth \fB\-y\fPlength \fB\-n\fP login \fB\-h\fP host accounting_file
87.DE
88The
89.B \-x
90and
91.B \-y
92options specify the horizontal and vertical page
93size in pixels (from the
94.B px
95and
96.B py
97entries in the printcap file).
98The rest of the arguments are the same as for the
99.B if
100filter.