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