This file is indexed.

/usr/share/doc/lprng-doc/LPRng-Reference-Multipart/printcapref.htm is in lprng-doc 3.8.A~rc2-3.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta name="generator" content=
  "HTML Tidy for HTML5 for Linux version 5.2.0">
  <title>Printcap Database</title>
  <meta name="GENERATOR" content=
  "Modular DocBook HTML Stylesheet Version 1.79">
  <link rel="HOME" title=" LPRng Reference Manual" href=
  "index.htm">
  <link rel="PREVIOUS" title="Serial Printers " href=
  "secserial.htm">
  <link rel="NEXT" title="Simple Client Printcap Entry " href=
  "simple.htm">
</head>
<body class="CHAPTER" bgcolor="#FFFFFF" text="#000000" link=
"#0000FF" vlink="#840084" alink="#0000FF">
  <div class="NAVHEADER">
    <table summary="Header navigation table" width="100%" border=
    "0" cellpadding="0" cellspacing="0">
      <tr>
        <th colspan="3" align="center">LPRng Reference Manual: 24
        Sep 2004 (For LPRng-3.8.28)</th>
      </tr>
      <tr>
        <td width="10%" align="left" valign="bottom"><a href=
        "secserial.htm" accesskey="P">Prev</a></td>
        <td width="80%" align="center" valign="bottom"></td>
        <td width="10%" align="right" valign="bottom"><a href=
        "simple.htm" accesskey="N">Next</a></td>
      </tr>
    </table>
    <hr align="left" width="100%">
  </div>
  <div class="CHAPTER">
    <h1><a name="PRINTCAPREF" id="PRINTCAPREF"></a>Chapter 12.
    Printcap Database</h1>
    <div class="TOC">
      <dl>
        <dt><b>Table of Contents</b></dt>
        <dt>12.1. <a href="printcapref.htm#PRINTCAPPARSE">The
        Printcap Parsing Rules</a></dt>
        <dt>12.2. <a href="simple.htm">Simple Client Printcap
        Entry</a></dt>
        <dt>12.3. <a href="cm.htm">Simple Server Printcap
        Example</a></dt>
        <dt>12.4. <a href="x5744.htm">Using :oh To Select Printcap
        Information</a></dt>
        <dt>12.5. <a href="x5770.htm">Using the Wildcard Printcap
        Entry</a></dt>
        <dt>12.6. <a href="x5782.htm">Enterprise Strength Printcap
        Example</a></dt>
        <dt>12.7. <a href="x5799.htm">Remote Printer Using
        RFC1179</a></dt>
        <dt>12.8. <a href="x5833.htm">Remote Printer Using Socket
        API</a></dt>
        <dt>12.9. <a href="x5860.htm">Parallel Printer</a></dt>
        <dt>12.10. <a href="serial.htm">Serial Printer</a></dt>
        <dt>12.11. <a href="lpdbounce.htm">Bounce Queue</a></dt>
        <dt>12.12. <a href="translateformat.htm">Job Format
        Translation</a></dt>
        <dt>12.13. <a href="destinations.htm">Dynamic
        Routing</a></dt>
        <dt>12.14. <a href="loadbalance.htm">Printer Load
        Balancing</a></dt>
        <dt>12.15. <a href="printcappath.htm">Locations of Printcap
        Files</a></dt>
        <dt>12.16. <a href="secoh.htm">Single Printcap File for
        Large Installation</a></dt>
        <dt>12.17. <a href="x6130.htm">Management Strategies for
        Large Installations</a></dt>
        <dt>12.18. <a href="secnis.htm">Using Programs To Get
        Printcap Information</a></dt>
        <dt>12.19. <a href="x6240.htm">Lexmark Printers</a></dt>
        <dt>12.20. <a href="p450.htm">Tektronix Phaser
        Printers</a></dt>
        <dt>12.21. <a href="x6254.htm">Duplex Printing</a></dt>
        <dt>12.22. <a href="x6275.htm">Solaris, Newsprint and
        FrameMaker</a></dt>
      </dl>
    </div>
    <p>As described in the <a href="tutorial.htm#OVERVIEW">Print
    Spooling Overview</a>, the heart of the <b class=
    "APPLICATION">LPRng</b> system is information in the <tt class=
    "FILENAME">printcap</tt> file. The printcap information
    specifies:</p>
    <ol type="1">
      <li>
        <p>The print queues available to users.</p>
      </li>
      <li>
        <p>How client programs communicate with the <b class=
        "APPLICATION">lpc</b> print server.</p>
      </li>
      <li>
        <p>The configuration, location, and other information for
        each print queue on the print server.</p>
      </li>
      <li>
        <p>How the <b class="APPLICATION">lpd</b> server processes
        jobs in each print queue.</p>
      </li>
    </ol>
    <p>In order to explain a complex subject, we will start with a
    set of simple printer configurations, and explain the purpose
    and effect of each entry in the printcap.</p>
    <p>For details about individual printcap options, see the
    <span class="CITEREFENTRY"><span class=
    "REFENTRYTITLE">printcap</span>(5)</span> man page from the
    <b class="APPLICATION">LPRng</b> distribution, or use the
    <a href="optionindex.htm">Index To All The Configuration and
    Printcap Options</a> to find a specific printcap option and its
    effects.</p>
    <div class="SECT1">
      <h1 class="SECT1"><a name="PRINTCAPPARSE" id=
      "PRINTCAPPARSE">12.1. The Printcap Parsing Rules</a></h1>
      <p>Options used:</p>
      <ul>
        <li>
          <p><tt class="LITERAL">client</tt> FLAG <span class=
          "emphasis"><i class="EMPHASIS">printcap entry valid only
          for client programs</i></span></p>
        </li>
        <li>
          <p><tt class="LITERAL">oh=</tt> <span class=
          "emphasis"><i class="EMPHASIS">hosts where printcap entry
          valid</i></span></p>
        </li>
        <li>
          <p><tt class="LITERAL">server</tt> <span class=
          "emphasis"><i class="EMPHASIS">printcap entry valid only
          for lpd server</i></span></p>
        </li>
        <li>
          <p><tt class="LITERAL">tc</tt> <span class=
          "emphasis"><i class="EMPHASIS">add named printcap entry
          contents</i></span></p>
        </li>
      </ul>
      <p>In this section, we will discuss the remaining tricky
      parts of the <b class="APPLICATION">LPRng</b> printcap
      database: combined client and server printcaps, host specific
      printcap entries, and the <tt class="LITERAL">tc</tt>
      <span class="emphasis"><i class="EMPHASIS">include</i></span>
      facility.</p>
      <p>The following is a complete description of how a printcap
      file is processed:</p>
      <ol type="1">
        <li>
          <p>When processing a printcap file, the <b class=
          "APPLICATION">LPRng</b> software reads and parses each
          entry individually. Leading whitespace is removed. Lines
          starting with <tt class="LITERAL">#</tt> and blank lines
          are ignored.</p>
        </li>
        <li>
          <p>Lines ending with <tt class="LITERAL">\</tt> will have
          the <tt class="LITERAL">\</tt> discarded, and all lines
          of a printcap entry are joined by removing the line
          separators (<tt class="LITERAL">\n</tt>) and replacing
          them with a space.</p>
        </li>
        <li>
          <p>The printcap entry is parsed, and the printcap name,
          aliases, and options are determined. Colons <tt class=
          "LITERAL">:</tt> act as option separators, and leading
          and trailing whitespaces are removed.</p>
        </li>
        <li>
          <p>Options are sorted and except for the <tt class=
          "LITERAL">tc=...</tt> option only the last option setting
          is retained.</p>
        </li>
        <li>
          <p>If an option value requires a colon, then the
          <tt class="LITERAL">\:</tt> or <tt class=
          "LITERAL">\072</tt>, the same escaped character value as
          used in the C, Perl, tcl, and other programming
          languages, can be used.</p>
        </li>
        <li>
          <p>Client programs will discard a printcap entry with a
          <tt class="LITERAL">server</tt> option and server
          programs will discard a printcap entry with a <tt class=
          "LITERAL">client</tt> options.</p>
        </li>
        <li>
          <p>The <tt class="LITERAL">oh</tt> (<span class=
          "emphasis"><i class="EMPHASIS">o</i></span>n this
          <span class="emphasis"><i class=
          "EMPHASIS">h</i></span>ost) 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 below).</p>
        </li>
        <li>
          <p>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 <tt class="LITERAL">tc</tt> entries which
          are combined.</p>
        </li>
        <li>
          <p>When a printcap entry is actually used, the printcap
          entries listed by the <tt class="LITERAL">tc</tt> 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 <tt class="LITERAL">tc</tt> included
          entries.</p>
        </li>
        <li>
          <p>Finally, each string printcap option with a
          <span class="emphasis"><i class="EMPHASIS">%X</i></span>
          value has <span class="emphasis"><i class=
          "EMPHASIS">%X</i></span> replaced by the following
          values. Unspecified values will not be modified.</p>
          <div class="INFORMALTABLE">
            <a name="AEN5426" id="AEN5426"></a>
            <table border="1" frame="border" rules="all" class=
            "CALSTABLE">
              <col>
              <col>
              <col>
              <thead>
                <tr>
                  <th>Key</th>
                  <th>Value</th>
                  <th>Purpose</th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td><tt class="LITERAL">%P</tt></td>
                  <td>printcap entry primary name</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td><tt class="LITERAL">%Q</tt></td>
                  <td>queue requested</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td><tt class="LITERAL">%h</tt></td>
                  <td>short host name (host)</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td><tt class="LITERAL">%H</tt></td>
                  <td>fully qualified host name
                  (host.dns.whatever)</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td><tt class="LITERAL">%R</tt></td>
                  <td>remote printer (rp value)</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td><tt class="LITERAL">%M</tt></td>
                  <td>remote host (rm value)</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td><tt class="LITERAL">%D</tt></td>
                  <td>date in YYYY-MM-DD format</td>
                  <td>&nbsp;</td>
                </tr>
              </tbody>
            </table>
          </div>
        </li>
        <li>
          <p>When parsing multiple printcap files, these are
          processed in order, and all of their printcap entries are
          combined according to the above procedures. The
          <tt class="LITERAL">tc</tt> resolution and <span class=
          "emphasis"><i class="EMPHASIS">%X</i></span> expansion is
          done after all the files have been processed.</p>
        </li>
      </ol>
      <p>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:</p>
      <div class="INFORMALEXAMPLE">
        <a name="AEN5467" id="AEN5467"></a>
        <pre class="SCREEN"># seen by both client and server
