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