User`s guide

4-159
Printer, Plotter, and Spooler Subsystem Programming
Modifying the mo Virtual Printer Attribute
All virtual printer definitions contain an attribute named mo. The mo attribute specifies the
command string to invoke the device driver interface program. The device driver interface
program is the last process in the input data stream processing pipeline and, in the case of
local spooler queues with piobe as the backend, is usually pioout. It is named the device
driver interface program because, as the last process in the pipeline, it generally opens the
device driver for writing and then writes the processed input data stream to the device
driver. See the Datastream Flow for Common Print Jobs figure, on page 3-13 and the
related text for additional information.
One of the useful features of the AIX spooler is that its design allows the root user to
replace pieces of the input data stream processing pipeline with user–written code. In this
article an example of redefining the mo attribute, whose default value is the full path of
pioout, to the full path of a user–written delivery program will be discussed. You may want
to see ”Overview of Backend Processing”, on page 3-12 .
Handling Unsupported, IP–Addressable Terminal Servers
Suppose that you have an IP–addressable terminal server attached to your Ethernet
network. The terminal server has some number of asynchronous ports to which you can
attach ASCII terminals, modems, printers, or other asynchronous devices. Further suppose
that the terminal server vendor supplied you with a program, named ts_print , that has
the following properties:
It will read from stdin.
It accepts a –A flag to specify an IP address.
It accepts a –P flag to specify a port number.
(Clearly this is not a particularly hypothetical scenario.)
To turn this into a specific example, suppose that you have an IBM 4029 LaserPrinter that
you want to attach to port 11 on the terminal server and that the terminal servers IP address
is 9.19.129.101. Your goal is have a queue on a print server to which users can submit
ASCII jobs and have them printed on the 4029 on the terminal server. Though you can use
ts_print from the command line, you would prefer to make use of the formatter filter’s
ability to perform extensive manipulation of both the printers mode and the input data
stream. Providing true serial access to the printer is also a goal.
There is more than one way to accomplish this goal. The easiest way involves making a
local ASCII queue on a normal file, instead of on a character–special file in the /dev
directory. After you create the queue and the associated virtual printer, you can modify the
virtual printer to use ts_print .
To begin the queue creation process, type the SMIT fast path smit mkquedev. A menu
similar to the following displays:
Add a Print Queue
Move cursor to desired item and press Enter. Use arrow keys to
scroll.
# ATTACHMENT TYPE DESCRIPTION
local Printer Attached to Local Host
remote Printer Attached to Remote Host
xstation Printer Attached to Xstation
ascii Printer Attached to ASCII Terminal
hpJetDirect Network Printer (HP JetDirect)
file File (in /dev directory)
other User Defined Backend