File: conf.h

package info (click to toggle)
cups 1.4.4-7+squeeze10
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 25,548 kB
  • ctags: 9,583
  • sloc: ansic: 138,214; sh: 37,926; cpp: 25,469; makefile: 3,285; perl: 190; python: 127; php: 28
file content (300 lines) | stat: -rw-r--r-- 9,532 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
/*
 * "$Id: conf.h 9120 2010-04-23 18:56:34Z mike $"
 *
 *   Configuration file definitions for CUPS.
 *
 *   Copyright 2007-2010 by Apple Inc.
 *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
 *
 *   These coded instructions, statements, and computer programs are the
 *   property of Apple Inc. and are protected by Federal copyright
 *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
 *   which should have been included with this file.  If this file is
 *   file is missing or damaged, see the license at "http://www.cups.org/".
 */


/*
 * Log levels...
 */

typedef enum
{
  CUPSD_LOG_PPD = -4,			/* Used internally for PPD keywords */
  CUPSD_LOG_ATTR,			/* Used internally for attributes */
  CUPSD_LOG_STATE,			/* Used internally for state-reasons */
  CUPSD_LOG_PAGE,			/* Used internally for page logging */
  CUPSD_LOG_NONE,
  CUPSD_LOG_EMERG,			/* Emergency issues */
  CUPSD_LOG_ALERT,			/* Something bad happened that needs attention */
  CUPSD_LOG_CRIT,			/* Critical error but server continues */
  CUPSD_LOG_ERROR,			/* Error condition */
  CUPSD_LOG_WARN,			/* Warning */
  CUPSD_LOG_NOTICE,			/* Normal condition that needs logging */
  CUPSD_LOG_INFO,			/* General information */
  CUPSD_LOG_DEBUG,			/* General debugging */
  CUPSD_LOG_DEBUG2			/* Detailed debugging */
} cupsd_loglevel_t;

typedef enum
{
  CUPSD_ACCESSLOG_CONFIG,		/* Log config requests */
  CUPSD_ACCESSLOG_ACTIONS,		/* Log config, print, and job management requests */
  CUPSD_ACCESSLOG_ALL			/* Log everything */
} cupsd_accesslog_t;

typedef enum
{
  CUPSD_TIME_STANDARD,			/* "Standard" Apache/CLF format */
  CUPSD_TIME_USECS			/* Standard format with microseconds */
} cupsd_time_t;


/*
 * FatalErrors flags...
 */

#define CUPSD_FATAL_NONE	0	/* No errors are fatal */
#define CUPSD_FATAL_BROWSE	1	/* Browse bind errors are fatal */
#define CUPSD_FATAL_CONFIG	2	/* Config file syntax errors are fatal */
#define CUPSD_FATAL_LISTEN	4	/* Listen/Port bind errors are fatal */
#define CUPSD_FATAL_LOG		8	/* Log file errors are fatal */
#define CUPSD_FATAL_PERMISSIONS	16	/* File permission errors are fatal */
#define CUPSD_FATAL_ALL		~0	/* All errors are fatal */


/*
 * Printcap formats...
 */

#define PRINTCAP_BSD		0	/* Berkeley LPD format */
#define PRINTCAP_SOLARIS	1	/* Solaris lpsched format */
#define PRINTCAP_PLIST		2	/* Mac OS X plist format */


/*
 * SSL options (bits)...
 */

#define CUPSD_SSL_NONE		0	/* No special options */
#define CUPSD_SSL_NOEMPTY	1	/* Do not insert empty fragments */


/*
 * ServerAlias data...
 */

typedef struct
{
  size_t	namelen;		/* Length of alias name */
  char		name[1];		/* Alias name */
} cupsd_alias_t;


/*
 * Globals...
 */

VAR char		*ConfigurationFile	VALUE(NULL),
					/* Configuration file to use */
			*ServerName		VALUE(NULL),
					/* FQDN for server */
			*ServerAdmin		VALUE(NULL),
					/* Administrator's email */
			*ServerRoot		VALUE(NULL),
					/* Root directory for scheduler */
			*ServerBin		VALUE(NULL),
					/* Root directory for binaries */
			*StateDir		VALUE(NULL),
					/* Root directory for state data */
			*RequestRoot		VALUE(NULL),
					/* Directory for request files */
			*DocumentRoot		VALUE(NULL);
					/* Root directory for documents */
