source: branches/samba-3.0/source/include/printing.h@ 929

Last change on this file since 929 was 1, checked in by Paul Smedley, 18 years ago

Initial code import

File size: 3.3 KB
Line 
1#ifndef PRINTING_H_
2#define PRINTING_H_
3
4/*
5 Unix SMB/CIFS implementation.
6 printing definitions
7 Copyright (C) Andrew Tridgell 1992-2000
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22*/
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 */
30struct 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 int page_count; /* then number of pages so far */
38 BOOL spooled; /* has it been sent to the spooler yet? */
39 BOOL smbjob; /* set if the job is a SMB job */
40 fstring filename; /* the filename used to spool the file */
41 fstring jobname; /* the job name given to us by the client */
42 fstring user; /* the user who started the job */
43 fstring queuename; /* service number of printer for this job */
44 NT_DEVICEMODE *nt_devmode;
45};
46
47/* Information for print interfaces */
48struct printif
49{
50 /* value of the 'printing' option for this service */
51 enum printing_types type;
52
53 int (*queue_get)(const char *printer_name,
54 enum printing_types printing_type,
55 char *lpq_command,
56 print_queue_struct **q,
57 print_status_struct *status);
58 int (*queue_pause)(int snum);
59 int (*queue_resume)(int snum);
60 int (*job_delete)(const char *sharename, const char *lprm_command, struct printjob *pjob);
61 int (*job_pause)(int snum, struct printjob *pjob);
62 int (*job_resume)(int snum, struct printjob *pjob);
63 int (*job_submit)(int snum, struct printjob *pjob);
64};
65
66extern struct printif generic_printif;
67
68#ifdef HAVE_CUPS
69extern struct printif cups_printif;
70#endif /* HAVE_CUPS */
71
72#ifdef HAVE_IPRINT
73extern struct printif iprint_printif;
74#endif /* HAVE_IPRINT */
75
76#if defined(DEVELOPER) || defined(ENABLE_BUILD_FARM_HACKS)
77extern struct printif test_printif;
78#endif /* DEVELOPER||ENABLE_BUILD_FARM_HACKS */
79
80/* PRINT_MAX_JOBID is now defined in local.h */
81#define UNIX_JOB_START PRINT_MAX_JOBID
82#define NEXT_JOBID(j) ((j+1) % PRINT_MAX_JOBID > 0 ? (j+1) % PRINT_MAX_JOBID : 1)
83
84#define MAX_CACHE_VALID_TIME 3600
85
86#ifndef PRINT_SPOOL_PREFIX
87#define PRINT_SPOOL_PREFIX "smbprn."
88#endif
89#define PRINT_DATABASE_VERSION 5
90
91/* There can be this many printing tdb's open, plus any locked ones. */
92#define MAX_PRINT_DBS_OPEN 1
93
94struct tdb_print_db {
95 struct tdb_print_db *next, *prev;
96 TDB_CONTEXT *tdb;
97 int ref_count;
98 fstring printer_name;
99};
100
101/*
102 * Used for print notify
103 */
104
105#define NOTIFY_PID_LIST_KEY "NOTIFY_PID_LIST"
106
107#endif /* PRINTING_H_ */
Note: See TracBrowser for help on using the repository browser.