]> 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/*
2 * "$Id: job.h 4819 2005-11-04 18:39:32Z mike $"
3 *
4 * Print job definitions for the Common UNIX Printing System (CUPS) scheduler.
5 *
6 * Copyright 1997-2005 by Easy Software Products, all rights reserved.
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 */
33 ipp_attribute_t *state; /* Job state */
34 ipp_attribute_t *sheets; /* job-media-sheets-completed */
35 time_t hold_until; /* Hold expiration date/time */
36 char *username; /* Printing user */
37 char *dest; /* Destination printer or class */
38 cups_ptype_t dtype; /* Destination type (class/remote bits) */
39 ipp_attribute_t *job_sheets; /* Job sheets (NULL if none) */
40 int num_files; /* Number of files in job */
41 int current_file; /* Current file in job */
42 mime_type_t **filetypes; /* File types */
43 int *compressions; /* Compression status of each file */
44 ipp_t *attrs; /* Job attributes */
45 cupsd_statbuf_t *status_buffer; /* Status buffer for this job */
46 int print_pipes[2], /* Print data pipes */
47 back_pipes[2]; /* Backchannel pipes */
48 int cost; /* Filtering cost */
49 int filters[MAX_FILTERS + 1];
50 /* Filter process IDs, 0 terminated */
51 int backend; /* Backend process ID */
52 int status; /* Status code from filters */
53 cupsd_printer_t *printer; /* Printer this job is assigned to */
54 int tries; /* Number of tries for this job */
55} cupsd_job_t;
56
57
58/*
59 * Globals...
60 */
61
62VAR int JobHistory VALUE(1);
63 /* Preserve job history? */
64VAR int JobFiles VALUE(0);
65 /* Preserve job files? */
66VAR int MaxJobs VALUE(0),
67 /* Max number of jobs */
68 MaxActiveJobs VALUE(0),
69 /* Max number of active jobs */
70 MaxJobsPerUser VALUE(0),
71 /* Max jobs per user */
72 MaxJobsPerPrinter VALUE(0);
73 /* Max jobs per printer */
74VAR int JobAutoPurge VALUE(0);
75 /* Automatically purge jobs */
76VAR cups_array_t *Jobs VALUE(NULL),
77 /* List of current jobs */
78 *ActiveJobs VALUE(NULL);
79 /* List of active jobs */
80VAR int NextJobId VALUE(1);
81 /* Next job ID to use */
82VAR int JobRetryLimit VALUE(5),
83 /* Max number of tries */
84 JobRetryInterval VALUE(300);
85 /* Seconds between retries */
86
87
88/*
89 * Prototypes...
90 */
91
92extern cupsd_job_t *cupsdAddJob(int priority, const char *dest);
93extern void cupsdCancelJob(cupsd_job_t *job, int purge);
94extern void cupsdCancelJobs(const char *dest, const char *username,
95 int purge);
96extern void cupsdCheckJobs(void);
97extern void cupsdCleanJobs(void);
98extern void cupsdDeleteJob(cupsd_job_t *job);
99extern cupsd_job_t *cupsdFindJob(int id);
100extern void cupsdFinishJob(cupsd_job_t *job);
101extern void cupsdFreeAllJobs(void);
102extern int cupsdGetPrinterJobCount(const char *dest);
103extern int cupsdGetUserJobCount(const char *username);
104extern void cupsdHoldJob(cupsd_job_t *job);
105extern void cupsdLoadAllJobs(void);
106extern void cupsdMoveJob(cupsd_job_t *job, const char *dest);
107extern void cupsdReleaseJob(cupsd_job_t *job);
108extern void cupsdRestartJob(cupsd_job_t *job);
109extern void cupsdSaveJob(cupsd_job_t *job);
110extern void cupsdSetJobHoldUntil(cupsd_job_t *job, const char *when);
111extern void cupsdSetJobPriority(cupsd_job_t *job, int priority);
112extern void cupsdStartJob(cupsd_job_t *job, cupsd_printer_t *printer);
113extern void cupsdStopAllJobs(void);
114extern void cupsdStopJob(cupsd_job_t *job, int force);
115extern void cupsdUpdateJob(cupsd_job_t *job);
116
117
118/*
119 * End of "$Id: job.h 4819 2005-11-04 18:39:32Z mike $".
120 */