2 * "$Id: cupsd.h 6376 2007-03-21 06:39:10Z mike $"
4 * Main header file for the Common UNIX Printing System (CUPS) scheduler.
6 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
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
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
27 * Include necessary headers.
30 #include <cups/http-private.h>
31 #include <cups/string.h>
39 #include <sys/types.h>
50 #include <cups/array.h>
51 #include <cups/cups.h>
53 #include <cups/http.h>
55 #include <cups/i18n.h>
56 #include <cups/debug.h>
58 #if defined(HAVE_CDSASSL)
59 # include <CoreFoundation/CoreFoundation.h>
60 #endif /* HAVE_CDSASSL */
64 * Some OS's don't have hstrerror(), most notably Solaris...
67 #ifndef HAVE_HSTRERROR
70 # endif /* hstrerror */
71 # define hstrerror cups_hstrerror
73 extern const char *cups_hstrerror(int);
74 #endif /* !HAVE_HSTRERROR */
83 # define TRUE (!FALSE)
88 * Implementation limits...
91 #define MAX_ENV 100 /* Maximum number of environment strings */
92 #define MAX_USERPASS 33 /* Maximum size of username/password */
93 #define MAX_FILTERS 20 /* Maximum number of filters */
94 #define MAX_SYSTEM_GROUPS 32 /* Maximum number of system groups */
101 #define DEFAULT_HISTORY 1 /* Preserve job history? */
102 #define DEFAULT_FILES 0 /* Preserve job files? */
103 #define DEFAULT_TIMEOUT 300 /* Timeout during requests/updates */
104 #define DEFAULT_KEEPALIVE 60 /* Timeout between requests */
105 #define DEFAULT_INTERVAL 30 /* Interval between browse updates */
106 #define DEFAULT_CHARSET "utf-8" /* Default charset */
110 * Global variable macros...
116 # define VALUE2(x,y) ={x,y}
125 * Other stuff for the scheduler...
134 #include "printers.h"
141 #include "subscriptions.h"
148 #define RELOAD_NONE 0 /* No reload needed */
149 #define RELOAD_ALL 1 /* Reload everything */
150 #define RELOAD_CUPSD 2 /* Reload only cupsd.conf */
154 * Select callback function type...
157 typedef void (*cupsd_selfunc_t
)(void *data
);
164 VAR
int MaxFDs
; /* Maximum number of files */
166 VAR
time_t ReloadTime
VALUE(0);
167 /* Time of reload request... */
168 VAR
int NeedReload
VALUE(RELOAD_ALL
);
169 /* Need to load configuration? */
171 VAR
int Launchd
VALUE(0);
172 /* Running from launchd */
173 #endif /* HAVE_LAUNCH_H */
175 #if defined(__APPLE__) && defined(HAVE_DLFCN_H)
176 typedef int (*PSQUpdateQuotaProcPtr
)(const char *printer
, const char *info
,
177 const char *user
, int nPages
, int options
);
178 VAR PSQUpdateQuotaProcPtr PSQUpdateQuotaProc
180 /* Apple PrintService quota function */
181 #endif /* __APPLE__ && HAVE_DLFCN_H */
190 extern void cupsdClearString(char **s
);
191 extern void cupsdHoldSignals(void);
192 extern void cupsdReleaseSignals(void);
193 extern void cupsdSetString(char **s
, const char *v
);
194 extern void cupsdSetStringf(char **s
, const char *f
, ...)
196 __attribute__ ((__format__ (__printf__
, 2, 3)))
197 #endif /* __GNUC__ */
199 extern void cupsdStartServer(void);
200 extern void cupsdStopServer(void);
201 extern void cupsdClosePipe(int *fds
);
202 extern int cupsdOpenPipe(int *fds
);
204 extern void cupsdInitEnv(void);
205 extern int cupsdLoadEnv(char *envp
[], int envmax
);
206 extern void cupsdSetEnv(const char *name
, const char *value
);
207 extern void cupsdSetEnvf(const char *name
, const char *value
, ...)
209 __attribute__ ((__format__ (__printf__
, 2, 3)))
210 #endif /* __GNUC__ */
213 extern int cupsdEndProcess(int pid
, int force
);
214 extern const char *cupsdFinishProcess(int pid
, char *name
, int namelen
);
215 extern int cupsdStartProcess(const char *command
, char *argv
[],
216 char *envp
[], int infd
, int outfd
,
217 int errfd
, int backfd
, int sidefd
,
220 extern int cupsdAddSelect(int fd
, cupsd_selfunc_t read_cb
,
221 cupsd_selfunc_t write_cb
, void *data
);
222 extern int cupsdDoSelect(long timeout
);
223 #ifdef CUPSD_IS_SELECTING
224 extern int cupsdIsSelecting(int fd
);
225 #endif /* CUPSD_IS_SELECTING */
226 extern void cupsdRemoveSelect(int fd
);
227 extern void cupsdStartSelect(void);
228 extern void cupsdStopSelect(void);
232 * End of "$Id: cupsd.h 6376 2007-03-21 06:39:10Z mike $".