1.\" $NetBSD: printcap.5,v 1.27 2012/04/22 10:18:47 wiz 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 April 5, 2012 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. 152The filters selected depend on the flags passed to 153.Xr lpr 1 . 154The pipeline set up is: 155.Bd -literal -offset indent 156p pr | if regular text + pr(1) 157none if regular text 158c cf cifplot 159d df DVI (tex) 160g gf plot(3) 161n nf ditroff 162o pf PostScript 163f rf Fortran 164t tf troff 165v vf raster image 166.Ed 167.Pp 168The 169.Sy if 170filter is invoked with arguments: 171.Bd -filled -offset indent 172.Cm if 173.Op Fl c 174.Fl w Ns Ar width 175.Fl l Ns Ar length 176.Fl i Ns Ar indent 177.Fl n Ar login 178.Op Fl j Ar jobname 179.Fl h Ar host acct-file 180.Ed 181.Pp 182The 183.Fl c 184flag is passed only if the 185.Fl l 186flag (pass control characters literally) 187is specified to 188.Xr lpr 1 . 189The 190.Ar width 191and 192.Ar length 193specify the page width and length 194(from 195.Cm pw 196and 197.Cm pl 198respectively) in characters. 199The 200.Fl n 201and 202.Fl h 203parameters specify the login name and host name of the owner 204of the job respectively. 205The 206.Fl j 207parameter is optional and specifies the name of the print 208job if available. 209The 210.Ar acct-file 211option is passed from the 212.Cm af 213.Nm printcap 214entry. 215.Pp 216If no 217.Cm if 218is specified, 219.Cm of 220is used instead, 221with the distinction that 222.Cm of 223is opened only once, 224while 225.Cm if 226is opened for every individual job. 227Thus, 228.Cm if 229is better suited to performing accounting. 230The 231.Cm of 232is only given the 233.Ar width 234and 235.Ar length 236flags. 237.Pp 238All other filters are called as: 239.Bd -filled -offset indent 240.Nm filter 241.Fl x Ns Ar width 242.Fl y Ns Ar length 243.Fl n Ar login 244.Op Fl j Ar jobname 245.Fl h Ar host acct-file 246.Ed 247.Pp 248where 249.Ar width 250and 251.Ar length 252are represented in pixels, 253specified by the 254.Cm px 255and 256.Cm py 257entries respectively. 258.Pp 259All filters take 260.Em stdin 261as the file, 262.Em stdout 263as the printer, 264may log either to 265.Em stderr 266or using 267.Xr syslog 3 , 268and must not ignore 269.Dv SIGINT . 270.Pp 271Filters can communicate errors to lpd by their exit code and by modifying 272the mode of the spool lock file as follows: 273.Bl -tag -width Exit-code -compact -offset indent 274.It Sy Exit code 275.Sy Description 276.It 0 277Success. 278.It 1 279An attempt is made to reprint the job and mail is sent if it fails. 280.It 2 281.Xr lpd 8 282silently discards the job. 283.It n 284.Xr lpd 8 285discards the job and mail is sent. 286.El 287.Bl -tag -width lockxmode -compact -offset indent 288.It Sy lock code 289.Sy Description 290.It u+x 291Stop printing and leave queue disabled (S_IXUSR). 292.It o+x 293Rebuild the queue (S_IXOTH). 294.El 295.Sh LOGGING 296Error messages generated by the line printer programs themselves 297(that is, the lp* programs) are logged by 298.Xr syslog 3 299using the 300.Dv LPR 301facility. 302Messages printed on 303.Em stderr 304of one of the filters are sent to the corresponding 305.Cm lf 306file. 307The filters may, of course, use 308.Xr syslog 3 309themselves. 310.Pp 311Error messages sent to the console have a carriage return and a line 312feed appended to them, rather than just a line feed. 313.Sh SEE ALSO 314.Xr lpq 1 , 315.Xr lpr 1 , 316.Xr lprm 1 , 317.Xr capfile 5 , 318.Xr lpc 8 , 319.Xr lpd 8 , 320.Xr pac 8 321.Rs 322.%T "4.3 BSD Line Printer Spooler Manual" 323.Re 324.Sh NOTES 325The 326.Sy sh 327flag is a function of the spooler with the locally attached printer, 328and so has no effect when used with 329.Sy rm . 330.Nx 331never adds a burst page when used as a remote spooler. 332To suppress the burst page for other systems or dedicated devices, 333refer to the documentation for those systems or devices. 334.Sh HISTORY 335The 336.Nm 337file format appeared in 338.Bx 4.2 . 339