xref: /freebsd/usr.sbin/lpr/lpr/printcap.5 (revision 17ee9d00bc1ae1e598c38f25826f861e4bc6c3ce)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  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.\"     @(#)printcap.5	8.2 (Berkeley) 12/11/93
33.\"
34.Dd December 11, 1993
35.Dt PRINTCAP 5
36.Os BSD 4.2
37.Sh NAME
38.Nm printcap
39.Nd printer capability data base
40.Sh SYNOPSIS
41.Nm printcap
42.Sh DESCRIPTION
43The
44.Nm Printcap
45function
46is a simplified version of the
47.Xr termcap 5
48data base
49used to describe line printers.  The spooling system accesses the
50.Nm printcap
51file every time it is used, allowing dynamic
52addition and deletion of printers.  Each entry in the data base
53is used to describe one printer.  This data base may not be
54substituted for, as is possible for
55.Xr termcap ,
56because it may allow accounting to be bypassed.
57.Pp
58The default printer is normally
59.Em lp ,
60though the environment variable
61.Ev PRINTER
62may be used to override this.  Each spooling utility supports an option,
63.Fl P Ar printer ,
64to allow explicit naming of a destination printer.
65.Pp
66Refer to the
67.%T "4.3 BSD Line Printer Spooler Manual"
68for a complete discussion on how to setup the database for a given printer.
69.Sh CAPABILITIES
70Refer to
71.Xr termcap 5
72for a description of the file layout.
73.Bl -column Namexxx Typexx "/var/spool/lpdxxxxx"
74.Sy Name	Type	Description
75.It "af	str" Ta Dv NULL Ta No "name of accounting file"
76.It "br	num	none	if lp is a tty, set the baud rate"
77.Pf ( Xr ioctl 2
78call)
79.It "cf	str" Ta Dv NULL Ta No "cifplot data filter"
80.It "df	str" Ta Dv NULL Ta No "tex data filter"
81.Pf ( Tn DVI
82format)
83.It "fc	num	0	if lp is a tty, clear flag bits"
84.Pq Pa sgtty.h
85.It "ff	str" Ta So Li \ef Sc Ta No "string to send for a form feed"
86.It "fo	bool	false	print a form feed when device is opened"
87.It "fs	num	0	like `fc' but set bits"
88.It "gf	str" Ta Dv NULL Ta No "graph data filter"
89.Pf ( Xr plot 3
90format
91.It "hl	bool	false	print the burst header page last"
92.It "ic	bool	false	driver supports (non standard) ioctl to indent printout"
93.It "if	str" Ta Dv NULL Ta No "name of text filter which does accounting"
94.It "lf	str" Ta Pa /dev/console Ta No "error logging file name"
95.It "lo	str" Ta Pa lock Ta No "name of lock file"
96.It "lp	str" Ta Pa /dev/lp Ta No "device name to open for output"
97.It "mx	num	1000	maximum file size (in"
98.Dv BUFSIZ
99blocks), zero = unlimited
100.It "nd	str" Ta Dv NULL Ta No "next directory for list of queues (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 members of group allowed 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	restrict remote users to those with local accounts"
115.It "rw	bool	false	open the 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/lpd 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	like `xc' but set bits"
128.El
129.Pp
130If the local line printer driver supports indentation, the daemon
131must understand how to invoke it.
132.Sh FILTERS
133The
134.Xr lpd 8
135daemon creates a pipeline of
136.Em filters
137to process files for various printer types.
138The filters selected depend on the flags passed to
139.Xr lpr 1 .
140The pipeline set up is:
141.Bd -literal -offset indent
142p	pr | if	regular text + pr(1)
143none	if	regular text
144c	cf	cifplot
145d	df	DVI (tex)
146g	gf	plot(3)
147n	nf	ditroff
148f	rf	Fortran
149t	tf	troff
150v	vf	raster image
151.Ed
152.Pp
153The
154.Sy if
155filter is invoked with arguments:
156.Bd -filled -offset indent
157.Cm if
158.Op Fl c
159.Fl w Ns Ar width
160.Fl l Ns Ar length
161.Fl i Ns Ar indent
162.Fl n Ar login
163.Fl h Ar host acct-file
164.Ed
165.Pp
166The
167.Fl c
168flag is passed only if the
169.Fl l
170flag (pass control characters literally)
171is specified to
172.Xr lpr .
173The
174.Ar Width
175function
176and
177.Ar length
178specify the page width and length
179(from
180.Cm pw
181and
182.Cm pl
183respectively) in characters.
184The
185.Fl n
186and
187.Fl h
188parameters specify the login name and host name of the owner
189of the job respectively.
190The
191.Ar Acct-file
192function
193is passed from the
194.Cm af
195.Nm printcap
196entry.
197.Pp
198If no
199.Cm if
200is specified,
201.Cm of
202is used instead,
203with the distinction that
204.Cm of
205is opened only once,
206while
207.Cm if
208is opened for every individual job.
209Thus,
210.Cm if
211is better suited to performing accounting.
212The
213.Cm of
214is only given the
215.Ar width
216and
217.Ar length
218flags.
219.Pp
220All other filters are called as:
221.Bd -filled -offset indent
222.Nm filter
223.Fl x Ns Ar width
224.Fl y Ns Ar length
225.Fl n Ar login
226.Fl h Ar host acct-file
227.Ed
228.Pp
229where
230.Ar width
231and
232.Ar length
233are represented in pixels,
234specified by the
235.Cm px
236and
237.Cm py
238entries respectively.
239.Pp
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
253(that is, the
254.Xr lp Ns *
255programs)
256are logged by
257.Xr syslog 3
258using the
259.Dv LPR
260facility.
261Messages printed on
262.Em stderr
263of one of the filters
264are sent to the corresponding
265.Cm lf
266file.
267The filters may, of course, use
268.Xr syslog
269themselves.
270.Pp
271Error messages sent to the console have a carriage return and a line
272feed appended to them, rather than just a line feed.
273.Sh SEE ALSO
274.Xr termcap 5 ,
275.Xr lpc 8 ,
276.Xr lpd 8 ,
277.Xr pac 8 ,
278.Xr lpr 1 ,
279.Xr lpq 1 ,
280.Xr lprm 1
281.Rs
282.%T "4.3 BSD Line Printer Spooler Manual"
283.Re
284.Sh HISTORY
285The
286.Nm
287file format appeared in
288.Bx 4.2 ..
289