]>
Commit | Line | Data |
---|---|---|
43e2fc22 | 1 | /* |
daf8f5f0 | 2 | * "$Id: cupsd.h,v 1.28.2.20 2003/07/19 21:57:47 mike Exp $" |
43e2fc22 | 3 | * |
fd8b1cf8 | 4 | * Main header file for the Common UNIX Printing System (CUPS) scheduler. |
43e2fc22 | 5 | * |
1d9595ab | 6 | * Copyright 1997-2003 by Easy Software Products, all rights reserved. |
43e2fc22 | 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 | |
8784b6a6 | 17 | * 44141 Airport View Drive, Suite 204 |
43e2fc22 | 18 | * Hollywood, Maryland 20636-3111 USA |
19 | * | |
20 | * Voice: (301) 373-9603 | |
21 | * EMail: cups-info@cups.org | |
22 | * WWW: http://www.cups.org | |
43e2fc22 | 23 | */ |
24 | ||
a351bcb0 | 25 | #ifdef __sun |
f3bc1068 | 26 | /* |
a351bcb0 | 27 | * Define FD_SETSIZE to 2048 on Solaris to get the correct version of |
28 | * select() for large numbers of file descriptors. | |
f3bc1068 | 29 | */ |
30 | ||
a351bcb0 | 31 | # define FD_SETSIZE 2048 |
32 | #endif /* __sun */ | |
f3bc1068 | 33 | |
34 | ||
43e2fc22 | 35 | /* |
36 | * Include necessary headers. | |
37 | */ | |
38 | ||
fd8b1cf8 | 39 | #include <stdio.h> |
40 | #include <stdlib.h> | |
fd8b1cf8 | 41 | #include <limits.h> |
fd8b1cf8 | 42 | #include <errno.h> |
43 | #include <time.h> | |
44 | #include <signal.h> | |
fd8b1cf8 | 45 | #include <fcntl.h> |
7ed5d5f2 | 46 | #include <math.h> |
fd8b1cf8 | 47 | #include <sys/types.h> |
48 | #include <sys/time.h> | |
49 | #include <sys/stat.h> | |
50 | #include <sys/wait.h> | |
51 | ||
c3026ddc | 52 | #ifdef WIN32 |
a74b005d | 53 | # include <direct.h> |
fd8b1cf8 | 54 | #else |
a74b005d | 55 | # include <unistd.h> |
c3026ddc | 56 | #endif /* WIN32 */ |
a74b005d | 57 | |
58 | #include <cups/cups.h> | |
59 | #include <cups/string.h> | |
f41ba047 | 60 | #include "mime.h" |
707152b4 | 61 | #include <cups/http.h> |
bcf61448 | 62 | #include <cups/ipp.h> |
a74b005d | 63 | #include <cups/language.h> |
6abc7437 | 64 | #include <cups/debug.h> |
fd8b1cf8 | 65 | |
dcfcaeac | 66 | #if defined(HAVE_CDSASSL) |
67 | # include <CoreFoundation/CoreFoundation.h> | |
68 | #endif /* HAVE_CDSASSL */ | |
69 | ||
fd8b1cf8 | 70 | |
dfb69f7a | 71 | /* |
72 | * Some OS's don't have hstrerror(), most notably Solaris... | |
73 | */ | |
74 | ||
75 | #ifndef HAVE_HSTRERROR | |
76 | # define hstrerror cups_hstrerror | |
77 | ||
78 | extern const char *cups_hstrerror(int); | |
79 | #endif /* !HAVE_HSTRERROR */ | |
80 | ||
81 | ||
fd8b1cf8 | 82 | /* |
83 | * Common constants. | |
84 | */ | |
85 | ||
86 | #ifndef FALSE | |
87 | # define FALSE 0 | |
88 | # define TRUE (!FALSE) | |
89 | #endif /* !FALSE */ | |
90 | ||
91 | ||
92 | /* | |
93 | * Implementation limits... | |
94 | */ | |
95 | ||
83e740a5 | 96 | #define MAX_USERPASS 33 /* Maximum size of username/password */ |
6abc7437 | 97 | #define MAX_FILTERS 20 /* Maximum number of filters */ |
753453e4 | 98 | #define MAX_SYSTEM_GROUPS 32 /* Maximum number of system groups */ |
fd8b1cf8 | 99 | |
bd84e0d1 | 100 | |
fd8b1cf8 | 101 | /* |
102 | * Defaults... | |
103 | */ | |
104 | ||
bd84e0d1 | 105 | #define DEFAULT_HISTORY 1 /* Preserve job history? */ |
106 | #define DEFAULT_FILES 0 /* Preserve job files? */ | |
fd8b1cf8 | 107 | #define DEFAULT_TIMEOUT 300 /* Timeout during requests/updates */ |
bd176c9c | 108 | #define DEFAULT_KEEPALIVE 60 /* Timeout between requests */ |
fd8b1cf8 | 109 | #define DEFAULT_INTERVAL 30 /* Interval between browse updates */ |
753453e4 | 110 | #define DEFAULT_LANGUAGE setlocale(LC_ALL,"") |
bd176c9c | 111 | /* Default language encoding */ |
753453e4 | 112 | #define DEFAULT_CHARSET "utf-8" /* Default charset */ |
472ce1dc | 113 | |
17b95e13 | 114 | |
fd8b1cf8 | 115 | /* |
116 | * Global variable macros... | |
117 | */ | |
118 | ||
119 | #ifdef _MAIN_C_ | |
120 | # define VAR | |
121 | # define VALUE(x) =x | |
0a968cfb | 122 | # define VALUE2(x,y) ={x,y} |
fd8b1cf8 | 123 | #else |
124 | # define VAR extern | |
125 | # define VALUE(x) | |
0a968cfb | 126 | # define VALUE2(x,y) |
fd8b1cf8 | 127 | #endif /* _MAIN_C */ |
128 | ||
129 | ||
130 | /* | |
131 | * Other stuff for the scheduler... | |
132 | */ | |
133 | ||
d2122fde | 134 | #include "cert.h" |
a74b005d | 135 | #include "client.h" |
fd8b1cf8 | 136 | #include "auth.h" |
f27bd5ab | 137 | #include "policy.h" |
fd8b1cf8 | 138 | #include "printers.h" |
a9de544f | 139 | #include "classes.h" |
140 | #include "job.h" | |
c7fa9d06 | 141 | #include "conf.h" |
d21a7597 | 142 | #include "banners.h" |
753453e4 | 143 | #include "dirsvc.h" |
20264b99 | 144 | #include "network.h" |
d21a7597 | 145 | |
146 | ||
147 | /* | |
148 | * Directory handling functions... | |
149 | */ | |
150 | ||
151 | #if HAVE_DIRENT_H | |
152 | # include <dirent.h> | |
153 | typedef struct dirent DIRENT; | |
154 | # define NAMLEN(dirent) strlen((dirent)->d_name) | |
155 | #else | |
156 | # if HAVE_SYS_NDIR_H | |
157 | # include <sys/ndir.h> | |
158 | # endif | |
159 | # if HAVE_SYS_DIR_H | |
160 | # include <sys/dir.h> | |
161 | # endif | |
162 | # if HAVE_NDIR_H | |
163 | # include <ndir.h> | |
164 | # endif | |
165 | typedef struct direct DIRENT; | |
166 | # define NAMLEN(dirent) (dirent)->d_namlen | |
167 | #endif | |
fd8b1cf8 | 168 | |
169 | ||
53510eae | 170 | /* |
171 | * Reload types... | |
172 | */ | |
173 | ||
174 | #define RELOAD_NONE 0 /* No reload needed */ | |
175 | #define RELOAD_ALL 1 /* Reload everything */ | |
176 | #define RELOAD_CUPSD 2 /* Reload only cupsd.conf */ | |
177 | ||
178 | ||
fd8b1cf8 | 179 | /* |
180 | * Globals... | |
181 | */ | |
182 | ||
f3bc1068 | 183 | VAR int MaxFDs, /* Maximum number of files */ |
184 | SetSize; /* The size of the input/output sets */ | |
185 | VAR fd_set *InputSet, /* Input files for select() */ | |
186 | *OutputSet; /* Output files for select() */ | |
fd8b1cf8 | 187 | |
daf8f5f0 | 188 | VAR int NeedReload VALUE(RELOAD_ALL), |
a74b005d | 189 | /* Need to load configuration? */ |
daf8f5f0 | 190 | SignalCount VALUE(0); |
191 | /* Signal handler level */ | |
192 | ||
36992080 | 193 | VAR char *TZ VALUE(NULL); |
05e63c18 | 194 | /* Timezone configuration */ |
fd8b1cf8 | 195 | |
bd84e0d1 | 196 | VAR ipp_t *Devices VALUE(NULL), |
197 | /* Available devices */ | |
198 | *PPDs VALUE(NULL); | |
199 | /* Available PPDs */ | |
200 | ||
fd8b1cf8 | 201 | |
202 | /* | |
203 | * Prototypes... | |
204 | */ | |
43e2fc22 | 205 | |
d7845573 | 206 | extern void CatchChildSignals(void); |
36992080 | 207 | extern void ClearString(char **s); |
38743560 | 208 | extern void HoldSignals(void); |
d7845573 | 209 | extern void IgnoreChildSignals(void); |
dd0f599a | 210 | extern void LoadDevices(const char *d); |
211 | extern void LoadPPDs(const char *d); | |
38743560 | 212 | extern void ReleaseSignals(void); |
36992080 | 213 | extern void SetString(char **s, const char *v); |
214 | extern void SetStringf(char **s, const char *f, ...); | |
89db771d | 215 | extern void StartServer(void); |
216 | extern void StopServer(void); | |
217 | ||
43e2fc22 | 218 | |
219 | /* | |
daf8f5f0 | 220 | * End of "$Id: cupsd.h,v 1.28.2.20 2003/07/19 21:57:47 mike Exp $". |
43e2fc22 | 221 | */ |