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

Technical Reference: Kernel and Subsystems, Volume 2

passthru Subroutine


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


None (provided by the formatter).


#include <piostruct.h>
int passthru ()


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.

Related Information

The lineout subroutine, piocmdout subroutine, pioexit subroutine, piogetstr subroutine, piomsgout subroutine, setup subroutine.

Adding a New Printer Type to Your System in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

Example of Print Formatter in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

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