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