]> git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/cupsd.h
Load cups into easysw/current.
[thirdparty/cups.git] / scheduler / cupsd.h
1 /*
2 * "$Id: cupsd.h 4903 2006-01-10 20:02:46Z mike $"
3 *
4 * Main header file for the Common UNIX Printing System (CUPS) scheduler.
5 *
6 * Copyright 1997-2006 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/array.h>
51 #include <cups/cups.h>
52 #include "mime.h"
53 #include <cups/http.h>
54 #include <cups/ipp.h>
55 #include <cups/i18n.h>
56 #include <cups/debug.h>
57
58 #if defined(HAVE_CDSASSL)
59 # include <CoreFoundation/CoreFoundation.h>
60 #endif /* HAVE_CDSASSL */
61
62
63 /*
64 * Some OS's don't have hstrerror(), most notably Solaris...
65 */
66
67 #ifndef HAVE_HSTRERROR
68 # define hstrerror cups_hstrerror
69
70 extern const char *cups_hstrerror(int);
71 #endif /* !HAVE_HSTRERROR */
72
73
74 /*
75 * Common constants.
76 */
77
78 #ifndef FALSE
79 # define FALSE 0
80 # define TRUE (!FALSE)
81 #endif /* !FALSE */
82
83
84 /*
85 * Implementation limits...
86 */
87
88 #define MAX_USERPASS 33 /* Maximum size of username/password */
89 #define MAX_FILTERS 20 /* Maximum number of filters */
90 #define MAX_SYSTEM_GROUPS 32 /* Maximum number of system groups */
91
92
93 /*
94 * Defaults...
95 */
96
97 #define DEFAULT_HISTORY 1 /* Preserve job history? */
98 #define DEFAULT_FILES 0 /* Preserve job files? */
99 #define DEFAULT_TIMEOUT 300 /* Timeout during requests/updates */
100 #define DEFAULT_KEEPALIVE 60 /* Timeout between requests */
101 #define DEFAULT_INTERVAL 30 /* Interval between browse updates */
102 #define DEFAULT_CHARSET "utf-8" /* Default charset */
103
104
105 /*
106 * Global variable macros...
107 */
108
109 #ifdef _MAIN_C_
110 # define VAR
111 # define VALUE(x) =x
112 # define VALUE2(x,y) ={x,y}
113 #else
114 # define VAR extern
115 # define VALUE(x)
116 # define VALUE2(x,y)
117 #endif /* _MAIN_C */
118
119
120 /*
121 * Other stuff for the scheduler...
122 */
123
124 #include "statbuf.h"
125 #include "cert.h"
126 #include "auth.h"
127 #include "client.h"
128 #include "policy.h"
129 #include "printers.h"
130 #include "classes.h"
131 #include "job.h"
132 #include "conf.h"
133 #include "banners.h"
134 #include "dirsvc.h"
135 #include "network.h"
136 #include "subscriptions.h"
137
138
139 /*
140 * Reload types...
141 */
142
143 #define RELOAD_NONE 0 /* No reload needed */
144 #define RELOAD_ALL 1 /* Reload everything */
145 #define RELOAD_CUPSD 2 /* Reload only cupsd.conf */
146
147
148 /*
149 * Globals...
150 */
151
152 VAR int MaxFDs, /* Maximum number of files */
153 SetSize; /* The size of the input/output sets */
154 VAR fd_set *InputSet, /* Input files for select() */
155 *OutputSet; /* Output files for select() */
156
157 VAR time_t ReloadTime VALUE(0);
158 /* Time of reload request... */
159 VAR int NeedReload VALUE(RELOAD_ALL);
160 /* Need to load configuration? */
161
162
163 /*
164 * Prototypes...
165 */
166
167 extern void cupsdCatchChildSignals(void);
168 extern void cupsdClearString(char **s);
169 extern void cupsdHoldSignals(void);
170 extern void cupsdIgnoreChildSignals(void);
171 extern void cupsdReleaseSignals(void);
172 extern void cupsdSetString(char **s, const char *v);
173 extern void cupsdSetStringf(char **s, const char *f, ...)
174 #ifdef __GNUC__
175 __attribute__ ((__format__ (__printf__, 2, 3)))
176 #endif /* __GNUC__ */
177 ;
178 extern void cupsdStartServer(void);
179 extern void cupsdStopServer(void);
180 extern void cupsdClosePipe(int *fds);
181 extern int cupsdOpenPipe(int *fds);
182
183 extern void cupsdClearEnv(void);
184 extern void cupsdInitEnv(void);
185 extern int cupsdLoadEnv(char *envp[], int envmax);
186 extern void cupsdSetEnv(const char *name, const char *value);
187 extern void cupsdSetEnvf(const char *name, const char *value, ...)
188 #ifdef __GNUC__
189 __attribute__ ((__format__ (__printf__, 2, 3)))
190 #endif /* __GNUC__ */
191 ;
192
193 extern int cupsdEndProcess(int pid, int force);
194 extern int cupsdStartProcess(const char *command, char *argv[],
195 char *envp[], int infd, int outfd,
196 int errfd, int backfd, int root, int *pid);
197
198
199 /*
200 * End of "$Id: cupsd.h 4903 2006-01-10 20:02:46Z mike $".
201 */