PRINTCAP — File Formats
NAME
printcap − printer capability data base
SYNOPSIS
/etc/printcap
DESCRIPTION
Printcap is a simplified version of the termcap(5) data base used to describe line printers. The spooling system accesses the printcap file every time it is used, allowing dynamic addition and deletion of printers. Each entry in the data base is used to describe one printer. This data base may not be substituted for, as is possible for termcap, because it may allow accounting to be bypassed.
The default printer is normally lp, though the environment variable PRINTER may be used to override this. Each spooling utility supports an option, −Pprinter, to allow explicit naming of a destination printer.
Refer to the 4.3BSD Line Printer Spooler Manual for a complete discussion on how setup the database for a given printer.
CAPABILITIES
Refer to termcap(5) for a description of the file layout.
NameTypeDefault Description
afstrNULLname of accounting file
brnumnoneif lp is a tty, set the baud rate (ioctl call)
cfstrNULLcifplot data filter
dfstrNULLtex data filter (DVI format)
fcnum0if lp is a tty, clear flag bits (sgtty.h)
ffstr“\f”string to send for a form feed
foboolfalseprint a form feed when device is opened
fsnum0like ‘fc’ but set bits
gfstrNULLgraph data filter (plot (3X) format)
hlboolfalseprint the burst header page last
icboolfalsedriver supports (non standard) ioctl to indent printout
ifstrNULLname of text filter which does accounting
lfstr“/dev/console”error logging file name
lostr“lock”name of lock file
lpstr“/dev/lp”device name to open for output
mxnum1000maximum file size (in BUFSIZ blocks), zero = unlimited
ndstrNULLnext directory for list of queues (unimplemented)
nfstrNULLditroff data filter (device independent troff)
ofstrNULLname of output filtering program
pcnum200price per foot or page in hundredths of cents
plnum66page length (in lines)
pwnum132page width (in characters)
pxnum0page width in pixels (horizontal)
pynum0page length in pixels (vertical)
rfstrNULLfilter for printing FORTRAN style text files
rgstrNULLrestricted group. Only members of group allowed access
rmstrNULLmachine name for remote printer
rpstr“lp”remote printer name argument
rsboolfalserestrict remote users to those with local accounts
rwboolfalseopen the printer device for reading and writing
sbboolfalseshort banner (one line only)
scboolfalsesuppress multiple copies
sdstr“/usr/spool/lpd”spool directory
sfboolfalsesuppress form feeds
shboolfalsesuppress printing of burst page header
ststr“status”status file name
tfstrNULLtroff data filter (cat phototypesetter)
trstrNULLtrailer string to print when queue empties
vfstrNULLraster image filter
xcnum0if lp is a tty, clear local mode bits (tty (4))
xsnum0like ‘xc’ but set bits
If the local line printer driver supports indentation, the daemon must understand how to invoke it.
FILTERS
The lpd(8) daemon creates a pipeline of filters to process files for various printer types. The filters selected depend on the flags passed to lpr(1). The pipeline set up is:
−ppr | ifregular text + pr(1)
noneifregular text
−ccfcifplot
−ddfDVI (tex)
−ggfplot(3)
−nnfditroff
−frfFortran
−ttftroff
−vvfraster image
The if filter is invoked with arguments:
if [ −c ] −wwidth −llength −iindent −n login −h host acct-file
The −c flag is passed only if the −l flag (pass control characters literally) is specified to lpr. Width and length specify the page width and length (from pw and pl respectively) in characters. The −n and −h parameters specify the login name and host name of the owner of the job respectively. Acct-file is passed from the af printcap entry.
If no if is specified, of is used instead, with the distinction that of is opened only once, while if is opened for every individual job. Thus, if is better suited to performing accounting. The of is only given the width and length flags.
All other filters are called as:
filter −xwidth −ylength −n login −h host acct-file
where width and length are represented in pixels, specified by the px and py entries respectively.
All filters take stdin as the file, stdout as the printer, may log either to stderr or using syslog(3), and must not ignore SIGINT.
LOGGING
Error messages generated by the line printer programs themselves (that is, the lp∗ programs) are logged by syslog(3) using the LPR facility. Messages printed on stderr of one of the filters are sent to the corresponding lf file. The filters may, of course, use syslog themselves.
Error messages sent to the console have a carriage return and a line feed appended to them, rather than just a line feed.
SEE ALSO
termcap(5), lpc(8), lpd(8), pac(8), lpr(1), lpq(1), lprm(1)
4.3BSD Line Printer Spooler Manual
Sprite version 1.0 — May 14, 1986