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