passthru Subroutine

Purpose

Passes through the input data stream without modification or formats the input data stream without assistance from the formatter driver.

Library

None (provided by the formatter).

Syntax

#include <piostruct.h>
int passthru ()

Description

The passthru subroutine is invoked by the formatter driver only if the setup subroutine returned a null pointer. If this is the case, the passthru subroutine is invoked (instead of the lineout subroutine) for one of the following reasons:

Even if the data is being passed through from input to output without modification, a formatter program is used to initialize the printer before printing the file and to restore it to a known state afterward. However, gathering accounting information for an unknown data stream being passed through is difficult, if not impossible.

The passthru subroutine can also be used to format the input data stream if no help from the formatter driver for vertical spacing is needed. For example, if the only formatting to be done is to add a carrier-return control character to each linefeed control character, the passthru subroutine provides this simple task. The passthru subroutine can also count line feeds and form feeds to keep track of the page count. These counts can then be reported to the log_pages status subroutine, which is provided by the spooler.

Return Values

A return value of 0 indicates a successful operation. If the passthru subroutine detects an error, it uses the piomsgout subroutine to issue an error message. It then invokes the pioexit subroutine with a value of PIOEXITBAD. Note that if the passthru subroutine calls the piocmdout subroutine or the piogetstr subroutine and either of these detects an error, then the subroutine that detects the error automatically issues its own error message and terminates the print job.