VAR cups_array_t	*ServerAlias		VALUE(NULL);
					/* Alias names for server */
VAR int			ServerNameIsIP		VALUE(0);
					/* Is the ServerName an IP address? */
VAR int			NumSystemGroups		VALUE(0);
					/* Number of system group names */
VAR char		*SystemGroups[MAX_SYSTEM_GROUPS]
						VALUE({0});
					/* System group names */
VAR gid_t		SystemGroupIDs[MAX_SYSTEM_GROUPS]
						VALUE({0});
					/* System group IDs */
VAR char		*AccessLog		VALUE(NULL),
					/* Access log filename */
			*ErrorLog		VALUE(NULL),
					/* Error log filename */
			*PageLog		VALUE(NULL),
					/* Page log filename */
			*CacheDir		VALUE(NULL),
					/* Cache file directory */
			*DataDir		VALUE(NULL),
					/* Data file directory */
			*DefaultLanguage	VALUE(NULL),
					/* Default language encoding */
			*DefaultLocale		VALUE(NULL),
					/* Default locale */
			*DefaultPaperSize	VALUE(NULL),
					/* Default paper size */
			*ErrorPolicy		VALUE(NULL),
					/* Default printer-error-policy */
			*RIPCache		VALUE(NULL),
					/* Amount of memory for RIPs */
			*TempDir		VALUE(NULL),
					/* Temporary directory */
			*Printcap		VALUE(NULL),
					/* Printcap file */
			*PrintcapGUI		VALUE(NULL),
					/* GUI program to use for IRIX */
			*FontPath		VALUE(NULL),
					/* Font search path */
			*RemoteRoot		VALUE(NULL),
					/* Remote root user */
			*Classification		VALUE(NULL);
					/* Classification of system */
VAR uid_t		User			VALUE(1);
					/* User ID for server */
VAR gid_t		Group			VALUE(0);
					/* Group ID for server */
VAR cupsd_accesslog_t	AccessLogLevel		VALUE(CUPSD_ACCESSLOG_ACTIONS);
					/* Access log level */
VAR int			ClassifyOverride	VALUE(0),
					/* Allow overrides? */
			ConfigFilePerm		VALUE(0640),
					/* Permissions for config files */
			LogDebugHistory		VALUE(200),
					/* Amount of automatic debug history */
			FatalErrors		VALUE(CUPSD_FATAL_CONFIG),
					/* Which errors are fatal? */
			LogFilePerm		VALUE(0644);
					/* Permissions for log files */
VAR cupsd_loglevel_t	LogLevel		VALUE(CUPSD_LOG_WARN);
					/* Error log level */
VAR cupsd_time_t	LogTimeFormat		VALUE(CUPSD_TIME_STANDARD);
					/* Log file time format */
VAR int			MaxClients		VALUE(100),
					/* Maximum number of clients */
			MaxClientsPerHost	VALUE(0),
					/* Maximum number of clients per host */
			MaxCopies		VALUE(CUPS_DEFAULT_MAX_COPIES),
					/* Maximum number of copies per job */
			MaxLogSize		VALUE(1024 * 1024),
					/* Maximum size of log files */
			MaxPrinterHistory	VALUE(10),
					/* Maximum printer state history */
			MaxRequestSize		VALUE(0),
					/* Maximum size of IPP requests */
			HostNameLookups		VALUE(FALSE),
					/* Do we do reverse lookups? */
			Timeout			VALUE(DEFAULT_TIMEOUT),
					/* Timeout during requests */
			KeepAlive		VALUE(TRUE),
					/* Support the Keep-Alive option? */
			KeepAliveTimeout	VALUE(DEFAULT_KEEPALIVE),
					/* Timeout between requests */
			ImplicitClasses		VALUE(TRUE),
					/* Are classes implicitly created? */
			ImplicitAnyClasses	VALUE(FALSE),
					/* Create AnyPrinter classes? */
			HideImplicitMembers	VALUE(TRUE),
					/* Hide implicit class members? */
			FileDevice		VALUE(FALSE),
					/* Allow file: devices? */
			FilterLimit		VALUE(0),
					/* Max filter cost at any time */
			FilterLevel		VALUE(0),
					/* Current filter level */
			FilterNice		VALUE(0),
					/* Nice value for filters */
			ReloadTimeout		VALUE(DEFAULT_KEEPALIVE),
					/* Timeout before reload from SIGHUP */
			RootCertDuration	VALUE(300),
					/* Root certificate update interval */
			RunUser			VALUE(0),
					/* User to run as, used for files */
			PrintcapFormat		VALUE(PRINTCAP_BSD),
					/* Format of printcap file? */
			DefaultShared		VALUE(TRUE),
					/* Share printers by default? */
			MultipleOperationTimeout VALUE(DEFAULT_TIMEOUT);
					/* multiple-operation-time-out value */
