Added files for CUP printing patch split.
[garming/samba-autobuild/.git] / source3 / include / printing.h
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 3.0
4    printing definitions
5    Copyright (C) Andrew Tridgell 1992-2000
6    
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22 #include "includes.h"
23
24 /*
25    This file defines the low-level printing system interfaces used by the
26    SAMBA printing subsystem.
27 */
28
29 /* Information for print jobs */
30 struct printjob {
31         pid_t pid; /* which process launched the job */
32         int sysjob; /* the system (lp) job number */
33         int fd; /* file descriptor of open file if open */
34         time_t starttime; /* when the job started spooling */
35         int status; /* the status of this job */
36         size_t size; /* the size of the job so far */
37         BOOL spooled; /* has it been sent to the spooler yet? */
38         BOOL smbjob; /* set if the job is a SMB job */
39         fstring filename; /* the filename used to spool the file */
40         fstring jobname; /* the job name given to us by the client */
41         fstring user; /* the user who started the job */
42         fstring qname; /* name of the print queue the job was sent to */
43 };
44
45 /* Information for print interfaces */
46 struct printif
47 {
48   int (*queue_get)(int snum, print_queue_struct **q,
49                    print_status_struct *status);
50   int (*queue_pause)(int snum);
51   int (*queue_resume)(int snum);
52   int (*job_delete)(int snum, struct printjob *pjob);
53   int (*job_pause)(int snum, struct printjob *pjob);
54   int (*job_resume)(int snum, struct printjob *pjob);
55   int (*job_submit)(int snum, struct printjob *pjob);
56 };
57
58 extern struct printif   generic_printif;
59
60 #ifdef HAVE_LIBCUPS
61 extern struct printif   cups_printif;
62 #endif /* HAVE_LIBCUPS */
63
64 #define PRINT_MAX_JOBID 10000
65 #define UNIX_JOB_START PRINT_MAX_JOBID
66 #define NEXT_JOBID(j) ((j+1) % PRINT_MAX_JOBID > 0 ? (j+1) % PRINT_MAX_JOBID : 1)
67
68 #define PRINT_SPOOL_PREFIX "smbprn."
69 #define PRINT_DATABASE_VERSION 2