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