Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

lpq(1)

lpr(1)

lprm(1)

snap(1)

stty(1V)

plot(3X)

ttcompat(4M)

termcap(5)

lpc(8)

lpd(8)

pac(8)

PRINTCAP(5)  —  FILE FORMATS

NAME

printcap − printer capability data base

SYNOPSIS

/etc/printcap

DESCRIPTION

printcap is a simplified version of the termcap(5) data base for describing 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 describes 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 a −Pprinter option to explicitly name a destination printer. 

Refer to System and Network Administration for a discussion of how to set up the database for a given printer.  On Sun386i systems, refer to snap(1) for information on setting up printers with the system and network administration program. 

Each entry in the printcap file describes a printer, and is a line consisting of a number of fields separated by ‘:’ characters.  The first entry for each printer gives the names which are known for the printer, separated by ‘|’ characters.  The first name is conventionally a number.  The second name given is the most common abbreviation for the printer, and the last name given should be a long name fully identifying the printer.  The second name should contain no blanks; the last name may well contain blanks for readability.  Entries may continue onto multiple lines by giving a ‘\’ as the last character of a line, and empty fields may be included for readability. 

Capabilities in printcap are all introduced by two-character codes, and are of three types:

Boolean Capabilities that indicate that the printer has some particular feature.  Boolean capabilities are simply written between the ‘:’ characters, and are indicated by the word ‘bool’ in the type column of the capabilities table below. 

Numeric Capabilities that supply information such as baud-rates, number of lines per page, and so on.  Numeric capabilities are indicated by the word num in the type column of the capabilities table below.  Numeric capabilities are given by the two-character capability code followed by the ‘#’ character, followed by the numeric value.  For example:

 :br#1200: 

is a numeric entry stating that this printer should run at 1200 baud. 

String Capabilities that give a sequence which can be used to perform particular printer operations such as cursor motion.  String valued capabilities are indicated by the word str in the type column of the capabilities table below.  String valued capabilities are given by the two-character capability code followed by an ‘=’ sign and then a string ending at the next following ‘:’.  For example,

  :rp=spinwriter: 

is a sample entry stating that the remote printer is named spinwriter. 

Sun386i DESCRIPTION

On Sun386i systems, lpr(1) and related printing commands use the Yellow Pages name service to obtain the printcap entry for a named printer if the entry does not exist in the local /etc/printcap file.  For example, when a user issues the command

  lpr -Pnewprinter foo 

lpr searches /etc/printcap on the local system for an entry for newprinter.  If no local entry for newprinter exists, then lpr searches the YP map called printcap.  The search is invisible to the user. 

lpr creates the spooling directory for the printer automatically if no spooling directory exists. 

System administrators can make a printer available to the entire YP domain by placing an entry for that printer in the YP printcap map, typically using snap.  Otherwise, the system administrator must edit the /etc/printcap file on the YP master and then rebuild the YP map. 

CAPABILITIES

Name Type Default Description
af str NULL name of accounting file
br num none if lp is a tty, set the baud rate (ioctl call)
cf str NULL cifplot data filter
df str NULL TeX data filter (DVI format)
du str 0 User ID of user ‘daemon’.
fc num 0 if lp is a tty, clear flag bits
ff str “\f” string to send for a form feed
fo bool false print a form feed when device is opened
fs num 0 like ‘fc’ but set bits
gf str NULL graph data filter (plot(3X) format)
hl bool false print the burst header page last
ic bool false driver supports (non standard) ioctl to indent printout
if str NULL name of input/communication filter (created per job)
lf str “/dev/console” error logging file name
lo str “lock” name of lock file
lp str “/dev/lp” device name to open for output
mc num 0 maximum number of copies
ms str NULL list of terminal modes to set or clear
mx num 1000 maximum file size (in BUFSIZ blocks), zero = unlimited
nd str NULL next directory for list of queues (unimplemented)
nf str NULL ditroff data filter (device independent troff)
of str NULL name of output/banner filter (created once)
pc num 200 price per foot or page in hundredths of cents
pl num 66 page length (in lines)
pw num 132 page width (in characters)
px num 0 page width in pixels (horizontal)
py num 0 page length in pixels (vertical)
rf str NULL filter for printing FORTRAN style text files
rg str NULL restricted group. Only members of group allowed access
rm str NULL machine name for remote printer
rp str “lp” remote printer name argument
rs bool false restrict remote users to those with local accounts
rw bool false open printer device read/write instead of read-only
sb bool false short banner (one line only)
sc bool false suppress multiple copies
sd str “/var/spool/lpd” spool directory
sf bool false suppress form feeds
sh bool false suppress printing of burst page header
st str “status” status file name
tc str NULL name of similar printer; must be last
tf str NULL troff data filter (C/A/T phototypesetter)
tr str NULL trailer string to print when queue empties
vf str NULL raster image filter
xc num 0 if lp is a tty, clear local mode bits
xs num 0 like ‘xc’ but set bits

If the local line printer driver supports indentation, the daemon must understand how to invoke it. 

Note: the fs, fc, xs, and xc fields are flag masks rather than flag values. Certain default device flags are set when the device is opened by the line printer daemon if the device is connected to a terminal port. The flags indicated in the fc field are then cleared; the flags in the fs field are then set (or vice-versa, depending on the order of fc#nnnn and fs#nnnn in the /etc/printcap file).  The bits cleared by the fc field and set by the fs field are those in the sg_flags field of the sgtty structure, as set by the TIOCSETP ioctl call, and the bits cleared by the xc field and set by the xs field are those in the “local flags” word, as set by the TIOCLSET ioctl call.  See ttcompat(4M) for a description of these flags.  For example, to set exactly the flags 06300 in the fs field, which specifies that the EVENP, ODDP, and XTABS modes are to be set, and all other flags are to be cleared, do:

:fc#0177777:fs#06300:

The same process applies to the xc and xs fields.  Alternatively, the ms field can be used to specify modes to be set and cleared.  These modes are specified as stty(1V) modes; any mode supported by stty may be specified, except for the baud rate which must be specified with the br field.  This permits modes not supported by the older terminal interface described in ttcompat(4M) to be set or cleared.  Thus, to set the terminal port to which the printer is attached to even parity, tab expansion, no newline to carriage-return/line-feed translation, and RTS/CTS flow control enabled, do:

:ms=evenp,-tabs,nl,crtscts:

On Sun386i systems, the tc field, as in the termcap(5) file, must appear last in the list of capabilities. It is recommended that each type of printer have a general entry describing common capabilities; then an individual printer can be defined with its particular capabilities plus a tc field that points to the general entry for that type of printer. 

FILES

/etc/printcap

SEE ALSO

lpq(1), lpr(1), lprm(1), snap(1), stty(1V), plot(3X), ttcompat(4M), termcap(5), lpc(8), lpd(8), pac(8)

System and Network Administration

Sun Release 4.0  —  Last change: 22 March 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026