]> git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/cupsd.h
Merge changes from 1.1.x into 1.2 devel.
[thirdparty/cups.git] / scheduler / cupsd.h
1 /*
2 * "$Id: cupsd.h,v 1.28.2.1 2001/12/26 16:52:52 mike Exp $"
3 *
4 * Main header file for the Common UNIX Printing System (CUPS) scheduler.
5 *
6 * Copyright 1997-2001 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" 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-3111 USA
19 *
20 * Voice: (301) 373-9603
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
23 */
24
25 /*
26 * Include necessary headers.
27 */
28
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <ctype.h>
32 #include <limits.h>
33 #include <errno.h>
34 #include <time.h>
35 #include <signal.h>
36 #include <fcntl.h>
37 #include <sys/types.h>
38 #include <sys/time.h>
39 #include <sys/stat.h>
40 #include <sys/wait.h>
41
42 #if defined(WIN32) || defined(__EMX__)
43 # include <direct.h>
44 #else
45 # include <unistd.h>
46 #endif /* WIN32 || __EMX__ */
47
48 #include <cups/cups.h>
49 #include <cups/string.h>
50 #include "mime.h"
51 #include <cups/http.h>
52 #include <cups/ipp.h>
53 #include <cups/language.h>
54 #include <cups/debug.h>
55
56
57 /*
58 * Common constants.
59 */
60
61 #ifndef FALSE
62 # define FALSE 0
63 # define TRUE (!FALSE)
64 #endif /* !FALSE */
65
66
67 /*
68 * Implementation limits...
69 */
70
71 #define MAX_BROWSERS 10 /* Maximum number of browse addresses */
72 #define MAX_LISTENERS 10 /* Maximum number of listener sockets */
73 #define MAX_USERPASS 33 /* Maximum size of username/password */
74 #define MAX_FILTERS 20 /* Maximum number of filters */
75 #define MAX_SYSTEM_GROUPS 32 /* Maximum number of system groups */
76
77
78 /*
79 * Defaults...
80 */
81
82 #define DEFAULT_HISTORY 1 /* Preserve job history? */
83 #define DEFAULT_FILES 0 /* Preserve job files? */
84 #define DEFAULT_TIMEOUT 300 /* Timeout during requests/updates */
85 #define DEFAULT_KEEPALIVE 60 /* Timeout between requests */
86 #define DEFAULT_INTERVAL 30 /* Interval between browse updates */
87 #define DEFAULT_LANGUAGE setlocale(LC_ALL,"")
88 /* Default language encoding */
89 #define DEFAULT_CHARSET "utf-8" /* Default charset */
90
91
92 /*
93 * Global variable macros...
94 */
95
96 #ifdef _MAIN_C_
97 # define VAR
98 # define VALUE(x) =x
99 #else
100 # define VAR extern
101 # define VALUE(x)
102 #endif /* _MAIN_C */
103
104
105 /*
106 * Other stuff for the scheduler...
107 */
108
109 #include "cert.h"
110 #include "client.h"
111 #include "auth.h"
112 #include "printers.h"
113 #include "classes.h"
114 #include "job.h"
115 #include "conf.h"
116 #include "banners.h"
117 #include "dirsvc.h"
118
119
120 /*
121 * Directory handling functions...
122 */
123
124 #if HAVE_DIRENT_H
125 # include <dirent.h>
126 typedef struct dirent DIRENT;
127 # define NAMLEN(dirent) strlen((dirent)->d_name)
128 #else
129 # if HAVE_SYS_NDIR_H
130 # include <sys/ndir.h>
131 # endif
132 # if HAVE_SYS_DIR_H
133 # include <sys/dir.h>
134 # endif
135 # if HAVE_NDIR_H
136 # include <ndir.h>
137 # endif
138 typedef struct direct DIRENT;
139 # define NAMLEN(dirent) (dirent)->d_namlen
140 #endif
141
142
143 /*
144 * Globals...
145 */
146
147 VAR int MaxFDs; /* Maximum number of files */
148 VAR fd_set InputSet, /* Input files for select() */
149 OutputSet; /* Output files for select() */
150
151 VAR int NeedReload VALUE(TRUE);
152 /* Need to load configuration? */
153 VAR char TZ[1024] VALUE("TZ=GMT");
154 /* Timezone configuration */
155
156 VAR ipp_t *Devices VALUE(NULL),
157 /* Available devices */
158 *PPDs VALUE(NULL);
159 /* Available PPDs */
160
161
162 /*
163 * Prototypes...
164 */
165
166 extern void CatchChildSignals(void);
167 extern void IgnoreChildSignals(void);
168 extern void LoadDevices(const char *d);
169 extern void LoadPPDs(const char *d);
170 extern void StartServer(void);
171 extern void StopServer(void);
172
173
174 /*
175 * End of "$Id: cupsd.h,v 1.28.2.1 2001/12/26 16:52:52 mike Exp $".
176 */