npu Interface Scripts

Two standard npu interface scripts are supplied with the npu product: one interfaces to npu from the UNIX lp subsystem; the other from Reality. These standard interface scripts act as templates from which printer-specific scripts can be created by the Network Printer Administration utility.

UNIX lp

UNIX lp relies on the printer interface script to gather banner data and to print the requested number of print file copies.

The lp interface script performs the following functions:

  1. Gathers details of the printer name, user-id, job id, number of copies, the banner title and the names of the files to be printed.

  2. Assigns appropriate configuration options to variables for substitution on the npu command line.

  3. Produces a banner title from the banner data supplied as part of the configuration.

  4. For each file to be printed, produces the number of copies required and supplies the appropriate number of form-feeds to each copy.

  5. Pipes the data from step 3 and step 4 to npu. The variables assigned in step 2 form the command line options.

  6. For files that are inaccessible from the script (for example, no read permission), an error is written to the error log ? /usr/adm/RCS/NPU_ERROR_LOG.

  7. The npu exit code is returned to the lp subsystem. If a problem occurs during communication with the printer, npu will disable the printer within the lp sub-system.

Reality

The Reality interface script is called directly from the Reality spooler sub-system. This script is simpler in operation than the lp version, as the Reality spooler is responsible for supplying banner data and will supply the appropriate number of end-of-job form-feed characters for each individual print job.

The Reality interface script performs the following functions:

  1. Gathers details of the printer name, user-id, job id, number of copies, the banner title and the name of the file to print. The number of copies will always be 1 and the banner title string will be null.

  2. Assigns appropriate configuration parameters to variables for substitution on the npu command line.

  3. Calls npu with the file name supplied using the -f npu command line option. The variables supplied in step 2 above form the command line options to npu. The print file would normally be a named pipe. For printers specified in Reality to be permanent, this pipe will be kept permanently open.

  4. For files that are inaccessible from the script (for example, no read permission), an error is written to the error log ? /usr/adm/RCS/NPU_ERROR_LOG.

  5. The npu exit code is returned to the Reality spooler sub-system.