User`s guide

4-33
Printer, Plotter, and Spooler Subsystem Programming
Understanding Backend Routines in libqb
This article defines the set of library routines that the backend should use to communicate
with the qdaemon process. These routines are in the /usr/lib/libqb.a library; they were
designed to make the task of writing a backend as easy as possible. These backend
routines are available using the ld or cc command–line option –lqb.
For information on using these routines with the backend, see ”Understanding the
Interaction between qdaemon and the Backend”, on page 4-28.
get_align() Returns TRUE or FALSE, telling whether an alignment form–feed
is to be printed. A form–feed is printed only when the printer has
been idle and is about to print a new job. The form–feed aligns the
paper to top–of–form and is helpful if someone moved the paper
while the printer was idle.
get_cmd_line() Returns a pointer to an array of characters containing the enq
command line as invoked by the user. The string returned does
not contain the name /usr/bin/enq, any of the file names
specified, or any options that were sent to the backend using the
enq –o option. For example, if the user enters the command line
enq –Plp0 –Bgn –o –i15 filename, the get_cmd_line
function returns the string –Plp0 –Bgn. This function is useful
when the backend needs to know the command line options a
user provided when the job was submitted.
get_copies() Returns the number of copies to be printed. Its return value is of
type int.
get_device_name() Returns a pointer to an array of characters containing the device
name.
get_feed() Returns the number of feed pages to be printed. Its return value is
of type unsigned int. Feed pages are blank pages printed only
when the printer has become idle. This makes it easier to tear off
paper from the printer.
get_from() Returns an array of characters containing the name of the person
who made the print request. The return value is of type char*.
get_header() Returns NEVER, ALWAYS, or GROUP (#include
<IN/backend.h>). Its return value is of type unsigned int. A
header is a page preceding a file that shows its title, date, its
recipient, and other information.
get_job_number() Returns job number of current print. Its return value is of type int.
get_mail_only() Returns TRUE if the user specifies mail–only.
get_qdate() Returns a string showing the date that the request was queued.
The return value is of type char*.
get_queue_name() Returns an array of characters containing the queue name.
get_title() Returns an array of characters containing the title of the job being
printed. The return value is of type char*.
get_trailer() Returns NEVER, ALWAYS, or GROUP. Its return value is of type
unsigned int. A trailer is a page following a file that gives the name
of the user of the output.
get_to() Returns an array of characters containing the name of the person
for whom the job is intended. The return value is of type char*.