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.\" 34.Dd December 11, 1993 35.Dt PRINTCAP 5 36.Os BSD 4.2 37.Sh NAME 38.Nm printcap 39.Nd printer capability data base 40.Sh SYNOPSIS 41.Nm printcap 42.Sh DESCRIPTION 43The 44.Nm Printcap 45function 46is a simplified version of the 47.Xr termcap 5 48data base 49used to describe line printers. The spooling system accesses the 50.Nm printcap 51file every time it is used, allowing dynamic 52addition and deletion of printers. Each entry in the data base 53is used to describe one printer. This data base may not be 54substituted for, as is possible for 55.Xr termcap 5 , 56because it may allow accounting to be bypassed. 57.Pp 58The default printer is normally 59.Em lp , 60though the environment variable 61.Ev PRINTER 62may be used to override this. Each spooling utility supports an option, 63.Fl P Ar printer , 64to allow explicit naming of a destination printer. 65.Pp 66Refer to the 67.%T "4.3 BSD Line Printer Spooler Manual" 68for a complete discussion on how to setup the database for a given printer. 69.Sh CAPABILITIES 70Refer to 71.Xr termcap 5 72for a description of the file layout. 73.Bl -column Namexxx Typexx "/var/spool/lpdxxxxx" 74.Sy Name Type Description 75.It "af str" Ta Dv NULL Ta No "name of accounting file" 76.It "br num none if lp is a tty, set the baud rate" 77.Pf ( Xr ioctl 2 78call) 79.It "cf str" Ta Dv NULL Ta No "cifplot data filter" 80.It "df str" Ta Dv NULL Ta No "tex data filter" 81.Pf ( Tn DVI 82format) 83.Pq Pa sgtty.h 84.It "ff str" Ta So Li \ef Sc Ta No "string to send for a form feed" 85.It "fo bool false print a form feed when device is opened" 86.It "gf str" Ta Dv NULL Ta No "graph data filter" 87.Pf ( Xr plot 3 88format 89.It "hl bool false print the burst header page last" 90.It "ic bool false driver supports (non standard) ioctl to indent printout" 91.It "if str" Ta Dv NULL Ta No "name of text filter which does accounting" 92.It "lf str" Ta Pa /dev/console Ta No "error logging file name" 93.It "lo str" Ta Pa lock Ta No "name of lock file" 94.It "lp str" Ta Pa /dev/lp Ta No "device name to open for output" 95.It "ms str" Ta Dv NULL Ta No "if lp is a tty, a comma-seperated, " 96.Xr stty 1 97-like list describing the tty modes 98.It "mx num 1000 maximum file size (in" 99.Dv BUFSIZ 100blocks), zero = unlimited 101.It "nd str" Ta Dv NULL Ta No "next directory for list of queues (unimplemented)" 102.It "nf str" Ta Dv NULL Ta No "ditroff data filter (device independent troff)" 103.It "of str" Ta Dv NULL Ta No "name of output filtering program" 104.It "pc num 200 price per foot or page in hundredths of cents" 105.It "pl num 66 page length (in lines)" 106.It "pw num 132 page width (in characters)" 107.It "px num 0 page width in pixels (horizontal)" 108.It "py num 0 page length in pixels (vertical)" 109.It "rf str" Ta Dv NULL Ta No "filter for printing" 110.Tn FORTRAN 111style text files 112.It "rg str" Ta Dv NULL Ta No "restricted group. Only members of group allowed access" 113.It "rm str" Ta Dv NULL Ta No "machine name for remote printer" 114.It "rp str ``lp'' remote printer name argument" 115.It "rs bool false restrict remote users to those with local accounts" 116.It "rw bool false open the printer device for reading and writing" 117.It "sb bool false short banner (one line only)" 118.It "sc bool false suppress multiple copies" 119.It "sd str" Ta Pa /var/spool/lpd Ta No "spool directory" 120.It "sf bool false suppress form feeds" 121.It "sh bool false suppress printing of burst page header" 122.It "st str" Ta Pa status Ta No "status file name" 123.It "tf str" Ta Dv NULL Ta No "troff data filter (cat phototypesetter)" 124.It "tr str" Ta Dv NULL Ta No "trailer string to print when queue empties" 125.It "vf str" Ta Dv NULL Ta No "raster image filter" 126.El 127.Pp 128If the local line printer driver supports indentation, the daemon 129must understand how to invoke it. 130.Sh FILTERS 131The 132.Xr lpd 8 133daemon creates a pipeline of 134.Em filters 135to process files for various printer types. 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.Cm 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) 169is specified to 170.Xr lpr 1 . 171The 172.Ar Width 173function 174and 175.Ar length 176specify the page width and length 177(from 178.Cm pw 179and 180.Cm pl 181respectively) in characters. 182The 183.Fl n 184and 185.Fl h 186parameters specify the login name and host name of the owner 187of the job respectively. 188The 189.Ar Acct-file 190function 191is passed from the 192.Cm af 193.Nm printcap 194entry. 195.Pp 196If no 197.Cm if 198is specified, 199.Cm of 200is used instead, 201with the distinction that 202.Cm of 203is opened only once, 204while 205.Cm if 206is opened for every individual job. 207Thus, 208.Cm if 209is better suited to performing accounting. 210The 211.Cm of 212is only given the 213.Ar width 214and 215.Ar length 216flags. 217.Pp 218All other filters are called as: 219.Bd -filled -offset indent 220.Nm filter 221.Fl x Ns Ar width 222.Fl y Ns Ar length 223.Fl n Ar login 224.Fl h Ar host acct-file 225.Ed 226.Pp 227where 228.Ar width 229and 230.Ar length 231are represented in pixels, 232specified by the 233.Cm px 234and 235.Cm py 236entries respectively. 237.Pp 238All filters take 239.Em stdin 240as the file, 241.Em stdout 242as the printer, 243may log either to 244.Em stderr 245or using 246.Xr syslog 3 , 247and must not ignore 248.Dv SIGINT . 249.Sh LOGGING 250Error messages generated by the line printer programs themselves 251(that is, the 252.Xr lpd 8 253and related programs) 254are logged by 255.Xr syslog 3 256using the 257.Dv LPR 258facility. 259Messages printed on 260.Em stderr 261of one of the filters 262are sent to the corresponding 263.Cm lf 264file. 265The filters may, of course, use 266.Xr syslog 8 267themselves. 268.Pp 269Error messages sent to the console have a carriage return and a line 270feed appended to them, rather than just a line feed. 271.Sh SEE ALSO 272.Xr termcap 5 , 273.Xr lpc 8 , 274.Xr lpd 8 , 275.Xr pac 8 , 276.Xr lpr 1 , 277.Xr lpq 1 , 278.Xr lprm 1 279.Rs 280.%T "4.3 BSD Line Printer Spooler Manual" 281.Re 282.Sh HISTORY 283The 284.Nm 285file format appeared in 286.Bx 4.2 .. 287