(v13) Configuration device
This page applies to Harlequin v13.1r0 and later; and to Harlequin Core but not Harlequin MultiRIP
A printer or typesetter using the Harlequin Core will either be processing a job or waiting for another job to arrive. While the Host Renderer is waiting for a job to arrive, it can also accept configuration commands.
The implementation of this uses the configuration device %config%
. This device controls the operation of the Harlequin Core; it supplies PostScript language text to the Harlequin Core that either configures the Harlequin Core, enquires about the state of the Harlequin Core, or sets up the Harlequin Core to process an incoming job. This chapter describes the mechanisms for performing this central role; details of the PostScript language that should be produced by the %config%
device can be found in the Extensions manual
or in example code.
The configuration device can also indicate that none of these are needed now. The Harlequin Core will use this idle time for tasks such as caching characters that may allow a future job to complete more quickly.
When the Harlequin Core is not processing a job, it iterates around the “server loop”, which is a section of PostScript language code that looks for and then processes a PDL file, and opens the %config%
configuration device. It then enters an inner loop performing a bytesavailable
test on the %config%
device, which results in a call to the bytes_file
routine of the config device type. When there are no bytes available (bytes_file
returns zero, which is passed on as the result of the bytesavailable
operator), the Harlequin Core may perform idle-time tasks for example, caching fonts or garbage collection.
When bytes become available, the Harlequin Core exits this inner loop and reads and executes PostScript language text from the device, closing the file when EOF
is reached. The PostScript language executed can do arbitrary tasks but should leave either false
or two file objects and true
on the operand stack when the end of file is reached.
If false
is on the top of the operand stack, the Harlequin Core continues to run round the server loop. false
should be returned when PostScript language text needs to be generated, perhaps for configuration or status enquiry, but there is no job to execute. device. Returning false
should not be used indicate there is nothing to do; use the bytesavailable
information to do that.
If true
is on the top of the operand stack, then a job is executed; the lower of the two file objects is used as the source (%stdin%
) of the job, and so must have been opened for reading, and the upper one as the standard output (%stdout%
) while the job is executing, and so must have been opened for writing. Using this mechanism, the Harlequin Core does not need to know where the job is coming from. If there are several possible sources for a job, the configuration device is responsible for polling the various sources, identifying the source of the next job, and supplying appropriate file objects to the Harlequin Core.
For more information see: (v13) Preboot device , (v13) Setting up the page device and (v13) Configuration device routines .