xref: /openbsd-src/share/man/man5/printcap.5 (revision 2b0358df1d88d06ef4139321dd05bd5e05d91eaf)
1.\"	$OpenBSD: printcap.5,v 1.21 2007/05/31 19:19:58 jmc Exp $
2.\"	$NetBSD: printcap.5,v 1.7 1998/02/20 12:24:50 hubertf Exp $
3.\"
4.\" Copyright (c) 1983, 1991, 1993
5.\"	The Regents of the University of California.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\"     @(#)printcap.5	8.2 (Berkeley) 12/11/93
32.\"
33.Dd $Mdocdate: May 31 2007 $
34.Dt PRINTCAP 5
35.Os
36.Sh NAME
37.Nm printcap
38.Nd printer capability database
39.Sh SYNOPSIS
40.Nm printcap
41.Sh DESCRIPTION
42The
43.Nm
44file is a simplified version of the
45.Xr termcap 5
46database used to describe line printers.
47The spooling system accesses the
48.Nm
49file every time it is used, allowing dynamic addition and deletion of printers.
50Each entry in the database is used to describe one printer.
51This database 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.Dq lp ,
57though the environment variable
58.Ev PRINTER
59may be used to override this.
60Each spooling utility supports an option,
61.Fl P Ns 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 "xx" "xx" "/var/spool/"
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 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 Aq 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	if lp is a tty, set flag bits"
86.Pq Aq Pa sgtty.h
87.It "gf	str" Ta Dv NULL Ta No "graph data filter"
88.Pf ( Xr plot 3
89format)
90.It "hl	bool	false	print the burst header page last"
91.It "ic	bool	false	supports non-standard ioctl to indent printout"
92.It "if	str" Ta Dv NULL Ta No "name of text filter which does accounting"
93.It "lf	str" Ta Pa /dev/console Ta No "error logging file name"
94.It "lo	str" Ta Pa lock Ta No "name of lock file"
95.It "lp	str" Ta Pa /dev/lp Ta No "local printer device, or port@host for remote"
96.It "mc	num	0	maximum number of copies allowed; 0=unlimited"
97.It "ms	str" Ta Dv NULL Ta No "list of terminal modes to set or clear"
98.It "mx	num	0	max file size (in"
99.Dv BUFSIZ
100blocks); 0=unlimited
101.It "nd	str" Ta Dv NULL Ta No "next directory for queues list (unimplemented)"
102.It "nf	str" Ta Dv NULL Ta No "ditroff data filter (device independent troff)"
103.It "of	str" Ta Dv NULL Ta No "name of output filtering program"
104.It "pc	num	200	price per foot or page in hundredths of cents"
105.It "pl	num	66	page length (in lines)"
106.It "pw	num	132	page width (in characters)"
107.It "px	num	0	page width in pixels (horizontal)"
108.It "py	num	0	page length in pixels (vertical)"
109.It "rf	str" Ta Dv NULL Ta No "filter for printing"
110.Tn FORTRAN
111style text files
112.It "rg	str" Ta Dv NULL Ta No "restricted group-only group members can access"
113.It "rm	str" Ta Dv NULL Ta No "machine name for remote printer"
114.It "rp	str	``lp''	remote printer name argument"
115.It "rs	bool	false	remote users must have a local account"
116.It "rw	bool	false	open printer device for reading and writing"
117.It "sb	bool	false	short banner (one line only)"
118.It "sc	bool	false	suppress multiple copies"
119.It "sd	str" Ta Pa /var/spool/output Ta No "spool directory"
120.It "sf	bool	false	suppress form feeds"
121.It "sh	bool	false	suppress printing of burst page header"
122.It "st	str" Ta Pa status Ta No "status file name"
123.It "tf	str" Ta Dv NULL Ta No "troff data filter (cat phototypesetter)"
124.It "tr	str" Ta Dv NULL Ta No "trailer string to print when queue empties"
125.It "vf	str" Ta Dv NULL Ta No "raster image filter"
126.It "xc	num	0	if lp is a tty, clear local mode bits"
127.Pq Xr tty 4
128.It "xs	num	0	if lp is a tty, set local mode bits"
129.Pq Xr tty 4
130.El
131.Pp
132If the local line printer driver supports indentation, the daemon
133must understand how to invoke it.
134.Sh FILTERS
135If a printer is specified via
136.Sy lp
137(either local or remote),
138the
139.Xr lpd 8
140daemon creates a pipeline of
141.Dq filters
142to process files for various printer types.
143The pipeline is not set up for remote printers specified via
144.Sy rm
145unless the local host is the same as the remote printer host given.
146The filters selected depend on the flags passed to
147.Xr lpr 1 .
148The pipeline set up is:
149.Bd -literal -offset indent
150p	pr | if	regular text + pr(1)
151none	if	regular text
152c	cf	cifplot
153d	df	DVI (tex)
154g	gf	plot(3)
155n	nf	ditroff
156f	rf	Fortran
157t	tf	troff
158v	vf	raster image
159.Ed
160.Pp
161The
162.Sy if
163filter is invoked with arguments:
164.Bd -filled -offset indent
165.Sy if
166.Op Fl c
167.Fl w Ns Ar width
168.Fl l Ns Ar length
169.Fl i Ns Ar indent
170.Fl n Ar login
171.Fl h Ar host acct-file
172.Ed
173.Pp
174The
175.Fl c
176flag is passed only if the
177.Fl l
178flag (pass control characters literally) is specified to
179.Xr lpr 1 .
180.Ar width
181and
182.Ar length
183specify the page width and length
184(from
185.Sy pw
186and
187.Sy pl ,
188respectively) in characters.
189The
190.Fl n
191and
192.Fl h
193parameters specify the login name and host name of the owner
194of the job, respectively.
195The
196.Ar acct-file
197function is passed from the
198.Sy af
199.Nm
200entry.
201.Pp
202If no
203.Sy if
204is specified,
205.Sy of
206is used instead, with the distinction that
207.Sy of
208is opened only once, while
209.Sy if
210is opened for every individual job.
211Thus,
212.Sy if
213is better suited to performing accounting.
214The
215.Sy of
216is only given the
217.Ar width
218and
219.Ar length
220flags.
221.Pp
222All other filters are called as:
223.Bd -filled -offset indent
224.Nm filter
225.Fl x Ns Ar width
226.Fl y Ns Ar length
227.Fl n Ar login
228.Fl h Ar host acct-file
229.Ed
230.Pp
231where
232.Ar width
233and
234.Ar length
235are represented in pixels, specified by the
236.Sy px
237and
238.Sy py
239entries, respectively.
240All filters take
241.Em stdin
242as the file,
243.Em stdout
244as the printer,
245may log either to
246.Em stderr
247or using
248.Xr syslog 3 ,
249and must not ignore
250.Dv SIGINT .
251.Sh LOGGING
252Error messages generated by the line printer programs themselves
253are logged by
254.Xr syslog 3
255using the
256.Dv LPR
257facility.
258Messages printed on
259.Em stderr
260by the filters are sent to the corresponding
261.Sy lf
262file.
263The filters may, of course, use
264.Xr syslog 3
265themselves.
266.Pp
267Error messages sent to the console have a carriage return and a line
268feed appended to them, rather than just a line feed.
269.Sh SEE ALSO
270.Xr lpq 1 ,
271.Xr lpr 1 ,
272.Xr lprm 1 ,
273.Xr termcap 5 ,
274.Xr lpc 8 ,
275.Xr lpd 8 ,
276.Xr pac 8
277.Rs
278.%T "4.3 BSD Line Printer Spooler Manual"
279.Re
280.Sh HISTORY
281The
282.Nm
283file format appeared in
284.Bx 4.2 .
285