Specifications

A-6
Guide to Printers and Printing
The %gq fetches the stored value of _Q from the internal variable q, and pushes it onto the
stack. The %{1} pushes another 1 onto the stack. The %= pops the top two values (two 1 s)
off the stack and, checking them for equality, succeeds; a 1 is pushed onto the stack. The
%t finds the 1 and so evaluates the %{2400}, which pushes 2400 onto the stack. The
calculation of wJ then falls through all but the last line of the remaining printer colon file
escape sequences defining wJ. The last escape sequence, %d, pops the top value, 2400,
off the stack and returns it, in ASCII format, to the in–progress calculation of wY.
The 2400 returned to the in–progress calculation of wY is the value of wJ, and is pushed
onto the stack. The %GwK in the else clause is skipped and the %; terminates the
if–then–else sequence. The %G_v fetches the line density (in lines per inch), 6, and pushes
it onto the stack. The %* pops the top two values (a 6 and a 2400) off the stack, multiplies
them together, and pushes the result (14400) back onto the stack. The %{300} pushes a
300 onto the stack. The %/ pops the top two values (a 14000 and a 300) off the stack,
divides the second value popped off the stack by the first value popped off the stack, and
pushes the result (48) onto the stack. The %d pops the top value (48) off the stack and
returns it to the in–progress calculation of wL.
The 48 returned to the in–progress calculation of wL is the value of _l. The value of wL was
originally referenced in the determination of the value of the ia attribute, the input
datastream pipeline for ASCII jobs. The number 48 replaces the %IwL in that determination,
so the value of the –! flag to pioformat becomes /usr/lib/lpd/pio/fmtrs/piof5202
–l48. The –l48 can be seen in the original diagnostic message from piobe that was the
basis of this discussion; it is part of the PIPELINE OF FILTERS section of the mail sent by
the qdaemon on behalf of piobe.
The calculation of the value associated with the –w flag to piof5202 is described in
Appendix B. Calculating Page Width Using Printer Colon File Escape Sequences on page
B-1.
The following ”Calculation of Page Length” figure depicts the stack operations (as described
above) used to obtain a final numeric value for page length in lines. The following numbered
steps correspond to the numbers on the left side of the columns in the figure, and provide a
step–by–step description of the evaluation of the printer colon file escape sequences
defining page length, in lines, for this particlular queue (asc), colon file, and command line.
Figure 6. Calculation of Page Length
1. %Cl – Pushes a 0 onto the stack because the l flag was not used on the command line.
2. %I_l – Calls for the evaluation of _l.
3. %G_z – Pushes a 1 onto the stack.
4. %{1} – Pushes a 1 onto the stack.