xref: /openbsd-src/share/man/man5/printcap.5 (revision 8500990981f885cbe5e6a4958549cacc238b5ae6)
1.\"	$OpenBSD: printcap.5,v 1.17 2003/06/02 23:30:14 millert 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 December 11, 1993
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 "ms	str" Ta Dv NULL Ta No "list of terminal modes to set or clear"
97.It "mx	num	1000	max file size (in"
98.Dv BUFSIZ
99blocks); 0=unlimited
100.It "nd	str" Ta Dv NULL Ta No "next directory for queues list (unimplemented)"
101.It "nf	str" Ta Dv NULL Ta No "ditroff data filter (device independent troff)"
102.It "of	str" Ta Dv NULL Ta No "name of output filtering program"
103.It "pc	num	200	price per foot or page in hundredths of cents"
104.It "pl	num	66	page length (in lines)"
105.It "pw	num	132	page width (in characters)"
106.It "px	num	0	page width in pixels (horizontal)"
107.It "py	num	0	page length in pixels (vertical)"
108.It "rf	str" Ta Dv NULL Ta No "filter for printing"
109.Tn FORTRAN
110style text files
111.It "rg	str" Ta Dv NULL Ta No "restricted group-only group members can access"
112.It "rm	str" Ta Dv NULL Ta No "machine name for remote printer"
113.It "rp	str	``lp''	remote printer name argument"
114.It "rs	bool	false	remote users must have a local account"
115.It "rw	bool	false	open printer device for reading and writing"
116.It "sb	bool	false	short banner (one line only)"
117.It "sc	bool	false	suppress multiple copies"
118.It "sd	str" Ta Pa /var/spool/output Ta No "spool directory"
119.It "sf	bool	false	suppress form feeds"
120.It "sh	bool	false	suppress printing of burst page header"
121.It "st	str" Ta Pa status Ta No "status file name"
122.It "tf	str" Ta Dv NULL Ta No "troff data filter (cat phototypesetter)"
123.It "tr	str" Ta Dv NULL Ta No "trailer string to print when queue empties"
124.It "vf	str" Ta Dv NULL Ta No "raster image filter"
125.It "xc	num	0	if lp is a tty, clear local mode bits"
126.Pq Xr tty 4
127.It "xs	num	0	if lp is a tty, set local mode bits"
128.Pq Xr tty 4
129.El
130.Pp
131If the local line printer driver supports indentation, the daemon
132must understand how to invoke it.
133.Sh FILTERS
134If a printer is specified via
135.Sy lp
136(either local or remote),
137the
138.Xr lpd 8
139daemon creates a pipeline of
140.Dq filters
141to process files for various printer types.
142The pipeline is not set up for remote printers specified via
143.Sy rm
144unless the local host is the same as the remote printer host given.
145The filters selected depend on the flags passed to
146.Xr lpr 1 .
147The pipeline set up is:
148.Bd -literal -offset indent
149p	pr | if	regular text + pr(1)
150none	if	regular text
151c	cf	cifplot
152d	df	DVI (tex)
153g	gf	plot(3)
154n	nf	ditroff
155f	rf	Fortran
156t	tf	troff
157v	vf	raster image
158.Ed
159.Pp
160The
161.Sy if
162filter is invoked with arguments:
163.Bd -filled -offset indent
164.Sy if
165.Op Fl c
166.Fl w Ns Ar width
167.Fl l Ns Ar length
168.Fl i Ns Ar indent
169.Fl n Ar login
170.Fl h Ar host acct-file
171.Ed
172.Pp
173The
174.Fl c
175flag is passed only if the
176.Fl l
177flag (pass control characters literally) is specified to
178.Xr lpr 1 .
179.Ar width
180and
181.Ar length
182specify the page width and length
183(from
184.Sy pw
185and
186.Sy pl ,
187respectively) in characters.
188The
189.Fl n
190and
191.Fl h
192parameters specify the login name and host name of the owner
193of the job, respectively.
194The
195.Ar acct-file
196function is passed from the
197.Sy af
198.Nm
199entry.
200.Pp
201If no
202.Sy if
203is specified,
204.Sy of
205is used instead, with the distinction that
206.Sy of
207is opened only once, while
208.Sy if
209is opened for every individual job.
210Thus,
211.Sy if
212is better suited to performing accounting.
213The
214.Sy of
215is only given the
216.Ar width
217and
218.Ar length
219flags.
220.Pp
221All other filters are called as:
222.Bd -filled -offset indent
223.Nm filter
224.Fl x Ns Ar width
225.Fl y Ns Ar length
226.Fl n Ar login
227.Fl h Ar host acct-file
228.Ed
229.Pp
230where
231.Ar width
232and
233.Ar length
234are represented in pixels, specified by the
235.Sy px
236and
237.Sy py
238entries, respectively.
239All filters take
240.Em stdin
241as the file,
242.Em stdout
243as the printer,
244may log either to
245.Em stderr
246or using
247.Xr syslog 3 ,
248and must not ignore
249.Dv SIGINT .
250.Sh LOGGING
251Error messages generated by the line printer programs themselves
252are logged by
253.Xr syslog 3
254using the
255.Dv LPR
256facility.
257Messages printed on
258.Em stderr
259of one of the filters are sent to the corresponding
260.Sy lf
261file.
262The filters may, of course, use
263.Xr syslog 3
264themselves.
265.Pp
266Error messages sent to the console have a carriage return and a line
267feed appended to them, rather than just a line feed.
268.Sh SEE ALSO
269.Xr lpq 1 ,
270.Xr lpr 1 ,
271.Xr lprm 1 ,
272.Xr termcap 5 ,
273.Xr lpc 8 ,
274.Xr lpd 8 ,
275.Xr pac 8
276.Rs
277.%T "4.3 BSD Line Printer Spooler Manual"
278.Re
279.Sh HISTORY
280The
281.Nm
282file format appeared in
283.Bx 4.2 .
284