Functions to loop through a full print job.
More...
- Copyright
- GNU General Public License 2 or later
- Author
- Jürgen Borleis
- Warning
- Use as experimental
◆ caps_drv_job_process()
| static int caps_drv_job_process |
( |
struct caps_drv * |
cdrv | ) |
|
|
static |
- Return values
-
- Postcondition
- The state of the job must be one of the final states
◆ caps_drv_job_wait()
| static int caps_drv_job_wait |
( |
struct caps_drv * |
cdrv | ) |
|
|
static |
Wait for a new job and monitor the printer while waiting
- Parameters
-
| [in,out] | cdrv | All required information about the current print job |
- Return values
-
| 0 | A new job is available |
| -ENODEV | Printer device is gone |
- Precondition
- Function relies on the timeout of caps_pp_job_check()
◆ _job_attach()
Attach a new job to a rasterizer in libcapsraster and do error processing on demand
- Parameters
-
| [in,out] | cdrv | All required information about the current print job |
| [in] | fd | Opened filedescriptor to the document's content |
| [in] | ppd_options | Table with the corresponding PPD options (printer depended) |
| [in] | params | Printing parameter specific to this job (can be NULL) |
- Return values
-
| -EPERM | Printing prohibited (PDF has such a feature), job should be aborted |
| -ENOTSUP | Job format isn't supported, job should be aborted |
| -EINVAL | Job is somehow unprintable due to unexpected content, job should be aborted |
| -ENODATA | Job's MIME format failed to detect due to low on data, job should be aborted |
- Note
- Does not return in case of an unexpected return code from caps_rstr_job_attach()
The final states set here (if the job failed) are only set, if not already set by the called subroutines.
- Postcondition
- Final job state set in case of a failure.
◆ _job_print()
| static int _job_print |
( |
struct caps_drv * |
cdrv | ) |
|
|
static |
Process (e.g. print) the job and handle some error cases
- Parameters
-
| [in,out] | cdrv | All required information about the current print job |
- Return values
-
| -ENODEV | Printer device is gone, driver should terminate |
| -EBUSY | Printer is in an unknown state, driver should terminate |
| -EINVAL | Job is somehow unprintable due to processing issues, job should be aborted |
| -EOF | Job is somehow unprintable due to its content, job should be aborted |
Just log some more detailed error messages, if the job fails somehow. It is expected the subroutines have set a finale job state if an processing error occurred.
- Note
- Does not return in case of an unexpected return code
- Postcondition
- We do not touch the job's status here.
◆ caps_drv_jobs_loop()
| int caps_drv_jobs_loop |
( |
struct caps_drv * |
drvi, |
|
|
const char * |
filename, |
|
|
const char * |
params |
|
) |
| |
The function returns if:
- the program should terminate
- the printer is gone, e.g. the filedescriptor is invalid