lp.cat(1M)


lp.cat, lp.set, lp.tell -- default printer filter used by interface programs

Synopsis

/usr/lib/lp/bin/lp.cat [ -r ] [ rate ]

/usr/lib/lp/bin/lp.set h_pitch v_pitch width length charset

/usr/lib/lp/bin/lp.tell printer

Description

lp.cat is the default printer filter called by the interface programs. lp.cat reads the file to be printed on its standard input and writes it to the device to be printed on.

lp.cat handles the following signals:

lp.cat will abort a printing job if it has to wait too long on output. The default maximum time to wait is calculated as twice the output buffer size (2 * 1024 bytes) divided by the smallest of the values of the transmission rate, print rate, or a rate specified as an argument (all rates in characters per second, CPS). A new maximum delay time may be defined by the argument rate provided that this increases the delay time. If rate is 0 then the delay allowed is effectively infinite.

The -r option is given, lp.cat reports the effective throughput in characters per second. This statistic is printed on the standard error after the transmission of every 1024 bytes.

Interface programs may call lp.set to set the character pitch (h_pitch), line pitch (v_pitch), page width, page length, and character set (charset) on the printer.

The default units are characters per inch for the character and line pitch, number of columns for width, and number of lines for length. Units may be stated explicitly by appending the values with ``c'' for centimeters, and ``i'' for inches.

If it cannot set a particular characteristic, lp.set exits with a value of 1 and prints a one letter character code followed by newline to the standard error. The character codes are shown in the following table:

Character code Printer characteristic not set
H character pitch
L page length
S character set
V line pitch
W page width

 Character code   Printer characteristic not set
 H                character pitch
 L                page length
 S                character set
 V                line pitch
 W                page width
Interface scripts can use lp.tell to forward descriptions of printer faults to the print service. lp.tell sends everything that it reads on its standard input to the print service. The print service forwards the message as an alert to the print administrator.

Files


/usr/lib/lp/bin/lp.cat
full pathname of lp.cat

/usr/lib/lp/bin/lp.set
full pathname of lp.set

/usr/lib/lp/bin/lp.tell
full pathname of lp.tell

/etc/lp/model

/etc/lp/interfaces
printer interface programs directories

Exit codes

The following table shows the possible exit values for lp.cat:

Exit value Reason
0 normal exit; no error
1 standard input not defined
2 standard output not defined
3 printer type (TERM) not defined or not in terminfo database
4 standard input and output are identical
5 write failed; printer may be off-line
6 excessive delay caused timeout; printer may be off-line
7 hangup (SIGHUP) detected; loss of carrier
8 termination (SIGINT or SIGQUIT), or pipe closed early (SIGPIPE)

 Exit value   Reason
 0            normal exit; no error
 1            standard input not defined
 2            standard output not defined
 3            printer type (TERM) not defined or not in terminfo
              database
 4            standard input and output are identical
 5            write failed; printer may be off-line
 6            excessive delay caused timeout; printer may be off-
              line
 7            hangup (SIGHUP) detected; loss of carrier
 8            termination (SIGINT or SIGQUIT), or pipe closed
              early (SIGPIPE)
lp.set returns 0 if successful; otherwise it returns 1 on error.

The next table shows the possible exit values for lp.tell:

Exit value Reason
0 normal exit; no error
1 cannot open message queue to the print service
90 cannot get printer name or key from print service
91 cannot send message to print service
92 cannot receive acknowledgment from print service
93 corrupted acknowledgment received from print service
94 print service reports message corrupted in transmission

 Exit value   Reason
 0            normal exit; no error
 1            cannot open message queue to the print service
 90           cannot get printer name or key from print service
 91           cannot send message to print service
 92           cannot receive acknowledgment from print service
 93           corrupted acknowledgment received from print service
 94           print service reports message corrupted in transmission

References

Intro(2), lp(1), signal(2), terminfo(4)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004