From 16b4a5a77d3c8dc34fe630c86cf55964f7d2b797 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sat, 11 Mar 2023 13:43:54 -0500 Subject: [PATCH] Initial work on job processing improvement (Issue #266) --- pappl/job-accessors.c | 5 ++++- pappl/job-process.c | 28 ++++++++++++++++++++++++++++ pappl/job.h | 8 +++++++- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/pappl/job-accessors.c b/pappl/job-accessors.c index 5c3fbbdf..47eff143 100644 --- a/pappl/job-accessors.c +++ b/pappl/job-accessors.c @@ -42,7 +42,10 @@ static const char * const pappl_jreasons[] = "processing-to-stop-point", "queued-in-device", "warnings-detected", - "job-hold-until-specified" + "job-hold-until-specified", + "job-canceled-after-timeout", + "job-fetchable", + "job-suspended-for-approval" }; diff --git a/pappl/job-process.c b/pappl/job-process.c index 5d3a0e02..18bfd828 100644 --- a/pappl/job-process.c +++ b/pappl/job-process.c @@ -846,6 +846,34 @@ _papplJobProcessRaster( } +// +// 'pappJobStart()' - Resume processing of a job. +// + +void +pappJobStart(pappl_job_t *job, // I - Job + pappl_jreason_t remove) // I - Reasons to remove from "job-state-reasons" +{ + // TODO: Implement papplJobStart + (void)job; + (void)remove; +} + + +// +// 'pappJobStop()' - Temporarily stop processing of a job. +// + +void +pappJobStop(pappl_job_t *job, // I - Job + pappl_jreason_t add) // I - Reasons to add to "job-state-reasons" +{ + // TODO: Implement papplJobStop + (void)job; + (void)add; +} + + // // 'cups_cspace_string()' - Get a string corresponding to a cupsColorSpace enum value. // diff --git a/pappl/job.h b/pappl/job.h index c90f08e2..2a46be10 100644 --- a/pappl/job.h +++ b/pappl/job.h @@ -44,7 +44,11 @@ enum pappl_jreason_e // IPP "job-state-reasons" bit values PAPPL_JREASON_PROCESSING_TO_STOP_POINT = 0x00080000, // 'processing-to-stop-point' PAPPL_JREASON_QUEUED_IN_DEVICE = 0x00100000, // 'queued-in-device' PAPPL_JREASON_WARNINGS_DETECTED = 0x00200000, // 'warnings-detected' - PAPPL_JREASON_JOB_HOLD_UNTIL_SPECIFIED = 0x00400000 // 'job-hold-until-specified' + PAPPL_JREASON_JOB_HOLD_UNTIL_SPECIFIED = 0x00400000, // 'job-hold-until-specified' + PAPPL_JREASON_JOB_CANCELED_AFTER_TIMEOUT = 0x00800000,// 'job-canceled-after-timeout' + PAPPL_JREASON_JOB_FETCHABLE = 0x01000000, // 'job-fetchable' + PAPPL_JREASON_JOB_SUSPENDED_FOR_APPROVAL = 0x02000000 // 'job-suspended-for-approval' + }; typedef unsigned int pappl_jreason_t; // Bitfield for IPP "job-state-reasons" values @@ -92,6 +96,8 @@ extern void papplJobSetImpressions(pappl_job_t *job, int impressions) _PAPPL_PU extern void papplJobSetImpressionsCompleted(pappl_job_t *job, int add) _PAPPL_PUBLIC; extern void papplJobSetMessage(pappl_job_t *job, const char *message, ...) _PAPPL_PUBLIC _PAPPL_FORMAT(2,3); extern void papplJobSetReasons(pappl_job_t *job, pappl_jreason_t add, pappl_jreason_t remove) _PAPPL_PUBLIC; +extern void pappJobStart(pappl_job_t *job, pappl_jreason_t remove) _PAPPL_PUBLIC; +extern void pappJobStop(pappl_job_t *job, pappl_jreason_t add) _PAPPL_PUBLIC; # ifdef __cplusplus