]> git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/job.h
Mirror 1.1.x changes.
[thirdparty/cups.git] / scheduler / job.h
1 /*
2 * "$Id: job.h,v 1.25.2.15 2004/08/23 18:01:56 mike Exp $"
3 *
4 * Print job definitions for the Common UNIX Printing System (CUPS) scheduler.
5 *
6 * Copyright 1997-2004 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 * Constants...
27 */
28
29 #define JOB_BUFFER_SIZE 1024 /* Bytes for job status buffer */
30
31
32 /*
33 * Job request structure...
34 */
35
36 typedef struct job_str
37 {
38 struct job_str *next; /* Next job in queue */
39 int id, /* Job ID */
40 priority; /* Job priority */
41 ipp_attribute_t *state; /* Job state */
42 ipp_attribute_t *sheets; /* job-media-sheets-completed */
43 time_t hold_until; /* Hold expiration date/time */
44 char *username; /* Printing user */
45 char *dest; /* Destination printer or class */
46 cups_ptype_t dtype; /* Destination type (class/remote bits) */
47 ipp_attribute_t *job_sheets; /* Job sheets (NULL if none) */
48 int num_files; /* Number of files in job */
49 int current_file; /* Current file in job */
50 mime_type_t **filetypes; /* File types */
51 int *compressions; /* Compression status of each file */
52 ipp_t *attrs; /* Job attributes */
53 cupsd_statbuf_t *status_buffer; /* Status buffer for this job */
54 int print_pipes[2], /* Print data pipes */
55 back_pipes[2]; /* Backchannel pipes */
56 int cost; /* Filtering cost */
57 int filters[MAX_FILTERS + 1];/* Filter process IDs, 0 terminated */
58 int backend; /* Backend process ID */
59 int status; /* Status code from filters */
60 printer_t *printer; /* Printer this job is assigned to */
61 int tries; /* Number of tries for this job */
62 } job_t;
63
64
65 /*
66 * Globals...
67 */
68
69 VAR int JobHistory VALUE(1); /* Preserve job history? */
70 VAR int JobFiles VALUE(0); /* Preserve job files? */
71 VAR int MaxJobs VALUE(0), /* Max number of jobs */
72 MaxActiveJobs VALUE(0), /* Max number of active jobs */
73 MaxJobsPerUser VALUE(0), /* Max jobs per user */
74 MaxJobsPerPrinter VALUE(0); /* Max jobs per printer */
75 VAR int JobAutoPurge VALUE(0); /* Automatically purge jobs */
76 VAR int NumJobs VALUE(0), /* Number of jobs in queue */
77 ActiveJobs VALUE(0); /* Number of active jobs */
78 VAR job_t *Jobs VALUE(NULL); /* List of current jobs */
79 VAR int NextJobId VALUE(1); /* Next job ID to use */
80 VAR int FaxRetryLimit VALUE(5), /* Max number of tries */
81 FaxRetryInterval VALUE(300); /* Seconds between retries */
82
83
84 /*
85 * Prototypes...
86 */
87
88 extern job_t *AddJob(int priority, const char *dest);
89 extern void CancelJob(int id, int purge);
90 extern void CancelJobs(const char *dest, const char *username, int purge);
91 extern void CheckJobs(void);
92 extern void CleanJobs(void);
93 extern void DeleteJob(int id);
94 extern job_t *FindJob(int id);
95 extern void FinishJob(job_t *job);
96 extern void FreeAllJobs(void);
97 extern int GetPrinterJobCount(const char *dest);
98 extern int GetUserJobCount(const char *username);
99 extern void HoldJob(int id);
100 extern void LoadAllJobs(void);
101 extern void MoveJob(int id, const char *dest);
102 extern void ReleaseJob(int id);
103 extern void RestartJob(int id);
104 extern void SaveJob(int id);
105 extern void SetJobHoldUntil(int id, const char *when);
106 extern void SetJobPriority(int id, int priority);
107 extern void StartJob(int id, printer_t *printer);
108 extern void StopAllJobs(void);
109 extern void StopJob(int id, int force);
110 extern void UpdateJob(job_t *job);
111
112
113 /*
114 * End of "$Id: job.h,v 1.25.2.15 2004/08/23 18:01:56 mike Exp $".
115 */