]> 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/*
e1d6a774 2 * "$Id: job.h 5305 2006-03-18 03:05:12Z 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 */
47 cupsd_statbuf_t *status_buffer; /* Status buffer for this job */
48 int print_pipes[2], /* Print data pipes */
49 back_pipes[2]; /* Backchannel pipes */
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 */
57} cupsd_job_t;
58
59
60/*
61 * Globals...
62 */
63
64VAR int JobHistory VALUE(1);
65 /* Preserve job history? */
66VAR int JobFiles VALUE(0);
67 /* Preserve job files? */
68VAR int MaxJobs VALUE(0),
69 /* Max number of jobs */
70 MaxActiveJobs VALUE(0),
71 /* Max number of active jobs */
72 MaxJobsPerUser VALUE(0),
73 /* Max jobs per user */
74 MaxJobsPerPrinter VALUE(0);
75 /* Max jobs per printer */
76VAR int JobAutoPurge VALUE(0);
77 /* Automatically purge jobs */
78VAR cups_array_t *Jobs VALUE(NULL),
79 /* List of current jobs */
80 *ActiveJobs VALUE(NULL);
81 /* List of active jobs */
82VAR int NextJobId VALUE(1);
83 /* Next job ID to use */
84VAR int JobRetryLimit VALUE(5),
85 /* Max number of tries */
86 JobRetryInterval VALUE(300);
87 /* Seconds between retries */
88
89
90/*
91 * Prototypes...
92 */
93
94extern cupsd_job_t *cupsdAddJob(int priority, const char *dest);
95extern void cupsdCancelJob(cupsd_job_t *job, int purge);
96extern void cupsdCancelJobs(const char *dest, const char *username,
97 int purge);
98extern void cupsdCheckJobs(void);
99extern void cupsdCleanJobs(void);
100extern void cupsdDeleteJob(cupsd_job_t *job);
101extern cupsd_job_t *cupsdFindJob(int id);
102extern void cupsdFinishJob(cupsd_job_t *job);
bd7854cb 103extern void cupsdUnloadCompletedJobs(void);
ef416fc2 104extern void cupsdFreeAllJobs(void);
105extern int cupsdGetPrinterJobCount(const char *dest);
106extern int cupsdGetUserJobCount(const char *username);
107extern void cupsdHoldJob(cupsd_job_t *job);
108extern void cupsdLoadAllJobs(void);
bd7854cb 109extern void cupsdLoadJob(cupsd_job_t *job);
ef416fc2 110extern void cupsdMoveJob(cupsd_job_t *job, const char *dest);
111extern void cupsdReleaseJob(cupsd_job_t *job);
112extern void cupsdRestartJob(cupsd_job_t *job);
bd7854cb 113extern void cupsdSaveAllJobs(void);
ef416fc2 114extern void cupsdSaveJob(cupsd_job_t *job);
115extern void cupsdSetJobHoldUntil(cupsd_job_t *job, const char *when);
116extern void cupsdSetJobPriority(cupsd_job_t *job, int priority);
ef416fc2 117extern void cupsdStopAllJobs(void);
118extern void cupsdStopJob(cupsd_job_t *job, int force);
119extern void cupsdUpdateJob(cupsd_job_t *job);
120
121
122/*
e1d6a774 123 * End of "$Id: job.h 5305 2006-03-18 03:05:12Z mike $".
ef416fc2 124 */