1.\" Copyright (c) 1983, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)printcap.5 8.2 (Berkeley) 12/11/93 33.\" $Id: printcap.5,v 1.14 1998/06/10 12:34:26 phk Exp $ 34.\" 35.Dd December 11, 1993 36.Dt PRINTCAP 5 37.Os BSD 4.2 38.Sh NAME 39.Nm printcap 40.Nd printer capability data base 41.Sh SYNOPSIS 42.Nm printcap 43.Sh DESCRIPTION 44The 45.Nm Printcap 46function 47is a simplified version of the 48.Xr termcap 5 49data base 50used to describe line printers. The spooling system accesses the 51.Nm printcap 52file every time it is used, allowing dynamic 53addition and deletion of printers. Each entry in the data base 54is used to describe one printer. This data base may not be 55substituted for, as is possible for 56.Xr termcap 5 , 57because it may allow accounting to be bypassed. 58.Pp 59The default printer is normally 60.Em lp , 61though the environment variable 62.Ev PRINTER 63may be used to override this. Each spooling utility supports an option, 64.Fl P Ar printer , 65to allow explicit naming of a destination printer. 66.Pp 67Refer to the 68.%T "4.3 BSD Line Printer Spooler Manual" 69for a complete discussion on how to setup the database for a given printer. 70.Sh CAPABILITIES 71Refer to 72.Xr termcap 5 73for a description of the file layout. 74.Bl -column Namexxx Typexx "/var/spool/lpdxxxxx" 75.Sy Name Type Default Description 76.It "af str" Ta Dv NULL Ta No "name of accounting file" 77.It "br num none if lp is a tty, set the baud rate" 78.Pf ( Xr ioctl 2 79call) 80.It "cf str" Ta Dv NULL Ta No "cifplot data filter" 81.It "ct num 120 TCP connection timeout in seconds" 82.It "df str" Ta Dv NULL Ta No "tex data filter" 83.Pf ( Tn DVI 84format) 85.It "ff str" Ta So Li \ef Sc Ta No "string to send for a form feed" 86.It "fo bool false print a form feed when device is opened" 87.It "gf str" Ta Dv NULL Ta No "graph data filter" 88.Pf ( Xr plot 3 89format 90.It "hl bool false print the burst header page last" 91.It "ic bool false driver supports (non standard) ioctl to indent printout" 92.It "if str" Ta Dv NULL Ta No "name of text filter which does accounting" 93.It "lf str" Ta Pa /dev/console Ta No "error logging file name" 94.It "lo str" Ta Pa lock Ta No "name of lock file" 95.It "lp str" Ta Pa /dev/lp Ta No "device name to open for output" 96.It "ms str" Ta Dv NULL Ta No "if lp is a tty, a comma-separated, " 97.Xr stty 1 98-like list describing the tty modes 99.It "mx num 1000 maximum file size (in" 100.Dv BUFSIZ 101blocks), zero = unlimited 102.It "nd str" Ta Dv NULL Ta No "next directory for list of queues (unimplemented)" 103.It "nf str" Ta Dv NULL Ta No "ditroff data filter (device independent troff)" 104.It "of str" Ta Dv NULL Ta No "name of output filtering program" 105.It "pc num 200 price per foot or page in hundredths of cents" 106.It "pl num 66 page length (in lines)" 107.It "pw num 132 page width (in characters)" 108.It "px num 0 page width in pixels (horizontal)" 109.It "py num 0 page length in pixels (vertical)" 110.It "rf str" Ta Dv NULL Ta No "filter for printing" 111.Tn FORTRAN 112style text files 113.It "rg str" Ta Dv NULL Ta No "restricted group. Only members of group allowed access" 114.It "rm str" Ta Dv NULL Ta No "machine name for remote printer" 115.It "rp str ``lp'' remote printer name argument" 116.It "rs bool false restrict remote users to those with local accounts" 117.It "rw bool false open the printer device for reading and writing" 118.It "sb bool false short banner (one line only)" 119.It "sc bool false suppress multiple copies" 120.It "sd str" Ta Pa /var/spool/lpd Ta No "spool directory" 121.It "sf bool false suppress form feeds" 122.It "sh bool false suppress printing of burst page header" 123.It "st str" Ta Pa status Ta No "status file name" 124.It "tf str" Ta Dv NULL Ta No "troff data filter (cat phototypesetter)" 125.It "tr str" Ta Dv NULL Ta No "trailer string to print when queue empties" 126.It "vf str" Ta Dv NULL Ta No "raster image filter" 127.El 128.Pp 129Each two-letter capability has a human-readable alternate name. 130.Bl -column "Short form" "Long form" 131.Sy "Short form Long form" 132.It "af acct.file" 133.It "br tty.rate" 134.It "cf filt.cifplot" 135.It "ct remote.timeout" 136.It "df filt.dvi" 137.It "du daemon.user" 138.It "ff job.formfeed" 139.It "fo job.topofform" 140.It "gf filt.plot" 141.It "hl banner.last" 142.It "if filt.input" 143.It "lf spool.log" 144.It "lo spool.lock" 145.It "lp tty.device" 146.It "mc max.copies" 147.It "ms tty.mode" 148.It "mx max.blocks" 149.It "nf filt.ditroff" 150.It "of filt.output" 151.It "pc acct.price" 152.It "pl page.length" 153.It "pw page.width" 154.It "px page.pwidth" 155.It "py page.plength" 156.It "rf filt.fortran" 157.It "rg daemon.restrictgrp" 158.It "rm remote.host" 159.It "rp remote.queue" 160.It "rs daemon.restricted" 161.It "rw tty.rw" 162.It "sb banner.short" 163.It "sc job.no_copies" 164.It "sd spool.dir" 165.It "sf job.no_formfeed" 166.It "sh banner.disable" 167.It "st spool.status" 168.It "tr job.trailer" 169.It "vf filt.raster" 170.El 171.Pp 172If the local line printer driver supports indentation, the daemon 173must understand how to invoke it. 174.Sh FILTERS 175The 176.Xr lpd 8 177daemon creates a pipeline of 178.Em filters 179to process files for various printer types. 180The filters selected depend on the flags passed to 181.Xr lpr 1 . 182The pipeline set up is: 183.Bd -literal -offset indent 184p pr | if regular text + pr(1) 185none if regular text 186c cf cifplot 187d df DVI (tex) 188g gf plot(3) 189n nf ditroff 190f rf Fortran 191t tf troff 192v vf raster image 193.Ed 194.Pp 195The 196.Sy if 197filter is invoked with arguments: 198.Bd -filled -offset indent 199.Cm if 200.Op Fl c 201.Fl w Ns Ar width 202.Fl l Ns Ar length 203.Fl i Ns Ar indent 204.Fl n Ar login 205.Fl h Ar host acct-file 206.Ed 207.Pp 208The 209.Fl c 210flag is passed only if the 211.Fl l 212flag (pass control characters literally) 213is specified to 214.Xr lpr 1 . 215The 216.Ar Width 217function 218and 219.Ar length 220specify the page width and length 221(from 222.Cm pw 223and 224.Cm pl 225respectively) in characters. 226The 227.Fl n 228and 229.Fl h 230parameters specify the login name and host name of the owner 231of the job respectively. 232The 233.Ar Acct-file 234function 235is passed from the 236.Cm af 237.Nm printcap 238entry. 239.Pp 240If no 241.Cm if 242is specified, 243.Cm of 244is used instead, 245with the distinction that 246.Cm of 247is opened only once, 248while 249.Cm if 250is opened for every individual job. 251Thus, 252.Cm if 253is better suited to performing accounting. 254The 255.Cm of 256is only given the 257.Ar width 258and 259.Ar length 260flags. 261.Pp 262All other filters are called as: 263.Bd -filled -offset indent 264.Nm filter 265.Fl x Ns Ar width 266.Fl y Ns Ar length 267.Fl n Ar login 268.Fl h Ar host acct-file 269.Ed 270.Pp 271where 272.Ar width 273and 274.Ar length 275are represented in pixels, 276specified by the 277.Cm px 278and 279.Cm py 280entries respectively. 281.Pp 282All filters take 283.Em stdin 284as the file, 285.Em stdout 286as the printer, 287may log either to 288.Em stderr 289or using 290.Xr syslog 3 , 291and must not ignore 292.Dv SIGINT . 293.Sh REMOTE PRINTING 294When printing to a remote printer using 295.Cm rm , 296it is possible to use either 297.Cm if 298or 299.Cm of . 300If both are specified, 301.Cm of 302is ignored. Both filters behave the same except that they are passed 303different arguments as above. Specifically, the output filter is 304terminated and restarted for each file transmitted. This is necessary 305in order to pass the resulting size to the remote 306.Xr lpd 8 . 307.Pp 308If the 309.Fl p 310flag was passed to 311.Xr lpr 1 , 312.Xr pr 1 313is not executed locally, but is requested of the remote 314.Xr lpd 8 . 315Any input filtering via 316.Cm if 317will therefore happen before 318.Xr pr 1 319is executed rather than afterwards. 320.Pp 321If 322.Cm lp 323is specified as 324.Em port Ns No @ Ns Em machine 325(and 326.Cm rm 327is not in use), printing will be send directly to the given 328.Em port 329on the given 330.Em machine . 331.Sh LOGGING 332Error messages generated by the line printer programs themselves 333(that is, the 334.Xr lpd 8 335and related programs) 336are logged by 337.Xr syslog 3 338using the 339.Dv LPR 340facility. 341Messages printed on 342.Em stderr 343of one of the filters 344are sent to the corresponding 345.Cm lf 346file. 347The filters may, of course, use 348.Xr syslog 8 349themselves. 350.Pp 351Error messages sent to the console have a carriage return and a line 352feed appended to them, rather than just a line feed. 353.Sh SEE ALSO 354.Xr lpq 1 , 355.Xr lpr 1 , 356.Xr lprm 1 , 357.Xr hosts.lpd 5 , 358.Xr termcap 5 , 359.Xr lpc 8 , 360.Xr lpd 8 , 361.Xr pac 8 362.Rs 363.%T "4.3 BSD Line Printer Spooler Manual" 364.Re 365.Sh HISTORY 366The 367.Nm 368file format appeared in 369.Bx 4.2 . 370