1.\" $OpenBSD: printcap.5,v 1.23 2011/09/03 22:59:07 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 3 2011 $ 34.Dt PRINTCAP 5 35.Os 36.Sh NAME 37.Nm printcap 38.Nd printer capability database 39.Sh SYNOPSIS 40.Nm printcap 41.Sh DESCRIPTION 42The 43.Nm 44file is a simplified version of the 45.Xr termcap 5 46database used to describe line printers. 47The spooling system accesses the 48.Nm 49file every time it is used, allowing dynamic addition and deletion of printers. 50Each entry in the database is used to describe one printer. 51This database may not be substituted for, as is possible for 52.Xr termcap 5 , 53because it may allow accounting to be bypassed. 54.Pp 55The default printer is normally 56.Dq lp , 57though the environment variable 58.Ev PRINTER 59may be used to override this. 60Each spooling utility supports an option, 61.Fl P Ns Ar printer , 62to allow explicit naming of a destination printer. 63.Pp 64Refer to the 65.%T "4.3 BSD Line Printer Spooler Manual" 66for a complete discussion on how to set up the database for a given printer. 67.Sh CAPABILITIES 68Refer to 69.Xr termcap 5 70for a description of the file layout. 71.Bl -column "Name" "Type" "/var/spool/output" "Description" 72.It Sy Name Ta Sy Type Ta Sy Default Ta Sy Description 73.It "af str" Ta Dv NULL Ta "name of accounting file" 74.It "br" Ta "num" Ta "none" Ta "if lp is a tty, set baud rate" 75.Pf ( Xr ioctl 2 76call) 77.It "cf" Ta "str" Ta Dv NULL Ta "cifplot data filter" 78.It "df" Ta "str" Ta Dv NULL Ta "tex data filter (DVI format)" 79.It "fc" Ta "num" Ta "0" Ta "if lp is a tty, clear flag bits" 80.Pq Aq Pa sgtty.h 81.It "ff" Ta "str" Ta So Li \ef Sc Ta "string to send for a form feed" 82.It "fo" Ta "bool" Ta "false" Ta "print a form feed when device is opened" 83.It "fs" Ta "num" Ta "0" Ta "if lp is a tty, set flag bits" 84.Pq Aq Pa sgtty.h 85.It "gf" Ta "str" Ta Dv NULL Ta "graph data filter" 86.Pf ( Xr plot 3 87format) 88.It "hl" Ta "bool" Ta "false" Ta "print the burst header page last" 89.It "ic" Ta "bool" Ta "false" Ta "supports non-standard ioctl to indent printout" 90.It "if" Ta "str" Ta Dv NULL Ta "name of text filter which does accounting" 91.It "lf" Ta "str" Ta Pa /dev/console Ta "error logging file name" 92.It "lo" Ta "str" Ta Pa lock Ta "name of lock file" 93.It "lp" Ta "str" Ta Pa /dev/lp Ta "local printer device, or port@host for remote" 94.It "mc" Ta "num" Ta "0" Ta "maximum number of copies allowed; 0=unlimited" 95.It "ms" Ta "str" Ta Dv NULL Ta "list of terminal modes to set or clear" 96.It "mx" Ta "num" Ta "0" Ta "max file size (in" 97.Dv BUFSIZ 98blocks); 0=unlimited 99.It "nd" Ta "str" Ta Dv NULL Ta "next directory for queues list (unimplemented)" 100.It "nf" Ta "str" Ta Dv NULL Ta "ditroff data filter (device independent troff)" 101.It "of" Ta "str" Ta Dv NULL Ta "name of output filtering program" 102.It "pc" Ta "num" Ta "200" Ta "price per foot or page in hundredths of cents" 103.It "pl" Ta "num" Ta "66" Ta "page length (in lines)" 104.It "pw" Ta "num" Ta "132" Ta "page width (in characters)" 105.It "px" Ta "num" Ta "0" Ta "page width in pixels (horizontal)" 106.It "py" Ta "num" Ta "0" Ta "page length in pixels (vertical)" 107.It "rf" Ta "str" Ta Dv NULL Ta "filter for printing FORTRAN style text files" 108.It "rg" Ta "str" Ta Dv NULL Ta "restricted group-only group members can access" 109.It "rm" Ta "str" Ta Dv NULL Ta "machine name for remote printer" 110.It "rp" Ta "str" Ta "``lp''" Ta "remote printer name argument" 111.It "rs" Ta "bool" Ta "false" Ta "remote users must have a local account" 112.It "rw" Ta "bool" Ta "false" Ta "open printer device for reading and writing" 113.It "sb" Ta "bool" Ta "false" Ta "short banner (one line only)" 114.It "sc" Ta "bool" Ta "false" Ta "suppress multiple copies" 115.It "sd" Ta "str" Ta Pa /var/spool/output Ta "spool directory" 116.It "sf" Ta "bool" Ta "false" Ta "suppress form feeds" 117.It "sh" Ta "bool" Ta "false" Ta "suppress printing of burst page header" 118.It "st" Ta "str" Ta Pa status Ta "status file name" 119.It "tf" Ta "str" Ta Dv NULL Ta "troff data filter (cat phototypesetter)" 120.It "tr" Ta "str" Ta Dv NULL Ta "trailer string to print when queue empties" 121.It "vf" Ta "str" Ta Dv NULL Ta "raster image filter" 122.It "xc" Ta "num" Ta "0" Ta "if lp is a tty, clear local mode bits" 123.Pq Xr tty 4 124.It "xs" Ta "num" Ta "0" Ta "if lp is a tty, set local mode bits" 125.Pq Xr tty 4 126.El 127.Pp 128If the local line printer driver supports indentation, the daemon 129must understand how to invoke it. 130.Sh FILTERS 131If a printer is specified via 132.Sy lp 133(either local or remote), 134the 135.Xr lpd 8 136daemon creates a pipeline of 137.Dq filters 138to process files for various printer types. 139The pipeline is not set up for remote printers specified via 140.Sy rm 141unless the local host is the same as the remote printer host given. 142The filters selected depend on the flags passed to 143.Xr lpr 1 . 144The pipeline set up is: 145.Bd -literal -offset indent 146p pr | if regular text + pr(1) 147none if regular text 148c cf cifplot 149d df DVI (tex) 150g gf plot(3) 151n nf ditroff 152f rf Fortran 153t tf troff 154v vf raster image 155.Ed 156.Pp 157The 158.Sy if 159filter is invoked with arguments: 160.Bd -filled -offset indent 161.Sy if 162.Op Fl c 163.Fl w Ns Ar width 164.Fl l Ns Ar length 165.Fl i Ns Ar indent 166.Fl n Ar login 167.Fl h Ar host acct-file 168.Ed 169.Pp 170The 171.Fl c 172flag is passed only if the 173.Fl l 174flag (pass control characters literally) is specified to 175.Xr lpr 1 . 176.Ar width 177and 178.Ar length 179specify the page width and length 180(from 181.Sy pw 182and 183.Sy 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 is passed from the 194.Sy af 195.Nm 196entry. 197.Pp 198If no 199.Sy if 200is specified, 201.Sy of 202is used instead, with the distinction that 203.Sy of 204is opened only once, while 205.Sy if 206is opened for every individual job. 207Thus, 208.Sy if 209is better suited to performing accounting. 210The 211.Sy of 212is only given the 213.Ar width 214and 215.Ar length 216flags. 217.Pp 218All other filters are called as: 219.Bd -filled -offset indent 220.Nm filter 221.Fl x Ns Ar width 222.Fl y Ns Ar length 223.Fl n Ar login 224.Fl h Ar host acct-file 225.Ed 226.Pp 227where 228.Ar width 229and 230.Ar length 231are represented in pixels, specified by the 232.Sy px 233and 234.Sy py 235entries, respectively. 236All filters take 237.Em stdin 238as the file, 239.Em stdout 240as the printer, 241may log either to 242.Em stderr 243or using 244.Xr syslog 3 , 245and must not ignore 246.Dv SIGINT . 247.Sh LOGGING 248Error messages generated by the line printer programs themselves 249are logged by 250.Xr syslog 3 251using the 252.Dv LPR 253facility. 254Messages printed on 255.Em stderr 256by the filters are sent to the corresponding 257.Sy lf 258file. 259The filters may, of course, use 260.Xr syslog 3 261themselves. 262.Pp 263Error messages sent to the console have a carriage return and a line 264feed appended to them, rather than just a line feed. 265.Sh SEE ALSO 266.Xr lpq 1 , 267.Xr lpr 1 , 268.Xr lprm 1 , 269.Xr termcap 5 , 270.Xr lpc 8 , 271.Xr lpd 8 , 272.Xr pac 8 273.Rs 274.%T "4.3 BSD Line Printer Spooler Manual" 275.Re 276.Sh HISTORY 277The 278.Nm 279file format appeared in 280.Bx 4.2 . 281