]> 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/*
f7deaa1a 2 * "$Id: job.h 6170 2007-01-02 17:26:41Z mike $"
ef416fc2 3 *
4 * Print job definitions for the Common UNIX Printing System (CUPS) scheduler.
5 *
bd7854cb 6 * Copyright 1997-2006 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 */
ef416fc2 34 char *username; /* Printing user */
35 char *dest; /* Destination printer or class */
36 cups_ptype_t dtype; /* Destination type (class/remote bits) */
ef416fc2 37 int num_files; /* Number of files in job */
ef416fc2 38 mime_type_t **filetypes; /* File types */
39 int *compressions; /* Compression status of each file */
bd7854cb 40 time_t access_time; /* Last access time */
41 ipp_attribute_t *sheets; /* job-media-sheets-completed */
42 time_t hold_until; /* Hold expiration date/time */
43 ipp_attribute_t *state; /* Job state */
44 ipp_attribute_t *job_sheets; /* Job sheets (NULL if none) */
45 int current_file; /* Current file in job */
ef416fc2 46 ipp_t *attrs; /* Job attributes */
ef416fc2 47 int print_pipes[2], /* Print data pipes */
89d46774 48 back_pipes[2], /* Backchannel pipes */
f7deaa1a 49 side_pipes[2], /* Sidechannel pipes */
89d46774 50 status_pipes[2];/* Status pipes */
51 cupsd_statbuf_t *status_buffer; /* Status buffer for this job */
ef416fc2 52 int cost; /* Filtering cost */
53 int filters[MAX_FILTERS + 1];
54 /* Filter process IDs, 0 terminated */
55 int backend; /* Backend process ID */
56 int status; /* Status code from filters */
57 cupsd_printer_t *printer; /* Printer this job is assigned to */
58 int tries; /* Number of tries for this job */
f7deaa1a 59#ifdef HAVE_GSSAPI
60 char *ccname; /* KRB5CCNAME environment variable */
61#endif /* HAVE_GSSAPI */
ef416fc2 62} cupsd_job_t;
63
64
65/*
66 * Globals...
67 */
68
69VAR int JobHistory VALUE(1);
70 /* Preserve job history? */
71VAR int JobFiles VALUE(0);
72 /* Preserve job files? */
73VAR 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 */
81VAR int JobAutoPurge VALUE(0);
82 /* Automatically purge jobs */
83VAR cups_array_t *Jobs VALUE(NULL),
84 /* List of current jobs */
85 *ActiveJobs VALUE(NULL);
86 /* List of active jobs */
87VAR int NextJobId VALUE(1);
88 /* Next job ID to use */
89VAR int JobRetryLimit VALUE(5),
90 /* Max number of tries */
91 JobRetryInterval VALUE(300);
92 /* Seconds between retries */
93
94
95/*
96 * Prototypes...
97 */
98
99extern cupsd_job_t *cupsdAddJob(int priority, const char *dest);
07725fee 100extern void cupsdCancelJob(cupsd_job_t *job, int purge,
101 ipp_jstate_t newstate);
ef416fc2 102extern void cupsdCancelJobs(const char *dest, const char *username,
103 int purge);
104extern void cupsdCheckJobs(void);
105extern void cupsdCleanJobs(void);
106extern void cupsdDeleteJob(cupsd_job_t *job);
107extern cupsd_job_t *cupsdFindJob(int id);
108extern void cupsdFinishJob(cupsd_job_t *job);
bd7854cb 109extern void cupsdUnloadCompletedJobs(void);
ef416fc2 110extern void cupsdFreeAllJobs(void);
111extern int cupsdGetPrinterJobCount(const char *dest);
112extern int cupsdGetUserJobCount(const char *username);
113extern void cupsdHoldJob(cupsd_job_t *job);
114extern void cupsdLoadAllJobs(void);
bd7854cb 115extern void cupsdLoadJob(cupsd_job_t *job);
e53920b9 116extern void cupsdMoveJob(cupsd_job_t *job, cupsd_printer_t *p);
ef416fc2 117extern void cupsdReleaseJob(cupsd_job_t *job);
118extern void cupsdRestartJob(cupsd_job_t *job);
bd7854cb 119extern void cupsdSaveAllJobs(void);
ef416fc2 120extern void cupsdSaveJob(cupsd_job_t *job);
121extern void cupsdSetJobHoldUntil(cupsd_job_t *job, const char *when);
122extern void cupsdSetJobPriority(cupsd_job_t *job, int priority);
d09495fa 123extern void cupsdStopAllJobs(int force);
ef416fc2 124extern void cupsdStopJob(cupsd_job_t *job, int force);
125extern void cupsdUpdateJob(cupsd_job_t *job);
126
127
128/*
f7deaa1a 129 * End of "$Id: job.h 6170 2007-01-02 17:26:41Z mike $".
ef416fc2 130 */