]>
Commit | Line | Data |
---|---|---|
2d7cba2b | 1 | /* |
bcd9e019 | 2 | * "$Id: job.h,v 1.25.2.15 2004/08/23 18:01:56 mike Exp $" |
2d7cba2b | 3 | * |
cbbfcc63 | 4 | * Print job definitions for the Common UNIX Printing System (CUPS) scheduler. |
2d7cba2b | 5 | * |
9639c4de | 6 | * Copyright 1997-2004 by Easy Software Products, all rights reserved. |
2d7cba2b | 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 | |
8784b6a6 | 17 | * 44141 Airport View Drive, Suite 204 |
bcd9e019 | 18 | * Hollywood, Maryland 20636 USA |
2d7cba2b | 19 | * |
9639c4de | 20 | * Voice: (301) 373-9600 |
2d7cba2b | 21 | * EMail: cups-info@cups.org |
22 | * WWW: http://www.cups.org | |
2d7cba2b | 23 | */ |
24 | ||
db911fcb | 25 | /* |
26 | * Constants... | |
27 | */ | |
28 | ||
29 | #define JOB_BUFFER_SIZE 1024 /* Bytes for job status buffer */ | |
30 | ||
31 | ||
a9de544f | 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 */ | |
a74b005d | 40 | priority; /* Job priority */ |
1049abbe | 41 | ipp_attribute_t *state; /* Job state */ |
aa0cb334 | 42 | ipp_attribute_t *sheets; /* job-media-sheets-completed */ |
05ca02bc | 43 | time_t hold_until; /* Hold expiration date/time */ |
36992080 | 44 | char *username; /* Printing user */ |
45 | char *dest; /* Destination printer or class */ | |
93894a43 | 46 | cups_ptype_t dtype; /* Destination type (class/remote bits) */ |
a3e17a89 | 47 | ipp_attribute_t *job_sheets; /* Job sheets (NULL if none) */ |
bd84e0d1 | 48 | int num_files; /* Number of files in job */ |
49 | int current_file; /* Current file in job */ | |
50 | mime_type_t **filetypes; /* File types */ | |
d59a189c | 51 | int *compressions; /* Compression status of each file */ |
93894a43 | 52 | ipp_t *attrs; /* Job attributes */ |
294f4cee | 53 | cupsd_statbuf_t *status_buffer; /* Status buffer for this job */ |
a2fc3d31 | 54 | int print_pipes[2], /* Print data pipes */ |
55 | back_pipes[2]; /* Backchannel pipes */ | |
8239f206 | 56 | int cost; /* Filtering cost */ |
a2fc3d31 | 57 | int filters[MAX_FILTERS + 1];/* Filter process IDs, 0 terminated */ |
58 | int backend; /* Backend process ID */ | |
553ce970 | 59 | int status; /* Status code from filters */ |
a9de544f | 60 | printer_t *printer; /* Printer this job is assigned to */ |
53510eae | 61 | int tries; /* Number of tries for this job */ |
a9de544f | 62 | } job_t; |
63 | ||
64 | ||
65 | /* | |
66 | * Globals... | |
67 | */ | |
68 | ||
bd84e0d1 | 69 | VAR int JobHistory VALUE(1); /* Preserve job history? */ |
70 | VAR int JobFiles VALUE(0); /* Preserve job files? */ | |
7b1b1c6e | 71 | VAR int MaxJobs VALUE(0), /* Max number of jobs */ |
99de6da0 | 72 | MaxActiveJobs VALUE(0), /* Max number of active jobs */ |
7b1b1c6e | 73 | MaxJobsPerUser VALUE(0), /* Max jobs per user */ |
74 | MaxJobsPerPrinter VALUE(0); /* Max jobs per printer */ | |
d7845573 | 75 | VAR int JobAutoPurge VALUE(0); /* Automatically purge jobs */ |
99de6da0 | 76 | VAR int NumJobs VALUE(0), /* Number of jobs in queue */ |
77 | ActiveJobs VALUE(0); /* Number of active jobs */ | |
a9de544f | 78 | VAR job_t *Jobs VALUE(NULL); /* List of current jobs */ |
79 | VAR int NextJobId VALUE(1); /* Next job ID to use */ | |
53510eae | 80 | VAR int FaxRetryLimit VALUE(5), /* Max number of tries */ |
81 | FaxRetryInterval VALUE(300); /* Seconds between retries */ | |
a9de544f | 82 | |
bd84e0d1 | 83 | |
a9de544f | 84 | /* |
85 | * Prototypes... | |
2d7cba2b | 86 | */ |
87 | ||
bd84e0d1 | 88 | extern job_t *AddJob(int priority, const char *dest); |
d65c1374 | 89 | extern void CancelJob(int id, int purge); |
dd9e85de | 90 | extern void CancelJobs(const char *dest, const char *username, int purge); |
a9de544f | 91 | extern void CheckJobs(void); |
d7845573 | 92 | extern void CleanJobs(void); |
a9de544f | 93 | extern void DeleteJob(int id); |
94 | extern job_t *FindJob(int id); | |
017c50f3 | 95 | extern void FinishJob(job_t *job); |
5fe35f41 | 96 | extern void FreeAllJobs(void); |
7b1b1c6e | 97 | extern int GetPrinterJobCount(const char *dest); |
98 | extern int GetUserJobCount(const char *username); | |
bd84e0d1 | 99 | extern void HoldJob(int id); |
100 | extern void LoadAllJobs(void); | |
bd84e0d1 | 101 | extern void MoveJob(int id, const char *dest); |
f63a2256 | 102 | extern void ReleaseJob(int id); |
bd84e0d1 | 103 | extern void RestartJob(int id); |
104 | extern void SaveJob(int id); | |
e583bc2d | 105 | extern void SetJobHoldUntil(int id, const char *when); |
9cbd98eb | 106 | extern void SetJobPriority(int id, int priority); |
a9de544f | 107 | extern void StartJob(int id, printer_t *printer); |
bd84e0d1 | 108 | extern void StopAllJobs(void); |
db911fcb | 109 | extern void StopJob(int id, int force); |
6abc7437 | 110 | extern void UpdateJob(job_t *job); |
1049abbe | 111 | |
2d7cba2b | 112 | |
113 | /* | |
bcd9e019 | 114 | * End of "$Id: job.h,v 1.25.2.15 2004/08/23 18:01:56 mike Exp $". |
2d7cba2b | 115 | */ |