xref: /netbsd/share/man/man5/printcap.5 (revision bf9ec67e)
1.\"	$NetBSD: printcap.5,v 1.12 2001/09/11 01:01:58 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 February 14, 2001
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 setup 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.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.It "st	str" Ta Pa status Ta No "status file name"
125.It "tf	str" Ta Dv NULL Ta No "troff data filter (cat phototypesetter)"
126.It "tr	str" Ta Dv NULL Ta No "trailer string to print when queue empties"
127.It "vf	str" Ta Dv NULL Ta No "raster image filter"
128.It "xc	num	0	if lp is a tty, clear local mode bits"
129.Pq Xr tty 4
130.It "xs	num	0	like `xc' but set bits"
131.El
132.Pp
133If the local line printer driver supports indentation, the daemon
134must understand how to invoke it.
135.Sh FILTERS
136If a printer is specified via
137.Sy lp
138(either local or remote),
139the
140.Xr lpd 8
141daemon creates a pipeline of
142.Em filters
143to process files for various printer types.
144The pipeline is not set up for remote printers specified via
145.Sy rm
146unless the local host is the same as the remote printer host
147given.
148The filters selected depend on the flags passed to
149.Xr lpr 1 .
150The pipeline set up is:
151.Bd -literal -offset indent
152p	pr | if	regular text + pr(1)
153none	if	regular text
154c	cf	cifplot
155d	df	DVI (tex)
156g	gf	plot(3)
157n	nf	ditroff
158f	rf	Fortran
159t	tf	troff
160v	vf	raster image
161.Ed
162.Pp
163The
164.Sy if
165filter is invoked with arguments:
166.Bd -filled -offset indent
167.Cm if
168.Op Fl c
169.Fl w Ns Ar width
170.Fl l Ns Ar length
171.Fl i Ns Ar indent
172.Fl n Ar login
173.Fl h Ar host acct-file
174.Ed
175.Pp
176The
177.Fl c
178flag is passed only if the
179.Fl l
180flag (pass control characters literally)
181is specified to
182.Xr lpr 1 .
183The
184.Ar width
185and
186.Ar length
187specify the page width and length
188(from
189.Cm pw
190and
191.Cm pl
192respectively) in characters.
193The
194.Fl n
195and
196.Fl h
197parameters specify the login name and host name of the owner
198of the job respectively.
199The
200.Ar acct-file
201option is passed from the
202.Cm af
203.Nm printcap
204entry.
205.Pp
206If no
207.Cm if
208is specified,
209.Cm of
210is used instead,
211with the distinction that
212.Cm of
213is opened only once,
214while
215.Cm if
216is opened for every individual job.
217Thus,
218.Cm if
219is better suited to performing accounting.
220The
221.Cm of
222is only given the
223.Ar width
224and
225.Ar length
226flags.
227.Pp
228All other filters are called as:
229.Bd -filled -offset indent
230.Nm filter
231.Fl x Ns Ar width
232.Fl y Ns Ar length
233.Fl n Ar login
234.Fl h Ar host acct-file
235.Ed
236.Pp
237where
238.Ar width
239and
240.Ar length
241are represented in pixels,
242specified by the
243.Cm px
244and
245.Cm py
246entries respectively.
247.Pp
248All filters take
249.Em stdin
250as the file,
251.Em stdout
252as the printer,
253may log either to
254.Em stderr
255or using
256.Xr syslog 3 ,
257and must not ignore
258.Dv SIGINT .
259.Sh LOGGING
260Error messages generated by the line printer programs themselves
261(that is, the lp* programs) are logged by
262.Xr syslog 3
263using the
264.Dv LPR
265facility.
266Messages printed on
267.Em stderr
268of one of the filters are sent to the corresponding
269.Cm lf
270file.
271The filters may, of course, use
272.Xr syslog 3
273themselves.
274.Pp
275Error messages sent to the console have a carriage return and a line
276feed appended to them, rather than just a line feed.
277.Sh SEE ALSO
278.Xr lpq 1 ,
279.Xr lpr 1 ,
280.Xr lprm 1 ,
281.Xr termcap 5 ,
282.Xr lpc 8 ,
283.Xr lpd 8 ,
284.Xr pac 8
285.Rs
286.%T "4.3 BSD Line Printer Spooler Manual"
287.Re
288.Sh HISTORY
289The
290.Nm
291file format appeared in
292.Bx 4.2 .
293