]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
75bd9771 | 2 | * "$Id: job.h 7468 2008-04-18 18:31:59Z mike $" |
ef416fc2 | 3 | * |
4 | * Print job definitions for the Common UNIX Printing System (CUPS) scheduler. | |
5 | * | |
91c84a35 | 6 | * Copyright 2007-2008 by Apple Inc. |
09a101d6 | 7 | * Copyright 1997-2007 by Easy Software Products, all rights reserved. |
ef416fc2 | 8 | * |
9 | * These coded instructions, statements, and computer programs are the | |
bc44d920 | 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/". | |
ef416fc2 | 14 | */ |
15 | ||
16 | /* | |
17 | * Job request structure... | |
18 | */ | |
19 | ||
20 | typedef struct cupsd_job_s | |
21 | { | |
22 | int id, /* Job ID */ | |
3dfe78b3 MS |
23 | priority, /* Job priority */ |
24 | dirty; /* Do we need to write the "c" file? */ | |
bd7854cb | 25 | ipp_jstate_t state_value; /* Cached job-state */ |
09a101d6 | 26 | int pending_timeout;/* Non-zero if the job was created and waiting on files */ |
ef416fc2 | 27 | char *username; /* Printing user */ |
28 | char *dest; /* Destination printer or class */ | |
29 | cups_ptype_t dtype; /* Destination type (class/remote bits) */ | |
ef416fc2 | 30 | int num_files; /* Number of files in job */ |
ef416fc2 | 31 | mime_type_t **filetypes; /* File types */ |
32 | int *compressions; /* Compression status of each file */ | |
bd7854cb | 33 | time_t access_time; /* Last access time */ |
34 | ipp_attribute_t *sheets; /* job-media-sheets-completed */ | |
35 | time_t hold_until; /* Hold expiration date/time */ | |
36 | ipp_attribute_t *state; /* Job state */ | |
37 | ipp_attribute_t *job_sheets; /* Job sheets (NULL if none) */ | |
bc44d920 | 38 | ipp_attribute_t *printer_message, |
39 | /* job-printer-state-message */ | |
40 | *printer_reasons; | |
41 | /* job-printer-state-reasons */ | |
bd7854cb | 42 | int current_file; /* Current file in job */ |
ef416fc2 | 43 | ipp_t *attrs; /* Job attributes */ |
ef416fc2 | 44 | int print_pipes[2], /* Print data pipes */ |
89d46774 | 45 | back_pipes[2], /* Backchannel pipes */ |
f7deaa1a | 46 | side_pipes[2], /* Sidechannel pipes */ |
89d46774 | 47 | status_pipes[2];/* Status pipes */ |
48 | cupsd_statbuf_t *status_buffer; /* Status buffer for this job */ | |
09a101d6 | 49 | int status_level; /* Highest log level in a status message */ |
ef416fc2 | 50 | int cost; /* Filtering cost */ |
51 | int filters[MAX_FILTERS + 1]; | |
52 | /* Filter process IDs, 0 terminated */ | |
53 | int backend; /* Backend process ID */ | |
54 | int status; /* Status code from filters */ | |
55 | cupsd_printer_t *printer; /* Printer this job is assigned to */ | |
56 | int tries; /* Number of tries for this job */ | |
09a101d6 | 57 | char *auth_username, /* AUTH_USERNAME environment variable, if any */ |
58 | *auth_domain, /* AUTH_DOMAIN environment variable, if any */ | |
59 | *auth_password; /* AUTH_PASSWORD environment variable, if any */ | |
a4924f6c | 60 | void *profile; /* Security profile */ |
9a4f8274 | 61 | int progress; /* Printing progress */ |
f7deaa1a | 62 | #ifdef HAVE_GSSAPI |
c24d2134 | 63 | krb5_ccache ccache; /* Kerberos credential cache */ |
f7deaa1a | 64 | char *ccname; /* KRB5CCNAME environment variable */ |
65 | #endif /* HAVE_GSSAPI */ | |
ef416fc2 | 66 | } cupsd_job_t; |
67 | ||
68 | ||
69 | /* | |
70 | * Globals... | |
71 | */ | |
72 | ||
73 | VAR int JobHistory VALUE(1); | |
74 | /* Preserve job history? */ | |
75 | VAR int JobFiles VALUE(0); | |
76 | /* Preserve job files? */ | |
77 | VAR int MaxJobs VALUE(0), | |
78 | /* Max number of jobs */ | |
79 | MaxActiveJobs VALUE(0), | |
80 | /* Max number of active jobs */ | |
81 | MaxJobsPerUser VALUE(0), | |
82 | /* Max jobs per user */ | |
83 | MaxJobsPerPrinter VALUE(0); | |
84 | /* Max jobs per printer */ | |
85 | VAR int JobAutoPurge VALUE(0); | |
86 | /* Automatically purge jobs */ | |
87 | VAR cups_array_t *Jobs VALUE(NULL), | |
88 | /* List of current jobs */ | |
3dfe78b3 | 89 | *ActiveJobs VALUE(NULL), |
ef416fc2 | 90 | /* List of active jobs */ |
3dfe78b3 MS |
91 | *PrintingJobs VALUE(NULL); |
92 | /* List of jobs that are printing */ | |
ef416fc2 | 93 | VAR int NextJobId VALUE(1); |
94 | /* Next job ID to use */ | |
95 | VAR int JobRetryLimit VALUE(5), | |
96 | /* Max number of tries */ | |
97 | JobRetryInterval VALUE(300); | |
98 | /* Seconds between retries */ | |
99 | ||
100 | ||
101 | /* | |
102 | * Prototypes... | |
103 | */ | |
104 | ||
105 | extern cupsd_job_t *cupsdAddJob(int priority, const char *dest); | |
07725fee | 106 | extern void cupsdCancelJob(cupsd_job_t *job, int purge, |
107 | ipp_jstate_t newstate); | |
ef416fc2 | 108 | extern void cupsdCancelJobs(const char *dest, const char *username, |
109 | int purge); | |
110 | extern void cupsdCheckJobs(void); | |
111 | extern void cupsdCleanJobs(void); | |
112 | extern void cupsdDeleteJob(cupsd_job_t *job); | |
113 | extern cupsd_job_t *cupsdFindJob(int id); | |
114 | extern void cupsdFinishJob(cupsd_job_t *job); | |
115 | extern void cupsdFreeAllJobs(void); | |
116 | extern int cupsdGetPrinterJobCount(const char *dest); | |
117 | extern int cupsdGetUserJobCount(const char *username); | |
118 | extern void cupsdHoldJob(cupsd_job_t *job); | |
119 | extern void cupsdLoadAllJobs(void); | |
bd7854cb | 120 | extern void cupsdLoadJob(cupsd_job_t *job); |
e53920b9 | 121 | extern void cupsdMoveJob(cupsd_job_t *job, cupsd_printer_t *p); |
ef416fc2 | 122 | extern void cupsdReleaseJob(cupsd_job_t *job); |
123 | extern void cupsdRestartJob(cupsd_job_t *job); | |
bd7854cb | 124 | extern void cupsdSaveAllJobs(void); |
ef416fc2 | 125 | extern void cupsdSaveJob(cupsd_job_t *job); |
126 | extern void cupsdSetJobHoldUntil(cupsd_job_t *job, const char *when); | |
127 | extern void cupsdSetJobPriority(cupsd_job_t *job, int priority); | |
d09495fa | 128 | extern void cupsdStopAllJobs(int force); |
ef416fc2 | 129 | extern void cupsdStopJob(cupsd_job_t *job, int force); |
91c84a35 | 130 | extern int cupsdTimeoutJob(cupsd_job_t *job); |
bc44d920 | 131 | extern void cupsdUnloadCompletedJobs(void); |
ef416fc2 | 132 | |
133 | ||
134 | /* | |
75bd9771 | 135 | * End of "$Id: job.h 7468 2008-04-18 18:31:59Z mike $". |
ef416fc2 | 136 | */ |