CAPS Universe documentation  1.0.4
All you need to know to be successful
Functions
page-loop.c File Reference

Function to loop over all pages of a document. More...

Functions

static bool caps_drv_all_pages_done (struct caps_drv *cdrv)
 
static int caps_drv_printer_state_loop (struct caps_drv *cdrv)
 
int caps_drv_page_loop (struct caps_drv *cdrv)
 

Detailed Description

Author
Jürgen Borleis
Warning
Use as experimental

Function Documentation

◆ caps_drv_all_pages_done()

static bool caps_drv_all_pages_done ( struct caps_drv cdrv)
static

Check if the whole document is done

Parameters
[in,out]cdrvAll required information about the current print job
Return values
trueAll pages are printed, job is done
falseStill pages to be printed

When quit signals a SIGTERM event, it returns true as well.

◆ caps_drv_printer_state_loop()

static int caps_drv_printer_state_loop ( struct caps_drv cdrv)
static

Handle printer states while printing

Parameters
[in,out]cdrvAll required information about the current print job
Return values
0Continue printing
-ENODEVPrinter device is gone, terminate
-EINVALFIXME

As long as we need to wait for a busy printer (due to an failure like out of paper), we mark the job as stopped as well.

◆ caps_drv_page_loop()

int caps_drv_page_loop ( struct caps_drv cdrv)

Loop over all pages to be print of the current document, deal with the printer and possible errors

Parameters
[in,out]cdrvAll required information about the current print job
Return values
-ENODEVTerminate whole driver (from caps_drv_printer_check())
-EINVALCancel current job (from caps_drv_printer_check())
-EBUSYBe patient, the driver is in an error state (paper jam, out of paper etc. from caps_drv_printer_check())
-EOFPremature end of document
-ENOTSUPA setting or some settings in pg aren't possible.
Note
job_data can be NULL for the special usecase of an injected job
We set the job's final state here to "aborted" if we receive a termination signal. Other routines do not need to do so.