]> git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/cupsd.h
Remove unused SignalCount variable, and fix permissions of certs dir.
[thirdparty/cups.git] / scheduler / cupsd.h
1 /*
2 * "$Id$"
3 *
4 * Main header file for the Common UNIX Printing System (CUPS) scheduler.
5 *
6 * Copyright 1997-2005 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 USA
19 *
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
23 */
24
25
26 /*
27 * Include necessary headers.
28 */
29
30 #include <cups/http-private.h>
31 #include <cups/string.h>
32 #include <stdlib.h>
33 #include <limits.h>
34 #include <errno.h>
35 #include <time.h>
36 #include <signal.h>
37 #include <fcntl.h>
38 #include <math.h>
39 #include <sys/types.h>
40 #include <sys/time.h>
41 #include <sys/stat.h>
42 #include <sys/wait.h>
43
44 #ifdef WIN32
45 # include <direct.h>
46 #else
47 # include <unistd.h>
48 #endif /* WIN32 */
49
50 #include <cups/cups.h>
51 #include "mime.h"
52 #include <cups/http.h>
53 #include <cups/ipp.h>
54 #include <cups/language.h>
55 #include <cups/debug.h>
56
57 #if defined(HAVE_CDSASSL)
58 # include <CoreFoundation/CoreFoundation.h>
59 #endif /* HAVE_CDSASSL */
60
61
62 /*
63 * Some OS's don't have hstrerror(), most notably Solaris...
64 */
65
66 #ifndef HAVE_HSTRERROR
67 # define hstrerror cups_hstrerror
68
69 extern const char *cups_hstrerror(int);
70 #endif /* !HAVE_HSTRERROR */
71
72
73 /*
74 * Common constants.
75 */
76
77 #ifndef FALSE
78 # define FALSE 0
79 # define TRUE (!FALSE)
80 #endif /* !FALSE */
81
82
83 /*
84 * Implementation limits...
85 */
86
87 #define MAX_USERPASS 33 /* Maximum size of username/password */
88 #define MAX_FILTERS 20 /* Maximum number of filters */
89 #define MAX_SYSTEM_GROUPS 32 /* Maximum number of system groups */
90
91
92 /*
93 * Defaults...
94 */
95
96 #define DEFAULT_HISTORY 1 /* Preserve job history? */
97 #define DEFAULT_FILES 0 /* Preserve job files? */
98 #define DEFAULT_TIMEOUT 300 /* Timeout during requests/updates */
99 #define DEFAULT_KEEPALIVE 60 /* Timeout between requests */
100 #define DEFAULT_INTERVAL 30 /* Interval between browse updates */
101 #define DEFAULT_LANGUAGE setlocale(LC_ALL,"")
102 /* Default language encoding */
103 #define DEFAULT_CHARSET "utf-8" /* Default charset */
104
105
106 /*
107 * Global variable macros...
108 */
109
110 #ifdef _MAIN_C_
111 # define VAR
112 # define VALUE(x) =x
113 # define VALUE2(x,y) ={x,y}
114 #else
115 # define VAR extern
116 # define VALUE(x)
117 # define VALUE2(x,y)
118 #endif /* _MAIN_C */
119
120
121 /*
122 * Other stuff for the scheduler...
123 */
124
125 #include "statbuf.h"
126 #include "cert.h"
127 #include "auth.h"
128 #include "client.h"
129 #include "policy.h"
130 #include "printers.h"
131 #include "classes.h"
132 #include "job.h"
133 #include "conf.h"
134 #include "banners.h"
135 #include "dirsvc.h"
136 #include "network.h"
137 #include "subscriptions.h"
138
139
140 /*
141 * Reload types...
142 */
143
144 #define RELOAD_NONE 0 /* No reload needed */
145 #define RELOAD_ALL 1 /* Reload everything */
146 #define RELOAD_CUPSD 2 /* Reload only cupsd.conf */
147
148
149 /*
150 * Globals...
151 */
152
153 VAR int MaxFDs, /* Maximum number of files */
154 SetSize; /* The size of the input/output sets */
155 VAR fd_set *InputSet, /* Input files for select() */
156 *OutputSet; /* Output files for select() */
157
158 VAR time_t ReloadTime VALUE(0);
159 /* Time of reload request... */
160 VAR int NeedReload VALUE(RELOAD_ALL);
161 /* Need to load configuration? */
162
163
164 /*
165 * Prototypes...
166 */
167
168 extern void CatchChildSignals(void);
169 extern void ClearString(char **s);
170 extern void HoldSignals(void);
171 extern void IgnoreChildSignals(void);
172 extern void LoadPPDs(const char *d);
173 extern void ReleaseSignals(void);
174 extern void SetString(char **s, const char *v);
175 extern void SetStringf(char **s, const char *f, ...)
176 #ifdef __GNUC__
177 __attribute__ ((__format__ (__printf__, 2, 3)))
178 #endif /* __GNUC__ */
179 ;
180 extern void StartServer(void);
181 extern void StopServer(void);
182 extern void cupsdClosePipe(int *fds);
183 extern int cupsdOpenPipe(int *fds);
184
185 extern void cupsdClearEnv(void);
186 extern void cupsdInitEnv(void);
187 extern int cupsdLoadEnv(char *envp[], int envmax);
188 extern void cupsdSetEnv(const char *name, const char *value);
189 extern void cupsdSetEnvf(const char *name, const char *value, ...)
190 #ifdef __GNUC__
191 __attribute__ ((__format__ (__printf__, 2, 3)))
192 #endif /* __GNUC__ */
193 ;
194
195 extern int cupsdEndProcess(int pid, int force);
196 extern int cupsdStartProcess(const char *command, char *argv[],
197 char *envp[], int infd, int outfd,
198 int errfd, int backfd, int root, int *pid);
199
200
201 /*
202 * End of "$Id$".
203 */