]> git.ipfire.org Git - thirdparty/cups.git/blame - scheduler/job.h
Load cups into easysw/current.
[thirdparty/cups.git] / scheduler / job.h
CommitLineData
ef416fc2 1/*
09a101d6 2 * "$Id: job.h 6593 2007-06-21 21:30:49Z mike $"
ef416fc2 3 *
4 * Print job definitions for the Common UNIX Printing System (CUPS) scheduler.
5 *
09a101d6 6 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
ef416fc2 7 *
8 * These coded instructions, statements, and computer programs are the
9 * property of Easy Software Products and are protected by Federal
10 * copyright law. Distribution and use rights are outlined in the file
11 * "LICENSE.txt" which should have been included with this file. If this
12 * file is missing or damaged please contact Easy Software Products
13 * at:
14 *
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
19 *
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
23 */
24
25/*
26 * Job request structure...
27 */
28
29typedef struct cupsd_job_s
30{
31 int id, /* Job ID */
32 priority; /* Job priority */
bd7854cb 33 ipp_jstate_t state_value; /* Cached job-state */
09a101d6 34 int pending_timeout;/* Non-zero if the job was created and waiting on files */
ef416fc2 35 char *username; /* Printing user */
36 char *dest; /* Destination printer or class */
37 cups_ptype_t dtype; /* Destination type (class/remote bits) */
ef416fc2 38 int num_files; /* Number of files in job */
ef416fc2 39 mime_type_t **filetypes; /* File types */
40 int *compressions; /* Compression status of each file */
bd7854cb 41 time_t access_time; /* Last access time */
42 ipp_attribute_t *sheets; /* job-media-sheets-completed */
43 time_t hold_until; /* Hold expiration date/time */
44 ipp_attribute_t *state; /* Job state */
45 ipp_attribute_t *job_sheets; /* Job sheets (NULL if none) */
46 int current_file; /* Current file in job */
ef416fc2 47 ipp_t *attrs; /* Job attributes */
ef416fc2 48 int print_pipes[2], /* Print data pipes */
89d46774 49 back_pipes[2], /* Backchannel pipes */
f7deaa1a 50 side_pipes[2], /* Sidechannel pipes */
89d46774 51 status_pipes[2];/* Status pipes */
52 cupsd_statbuf_t *status_buffer; /* Status buffer for this job */
09a101d6 53 int status_level; /* Highest log level in a status message */
ef416fc2 54 int cost; /* Filtering cost */
55 int filters[MAX_FILTERS + 1];
56 /* Filter process IDs, 0 terminated */
57 int backend; /* Backend process ID */
58 int status; /* Status code from filters */
59 cupsd_printer_t *printer; /* Printer this job is assigned to */
60 int tries; /* Number of tries for this job */
09a101d6 61 char *auth_username, /* AUTH_USERNAME environment variable, if any */
62 *auth_domain, /* AUTH_DOMAIN environment variable, if any */
63 *auth_password; /* AUTH_PASSWORD environment variable, if any */
f7deaa1a 64#ifdef HAVE_GSSAPI
65 char *ccname; /* KRB5CCNAME environment variable */
66#endif /* HAVE_GSSAPI */
ef416fc2 67} cupsd_job_t;
68
69
70/*
71 * Globals...
72 */
73
74VAR int JobHistory VALUE(1);
75 /* Preserve job history? */
76VAR int JobFiles VALUE(0);
77 /* Preserve job files? */
78VAR int MaxJobs VALUE(0),
79 /* Max number of jobs */
80 MaxActiveJobs VALUE(0),
81 /* Max number of active jobs */
82 MaxJobsPerUser VALUE(0),
83 /* Max jobs per user */
84 MaxJobsPerPrinter VALUE(0);
85 /* Max jobs per printer */
86VAR int JobAutoPurge VALUE(0);
87 /* Automatically purge jobs */
88VAR cups_array_t *Jobs VALUE(NULL),
89 /* List of current jobs */
90 *ActiveJobs VALUE(NULL);
91 /* List of active jobs */
92VAR int NextJobId VALUE(1);
93 /* Next job ID to use */
94VAR int JobRetryLimit VALUE(5),
95 /* Max number of tries */
96 JobRetryInterval VALUE(300);
97 /* Seconds between retries */
98
99
100/*
101 * Prototypes...
102 */
103
104extern cupsd_job_t *cupsdAddJob(int priority, const char *dest);
07725fee 105extern void cupsdCancelJob(cupsd_job_t *job, int purge,
106 ipp_jstate_t newstate);
ef416fc2 107extern void cupsdCancelJobs(const char *dest, const char *username,
108 int purge);
109extern void cupsdCheckJobs(void);
110extern void cupsdCleanJobs(void);
111extern void cupsdDeleteJob(cupsd_job_t *job);
112extern cupsd_job_t *cupsdFindJob(int id);
113extern void cupsdFinishJob(cupsd_job_t *job);
bd7854cb 114extern void cupsdUnloadCompletedJobs(void);
ef416fc2 115extern void cupsdFreeAllJobs(void);
116extern int cupsdGetPrinterJobCount(const char *dest);
117extern int cupsdGetUserJobCount(const char *username);
118extern void cupsdHoldJob(cupsd_job_t *job);
119extern void cupsdLoadAllJobs(void);
bd7854cb 120extern void cupsdLoadJob(cupsd_job_t *job);
e53920b9 121extern void cupsdMoveJob(cupsd_job_t *job, cupsd_printer_t *p);
ef416fc2 122extern void cupsdReleaseJob(cupsd_job_t *job);
123extern void cupsdRestartJob(cupsd_job_t *job);
bd7854cb 124extern void cupsdSaveAllJobs(void);
ef416fc2 125extern void cupsdSaveJob(cupsd_job_t *job);
126extern void cupsdSetJobHoldUntil(cupsd_job_t *job, const char *when);
127extern void cupsdSetJobPriority(cupsd_job_t *job, int priority);
d09495fa 128extern void cupsdStopAllJobs(int force);
ef416fc2 129extern void cupsdStopJob(cupsd_job_t *job, int force);
09a101d6 130extern void cupsdTimeoutJob(cupsd_job_t *job);
ef416fc2 131
132
133/*
09a101d6 134 * End of "$Id: job.h 6593 2007-06-21 21:30:49Z mike $".
ef416fc2 135 */