xref: /netbsd-src/share/man/man5/printcap.5 (revision 7e305bebbacdeadf94930a9d8b77b896b6721d91)
1.\"	$NetBSD: printcap.5,v 1.28 2022/10/21 18:21:56 christos 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. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     @(#)printcap.5	8.2 (Berkeley) 12/11/93
31.\"
32.Dd October 21, 2022
33.Dt PRINTCAP 5
34.Os
35.Sh NAME
36.Nm printcap
37.Nd printer capability data base
38.Sh SYNOPSIS
39.Nm printcap
40.Sh DESCRIPTION
41The
42.Nm
43data base is used to describe line printers.
44The spooling system accesses the
45.Nm printcap
46file every time it is used, allowing dynamic
47addition and deletion of printers.
48Each entry in the data base is used to describe one printer.
49.Pp
50The default printer is normally
51.Em lp ,
52though the environment variable
53.Ev PRINTER
54may be used to override this.
55Each spooling utility supports an option,
56.Fl P Ar printer ,
57to allow explicit naming of a destination printer.
58.Pp
59Refer to the
60.%T "4.3 BSD Line Printer Spooler Manual"
61for a complete discussion on how to set up the database for a given printer.
62.Sh CAPABILITIES
63Refer to
64.Xr capfile 5
65for a description of the file layout.
66.Bl -column Name Type "/var/spool/output/lpd"
67.It Sy Name	Type	Default	Description
68.It "af	str" Ta Dv NULL Ta No "name of accounting file"
69.It "br	num	none	if lp is a tty, set the baud rate"
70.Pf ( Xr ioctl 2
71call)
72.It "cf	str" Ta Dv NULL Ta No "cifplot data filter"
73.It "df	str" Ta Dv NULL Ta No "tex data filter"
74.Pf ( Tn DVI
75format)
76.It "fc	num	0	if lp is a tty, clear flag bits"
77.Pq Pa sgtty.h
78.It "ff	str" Ta So Li \ef Sc Ta No "string to send for a form feed"
79.It "fo	bool	false	print a form feed when device is opened"
80.It "fs	num	0	like `fc' but set bits"
81.It "gf	str" Ta Dv NULL Ta No "graph data filter"
82.Pf ( Xr plot 3
83format
84.It "hl	bool	false	print the burst header page last"
85.It "ic	bool	false	driver supports (non standard) ioctl to indent printout"
86.It "if	str" Ta Dv NULL Ta No "name of text filter which does accounting"
87.It "lf	str" Ta Pa /dev/console Ta No "error logging file name"
88.It "lo	str" Ta Pa lock Ta No "name of lock file"
89.It "lp	str" Ta Pa /dev/lp Ta No "device name to open for output to local \
90printer, or port@host for remote printer/printer on print server"
91.It "ms	str" Ta Dv NULL Ta No "list of terminal modes to set or clear"
92.It "mx	num	1000	maximum file size (in"
93.Dv BUFSIZ
94blocks), zero = unlimited
95.It "nd	str" Ta Dv NULL Ta No "next directory for list of queues (unimplemented)"
96.It "nf	str" Ta Dv NULL Ta No "ditroff data filter (device independent troff)"
97.It "of	str" Ta Dv NULL Ta No "name of output filtering program"
98.It "pc	num	200	price per foot or page in hundredths of cents"
99.It "pf	str" Ta Dv NULL Ta No "filter for printing"
100.Tn PostScript
101files
102.It "pl	num	66	page length (in lines)"
103.It "pw	num	132	page width (in characters)"
104.It "px	num	0	page width in pixels (horizontal)"
105.It "py	num	0	page length in pixels (vertical)"
106.It "rf	str" Ta Dv NULL Ta No "filter for printing"
107.Tn FORTRAN
108style text files
109.It "rg	str" Ta Dv NULL Ta No "restricted group. Only members of group allowed access"
110.It "rm	str" Ta Dv NULL Ta No "machine name for remote printer or port@host \
111for a remote printer on a port other than the standard port."
112.Po
113also suppress the burst page, see
114.Sx NOTES
115.Pc
116.It "rp	str	``lp''	remote printer name argument"
117.It "rs	bool	false	restrict remote users to those with local accounts"
118.It "rw	bool	false	open the printer device for reading and writing"
119.It "sb	bool	false	short banner (one line only)"
120.It "sc	bool	false	suppress multiple copies"
121.It "sd	str" Ta Pa /var/spool/output/lpd Ta No "spool directory"
122.It "sf	bool	false	suppress form feeds"
123.It "sh	bool	false	suppress printing of burst page header"
124.Po
125local only, see
126.Sx NOTES
127.Pc
128.It "st	str" Ta Pa status Ta No "status file name"
129.It "tf	str" Ta Dv NULL Ta No "troff data filter (cat phototypesetter)"
130.It "tr	str" Ta Dv NULL Ta No "trailer string to print when queue empties"
131.It "vf	str" Ta Dv NULL Ta No "raster image filter"
132.It "xc	num	0	if lp is a tty, clear local mode bits"
133.Pq Xr tty 4
134.It "xs	num	0	like `xc' but set bits"
135.El
136.Pp
137If the local line printer driver supports indentation, the daemon
138must understand how to invoke it.
139.Sh FILTERS
140If a printer is specified via
141.Sy lp
142(either local or remote),
143the
144.Xr lpd 8
145daemon creates a pipeline of
146.Em filters
147to process files for various printer types.
148The pipeline is not set up for remote printers specified via
149.Sy rm
150unless the local host is the same as the remote printer host
151given or
152.Xr lpd 8
153is run with the
154.Fl r
155flag.
156The filters selected depend on the flags passed to
157.Xr lpr 1 .
158The pipeline set up is:
159.Bd -literal -offset indent
160p	pr | if	regular text + pr(1)
161none	if	regular text
162c	cf	cifplot
163d	df	DVI (tex)
164g	gf	plot(3)
165n	nf	ditroff
166o	pf	PostScript
167f	rf	Fortran
168t	tf	troff
169v	vf	raster image
170.Ed
171.Pp
172The
173.Sy if
174filter is invoked with arguments:
175.Bd -filled -offset indent
176.Cm if
177.Op Fl c
178.Fl w Ns Ar width
179.Fl l Ns Ar length
180.Fl i Ns Ar indent
181.Fl n Ar login
182.Op Fl j Ar jobname
183.Fl h Ar host acct-file
184.Ed
185.Pp
186The
187.Fl c
188flag is passed only if the
189.Fl l
190flag (pass control characters literally)
191is specified to
192.Xr lpr 1 .
193The
194.Ar width
195and
196.Ar length
197specify the page width and length
198(from
199.Cm pw
200and
201.Cm pl
202respectively) in characters.
203The
204.Fl n
205and
206.Fl h
207parameters specify the login name and host name of the owner
208of the job respectively.
209The
210.Fl j
211parameter is optional and specifies the name of the print
212job if available.
213The
214.Ar acct-file
215option is passed from the
216.Cm af
217.Nm printcap
218entry.
219.Pp
220If no
221.Cm if
222is specified,
223.Cm of
224is used instead,
225with the distinction that
226.Cm of
227is opened only once,
228while
229.Cm if
230is opened for every individual job.
231Thus,
232.Cm if
233is better suited to performing accounting.
234The
235.Cm of
236is only given the
237.Ar width
238and
239.Ar length
240flags.
241.Pp
242All other filters are called as:
243.Bd -filled -offset indent
244.Nm filter
245.Fl x Ns Ar width
246.Fl y Ns Ar length
247.Fl n Ar login
248.Op Fl j Ar jobname
249.Fl h Ar host acct-file
250.Ed
251.Pp
252where
253.Ar width
254and
255.Ar length
256are represented in pixels,
257specified by the
258.Cm px
259and
260.Cm py
261entries respectively.
262.Pp
263All filters take
264.Em stdin
265as the file,
266.Em stdout
267as the printer,
268may log either to
269.Em stderr
270or using
271.Xr syslog 3 ,
272and must not ignore
273.Dv SIGINT .
274.Pp
275Filters can communicate errors to lpd by their exit code and by modifying
276the mode of the spool lock file as follows:
277.Bl -tag -width Exit-code -compact -offset indent
278.It Sy Exit code
279.Sy Description
280.It 0
281Success.
282.It 1
283An attempt is made to reprint the job and mail is sent if it fails.
284.It 2
285.Xr lpd 8
286silently discards the job.
287.It n
288.Xr lpd 8
289discards the job and mail is sent.
290.El
291.Bl -tag -width lockxmode -compact -offset indent
292.It Sy lock code
293.Sy Description
294.It u+x
295Stop printing and leave queue disabled (S_IXUSR).
296.It o+x
297Rebuild the queue (S_IXOTH).
298.El
299.Sh LOGGING
300Error messages generated by the line printer programs themselves
301(that is, the lp* programs) are logged by
302.Xr syslog 3
303using the
304.Dv LPR
305facility.
306Messages printed on
307.Em stderr
308of one of the filters are sent to the corresponding
309.Cm lf
310file.
311The filters may, of course, use
312.Xr syslog 3
313themselves.
314.Pp
315Error messages sent to the console have a carriage return and a line
316feed appended to them, rather than just a line feed.
317.Sh SEE ALSO
318.Xr lpq 1 ,
319.Xr lpr 1 ,
320.Xr lprm 1 ,
321.Xr capfile 5 ,
322.Xr lpc 8 ,
323.Xr lpd 8 ,
324.Xr pac 8
325.Rs
326.%T "4.3 BSD Line Printer Spooler Manual"
327.Re
328.Sh NOTES
329The
330.Sy sh
331flag is a function of the spooler with the locally attached printer,
332and so has no effect when used with
333.Sy rm .
334.Nx
335never adds a burst page when used as a remote spooler.
336To suppress the burst page for other systems or dedicated devices,
337refer to the documentation for those systems or devices.
338.Sh HISTORY
339The
340.Nm
341file format appeared in
342.Bx 4.2 .
343