[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Guide to Printers and Printing


How piobe Uses Printer Colon Files

piobe has the ability to generate diagnostic output. A specific example of this diagnostic output is used in the following discussion to examine the following:

This discussion is complex, and is intended for readers that need to understand printer colon file escape sequences at a low level, perhaps because they want to write their own colon file for a unique and unsupported printer. Before reading this discussion, you should be familiar with these topics:

The following command uses the -a1 flag/argument to request diagnostic data from the piobe backend. The remainder of the command specifies that the job be processed by the queue named asc, that three copies of the file named /etc/motd be printed in a 12-point Courier font rotated 90 degrees, that the job be pre-processed by the pr filter, and that any messages generated by the job should be mailed to the user that submitted the job.

qprt -a1 -Pasc -fp -z1 -p12 -scourier -C -N3 /etc/motd

Issuing this command results in mail similar to the following being sent to the user that issued the command:

Message from qdaemon:
=====> MESSAGE FROM PRINT JOB 31 (/etc/motd) <=====
0782-034 Below is the preview information requested with the -a1
flag.
         No files will be printed.

PRINTER:
[devices.cat,71,66;IBM 4029 LaserPrinter] (ASCII)

FLAG VALUES:
a=1, b=0, d=a, e=!, f=p, g=1, h=, i=0, j=1, l=48, p=12, q=, s=cou
rier, t=0,
u=1, v=6, w=128, x=2, y=!, z=1, A=1, B=nn, C=+, E=!, G=!, H=, I=,
 J=+, L=+,
N=3, O=3, P=ascx:lxx, Q=1, W=!, X=ISO8859-1, Z=+

PIPELINE OF FILTERS:
/usr/bin/pr
   -l48
   -w128  /etc/motd |
/usr/lib/lpd/pio/etc/pioformat
   -@/var/spool/lpd/pio/@local/ddi/ibm4029.asc.lp1.asc:lp1
   -!/usr/lib/lpd/pio/fmtrs/piof5202
   -l48
   -w128
   -p12
   -scourier
   -z1 

The mail specifies several items:

The flags values used on the command line, a1, Pasc, fp, z1, p12, scourier, C, and N3, can be seen in the section of the mail labeled FLAG VALUES.

Of more interest is the section of the mail labeled PIPELINE OF FILTERS. Here the pipeline of filters determined by piobe and constructed by the shell can be seen. The pr filter will pre-process the print job (/etc/motd) and send its output to pioformat, the device-independent formatter driver.

This is a good place to examine how piobe uses the virtual printer definition associated with the spooler queue named asc. The colon file (which contains the virtual printer definition for this queue) uses the attribute ia to specify the input data stream pipeline (the PIPELINE OF FILTERS section above) for ASCII jobs. The value of ia for this queue is:

%Ide/pioformat -@%Idd/%Imm -!%Idf/piof5202 -l%IwL -w%IwW
%f[begijpqstuvxyzEGIJLOQWXZ] %Uh

The lsvirprt command can be used to format ia so it reads as follows:

%Id         INCLUDE: (Directory Containing Miscellaneous Modules)
'/pioformat -@'
%Idd       INCLUDE: (Directory Containing Digested Data Base
Files)
'/'
%Imm     INCLUDE: (File Name Of (Digested) Data Base; Init. By
               "piodigest" (mt.md.mn.mq:mv))
' -!'
%Idf         INCLUDE: (Directory Containing Loadable Formatter
Routines)
'/piof5202 -l'
%IwL       INCLUDE: (Page Length In Chars, Using Length From Data
Base
               (used in pipelines))
' -w'
%IwW     INCLUDE: (Page Width In Characters, Using Width From
Data Base
               (used in pipelines))
' '
%f[begijpqstuvxyzEGIJLOQWXZ] For Each Flag x on Command
Line:"-xArgument" ->
                          OUTPUT
' '
%Uh    Indicate to piobe: Pass the Following Attributes to
subsequent
       printer commands

The %Id resolves to /usr/lib/lpd/pio/etc, the directory that contains miscellaneous modules. The '/pioformat -@' is appended, without the single quotes, to the previous string, becoming /usr/lib/lpd/pio/etc/pioformat, otherwise known as the full path name to the formatter driver. The -@ after pioformat is a flag to the pioformat command which, in this instance, specifies the full path name of the digested database file to be accessed.

The value of the -@ flag is specified by the concatenation of %Idd, '/', and %Imm. The value of %Idd is defined in the colon file as %I@5/ddi. The @5 is an automatic variable whose value is /var/spool/lpd/pio/@local, so %Idd resolves to /var/spool/lpd/pio/@local/ddi. The '/', without the single quotes, is appended to that path. %Imm is defined in the colon file as mt.md.mn.mq.mv, five other virtual printer attributes. These five attributes define:

These file virtual printer attributes are initialized by the piodigest command at the time the queue and virtual printer are created. The combination of the five is unique in the virtual printer database.

For this queue, the value of mt.md.mn.mq.mv is ibm4029.asc.lp1.asc.lp1. Thus the value of the -@ flag to pioformat becomes /var/spool/lpd/pio/@local/ddi/ibm4029.asc.lp1.asc.lp1, the full path of the digested database file defining the virtual printer associated with this queue (asc).

The '-!' is a second flag to pioformat, specifying the full path name of the device-dependent formatter to be loaded, linked, and driven at runtime by the formatter driver, pioformat. It is here that you can see how and where the runtime connection between these two modules occurs.

The value of the -! flag is specified by the concatenation of the remainder of the printer colon file escape sequences shown in the formatted form of the ia attribute, beginning with %Idf and '/piof5202 -l'.

The value of %Idf in defined in the colon file as %I@4/fmtrs. The @4 is an automatic variable whose value is /usr/lib/lpd/pio, so %Idf resolves to /usr/lib/lpd/pio/fmtrs. The 'piof5202 -l', without the single quotes, is appended to this string, so the value of the -! flag to this point becomes /usr/lib/lpd/pio/fmtrs/piof5202 -l. The -l is a flag to piof5202, the device-dependent formatter for an ASCII data stream on an IBM 4029 LaserPrinter, that specifies page width in characters.

The calculation of the argument to the -l flag, %IwL, is described in Calculating Page Length Using Printer Colon File Escape Sequences .


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]