lp1:lp=lp@pr1:mx=100
lp1:sd=/usr/local/spool/lp1:mx=0
# seen only by client
lp2:lp=lp@pr2:client
# seen only by server
lp2:lp=/dev/lp:server</pre>
      </div>
      <ol type="1">
        <li>
          <p>Printcap entries with the same name are combined. The
          first printcap entry, <tt class="LITERAL">lp1</tt>, the
          information is seen by both client and server. The next
          printcap entry, with the same name <tt class=
          "LITERAL">lp1</tt>, 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 <tt class=
          "LITERAL">lp1</tt> printcap entries, both client and
          server will have:</p>
          <div class="INFORMALEXAMPLE">
            <a name="AEN5475" id="AEN5475"></a>
            <pre class="SCREEN">lp1:lp=lp@pr1
  :mx=0
  :sd=/usr/local/spool/lp1</pre>
          </div>
        </li>
        <li>
          <p>The <tt class="LITERAL">lp2</tt> has a client and
          server version. This is recommended when complex
          printcaps on multiple hosts and servers are used. Thus,
          the <b class="APPLICATION">LPRng</b> clients will
          see:</p>
          <div class="INFORMALEXAMPLE">
            <a name="AEN5481" id="AEN5481"></a>
            <pre class="SCREEN">lp1
  :lp=lp@pr1
  :mx=0
  :sd=/usr/local/spool/lp1
