xref: /netbsd-src/share/man/man5/printcap.5 (revision d48f14661dda8638fee055ba15d35bdfb29b9fa8)
1.\"	$NetBSD: printcap.5,v 1.22 2006/01/21 23:36:31 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 January 20, 2006
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 "pf	str" Ta Dv NULL Ta No "filter for printing"
105.Tn PostScript
106files
107.It "pl	num	66	page length (in lines)"
108.It "pw	num	132	page width (in characters)"
109.It "px	num	0	page width in pixels (horizontal)"
110.It "py	num	0	page length in pixels (vertical)"
111.It "rf	str" Ta Dv NULL Ta No "filter for printing"
112.Tn FORTRAN
113style text files
114.It "rg	str" Ta Dv NULL Ta No "restricted group. Only members of group allowed access"
115.It "rm	str" Ta Dv NULL Ta No "machine name for remote printer or port@host \
116for a remote printer on a port other than the standard port."
117.Po
118also suppress the burst page, see
119.Sx NOTES
120.Pc
121.It "rp	str	``lp''	remote printer name argument"
122.It "rs	bool	false	restrict remote users to those with local accounts"
123.It "rw	bool	false	open the printer device for reading and writing"
124.It "sb	bool	false	short banner (one line only)"
125.It "sc	bool	false	suppress multiple copies"
126.It "sd	str" Ta Pa /var/spool/output/lpd Ta No "spool directory"
127.It "sf	bool	false	suppress form feeds"
128.It "sh	bool	false	suppress printing of burst page header"
129.Po
130local only, see
131.Sx NOTES
132.Pc
133.It "st	str" Ta Pa status Ta No "status file name"
134.It "tf	str" Ta Dv NULL Ta No "troff data filter (cat phototypesetter)"
135.It "tr	str" Ta Dv NULL Ta No "trailer string to print when queue empties"
136.It "vf	str" Ta Dv NULL Ta No "raster image filter"
137.It "xc	num	0	if lp is a tty, clear local mode bits"
138.Pq Xr tty 4
139.It "xs	num	0	like `xc' but set bits"
140.El
141.Pp
142If the local line printer driver supports indentation, the daemon
143must understand how to invoke it.
144.Sh FILTERS
145If a printer is specified via
146.Sy lp
147(either local or remote),
148the
149.Xr lpd 8
150daemon creates a pipeline of
151.Em filters
152to process files for various printer types.
153The pipeline is not set up for remote printers specified via
154.Sy rm
155unless the local host is the same as the remote printer host
156given.
157The filters selected depend on the flags passed to
158.Xr lpr 1 .
159The pipeline set up is:
160.Bd -literal -offset indent
161p	pr | if	regular text + pr(1)
162none	if	regular text
163c	cf	cifplot
164d	df	DVI (tex)
165g	gf	plot(3)
166n	nf	ditroff
167o	pf	PostScript
168f	rf	Fortran
169t	tf	troff
170v	vf	raster image
171.Ed
172.Pp
173The
174.Sy if
175filter is invoked with arguments:
176.Bd -filled -offset indent
177.Cm if
178.Op Fl c
179.Fl w Ns Ar width
180.Fl l Ns Ar length
181.Fl i Ns Ar indent
182.Fl n Ar login
183.Fl h Ar host acct-file
184.Ed
185.Pp
186The
187.Fl c
188flag is passed only if the
189.Fl l
190flag (pass control characters literally)
191is specified to
192.Xr lpr 1 .
193The
194.Ar width
195and
196.Ar length
197specify the page width and length
198(from
199.Cm pw
200and
201.Cm pl
202respectively) in characters.
203The
204.Fl n
205and
206.Fl h
207parameters specify the login name and host name of the owner
208of the job respectively.
209The
210.Ar acct-file
211option is passed from the
212.Cm af
213.Nm printcap
214entry.
215.Pp
216If no
217.Cm if
218is specified,
219.Cm of
220is used instead,
221with the distinction that
222.Cm of
223is opened only once,
224while
225.Cm if
226is opened for every individual job.
227Thus,
228.Cm if
229is better suited to performing accounting.
230The
231.Cm of
232is only given the
233.Ar width
234and
235.Ar length
236flags.
237.Pp
238All other filters are called as:
239.Bd -filled -offset indent
240.Nm filter
241.Fl x Ns Ar width
242.Fl y Ns Ar length
243.Fl n Ar login
244.Fl h Ar host acct-file
245.Ed
246.Pp
247where
248.Ar width
249and
250.Ar length
251are represented in pixels,
252specified by the
253.Cm px
254and
255.Cm py
256entries respectively.
257.Pp
258All filters take
259.Em stdin
260as the file,
261.Em stdout
262as the printer,
263may log either to
264.Em stderr
265or using
266.Xr syslog 3 ,
267and must not ignore
268.Dv SIGINT .
269.Pp
270Filters can communicate errors to lpd by their exit code and by modifying
271the mode of the spool lock file as follows:
272.Bl -tag -width Exit-code -compact -offset indent
273.It Sy Exit code
274.Sy Description
275.It 0
276Success.
277.It 1
278An attempt is made to reprint the job and mail is sent if it fails.
279.It 2
280.Xr lpd 8
281silently discards the job.
282.It n
283.Xr lpd 8
284discards the job and mail is sent.
285.El
286.Bl -tag -width lockxmode -compact -offset indent
287.It Sy lock code
288.Sy Description
289.It u+x
290Stop printing and leave queue disabled (S_IXUSR).
291.It o+x
292Rebuild the queue (S_IXOTH).
293.El
294.Sh LOGGING
295Error messages generated by the line printer programs themselves
296(that is, the lp* programs) are logged by
297.Xr syslog 3
298using the
299.Dv LPR
300facility.
301Messages printed on
302.Em stderr
303of one of the filters are sent to the corresponding
304.Cm lf
305file.
306The filters may, of course, use
307.Xr syslog 3
308themselves.
309.Pp
310Error messages sent to the console have a carriage return and a line
311feed appended to them, rather than just a line feed.
312.Sh SEE ALSO
313.Xr lpq 1 ,
314.Xr lpr 1 ,
315.Xr lprm 1 ,
316.Xr termcap 5 ,
317.Xr lpc 8 ,
318.Xr lpd 8 ,
319.Xr pac 8
320.Rs
321.%T "4.3 BSD Line Printer Spooler Manual"
322.Re
323.Sh NOTES
324The
325.Sy sh
326flag is a function of the spooler with the locally attached printer,
327and so has no effect when used with
328.Sy rm .
329.Nx
330never adds a burst page when used as a remote spooler.
331To suppress the burst page for other systems or dedicated devices,
332refer to the documentation for those systems or devices.
333.Sh HISTORY
334The
335.Nm
336file format appeared in
337.Bx 4.2 .
338