1.\" $OpenBSD: printcap.5,v 1.24 2013/12/10 16:38:04 naddy 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: December 10 2013 $ 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 "ff" Ta "str" Ta So Li \ef Sc Ta "string to send for a form feed" 80.It "fo" Ta "bool" Ta "false" Ta "print a form feed when device is opened" 81.It "gf" Ta "str" Ta Dv NULL Ta "graph data filter" 82.Pf ( Xr plot 3 83format) 84.It "hl" Ta "bool" Ta "false" Ta "print the burst header page last" 85.It "ic" Ta "bool" Ta "false" Ta "supports non-standard ioctl to indent printout" 86.It "if" Ta "str" Ta Dv NULL Ta "name of text filter which does accounting" 87.It "lf" Ta "str" Ta Pa /dev/console Ta "error logging file name" 88.It "lo" Ta "str" Ta Pa lock Ta "name of lock file" 89.It "lp" Ta "str" Ta Pa /dev/lp Ta "local printer device, or port@host for remote" 90.It "mc" Ta "num" Ta "0" Ta "maximum number of copies allowed; 0=unlimited" 91.It "ms" Ta "str" Ta Dv NULL Ta "if lp is a tty, a comma-separated," 92.Xr stty 1 Ns -like 93list describing the tty modes 94.It "mx" Ta "num" Ta "0" Ta "max file size (in" 95.Dv BUFSIZ 96blocks); 0=unlimited 97.It "nd" Ta "str" Ta Dv NULL Ta "next directory for queues list (unimplemented)" 98.It "nf" Ta "str" Ta Dv NULL Ta "ditroff data filter (device independent troff)" 99.It "of" Ta "str" Ta Dv NULL Ta "name of output filtering program" 100.It "pc" Ta "num" Ta "200" Ta "price per foot or page in hundredths of cents" 101.It "pl" Ta "num" Ta "66" Ta "page length (in lines)" 102.It "pw" Ta "num" Ta "132" Ta "page width (in characters)" 103.It "px" Ta "num" Ta "0" Ta "page width in pixels (horizontal)" 104.It "py" Ta "num" Ta "0" Ta "page length in pixels (vertical)" 105.It "rf" Ta "str" Ta Dv NULL Ta "filter for printing FORTRAN style text files" 106.It "rg" Ta "str" Ta Dv NULL Ta "restricted group-only group members can access" 107.It "rm" Ta "str" Ta Dv NULL Ta "machine name for remote printer" 108.It "rp" Ta "str" Ta "``lp''" Ta "remote printer name argument" 109.It "rs" Ta "bool" Ta "false" Ta "remote users must have a local account" 110.It "rw" Ta "bool" Ta "false" Ta "open printer device for reading and writing" 111.It "sb" Ta "bool" Ta "false" Ta "short banner (one line only)" 112.It "sc" Ta "bool" Ta "false" Ta "suppress multiple copies" 113.It "sd" Ta "str" Ta Pa /var/spool/output Ta "spool directory" 114.It "sf" Ta "bool" Ta "false" Ta "suppress form feeds" 115.It "sh" Ta "bool" Ta "false" Ta "suppress printing of burst page header" 116.It "st" Ta "str" Ta Pa status Ta "status file name" 117.It "tf" Ta "str" Ta Dv NULL Ta "troff data filter (cat phototypesetter)" 118.It "tr" Ta "str" Ta Dv NULL Ta "trailer string to print when queue empties" 119.It "vf" Ta "str" Ta Dv NULL Ta "raster image filter" 120.El 121.Pp 122If the local line printer driver supports indentation, the daemon 123must understand how to invoke it. 124.Sh FILTERS 125If a printer is specified via 126.Sy lp 127(either local or remote), 128the 129.Xr lpd 8 130daemon creates a pipeline of 131.Dq filters 132to process files for various printer types. 133The pipeline is not set up for remote printers specified via 134.Sy rm 135unless the local host is the same as the remote printer host given. 136The filters selected depend on the flags passed to 137.Xr lpr 1 . 138The pipeline set up is: 139.Bd -literal -offset indent 140p pr | if regular text + pr(1) 141none if regular text 142c cf cifplot 143d df DVI (tex) 144g gf plot(3) 145n nf ditroff 146f rf Fortran 147t tf troff 148v vf raster image 149.Ed 150.Pp 151The 152.Sy if 153filter is invoked with arguments: 154.Bd -filled -offset indent 155.Sy if 156.Op Fl c 157.Fl w Ns Ar width 158.Fl l Ns Ar length 159.Fl i Ns Ar indent 160.Fl n Ar login 161.Fl h Ar host acct-file 162.Ed 163.Pp 164The 165.Fl c 166flag is passed only if the 167.Fl l 168flag (pass control characters literally) is specified to 169.Xr lpr 1 . 170.Ar width 171and 172.Ar length 173specify the page width and length 174(from 175.Sy pw 176and 177.Sy pl , 178respectively) in characters. 179The 180.Fl n 181and 182.Fl h 183parameters specify the login name and host name of the owner 184of the job, respectively. 185The 186.Ar acct-file 187function is passed from the 188.Sy af 189.Nm 190entry. 191.Pp 192If no 193.Sy if 194is specified, 195.Sy of 196is used instead, with the distinction that 197.Sy of 198is opened only once, while 199.Sy if 200is opened for every individual job. 201Thus, 202.Sy if 203is better suited to performing accounting. 204The 205.Sy of 206is only given the 207.Ar width 208and 209.Ar length 210flags. 211.Pp 212All other filters are called as: 213.Bd -filled -offset indent 214.Nm filter 215.Fl x Ns Ar width 216.Fl y Ns Ar length 217.Fl n Ar login 218.Fl h Ar host acct-file 219.Ed 220.Pp 221where 222.Ar width 223and 224.Ar length 225are represented in pixels, specified by the 226.Sy px 227and 228.Sy py 229entries, respectively. 230All filters take 231.Em stdin 232as the file, 233.Em stdout 234as the printer, 235may log either to 236.Em stderr 237or using 238.Xr syslog 3 , 239and must not ignore 240.Dv SIGINT . 241.Sh LOGGING 242Error messages generated by the line printer programs themselves 243are logged by 244.Xr syslog 3 245using the 246.Dv LPR 247facility. 248Messages printed on 249.Em stderr 250by the filters are sent to the corresponding 251.Sy lf 252file. 253The filters may, of course, use 254.Xr syslog 3 255themselves. 256.Pp 257Error messages sent to the console have a carriage return and a line 258feed appended to them, rather than just a line feed. 259.Sh SEE ALSO 260.Xr lpq 1 , 261.Xr lpr 1 , 262.Xr lprm 1 , 263.Xr termcap 5 , 264.Xr lpc 8 , 265.Xr lpd 8 , 266.Xr pac 8 267.Rs 268.%T "4.3 BSD Line Printer Spooler Manual" 269.Re 270.Sh HISTORY 271The 272.Nm 273file format appeared in 274.Bx 4.2 . 275