xref: /netbsd-src/share/man/man5/printcap.5 (revision aaf4ece63a859a04e37cf3a7229b5fab0157cc06)
1.\"	$NetBSD: printcap.5,v 1.19 2006/01/12 21:24:04 wiz Exp $
2.\"
3.\" Copyright (c) 1983, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     @(#)printcap.5	8.2 (Berkeley) 12/11/93
31.\"
32.Dd March 15, 2003
33.Dt PRINTCAP 5
34.Os
35.Sh NAME
36.Nm printcap
37.Nd printer capability data base
38.Sh SYNOPSIS
39.Nm printcap
40.Sh DESCRIPTION
41The
42.Nm
43data base is a simplified version of the
44.Xr termcap 5
45data base used to describe line printers.
46The spooling system accesses the
47.Nm printcap
48file every time it is used, allowing dynamic
49addition and deletion of printers.
50Each entry in the data base is used to describe one printer.
51This data base may not be substituted for, as is possible for
52.Xr termcap 5 ,
53because it may allow accounting to be bypassed.
54.Pp
55The default printer is normally
56.Em lp ,
57though the environment variable
58.Ev PRINTER
59may be used to override this.
60Each spooling utility supports an option,
61.Fl P Ar printer ,
62to allow explicit naming of a destination printer.
63.Pp
64Refer to the
65.%T "4.3 BSD Line Printer Spooler Manual"
66for a complete discussion on how to set up the database for a given printer.
67.Sh CAPABILITIES
68Refer to
69.Xr termcap 5
70for a description of the file layout.
71.Bl -column Name Type "/var/spool/output/lpd"
72.Sy Name	Type	Default	Description
73.It "af	str" Ta Dv NULL Ta No "name of accounting file"
74.It "br	num	none	if lp is a tty, set the baud rate"
75.Pf ( Xr ioctl 2
76call)
77.It "cf	str" Ta Dv NULL Ta No "cifplot data filter"
78.It "df	str" Ta Dv NULL Ta No "tex data filter"
79.Pf ( Tn DVI
80format)
81.It "fc	num	0	if lp is a tty, clear flag bits"
82.Pq Pa sgtty.h
83.It "ff	str" Ta So Li \ef Sc Ta No "string to send for a form feed"
84.It "fo	bool	false	print a form feed when device is opened"
85.It "fs	num	0	like `fc' but set bits"
86.It "gf	str" Ta Dv NULL Ta No "graph data filter"
87.Pf ( Xr plot 3
88format
89.It "hl	bool	false	print the burst header page last"
90.It "ic	bool	false	driver supports (non standard) ioctl to indent printout"
91.It "if	str" Ta Dv NULL Ta No "name of text filter which does accounting"
92.It "lf	str" Ta Pa /dev/console Ta No "error logging file name"
93.It "lo	str" Ta Pa lock Ta No "name of lock file"
94.It "lp	str" Ta Pa /dev/lp Ta No "device name to open for output to local \
95printer, or port@host for remote printer/printer on print server"
96.It "ms	str" Ta Dv NULL Ta No "list of terminal modes to set or clear"
97.It "mx	num	1000	maximum file size (in"
98.Dv BUFSIZ
99blocks), zero = unlimited
100.It "nd	str" Ta Dv NULL Ta No "next directory for list of queues (unimplemented)"
101.It "nf	str" Ta Dv NULL Ta No "ditroff data filter (device independent troff)"
102.It "of	str" Ta Dv NULL Ta No "name of output filtering program"
103.It "pc	num	200	price per foot or page in hundredths of cents"
104.It "pl	num	66	page length (in lines)"
105.It "pw	num	132	page width (in characters)"
106.It "px	num	0	page width in pixels (horizontal)"
107.It "py	num	0	page length in pixels (vertical)"
108.It "rf	str" Ta Dv NULL Ta No "filter for printing"
109.Tn FORTRAN
110style text files
111.It "rg	str" Ta Dv NULL Ta No "restricted group. Only members of group allowed access"
112.It "rm	str" Ta Dv NULL Ta No "machine name for remote printer or port@host \
113for a remote printer on a port other than the standard port."
114.Po
115also suppress the burst page, see
116.Sx NOTES
117.Pc
118.It "rp	str	``lp''	remote printer name argument"
119.It "rs	bool	false	restrict remote users to those with local accounts"
120.It "rw	bool	false	open the printer device for reading and writing"
121.It "sb	bool	false	short banner (one line only)"
122.It "sc	bool	false	suppress multiple copies"
123.It "sd	str" Ta Pa /var/spool/output/lpd Ta No "spool directory"
124.It "sf	bool	false	suppress form feeds"
125.It "sh	bool	false	suppress printing of burst page header"
126.Po
127local only, see
128.Sx NOTES
129.Pc
130.It "st	str" Ta Pa status Ta No "status file name"
131.It "tf	str" Ta Dv NULL Ta No "troff data filter (cat phototypesetter)"
132.It "tr	str" Ta Dv NULL Ta No "trailer string to print when queue empties"
133.It "vf	str" Ta Dv NULL Ta No "raster image filter"
134.It "xc	num	0	if lp is a tty, clear local mode bits"
135.Pq Xr tty 4
136.It "xs	num	0	like `xc' but set bits"
137.El
138.Pp
139If the local line printer driver supports indentation, the daemon
140must understand how to invoke it.
141.Sh FILTERS
142If a printer is specified via
143.Sy lp
144(either local or remote),
145the
146.Xr lpd 8
147daemon creates a pipeline of
148.Em filters
149to process files for various printer types.
150The pipeline is not set up for remote printers specified via
151.Sy rm
152unless the local host is the same as the remote printer host
153given.
154The filters selected depend on the flags passed to
155.Xr lpr 1 .
156The pipeline set up is:
157.Bd -literal -offset indent
158p	pr | if	regular text + pr(1)
159none	if	regular text
160c	cf	cifplot
161d	df	DVI (tex)
162g	gf	plot(3)
163n	nf	ditroff
164f	rf	Fortran
165t	tf	troff
166v	vf	raster image
167.Ed
168.Pp
169The
170.Sy if
171filter is invoked with arguments:
172.Bd -filled -offset indent
173.Cm if
174.Op Fl c
175.Fl w Ns Ar width
176.Fl l Ns Ar length
177.Fl i Ns Ar indent
178.Fl n Ar login
179.Fl h Ar host acct-file
180.Ed
181.Pp
182The
183.Fl c
184flag is passed only if the
185.Fl l
186flag (pass control characters literally)
187is specified to
188.Xr lpr 1 .
189The
190.Ar width
191and
192.Ar length
193specify the page width and length
194(from
195.Cm pw
196and
197.Cm pl
198respectively) in characters.
199The
200.Fl n
201and
202.Fl h
203parameters specify the login name and host name of the owner
204of the job respectively.
205The
206.Ar acct-file
207option is passed from the
208.Cm af
209.Nm printcap
210entry.
211.Pp
212If no
213.Cm if
214is specified,
215.Cm of
216is used instead,
217with the distinction that
218.Cm of
219is opened only once,
220while
221.Cm if
222is opened for every individual job.
223Thus,
224.Cm if
225is better suited to performing accounting.
226The
227.Cm of
228is only given the
229.Ar width
230and
231.Ar length
232flags.
233.Pp
234All other filters are called as:
235.Bd -filled -offset indent
236.Nm filter
237.Fl x Ns Ar width
238.Fl y Ns Ar length
239.Fl n Ar login
240.Fl h Ar host acct-file
241.Ed
242.Pp
243where
244.Ar width
245and
246.Ar length
247are represented in pixels,
248specified by the
249.Cm px
250and
251.Cm py
252entries respectively.
253.Pp
254All filters take
255.Em stdin
256as the file,
257.Em stdout
258as the printer,
259may log either to
260.Em stderr
261or using
262.Xr syslog 3 ,
263and must not ignore
264.Dv SIGINT .
265.Pp
266Filters can communicate errors to lpd by their exit code and by modifying
267the mode of the spool lock file as follows:
268.Bl -tag -width Exit-code -compact -offset indent
269.It Sy Exit code
270.Sy Description
271.It 0
272Success.
273.It 1
274An attempt is made to reprint the job and mail is sent if it fails.
275.It 2
276.Xr lpd 8
277silently discards the job.
278.It n
279.Xr lpd 8
280discards the job and mail is sent.
281.El
282.Bl -tag -width lockxmode -compact -offset indent
283.It Sy lock code
284.Sy Description
285.It u+x
286Stop printing and leave queue disabled (S_IXUSR).
287.It o+x
288Rebuild the queue (S_IXOTH).
289.El
290.Sh LOGGING
291Error messages generated by the line printer programs themselves
292(that is, the lp* programs) are logged by
293.Xr syslog 3
294using the
295.Dv LPR
296facility.
297Messages printed on
298.Em stderr
299of one of the filters are sent to the corresponding
300.Cm lf
301file.
302The filters may, of course, use
303.Xr syslog 3
304themselves.
305.Pp
306Error messages sent to the console have a carriage return and a line
307feed appended to them, rather than just a line feed.
308.Sh SEE ALSO
309.Xr lpq 1 ,
310.Xr lpr 1 ,
311.Xr lprm 1 ,
312.Xr termcap 5 ,
313.Xr lpc 8 ,
314.Xr lpd 8 ,
315.Xr pac 8
316.Rs
317.%T "4.3 BSD Line Printer Spooler Manual"
318.Re
319.Sh NOTES
320The
321.Sy sh
322flag is a function of the spooler with the locally attached printer,
323and so has no effect when used with
324.Sy rm .
325.Nx
326never adds a burst page when used as a remote spooler.
327To suppress the burst page for other systems or dedicated devices,
328refer to the documentation for those systems or devices.
329.Sh HISTORY
330The
331.Nm
332file format appeared in
333.Bx 4.2 .
334