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