xref: /netbsd-src/share/man/man5/printcap.5 (revision 76dfffe33547c37f8bdd446e3e4ab0f3c16cea4b)
1.\"	$NetBSD: printcap.5,v 1.5 1996/01/15 02:04:05 thorpej 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 December 11, 1993
37.Dt PRINTCAP 5
38.Os BSD 4.2
39.Sh NAME
40.Nm printcap
41.Nd printer capability data base
42.Sh SYNOPSIS
43.Nm printcap
44.Sh DESCRIPTION
45The
46.Nm Printcap
47function
48is a simplified version of the
49.Xr termcap 5
50data base
51used to describe line printers.  The spooling system accesses the
52.Nm printcap
53file every time it is used, allowing dynamic
54addition and deletion of printers.  Each entry in the data base
55is used to describe one printer.  This data base may not be
56substituted for, as is possible for
57.Xr termcap ,
58because it may allow accounting to be bypassed.
59.Pp
60The default printer is normally
61.Em lp ,
62though the environment variable
63.Ev PRINTER
64may be used to override this.  Each 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/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"
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/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
136The
137.Xr lpd 8
138daemon creates a pipeline of
139.Em filters
140to process files for various printer types.
141The filters selected depend on the flags passed to
142.Xr lpr 1 .
143The pipeline set up is:
144.Bd -literal -offset indent
145p	pr | if	regular text + pr(1)
146none	if	regular text
147c	cf	cifplot
148d	df	DVI (tex)
149g	gf	plot(3)
150n	nf	ditroff
151f	rf	Fortran
152t	tf	troff
153v	vf	raster image
154.Ed
155.Pp
156The
157.Sy if
158filter is invoked with arguments:
159.Bd -filled -offset indent
160.Cm if
161.Op Fl c
162.Fl w Ns Ar width
163.Fl l Ns Ar length
164.Fl i Ns Ar indent
165.Fl n Ar login
166.Fl h Ar host acct-file
167.Ed
168.Pp
169The
170.Fl c
171flag is passed only if the
172.Fl l
173flag (pass control characters literally)
174is specified to
175.Xr lpr .
176The
177.Ar Width
178function
179and
180.Ar length
181specify the page width and length
182(from
183.Cm pw
184and
185.Cm pl
186respectively) in characters.
187The
188.Fl n
189and
190.Fl h
191parameters specify the login name and host name of the owner
192of the job respectively.
193The
194.Ar Acct-file
195function
196is passed from the
197.Cm af
198.Nm printcap
199entry.
200.Pp
201If no
202.Cm if
203is specified,
204.Cm of
205is used instead,
206with the distinction that
207.Cm of
208is opened only once,
209while
210.Cm if
211is opened for every individual job.
212Thus,
213.Cm if
214is better suited to performing accounting.
215The
216.Cm of
217is only given the
218.Ar width
219and
220.Ar length
221flags.
222.Pp
223All other filters are called as:
224.Bd -filled -offset indent
225.Nm filter
226.Fl x Ns Ar width
227.Fl y Ns Ar length
228.Fl n Ar login
229.Fl h Ar host acct-file
230.Ed
231.Pp
232where
233.Ar width
234and
235.Ar length
236are represented in pixels,
237specified by the
238.Cm px
239and
240.Cm py
241entries respectively.
242.Pp
243All filters take
244.Em stdin
245as the file,
246.Em stdout
247as the printer,
248may log either to
249.Em stderr
250or using
251.Xr syslog 3 ,
252and must not ignore
253.Dv SIGINT .
254.Sh LOGGING
255Error messages generated by the line printer programs themselves
256(that is, the
257.Xr lp Ns *
258programs)
259are logged by
260.Xr syslog 3
261using the
262.Dv LPR
263facility.
264Messages printed on
265.Em stderr
266of one of the filters
267are sent to the corresponding
268.Cm lf
269file.
270The filters may, of course, use
271.Xr syslog
272themselves.
273.Pp
274Error messages sent to the console have a carriage return and a line
275feed appended to them, rather than just a line feed.
276.Sh SEE ALSO
277.Xr termcap 5 ,
278.Xr lpc 8 ,
279.Xr lpd 8 ,
280.Xr pac 8 ,
281.Xr lpr 1 ,
282.Xr lpq 1 ,
283.Xr lprm 1
284.Rs
285.%T "4.3 BSD Line Printer Spooler Manual"
286.Re
287.Sh HISTORY
288The
289.Nm
290file format appeared in
291.Bx 4.2 ..
292