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.
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. The following example is a numeric entry stating that this printer should run at 1200 baud:
:br#1200:
is a sample entry stating that the remote printer is named spinwriter.
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 RETURN/LINEFEED 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
lprq(1), lpr(1), lprrm(1), termcap(5), lprc(8), lpd(8), lpsrvr, lp, lpq, lprm, lpc
System and Network Administration