xref: /freebsd/usr.sbin/lpr/lpr/printcap.5 (revision 41466b50c1d5bfd1cf6adaae547a579a75d7c04e)
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.\" $FreeBSD$
34.\"
35.Dd October 11, 2000
36.Dt PRINTCAP 5
37.Os
38.Sh NAME
39.Nm printcap
40.Nd printer capability data base
41.Sh SYNOPSIS
42.Nm
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
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 5 ,
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 to 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 Namexxx Typexx "/var/spool/lpdxxxxx"
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 "ct	num	120	TCP connection timeout in seconds"
82.It "df	str" Ta Dv NULL Ta No "tex data filter"
83.Pf ( Tn DVI
84format)
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 "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	driver 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 "device name to open for output"
96.It "ms	str" Ta Dv NULL Ta No "if lp is a tty, a comma-separated,"
97.Xr stty 1 Ns -like
98list describing the tty modes
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 "sr	str" Ta Dv NULL Ta No "file name to hold statistics of each datafile as it is received"
124.It "ss	str" Ta Dv NULL Ta No "file name to hold statistics of each datafile as it is sent"
125.It "st	str" Ta Pa status Ta No "status file name"
126.It "tf	str" Ta Dv NULL Ta No "troff data filter (cat phototypesetter)"
127.It "tr	str" Ta Dv NULL Ta No "trailer string to print when queue empties"
128.It "vf	str" Ta Dv NULL Ta No "raster image filter"
129.El
130.Pp
131Each two-letter capability has a human-readable alternate name.
132.Bl -column "Short form" "Long form"
133.Sy "Short form	Long form"
134.It "af	acct.file"
135.It "br	tty.rate"
136.It "cf	filt.cifplot"
137.It "ct	remote.timeout"
138.It "df	filt.dvi"
139.It "du	daemon.user"
140.It "ff	job.formfeed"
141.It "fo	job.topofform"
142.It "gf	filt.plot"
143.It "hl	banner.last"
144.It "if	filt.input"
145.It "lf	spool.log"
146.It "lo	spool.lock"
147.It "lp	tty.device"
148.It "mc	max.copies"
149.It "ms	tty.mode"
150.It "mx	max.blocks"
151.It "nf	filt.ditroff"
152.It "of	filt.output"
153.It "pc	acct.price"
154.It "pl	page.length"
155.It "pw	page.width"
156.It "px	page.pwidth"
157.It "py	page.plength"
158.It "rf	filt.fortran"
159.It "rg	daemon.restrictgrp"
160.It "rm	remote.host"
161.It "rp	remote.queue"
162.It "rs	daemon.restricted"
163.It "rw	tty.rw"
164.It "sb	banner.short"
165.It "sc	job.no_copies"
166.It "sd	spool.dir"
167.It "sf	job.no_formfeed"
168.It "sh	banner.disable"
169.It "sr	stat.recv"
170.It "ss	stat.send"
171.It "st	spool.status"
172.It "tr	job.trailer"
173.It "vf	filt.raster"
174.El
175.Pp
176If the local line printer driver supports indentation, the daemon
177must understand how to invoke it.
178.Sh FILTERS
179The
180.Xr lpd 8
181daemon creates a pipeline of
182.Em filters
183to process files for various printer types.
184The filters selected depend on the flags passed to
185.Xr lpr 1 .
186The pipeline set up is:
187.Bd -literal -offset indent
188p	pr | if	regular text + pr(1)
189none	if	regular text
190c	cf	cifplot
191d	df	DVI (tex)
192g	gf	plot(3)
193n	nf	ditroff
194f	rf	Fortran
195t	tf	troff
196v	vf	raster image
197.Ed
198.Pp
199The
200.Sy if
201filter is invoked with arguments:
202.Bd -ragged -offset indent
203.Cm if
204.Op Fl c
205.Fl w Ns Ar width
206.Fl l Ns Ar length
207.Fl i Ns Ar indent
208.Fl n Ar login
209.Fl h Ar host acct-file
210.Ed
211.Pp
212The
213.Fl c
214flag is passed only if the
215.Fl l
216flag (pass control characters literally)
217is specified to
218.Xr lpr 1 .
219The
220.Ar Width
221function
222and
223.Ar length
224specify the page width and length
225(from
226.Cm pw
227and
228.Cm pl
229respectively) in characters.
230The
231.Fl n
232and
233.Fl h
234parameters specify the login name and host name of the owner
235of the job respectively.
236The
237.Ar Acct-file
238function
239is passed from the
240.Cm af
241.Nm
242entry.
243.Pp
244If no
245.Cm if
246is specified,
247.Cm of
248is used instead,
249with the distinction that
250.Cm of
251is opened only once,
252while
253.Cm if
254is opened for every individual job.
255Thus,
256.Cm if
257is better suited to performing accounting.
258The
259.Cm of
260is only given the
261.Ar width
262and
263.Ar length
264flags.
265.Pp
266All other filters are called as:
267.Bd -ragged -offset indent
268.Nm filter
269.Fl x Ns Ar width
270.Fl y Ns Ar length
271.Fl n Ar login
272.Fl h Ar host acct-file
273.Ed
274.Pp
275where
276.Ar width
277and
278.Ar length
279are represented in pixels,
280specified by the
281.Cm px
282and
283.Cm py
284entries respectively.
285.Pp
286All filters take
287.Em stdin
288as the file,
289.Em stdout
290as the printer,
291may log either to
292.Em stderr
293or using
294.Xr syslog 3 ,
295and must not ignore
296.Dv SIGINT .
297.Sh REMOTE PRINTING
298When printing to a remote printer using
299.Cm rm ,
300it is possible to use either
301.Cm if
302or
303.Cm of .
304If both are specified,
305.Cm of
306is ignored.  Both filters behave the same except that they are passed
307different arguments as above.  Specifically, the output filter is
308terminated and restarted for each file transmitted.  This is necessary
309in order to pass the resulting size to the remote
310.Xr lpd 8 .
311.Pp
312If the
313.Fl p
314flag was passed to
315.Xr lpr 1 ,
316.Xr pr 1
317is not executed locally, but is requested of the remote
318.Xr lpd 8 .
319Any input filtering via
320.Cm if
321will therefore happen before
322.Xr pr 1
323is executed rather than afterwards.
324.Pp
325If
326.Cm lp
327is specified as
328.Em port Ns No @ Ns Em machine
329(and
330.Cm rm
331is not in use), printing will be send directly to the given
332.Em port
333on the given
334.Em machine .
335.Sh TRANSFER STATISTICS
336When a print job is transfered to a remote machine (which might be
337another unix box, or may be a network printer), it may be useful
338to keep statistics on each transfer.  The
339.Cm sr
340and
341.Cm ss
342options indicate filenames that lpd should use to store such
343statistics.  A statistics line is written for each datafile of a
344job as the file is successfully transferred.  The format of the
345line is the same for both the sending and receiving side of a
346transfer.
347.Pp
348Statistics on datafiles being received would be used on a print
349server, if you are interested in network performance between a
350variety of machines which are sending jobs to that print server.
351The print server could collect statistics on the speed of each
352print job as it arrived on the server.
353.Pp
354Statistics on datafiles being sent might be used as a minimal
355accounting record, when you want to know who sent which jobs to a
356remote printer, when they were sent, and how large (in bytes) the
357files were.  This will not give include any idea of how many pages
358were printed, because there is no standard way to get that information
359back from a remote (network) printer in this case.
360.Sh LOGGING
361Error messages generated by the line printer programs themselves
362(that is, the
363.Xr lpd 8
364and related programs)
365are logged by
366.Xr syslog 3
367using the
368.Dv LPR
369facility.
370Messages printed on
371.Em stderr
372of one of the filters
373are sent to the corresponding
374.Cm lf
375file.
376The filters may, of course, use
377.Xr syslogd 8
378themselves.
379.Pp
380Error messages sent to the console have a carriage return and a line
381feed appended to them, rather than just a line feed.
382.Sh SEE ALSO
383.Xr lpq 1 ,
384.Xr lpr 1 ,
385.Xr lprm 1 ,
386.Xr hosts.lpd 5 ,
387.Xr termcap 5 ,
388.Xr lpc 8 ,
389.Xr lpd 8 ,
390.Xr pac 8
391.Rs
392.%T "4.3 BSD Line Printer Spooler Manual"
393.Re
394.Sh HISTORY
395The
396.Nm
397file format appeared in
398.Bx 4.2 .
399