typedef enum cupsd_jobaction_e
{
CUPSD_JOB_DEFAULT,
CUPSD_JOB_FORCE,
CUPSD_JOB_PURGE
} cupsd_jobaction_t;
struct cupsd_job_s
{
int id,
priority,
dirty;
ipp_jstate_t state_value;
int pending_timeout;
char *username;
char *dest;
char *name;
int koctets;
cups_ptype_t dtype;
cupsd_printer_t *printer;
int num_files;
mime_type_t **filetypes;
int *compressions;
ipp_attribute_t *impressions,
*sheets;
time_t access_time,
cancel_time,
creation_time,
completed_time,
file_time,
history_time,
hold_until,
kill_time;
ipp_attribute_t *state;
ipp_attribute_t *reasons;
ipp_attribute_t *job_sheets;
ipp_attribute_t *printer_message,
*printer_reasons;
int current_file;
ipp_t *attrs;
int print_pipes[2],
back_pipes[2],
side_pipes[2],
status_pipes[2];
cupsd_statbuf_t *status_buffer;
int status_level;
int cost;
int pending_cost;
int filters[MAX_FILTERS + 1];
int backend;
int status;
int tries;
int completed;
int retry_as_raster;
char *auth_env[3],
*auth_uid;
void *profile,
*bprofile;
cups_array_t *history;
int progress;
int num_keywords;
cups_option_t *keywords;
};
typedef struct cupsd_joblog_s
{
time_t time;
char message[1];
} cupsd_joblog_t;
VAR int JobHistory VALUE(INT_MAX);
VAR int JobFiles VALUE(86400);
VAR time_t JobHistoryUpdate VALUE(0);
VAR int MaxJobs VALUE(0),
MaxActiveJobs VALUE(0),
MaxHoldTime VALUE(0),
MaxJobsPerUser VALUE(0),
MaxJobsPerPrinter VALUE(0),
MaxJobTime VALUE(3 * 60 * 60);
VAR int JobAutoPurge VALUE(0);
VAR cups_array_t *Jobs VALUE(NULL),
*ActiveJobs VALUE(NULL),
*PrintingJobs VALUE(NULL);
VAR int NextJobId VALUE(1);
VAR int JobKillDelay VALUE(DEFAULT_TIMEOUT),
JobRetryLimit VALUE(5),
JobRetryInterval VALUE(300);
extern cupsd_job_t *cupsdAddJob(int priority, const char *dest);
extern void cupsdCancelJobs(const char *dest, const char *username,
int purge);
extern void cupsdCheckJobs(void);
extern void cupsdCleanJobs(void);
extern void cupsdContinueJob(cupsd_job_t *job);
extern void cupsdDeleteJob(cupsd_job_t *job,
cupsd_jobaction_t action);
extern cupsd_job_t *cupsdFindJob(int id);
extern void cupsdFreeAllJobs(void);
extern cups_array_t *cupsdGetCompletedJobs(cupsd_printer_t *p);
extern int cupsdGetPrinterJobCount(const char *dest);
extern int cupsdGetUserJobCount(const char *username);
extern void cupsdLoadAllJobs(void);
extern int cupsdLoadJob(cupsd_job_t *job);
extern void cupsdMoveJob(cupsd_job_t *job, cupsd_printer_t *p);
extern void cupsdReleaseJob(cupsd_job_t *job);
extern void cupsdRestartJob(cupsd_job_t *job);
extern void cupsdSaveAllJobs(void);
extern void cupsdSaveJob(cupsd_job_t *job);
extern void cupsdSetJobHoldUntil(cupsd_job_t *job,
const char *when, int update);
extern void cupsdSetJobPriority(cupsd_job_t *job, int priority);
extern void cupsdSetJobState(cupsd_job_t *job,
ipp_jstate_t newstate,
cupsd_jobaction_t action,
const char *message, ...)
__attribute__((__format__(__printf__,
4, 5)));
extern void cupsdStopAllJobs(cupsd_jobaction_t action,
int kill_delay);
extern int cupsdTimeoutJob(cupsd_job_t *job);
extern void cupsdUnloadCompletedJobs(void);
extern void cupsdUpdateJobs(void);