]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
c24d2134 | 2 | * "$Id: job.h 6755 2007-08-01 19:02:47Z mike $" |
ef416fc2 | 3 | * |
4 | * Print job definitions for the Common UNIX Printing System (CUPS) scheduler. | |
5 | * | |
bc44d920 | 6 | * Copyright 2007 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 */ | |
23 | priority; /* Job priority */ | |
bd7854cb | 24 | ipp_jstate_t state_value; /* Cached job-state */ |
09a101d6 | 25 | int pending_timeout;/* Non-zero if the job was created and waiting on files */ |
ef416fc2 | 26 | char *username; /* Printing user */ |
27 | char *dest; /* Destination printer or class */ | |
28 | cups_ptype_t dtype; /* Destination type (class/remote bits) */ | |
ef416fc2 | 29 | int num_files; /* Number of files in job */ |
ef416fc2 | 30 | mime_type_t **filetypes; /* File types */ |
31 | int *compressions; /* Compression status of each file */ | |
bd7854cb | 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) */ | |
bc44d920 | 37 | ipp_attribute_t *printer_message, |
38 | /* job-printer-state-message */ | |
39 | *printer_reasons; | |
40 | /* job-printer-state-reasons */ | |
bd7854cb | 41 | int current_file; /* Current file in job */ |
ef416fc2 | 42 | ipp_t *attrs; /* Job attributes */ |
ef416fc2 | 43 | int print_pipes[2], /* Print data pipes */ |
89d46774 | 44 | back_pipes[2], /* Backchannel pipes */ |
f7deaa1a | 45 | side_pipes[2], /* Sidechannel pipes */ |
89d46774 | 46 | status_pipes[2];/* Status pipes */ |
47 | cupsd_statbuf_t *status_buffer; /* Status buffer for this job */ | |
09a101d6 | 48 | int status_level; /* Highest log level in a status message */ |
ef416fc2 | 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 */ | |
09a101d6 | 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 */ | |
f7deaa1a | 59 | #ifdef HAVE_GSSAPI |
c24d2134 | 60 | krb5_ccache ccache; /* Kerberos credential cache */ |
f7deaa1a | 61 | char *ccname; /* KRB5CCNAME environment variable */ |
62 | #endif /* HAVE_GSSAPI */ | |
ef416fc2 | 63 | } cupsd_job_t; |
64 | ||
65 | ||
66 | /* | |
67 | * Globals... | |
68 | */ | |
69 | ||
70 | VAR int JobHistory VALUE(1); | |
71 | /* Preserve job history? */ | |
72 | VAR int JobFiles VALUE(0); | |
73 | /* Preserve job files? */ | |
74 | VAR int MaxJobs VALUE(0), | |
75 | /* Max number of jobs */ | |
76 | MaxActiveJobs VALUE(0), | |
77 | /* Max number of active jobs */ | |
78 | MaxJobsPerUser VALUE(0), | |
79 | /* Max jobs per user */ | |
80 | MaxJobsPerPrinter VALUE(0); | |
81 | /* Max jobs per printer */ | |
82 | VAR int JobAutoPurge VALUE(0); | |
83 | /* Automatically purge jobs */ | |
84 | VAR cups_array_t *Jobs VALUE(NULL), | |
85 | /* List of current jobs */ | |
86 | *ActiveJobs VALUE(NULL); | |
87 | /* List of active jobs */ | |
88 | VAR int NextJobId VALUE(1); | |
89 | /* Next job ID to use */ | |
90 | VAR int JobRetryLimit VALUE(5), | |
91 | /* Max number of tries */ | |
92 | JobRetryInterval VALUE(300); | |
93 | /* Seconds between retries */ | |
94 | ||
95 | ||
96 | /* | |
97 | * Prototypes... | |
98 | */ | |
99 | ||
100 | extern cupsd_job_t *cupsdAddJob(int priority, const char *dest); | |
07725fee | 101 | extern void cupsdCancelJob(cupsd_job_t *job, int purge, |
102 | ipp_jstate_t newstate); | |
ef416fc2 | 103 | extern void cupsdCancelJobs(const char *dest, const char *username, |
104 | int purge); | |
105 | extern void cupsdCheckJobs(void); | |
106 | extern void cupsdCleanJobs(void); | |
107 | extern void cupsdDeleteJob(cupsd_job_t *job); | |
108 | extern cupsd_job_t *cupsdFindJob(int id); | |
109 | extern void cupsdFinishJob(cupsd_job_t *job); | |
110 | extern void cupsdFreeAllJobs(void); | |
111 | extern int cupsdGetPrinterJobCount(const char *dest); | |
112 | extern int cupsdGetUserJobCount(const char *username); | |
113 | extern void cupsdHoldJob(cupsd_job_t *job); | |
114 | extern void cupsdLoadAllJobs(void); | |
bd7854cb | 115 | extern void cupsdLoadJob(cupsd_job_t *job); |
e53920b9 | 116 | extern void cupsdMoveJob(cupsd_job_t *job, cupsd_printer_t *p); |
ef416fc2 | 117 | extern void cupsdReleaseJob(cupsd_job_t *job); |
118 | extern void cupsdRestartJob(cupsd_job_t *job); | |
bd7854cb | 119 | extern void cupsdSaveAllJobs(void); |
ef416fc2 | 120 | extern void cupsdSaveJob(cupsd_job_t *job); |
121 | extern void cupsdSetJobHoldUntil(cupsd_job_t *job, const char *when); | |
122 | extern void cupsdSetJobPriority(cupsd_job_t *job, int priority); | |
d09495fa | 123 | extern void cupsdStopAllJobs(int force); |
ef416fc2 | 124 | extern void cupsdStopJob(cupsd_job_t *job, int force); |
09a101d6 | 125 | extern void cupsdTimeoutJob(cupsd_job_t *job); |
bc44d920 | 126 | extern void cupsdUnloadCompletedJobs(void); |
ef416fc2 | 127 | |
128 | ||
129 | /* | |
c24d2134 | 130 | * End of "$Id: job.h 6755 2007-08-01 19:02:47Z mike $". |
ef416fc2 | 131 | */ |