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