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