VAR cups_file_t		*AccessFile		VALUE(NULL),
					/* Access log file */
			*ErrorFile		VALUE(NULL),
					/* Error log file */
			*PageFile		VALUE(NULL);
					/* Page log file */
VAR char		*PageLogFormat		VALUE(NULL);
					/* Page log format */
VAR mime_t		*MimeDatabase		VALUE(NULL);
					/* MIME type database */
VAR int			NumMimeTypes		VALUE(0);
					/* Number of MIME types */
VAR const char		**MimeTypes		VALUE(NULL);
					/* Array of MIME types */

#ifdef HAVE_SSL
VAR char		*ServerCertificate	VALUE(NULL);
					/* Server certificate file */
#  if defined(HAVE_LIBSSL) || defined(HAVE_GNUTLS)
VAR char		*ServerKey		VALUE(NULL);
					/* Server key file */
#  endif /* HAVE_LIBSSL || HAVE_GNUTLS */
VAR int			SSLOptions		VALUE(CUPSD_SSL_NONE);
					/* SSL/TLS options */
#endif /* HAVE_SSL */

#ifdef HAVE_LAUNCHD
VAR int			LaunchdTimeout		VALUE(DEFAULT_KEEPALIVE);
					/* Time after which an idle cupsd will exit */
#endif /* HAVE_LAUNCHD */

#ifdef __APPLE__
VAR int			AppleQuotas		VALUE(TRUE);
					/* Use Apple PrintService Quotas instead of CUPS quotas */
#endif  /* __APPLE__ */

#ifdef HAVE_AUTHORIZATION_H
VAR char		*SystemGroupAuthKey	VALUE(NULL);
					/* System group auth key */
#endif /* HAVE_AUTHORIZATION_H */


/*
 * Prototypes...
 */

extern void	cupsdAddAlias(cups_array_t *aliases, const char *name);
extern int	cupsdCheckPermissions(const char *filename,
		                      const char *suffix, int mode,
	 			      int user, int group, int is_dir,
				      int create_dir);
extern void	cupsdFreeAliases(cups_array_t *aliases);
extern char	*cupsdGetDateTime(struct timeval *t, cupsd_time_t format);
#ifdef HAVE_GSSAPI
extern int	cupsdLogGSSMessage(int level, int major_status,
		                   int minor_status,
		                   const char *message, ...);
#endif /* HAVE_GSSAPI */
extern int	cupsdLogJob(cupsd_job_t *job, int level, const char *message, ...)
#ifdef __GNUC__
__attribute__ ((__format__ (__printf__, 3, 4)))
#endif /* __GNUC__ */
;
extern int	cupsdLogMessage(int level, const char *message, ...)
#ifdef __GNUC__
__attribute__ ((__format__ (__printf__, 2, 3)))
#endif /* __GNUC__ */
;
extern int	cupsdLogPage(cupsd_job_t *job, const char *page);
extern int	cupsdLogRequest(cupsd_client_t *con, http_status_t code);
extern int	cupsdReadConfiguration(void);
extern int	cupsdWriteErrorLog(int level, const char *message);


/*
 * End of "$Id: conf.h 9120 2010-04-23 18:56:34Z mike $".
 */