]>
git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/job.h
2 * "$Id: job.h 7883 2008-08-28 20:38:13Z mike $"
4 * Print job definitions for the Common UNIX Printing System (CUPS) scheduler.
6 * Copyright 2007-2009 by Apple Inc.
7 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
9 * These coded instructions, statements, and computer programs are the
10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
20 typedef enum cupsd_jobaction_e
/**** Actions for state changes ****/
22 CUPSD_JOB_DEFAULT
, /* Use default action */
23 CUPSD_JOB_FORCE
, /* Force the change */
24 CUPSD_JOB_PURGE
/* Force the change and purge */
29 * Job request structure...
32 typedef struct cupsd_job_s
35 priority
, /* Job priority */
36 dirty
; /* Do we need to write the "c" file? */
37 ipp_jstate_t state_value
; /* Cached job-state */
38 int pending_timeout
;/* Non-zero if the job was created and
40 char *username
; /* Printing user */
41 char *dest
; /* Destination printer or class */
42 cups_ptype_t dtype
; /* Destination type */
43 int num_files
; /* Number of files in job */
44 mime_type_t
**filetypes
; /* File types */
45 int *compressions
; /* Compression status of each file */
46 ipp_attribute_t
*sheets
; /* job-media-sheets-completed */
47 time_t access_time
, /* Last access time */
48 kill_time
, /* When to send SIGKILL */
49 hold_until
; /* Hold expiration date/time */
50 ipp_attribute_t
*state
; /* Job state */
51 ipp_attribute_t
*job_sheets
; /* Job sheets (NULL if none) */
52 ipp_attribute_t
*printer_message
,
53 /* job-printer-state-message */
55 /* job-printer-state-reasons */
56 int current_file
; /* Current file in job */
57 ipp_t
*attrs
; /* Job attributes */
58 int print_pipes
[2], /* Print data pipes */
59 back_pipes
[2], /* Backchannel pipes */
60 side_pipes
[2], /* Sidechannel pipes */
61 status_pipes
[2];/* Status pipes */
62 cupsd_statbuf_t
*status_buffer
; /* Status buffer for this job */
63 int status_level
; /* Highest log level in a status
65 int cost
; /* Filtering cost */
66 int filters
[MAX_FILTERS
+ 1];
67 /* Filter process IDs, 0 terminated */
68 int backend
; /* Backend process ID */
69 int status
; /* Status code from filters */
70 cupsd_printer_t
*printer
; /* Printer this job is assigned to */
71 int tries
; /* Number of tries for this job */
72 char *auth_username
, /* AUTH_USERNAME environment variable,
74 *auth_domain
, /* AUTH_DOMAIN environment variable,
76 *auth_password
; /* AUTH_PASSWORD environment variable,
78 void *profile
; /* Security profile */
79 int progress
; /* Printing progress */
81 krb5_ccache ccache
; /* Kerberos credential cache */
82 char *ccname
; /* KRB5CCNAME environment variable */
83 #endif /* HAVE_GSSAPI */
91 VAR
int JobHistory
VALUE(1);
92 /* Preserve job history? */
93 VAR
int JobFiles
VALUE(0);
94 /* Preserve job files? */
95 VAR
int MaxJobs
VALUE(0),
96 /* Max number of jobs */
97 MaxActiveJobs
VALUE(0),
98 /* Max number of active jobs */
99 MaxJobsPerUser
VALUE(0),
100 /* Max jobs per user */
101 MaxJobsPerPrinter
VALUE(0);
102 /* Max jobs per printer */
103 VAR
int JobAutoPurge
VALUE(0);
104 /* Automatically purge jobs */
105 VAR cups_array_t
*Jobs
VALUE(NULL
),
106 /* List of current jobs */
107 *ActiveJobs
VALUE(NULL
),
108 /* List of active jobs */
109 *PrintingJobs
VALUE(NULL
);
110 /* List of jobs that are printing */
111 VAR
int NextJobId
VALUE(1);
112 /* Next job ID to use */
113 VAR
int JobKillDelay
VALUE(DEFAULT_TIMEOUT
),
114 /* Delay before killing jobs */
115 JobRetryLimit
VALUE(5),
116 /* Max number of tries */
117 JobRetryInterval
VALUE(300);
118 /* Seconds between retries */
125 extern cupsd_job_t
*cupsdAddJob(int priority
, const char *dest
);
126 extern void cupsdCancelJobs(const char *dest
, const char *username
,
128 extern void cupsdCheckJobs(void);
129 extern void cupsdCleanJobs(void);
130 extern void cupsdContinueJob(cupsd_job_t
*job
);
131 extern void cupsdDeleteJob(cupsd_job_t
*job
,
132 cupsd_jobaction_t action
);
133 extern cupsd_job_t
*cupsdFindJob(int id
);
134 extern void cupsdFreeAllJobs(void);
135 extern int cupsdGetPrinterJobCount(const char *dest
);
136 extern int cupsdGetUserJobCount(const char *username
);
137 extern void cupsdLoadAllJobs(void);
138 extern int cupsdLoadJob(cupsd_job_t
*job
);
139 extern void cupsdMoveJob(cupsd_job_t
*job
, cupsd_printer_t
*p
);
140 extern void cupsdReleaseJob(cupsd_job_t
*job
);
141 extern void cupsdRestartJob(cupsd_job_t
*job
);
142 extern void cupsdSaveAllJobs(void);
143 extern void cupsdSaveJob(cupsd_job_t
*job
);
144 extern void cupsdSetJobHoldUntil(cupsd_job_t
*job
,
145 const char *when
, int update
);
146 extern void cupsdSetJobPriority(cupsd_job_t
*job
, int priority
);
147 extern void cupsdSetJobState(cupsd_job_t
*job
,
148 ipp_jstate_t newstate
,
149 cupsd_jobaction_t action
,
150 const char *message
, ...)
152 __attribute__ ((__format__ (__printf__
, 4, 5)))
153 #endif /* __GNUC__ */
155 extern void cupsdStopAllJobs(cupsd_jobaction_t action
,
157 extern int cupsdTimeoutJob(cupsd_job_t
*job
);
158 extern void cupsdUnloadCompletedJobs(void);
162 * End of "$Id: job.h 7883 2008-08-28 20:38:13Z mike $".