lp2
  :client
  :lp=lp@pr2</pre>
          </div>and the server will see:
          <div class="INFORMALEXAMPLE">
            <a name="AEN5483" id="AEN5483"></a>
            <pre class="SCREEN">lp1
  :lp=lp@pr1
  :mx=0
  :sd=/usr/local/spool/lp1
lp2
  :lp=/dev/lp
  :server</pre>
          </div>
        </li>
      </ol>
      <p>If you have multiple printers of the same type whose
      configuration is almost identical, then you can define a set
      of <span class="emphasis"><i class="EMPHASIS">tc</i></span>
      only printcap entries containing common information and use
      the <tt class="LITERAL">tc</tt> include facility.</p>
      <p>Printcap entry names may start with period (<tt class=
      "LITERAL">.</tt>), question mark (<tt class=
      "LITERAL">?</tt>), or exclamation mark (<tt class=
      "LITERAL">!</tt>), followed by one or more alphanumeric ,
      underscore (<tt class="LITERAL">_</tt>) or hyphen (<tt class=
      "LITERAL">-</tt>) 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 <tt class="LITERAL">tc</tt> include
      facility. For example:</p>
      <div class="INFORMALEXAMPLE">
        <a name="AEN5495" id="AEN5495"></a>
        <pre class="SCREEN">.hp:
  :sd=/usr/local/spool/%P
  :mx=0
