client FLAG printcap entry valid only for client
oh=hosts where printcap entry valid
serverprintcap entry valid only for lpd
named printcap entry contents
In this section, we will discuss the remaining tricky
parts of the LPRng printcap
database: combined client and server printcaps, host
specific printcap entries, and the tcinclude
The following is a complete description of how a
printcap file is processed:
When processing a printcap file, the LPRng software reads and parses each
entry individually. Leading whitespace is removed.
Lines starting with # and
blank lines are ignored.
Lines ending with \ will
have the \ discarded, and all
lines of a printcap entry are joined by removing the
line separators (\n) and
replacing them with a space.
The printcap entry is parsed, and the printcap name,
aliases, and options are determined. Colons : act as option separators, and leading
and trailing whitespaces are removed.
Options are sorted and except for the tc=... option only the last option
setting is retained.
If an option value requires a colon, then the \: or \072, the same escaped character value
as used in the C, Perl, tcl, and other programming
languages, can be used.
Client programs will discard a printcap entry with a
server option and server
programs will discard a printcap entry with a client options.
The oh (on this host)
option specifies a list of IP addresses and mask pairs
or glob strings which are used to determine if this
printcap entry is valid for this host (see discussion
After the above processing, if there is an existing
termcap entry with the same name, the two sets of
options are combined, with the last option setting
retained except for the tc
entries which are combined.
When a printcap entry is actually used, the printcap
entries listed by the tc
include option are extracted and combined in order.
This allows include entries to appear after the
referring printcap entry. Then printcap options will be
combined with the included ones. This has the effect
that the options specified in the printcap entry will
override the ones from the tc
Finally, each string printcap option with a %X value has %X replaced by the following values.
Unspecified values will not be modified.
short host name
host name (host.dns.whatever)
remote host (rm
When parsing multiple printcap files, these are
processed in order, and all of their printcap entries
are combined according to the above procedures. The tc resolution and %X expansion is done after all the files
have been processed.
The following examples show how to use the above rules
to your advantage. You can combine both client and server
printcap information in a single file as well as dividing a
printcap entry into several parts. Here is an example:
# seen by both client and server
# seen only by client
# seen only by server
Printcap entries with the same name are combined.
The first printcap entry, lp1,
the information is seen by both client and server. The
next printcap entry, with the same name lp1, will be combined with the first
one. The order of options is important - the entries
are scanned in order and an option will have the last
value set. Thus, after having read both the lp1 printcap entries, both client and
server will have:
The lp2 has a client and
server version. This is recommended when complex
printcaps on multiple hosts and servers are used. Thus,
the LPRng clients will
If you have multiple printers of the same type whose
configuration is almost identical, then you can define a
set of tc only printcap entries
containing common information and use the tc include facility.
Printcap entry names may start with period (.), question mark (?), or exclamation mark (!), followed by one or more alphanumeric ,
underscore (_) or hyphen (-) characters. Queue or printer names
start with an alphanumeric character. Printcap entries
whose names do not start with an alphanumeric character can
only be used as targets of the tc
include facility. For example: