xref: /openbsd-src/share/man/man5/printcap.5 (revision ed1d2f927894a41196f33dec505a148d049b21b5)
1.\"	$OpenBSD: printcap.5,v 1.29 2022/09/01 18:15:04 jmc Exp $
2.\"	$NetBSD: printcap.5,v 1.7 1998/02/20 12:24:50 hubertf Exp $
3.\"
4.\" Copyright (c) 1983, 1991, 1993
5.\"	The Regents of the University of California.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\"     @(#)printcap.5	8.2 (Berkeley) 12/11/93
32.\"
33.Dd $Mdocdate: September 1 2022 $
34.Dt PRINTCAP 5
35.Os
36.Sh NAME
37.Nm printcap
38.Nd printer capability database
39.Sh DESCRIPTION
40The
41.Nm
42file is a simplified version of the
43.Xr termcap 5
44database used to describe line printers.
45The spooling system accesses the
46.Nm
47file every time it is used, allowing dynamic addition and deletion of printers.
48Each entry in the database is used to describe one printer.
49This database may not be substituted for, as is possible for
50.Xr termcap 5 ,
51because it may allow accounting to be bypassed.
52.Pp
53The default printer is normally
54.Dq lp ,
55though the environment variable
56.Ev PRINTER
57may be used to override this.
58Each spooling utility supports an option,
59.Fl P Ns Ar printer ,
60to allow explicit naming of a destination printer.
61.Pp
62Refer to the
63.%T "4.3 BSD Line Printer Spooler Manual"
64for a complete discussion on how to set up the database for a given printer.
65.Sh CAPABILITIES
66Refer to
67.Xr termcap 5
68for a description of the file layout.
69.Bl -column "Name" "Type" "/var/spool/output/lpd" "Description"
70.It Sy Name Ta Sy Type Ta Sy Default Ta Sy Description
71.It "af	str" Ta Dv NULL Ta "name of accounting file"
72.It "br" Ta "num" Ta "none" Ta "if lp is a tty, set baud rate"
73.Pf ( Xr ioctl 2
74call)
75.It "cf" Ta "str" Ta Dv NULL Ta "cifplot data filter"
76.It "df" Ta "str" Ta Dv NULL Ta "tex data filter (DVI format)"
77.It "ff" Ta "str" Ta So Li \ef Sc Ta "string to send for a form feed"
78.It "fo" Ta "bool" Ta "false" Ta "print a form feed when device is opened"
79.It "gf" Ta "str" Ta Dv NULL Ta "graph data filter"
80.Pf ( Xr plot 3
81format)
82.It "hl" Ta "bool" Ta "false" Ta "print the burst header page last"
83.It "ic" Ta "bool" Ta "false" Ta "supports non-standard ioctl to indent printout"
84.It "if" Ta "str" Ta Dv NULL Ta "name of text filter which does accounting"
85.It "lf" Ta "str" Ta Pa /dev/console Ta "error logging file name"
86.It "lo" Ta "str" Ta Pa lock Ta "name of lock file"
87.It "lp" Ta "str" Ta Pa /dev/lp Ta "local printer device, or port@host for remote"
88.It "mc" Ta "num" Ta "0" Ta "maximum number of copies allowed; 0=unlimited"
89.It "ms" Ta "str" Ta Dv NULL Ta "if lp is a tty, a comma-separated,"
90.Xr stty 1 Ns -like
91list describing the tty modes
92.It "mx" Ta "num" Ta "0" Ta "max file size (in"
93.Dv BUFSIZ
94blocks); 0=unlimited
95.It "nd" Ta "str" Ta Dv NULL Ta "next directory for queues list (unimplemented)"
96.It "nf" Ta "str" Ta Dv NULL Ta "ditroff data filter (device independent troff)"
97.It "of" Ta "str" Ta Dv NULL Ta "name of output filtering program"
98.It "pc" Ta "num" Ta "200" Ta "price per foot or page in hundredths of cents"
99.It "pl" Ta "num" Ta "66" Ta "page length (in lines)"
100.It "pw" Ta "num" Ta "132" Ta "page width (in characters)"
101.It "px" Ta "num" Ta "0" Ta "page width in pixels (horizontal)"
102.It "py" Ta "num" Ta "0" Ta "page length in pixels (vertical)"
103.It "rf" Ta "str" Ta Dv NULL Ta "filter for printing FORTRAN style text files"
104.It "rg" Ta "str" Ta Dv NULL Ta "restricted group-only group members can access"
105.It "rm" Ta "str" Ta Dv NULL Ta "machine name for remote printer"
106.It "rp" Ta "str" Ta "``lp''" Ta "remote printer name argument"
107.It "rs" Ta "bool" Ta "false" Ta "remote users must have a local account"
108.It "rw" Ta "bool" Ta "false" Ta "open printer device for reading and writing"
109.It "sb" Ta "bool" Ta "false" Ta "short banner (one line only)"
110.It "sc" Ta "bool" Ta "false" Ta "suppress multiple copies"
111.It "sd" Ta "str" Ta Pa /var/spool/output/lpd Ta "spool directory"
112.It "sf" Ta "bool" Ta "false" Ta "suppress form feeds"
113.It "sh" Ta "bool" Ta "false" Ta "suppress printing of burst page header"
114.It "st" Ta "str" Ta Pa status Ta "status file name"
115.It "tf" Ta "str" Ta Dv NULL Ta "troff data filter (C/A/T phototypesetter)"
116.It "tr" Ta "str" Ta Dv NULL Ta "trailer string to print when queue empties"
117.It "vf" Ta "str" Ta Dv NULL Ta "raster image filter"
118.El
119.Pp
120If the local line printer driver supports indentation, the daemon
121must understand how to invoke it.
122.Sh FILTERS
123If a printer is specified via
124.Sy lp
125(either local or remote),
126the
127.Xr lpd 8
128daemon creates a pipeline of
129.Dq filters
130to process files for various printer types.
131The pipeline is not set up for remote printers specified via
132.Sy rm
133unless the local host is the same as the remote printer host given.
134The filters selected depend on the flags passed to
135.Xr lpr 1 .
136The pipeline set up is:
137.Bd -literal -offset indent
138p	pr | if	regular text + pr(1)
139none	if	regular text
140c	cf	cifplot
141d	df	DVI (tex)
142g	gf	plot(3)
143n	nf	ditroff
144f	rf	Fortran
145t	tf	troff
146v	vf	raster image
147.Ed
148.Pp
149The
150.Sy if
151filter is invoked with arguments:
152.Bd -filled -offset indent
153.Sy if
154.Op Fl c
155.Fl w Ns Ar width
156.Fl l Ns Ar length
157.Fl i Ns Ar indent
158.Fl n Ar login
159.Fl h Ar host acct-file
160.Ed
161.Pp
162The
163.Fl c
164flag is passed only if the
165.Fl l
166flag (pass control characters literally) is specified to
167.Xr lpr 1 .
168.Ar width
169and
170.Ar length
171specify the page width and length
172(from
173.Sy pw
174and
175.Sy pl ,
176respectively) in characters.
177The
178.Fl n
179and
180.Fl h
181parameters specify the login name and host name of the owner
182of the job, respectively.
183The
184.Ar acct-file
185function is passed from the
186.Sy af
187.Nm
188entry.
189.Pp
190If no
191.Sy if
192is specified,
193.Sy of
194is used instead, with the distinction that
195.Sy of
196is opened only once, while
197.Sy if
198is opened for every individual job.
199Thus,
200.Sy if
201is better suited to performing accounting.
202The
203.Sy of
204is only given the
205.Ar width
206and
207.Ar length
208flags.
209.Pp
210All other filters are called as:
211.Bd -filled -offset indent
212.Nm filter
213.Fl x Ns Ar width
214.Fl y Ns Ar length
215.Fl n Ar login
216.Fl h Ar host acct-file
217.Ed
218.Pp
219where
220.Ar width
221and
222.Ar length
223are represented in pixels, specified by the
224.Sy px
225and
226.Sy py
227entries, respectively.
228All filters take
229.Em stdin
230as the file,
231.Em stdout
232as the printer,
233may log either to
234.Em stderr
235or using
236.Xr syslog 3 ,
237and must not ignore
238.Dv SIGINT .
239.Sh LOGGING
240Error messages generated by the line printer programs themselves
241are logged by
242.Xr syslog 3
243using the
244.Dv LPR
245facility.
246Messages printed on
247.Em stderr
248by the filters are sent to the corresponding
249.Sy lf
250file.
251The filters may, of course, use
252.Xr syslog 3
253themselves.
254.Pp
255Error messages sent to the console have a carriage return and a line
256feed appended to them, rather than just a line feed.
257.Sh FILES
258.Bl -tag -width /etc/examples/printcap -compact
259.It Pa /etc/printcap
260Default location of the database file.
261.It Pa /etc/examples/printcap
262Example database file.
263.El
264.Sh SEE ALSO
265.Xr lpq 1 ,
266.Xr lpr 1 ,
267.Xr lprm 1 ,
268.Xr termcap 5 ,
269.Xr lpc 8 ,
270.Xr lpd 8
271.Rs
272.%T "4.3 BSD Line Printer Spooler Manual"
273.Re
274.Sh HISTORY
275The
276.Nm
277file format appeared in
278.Bx 4.2 .
279