]>
Commit | Line | Data |
---|---|---|
43e2fc22 | 1 | /* |
efb2f309 | 2 | * "$Id: cupsd.h,v 1.32 2002/01/02 17:59:15 mike Exp $" |
43e2fc22 | 3 | * |
fd8b1cf8 | 4 | * Main header file for the Common UNIX Printing System (CUPS) scheduler. |
43e2fc22 | 5 | * |
efb2f309 | 6 | * Copyright 1997-2002 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 | ||
25 | /* | |
26 | * Include necessary headers. | |
27 | */ | |
28 | ||
fd8b1cf8 | 29 | #include <stdio.h> |
30 | #include <stdlib.h> | |
31 | #include <ctype.h> | |
32 | #include <limits.h> | |
fd8b1cf8 | 33 | #include <errno.h> |
34 | #include <time.h> | |
35 | #include <signal.h> | |
fd8b1cf8 | 36 | #include <fcntl.h> |
fd8b1cf8 | 37 | #include <sys/types.h> |
38 | #include <sys/time.h> | |
39 | #include <sys/stat.h> | |
40 | #include <sys/wait.h> | |
41 | ||
a74b005d | 42 | #if defined(WIN32) || defined(__EMX__) |
43 | # include <direct.h> | |
fd8b1cf8 | 44 | #else |
a74b005d | 45 | # include <unistd.h> |
46 | #endif /* WIN32 || __EMX__ */ | |
47 | ||
48 | #include <cups/cups.h> | |
49 | #include <cups/string.h> | |
f41ba047 | 50 | #include "mime.h" |
a74b005d | 51 | #include <cups/http.h> |
52 | #include <cups/ipp.h> | |
53 | #include <cups/language.h> | |
6abc7437 | 54 | #include <cups/debug.h> |
fd8b1cf8 | 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 | ||
fd8b1cf8 | 71 | #define MAX_BROWSERS 10 /* Maximum number of browse addresses */ |
72 | #define MAX_LISTENERS 10 /* Maximum number of listener sockets */ | |
83e740a5 | 73 | #define MAX_USERPASS 33 /* Maximum size of username/password */ |
6abc7437 | 74 | #define MAX_FILTERS 20 /* Maximum number of filters */ |
b1e1ae04 | 75 | #define MAX_SYSTEM_GROUPS 32 /* Maximum number of system groups */ |
fd8b1cf8 | 76 | |
bd84e0d1 | 77 | |
fd8b1cf8 | 78 | /* |
79 | * Defaults... | |
80 | */ | |
81 | ||
bd84e0d1 | 82 | #define DEFAULT_HISTORY 1 /* Preserve job history? */ |
83 | #define DEFAULT_FILES 0 /* Preserve job files? */ | |
fd8b1cf8 | 84 | #define DEFAULT_TIMEOUT 300 /* Timeout during requests/updates */ |
bd176c9c | 85 | #define DEFAULT_KEEPALIVE 60 /* Timeout between requests */ |
fd8b1cf8 | 86 | #define DEFAULT_INTERVAL 30 /* Interval between browse updates */ |
74c5d458 | 87 | #define DEFAULT_LANGUAGE setlocale(LC_ALL,"") |
bd176c9c | 88 | /* Default language encoding */ |
74c5d458 | 89 | #define DEFAULT_CHARSET "utf-8" /* Default charset */ |
472ce1dc | 90 | |
17b95e13 | 91 | |
fd8b1cf8 | 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 | ||
d2122fde | 109 | #include "cert.h" |
a74b005d | 110 | #include "client.h" |
fd8b1cf8 | 111 | #include "auth.h" |
fd8b1cf8 | 112 | #include "printers.h" |
a9de544f | 113 | #include "classes.h" |
114 | #include "job.h" | |
c7fa9d06 | 115 | #include "conf.h" |
d21a7597 | 116 | #include "banners.h" |
1012752f | 117 | #include "dirsvc.h" |
d21a7597 | 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 | |
fd8b1cf8 | 141 | |
142 | ||
143 | /* | |
144 | * Globals... | |
145 | */ | |
146 | ||
93336dbc | 147 | VAR int MaxFDs; /* Maximum number of files */ |
fd8b1cf8 | 148 | VAR fd_set InputSet, /* Input files for select() */ |
149 | OutputSet; /* Output files for select() */ | |
150 | ||
151 | VAR int NeedReload VALUE(TRUE); | |
a74b005d | 152 | /* Need to load configuration? */ |
05e63c18 | 153 | VAR char TZ[1024] VALUE("TZ=GMT"); |
154 | /* Timezone configuration */ | |
fd8b1cf8 | 155 | |
bd84e0d1 | 156 | VAR ipp_t *Devices VALUE(NULL), |
157 | /* Available devices */ | |
158 | *PPDs VALUE(NULL); | |
159 | /* Available PPDs */ | |
160 | ||
fd8b1cf8 | 161 | |
162 | /* | |
163 | * Prototypes... | |
164 | */ | |
43e2fc22 | 165 | |
d7845573 | 166 | extern void CatchChildSignals(void); |
167 | extern void IgnoreChildSignals(void); | |
dd0f599a | 168 | extern void LoadDevices(const char *d); |
169 | extern void LoadPPDs(const char *d); | |
89db771d | 170 | extern void StartServer(void); |
171 | extern void StopServer(void); | |
172 | ||
43e2fc22 | 173 | |
174 | /* | |
efb2f309 | 175 | * End of "$Id: cupsd.h,v 1.32 2002/01/02 17:59:15 mike Exp $". |
43e2fc22 | 176 | */ |