hp1:tc=.hp,.filter
  :lp=lp@10.0.0.1
hp2:tc=.hp,.filter
  :lp=lp@10.0.0.2
.filter
  :filter=/usr/local/libexec/filters/ifhp</pre>
      </div>
      <ol type="1">
        <li>
          <p>The <tt class="FILENAME">.hp</tt> and <tt class=
          "FILENAME">.filter</tt> printcap entities are not spool
          queue definitions. After <tt class="LITERAL">tc</tt>
          include processing is completed, the printcap information
          would resemble:</p>
          <div class="INFORMALEXAMPLE">
            <a name="AEN5503" id="AEN5503"></a>
            <pre class="SCREEN">hp1
  :lp=lp@10.0.0.1
  :filter=/usr/local/libexec/filters/ifhp
  :mx=0
  :sd=/usr/local/spool/%P
hp2
  :lp=lp@10.0.0.2
  :filter=/usr/local/libexec/filters/ifhp
  :mx=0
  :sd=/usr/local/spool/%P</pre>
          </div>
        </li>
        <li>
          <p>The <tt class="LITERAL">%X</tt> processing will
          replace <tt class="LITERAL">%P</tt> with the printcap
          name, so we would have:</p>
          <div class="INFORMALEXAMPLE">
            <a name="AEN5509" id="AEN5509"></a>
            <pre class="SCREEN">hp1
  :lp=lp@10.0.0.1
  :filter=/usr/local/libexec/filters/ifhp
  :mx=0
  :sd=/usr/local/spool/hp1
hp2
  :lp=lp@10.0.0.2
  :filter=/usr/local/libexec/filters/ifhp
  :mx=0
  :sd=/usr/local/spool/hp2</pre>
          </div>
        </li>
      </ol>
    </div>
  </div>
  <div class="NAVFOOTER">
    <hr align="left" width="100%">
    <table summary="Footer navigation table" width="100%" border=
    "0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="33%" align="left" valign="top"><a href=
        "secserial.htm" accesskey="P">Prev</a></td>
        <td width="34%" align="center" valign="top"><a href=
        "index.htm" accesskey="H">Home</a></td>
        <td width="33%" align="right" valign="top"><a href=
        "simple.htm" accesskey="N">Next</a></td>
      </tr>
      <tr>
        <td width="33%" align="left" valign="top">Serial
        Printers</td>
        <td width="34%" align="center" valign="top">&nbsp;</td>
        <td width="33%" align="right" valign="top">Simple Client
        Printcap Entry</td>
      </tr>
    </table>
  </div>
  <p align="center"></p>
</body>
</html>