xref: /netbsd-src/share/man/man5/printcap.5 (revision d9158b13b5dfe46201430699a3f7a235ecf28df3)
1.\" Copyright (c) 1983, 1991 Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"     from: @(#)printcap.5	6.6 (Berkeley) 5/10/91
33.\"	$Id: printcap.5,v 1.3 1994/04/06 05:29:32 mycroft Exp $
34.\"
35.Dd May 10, 1991
36.Dt PRINTCAP 5
37.Os BSD 4.2
38.Sh NAME
39.Nm printcap
40.Nd printer capability data base
41.Sh SYNOPSIS
42.Nm printcap
43.Sh DESCRIPTION
44The
45.Nm Printcap
46function
47is a simplified version of the
48.Xr termcap 5
49data base
50used to describe line printers.  The spooling system accesses the
51.Nm printcap
52file every time it is used, allowing dynamic
53addition and deletion of printers.  Each entry in the data base
54is used to describe one printer.  This data base may not be
55substituted for, as is possible for
56.Xr termcap ,
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.  Each spooling utility supports an option,
64.Fl P Ar printer ,
65to allow explicit naming of a destination printer.
66.Pp
67Refer to the
68.%T "4.3 BSD Line Printer Spooler Manual"
69for a complete discussion on how setup the database for a given printer.
70.Sh CAPABILITIES
71Refer to
72.Xr termcap 5
73for a description of the file layout.
74.Bl -column Name Type "/var/spool/lpd"
75.Sy Name	Type	Default	Description
76.It "af	str" Ta Dv NULL Ta No "name of accounting file"
77.It "br	num	none	if lp is a tty, set the baud rate"
78.Pf ( Xr ioctl 2
79call)
80.It "cf	str" Ta Dv NULL Ta No "cifplot data filter"
81.It "df	str" Ta Dv NULL Ta No "tex data filter"
82.Pf ( Tn DVI
83format)
84.It "fc	num	0	if lp is a tty, clear flag bits"
85.Pq Pa sgtty.h
86.It "ff	str" Ta So Li \ef Sc Ta No "string to send for a form feed"
87.It "fo	bool	false	print a form feed when device is opened"
88.It "fs	num	0	like `fc' but set bits"
89.It "gf	str" Ta Dv NULL Ta No "graph data filter"
90.Pf ( Xr plot 3
91format
92.It "hl	bool	false	print the burst header page last"
93.It "ic	bool	false	driver supports (non standard) ioctl to indent printout"
94.It "if	str" Ta Dv NULL Ta No "name of text filter which does accounting"
95.It "lf	str" Ta Pa /dev/console Ta No "error logging file name"
96.It "lo	str" Ta Pa lock Ta No "name of lock file"
97.It "lp	str" Ta Pa /dev/lp Ta No "device name to open for output"
98.It "mx	num	1000	maximum file size (in"
99.Dv BUFSIZ
100blocks), zero = unlimited
101.It "nd	str" Ta Dv NULL Ta No "next directory for list of queues (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 members of group allowed 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	restrict remote users to those with local accounts"
116.It "rw	bool	false	open the 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/lpd 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	like `xc' but set bits"
129.El
130.Pp
131If the local line printer driver supports indentation, the daemon
132must understand how to invoke it.
133.Sh FILTERS
134The
135.Xr lpd 8
136daemon creates a pipeline of
137.Em filters
138to process files for various printer types.
139The filters selected depend on the flags passed to
140.Xr lpr 1 .
141The pipeline set up is:
142.Bd -literal -offset indent
143p	pr | if	regular text + pr(1)
144none	if	regular text
145c	cf	cifplot
146d	df	DVI (tex)
147g	gf	plot(3)
148n	nf	ditroff
149f	rf	Fortran
150t	tf	troff
151v	vf	raster image
152.Ed
153.Pp
154The
155.Sy if
156filter is invoked with arguments:
157.Bd -filled -offset indent
158.Cm if
159.Op Fl c
160.Fl w Ns Ar width
161.Fl l Ns Ar length
162.Fl i Ns Ar indent
163.Fl n Ar login
164.Fl h Ar host acct-file
165.Ed
166.Pp
167The
168.Fl c
169flag is passed only if the
170.Fl l
171flag (pass control characters literally)
172is specified to
173.Xr lpr .
174The
175.Ar Width
176function
177and
178.Ar length
179specify the page width and length
180(from
181.Cm pw
182and
183.Cm pl
184respectively) in characters.
185The
186.Fl n
187and
188.Fl h
189parameters specify the login name and host name of the owner
190of the job respectively.
191The
192.Ar Acct-file
193function
194is passed from the
195.Cm af
196.Nm printcap
197entry.
198.Pp
199If no
200.Cm if
201is specified,
202.Cm of
203is used instead,
204with the distinction that
205.Cm of
206is opened only once,
207while
208.Cm if
209is opened for every individual job.
210Thus,
211.Cm if
212is better suited to performing accounting.
213The
214.Cm 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,
235specified by the
236.Cm px
237and
238.Cm py
239entries respectively.
240.Pp
241All filters take
242.Em stdin
243as the file,
244.Em stdout
245as the printer,
246may log either to
247.Em stderr
248or using
249.Xr syslog 3 ,
250and must not ignore
251.Dv SIGINT .
252.Sh LOGGING
253Error messages generated by the line printer programs themselves
254(that is, the
255.Xr lp Ns *
256programs)
257are logged by
258.Xr syslog 3
259using the
260.Dv LPR
261facility.
262Messages printed on
263.Em stderr
264of one of the filters
265are sent to the corresponding
266.Cm lf
267file.
268The filters may, of course, use
269.Xr syslog
270themselves.
271.Pp
272Error messages sent to the console have a carriage return and a line
273feed appended to them, rather than just a line feed.
274.Sh SEE ALSO
275.Xr termcap 5 ,
276.Xr lpc 8 ,
277.Xr lpd 8 ,
278.Xr pac 8 ,
279.Xr lpr 1 ,
280.Xr lpq 1 ,
281.Xr lprm 1
282.Rs
283.%T "4.3 BSD Line Printer Spooler Manual"
284.Re
285.Sh HISTORY
286The
287.Nm
288file format appeared in
289.Bx 4.2 ..
290