]>
git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/job.h
2 * "$Id: job.h 6655 2007-07-12 22:58:17Z mike $"
4 * Print job definitions for the Common UNIX Printing System (CUPS) scheduler.
6 * Copyright 2007 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/".
17 * Job request structure...
20 typedef struct cupsd_job_s
23 priority
; /* Job priority */
24 ipp_jstate_t state_value
; /* Cached job-state */
25 int pending_timeout
;/* Non-zero if the job was created and waiting on files */
26 char *username
; /* Printing user */
27 char *dest
; /* Destination printer or class */
28 cups_ptype_t dtype
; /* Destination type (class/remote bits) */
29 int num_files
; /* Number of files in job */
30 mime_type_t
**filetypes
; /* File types */
31 int *compressions
; /* Compression status of each file */
32 time_t access_time
; /* Last access time */
33 ipp_attribute_t
*sheets
; /* job-media-sheets-completed */
34 time_t hold_until
; /* Hold expiration date/time */
35 ipp_attribute_t
*state
; /* Job state */
36 ipp_attribute_t
*job_sheets
; /* Job sheets (NULL if none) */
37 ipp_attribute_t
*printer_message
,
38 /* job-printer-state-message */
40 /* job-printer-state-reasons */
41 int current_file
; /* Current file in job */
42 ipp_t
*attrs
; /* Job attributes */
43 int print_pipes
[2], /* Print data pipes */
44 back_pipes
[2], /* Backchannel pipes */
45 side_pipes
[2], /* Sidechannel pipes */
46 status_pipes
[2];/* Status pipes */
47 cupsd_statbuf_t
*status_buffer
; /* Status buffer for this job */
48 int status_level
; /* Highest log level in a status message */
49 int cost
; /* Filtering cost */
50 int filters
[MAX_FILTERS
+ 1];
51 /* Filter process IDs, 0 terminated */
52 int backend
; /* Backend process ID */
53 int status
; /* Status code from filters */
54 cupsd_printer_t
*printer
; /* Printer this job is assigned to */
55 int tries
; /* Number of tries for this job */
56 char *auth_username
, /* AUTH_USERNAME environment variable, if any */
57 *auth_domain
, /* AUTH_DOMAIN environment variable, if any */
58 *auth_password
; /* AUTH_PASSWORD environment variable, if any */
60 char *ccname
; /* KRB5CCNAME environment variable */
61 #endif /* HAVE_GSSAPI */
69 VAR
int JobHistory
VALUE(1);
70 /* Preserve job history? */
71 VAR
int JobFiles
VALUE(0);
72 /* Preserve job files? */
73 VAR
int MaxJobs
VALUE(0),
74 /* Max number of jobs */
75 MaxActiveJobs
VALUE(0),
76 /* Max number of active jobs */
77 MaxJobsPerUser
VALUE(0),
78 /* Max jobs per user */
79 MaxJobsPerPrinter
VALUE(0);
80 /* Max jobs per printer */
81 VAR
int JobAutoPurge
VALUE(0);
82 /* Automatically purge jobs */
83 VAR cups_array_t
*Jobs
VALUE(NULL
),
84 /* List of current jobs */
85 *ActiveJobs
VALUE(NULL
);
86 /* List of active jobs */
87 VAR
int NextJobId
VALUE(1);
88 /* Next job ID to use */
89 VAR
int JobRetryLimit
VALUE(5),
90 /* Max number of tries */
91 JobRetryInterval
VALUE(300);
92 /* Seconds between retries */
99 extern cupsd_job_t
*cupsdAddJob(int priority
, const char *dest
);
100 extern void cupsdCancelJob(cupsd_job_t
*job
, int purge
,
101 ipp_jstate_t newstate
);
102 extern void cupsdCancelJobs(const char *dest
, const char *username
,
104 extern void cupsdCheckJobs(void);
105 extern void cupsdCleanJobs(void);
106 extern void cupsdDeleteJob(cupsd_job_t
*job
);
107 extern cupsd_job_t
*cupsdFindJob(int id
);
108 extern void cupsdFinishJob(cupsd_job_t
*job
);
109 extern void cupsdFreeAllJobs(void);
110 extern int cupsdGetPrinterJobCount(const char *dest
);
111 extern int cupsdGetUserJobCount(const char *username
);
112 extern void cupsdHoldJob(cupsd_job_t
*job
);
113 extern void cupsdLoadAllJobs(void);
114 extern void cupsdLoadJob(cupsd_job_t
*job
);
115 extern void cupsdMoveJob(cupsd_job_t
*job
, cupsd_printer_t
*p
);
116 extern void cupsdReleaseJob(cupsd_job_t
*job
);
117 extern void cupsdRestartJob(cupsd_job_t
*job
);
118 extern void cupsdSaveAllJobs(void);
119 extern void cupsdSaveJob(cupsd_job_t
*job
);
120 extern void cupsdSetJobHoldUntil(cupsd_job_t
*job
, const char *when
);
121 extern void cupsdSetJobPriority(cupsd_job_t
*job
, int priority
);
122 extern void cupsdStopAllJobs(int force
);
123 extern void cupsdStopJob(cupsd_job_t
*job
, int force
);
124 extern void cupsdTimeoutJob(cupsd_job_t
*job
);
125 extern void cupsdUnloadCompletedJobs(void);
129 * End of "$Id: job.h 6655 2007-07-12 22:58:17Z mike $".