]> git.ipfire.org Git - thirdparty/cups.git/blame - vcnet/config.h
support Upstart socket activation
[thirdparty/cups.git] / vcnet / config.h
CommitLineData
ef416fc2 1/*
5a1d7a17 2 * Configuration file for CUPS on Windows.
ef416fc2 3 *
f73476ae 4 * Copyright 2007-2016 by Apple Inc.
5a1d7a17 5 * Copyright 1997-2007 by Easy Software Products.
ef416fc2 6 *
5a1d7a17
MS
7 * These coded instructions, statements, and computer programs are the
8 * property of Apple Inc. and are protected by Federal copyright
9 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 * which should have been included with this file. If this file is
11 * file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 12 */
13
14#ifndef _CUPS_CONFIG_H_
15#define _CUPS_CONFIG_H_
16
536bc2c6
MS
17/*
18 * Include necessary headers...
19 */
20
21#include <stdio.h>
22#include <stdlib.h>
23#include <string.h>
24#include <stdarg.h>
536bc2c6 25#include <io.h>
7cf5915e 26#include <direct.h>
536bc2c6
MS
27
28
29/*
7a0cbd5e 30 * Microsoft renames the POSIX functions to _name, and introduces
536bc2c6
MS
31 * a broken compatibility layer using the original names. As a result,
32 * random crashes can occur when, for example, strdup() allocates memory
33 * from a different heap than used by malloc() and free().
34 *
35 * To avoid moronic problems like this, we #define the POSIX function
36 * names to the corresponding non-standard Microsoft names.
37 */
38
39#define access _access
40#define close _close
41#define fileno _fileno
42#define lseek _lseek
7cf5915e 43#define mkdir(d,p) _mkdir(d)
536bc2c6
MS
44#define open _open
45#define read _read
7cf5915e 46#define rmdir _rmdir
536bc2c6
MS
47#define snprintf _snprintf
48#define strdup _strdup
49#define unlink _unlink
50#define vsnprintf _vsnprintf
51#define write _write
52
53
015214aa
MS
54/*
55 * Map the POSIX strcasecmp() and strncasecmp() functions to the Win32 stricmp()
56 * and strnicmp() functions...
57 */
58
59#define strcasecmp stricmp
60#define strncasecmp strnicmp
61
62
5180a04c
MS
63/*
64 * Map the POSIX sleep() and usleep() functions to the Win32 Sleep() function...
65 */
66
33c9220c 67typedef unsigned long useconds_t;
5180a04c
MS
68#define sleep(X) Sleep(1000 * (X))
69#define usleep(X) Sleep((X)/1000)
70
71
6d2f911b
MS
72/*
73 * Map various parameters to Posix style system calls
74 */
75
76# define F_OK 00
77# define W_OK 02
78# define R_OK 04
79# define O_RDONLY _O_RDONLY
80# define O_WRONLY _O_WRONLY
015214aa 81# define O_CREAT _O_CREAT
6d2f911b
MS
82# define O_TRUNC _O_TRUNC
83
84
ef416fc2 85/*
86 * Compiler stuff...
87 */
88
89#undef const
90#undef __CHAR_UNSIGNED__
91
92
93/*
94 * Version of software...
95 */
96
24343173
MS
97#define CUPS_SVERSION "CUPS v2.2"
98#define CUPS_MINIMAL "CUPS/2.2"
ef416fc2 99
100
101/*
536bc2c6 102 * Default user and groups...
ef416fc2 103 */
104
6d2f911b
MS
105#define CUPS_DEFAULT_USER ""
106#define CUPS_DEFAULT_GROUP ""
107#define CUPS_DEFAULT_SYSTEM_GROUPS ""
108#define CUPS_DEFAULT_PRINTOPERATOR_AUTH ""
536bc2c6
MS
109
110
111/*
112 * Default file permissions...
113 */
114
db8b865d 115#define CUPS_DEFAULT_CONFIG_FILE_PERM 0640
536bc2c6
MS
116#define CUPS_DEFAULT_LOG_FILE_PERM 0644
117
118
119/*
120 * Default logging settings...
121 */
122
123#define CUPS_DEFAULT_LOG_LEVEL "warn"
124#define CUPS_DEFAULT_ACCESS_LOG_LEVEL "actions"
125
126
127/*
128 * Default fatal error settings...
129 */
130
131#define CUPS_DEFAULT_FATAL_ERRORS "config"
132
133
134/*
135 * Default browsing settings...
136 */
137
138#define CUPS_DEFAULT_BROWSING 1
db8b865d 139#define CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS ""
536bc2c6 140#define CUPS_DEFAULT_DEFAULT_SHARED 1
ef416fc2 141
142
143/*
144 * Default IPP port...
145 */
146
536bc2c6
MS
147#define CUPS_DEFAULT_IPP_PORT 631
148
149
150/*
151 * Default printcap file...
152 */
153
154#define CUPS_DEFAULT_PRINTCAP ""
ef416fc2 155
156
157/*
536bc2c6 158 * Default Samba and LPD config files...
ef416fc2 159 */
160
536bc2c6
MS
161#define CUPS_DEFAULT_SMB_CONFIG_FILE ""
162#define CUPS_DEFAULT_LPD_CONFIG_FILE ""
163
164
165/*
166 * Default MaxCopies value...
167 */
168
169#define CUPS_DEFAULT_MAX_COPIES 9999
ef416fc2 170
171
172/*
1e564ac8 173 * Do we have domain socket support, and if so what is the default one?
ef416fc2 174 */
175
176#undef CUPS_DEFAULT_DOMAINSOCKET
177
178
db8b865d
MS
179/*
180 * Default WebInterface value...
181 */
182
183#undef CUPS_DEFAULT_WEBIF
184
185
ef416fc2 186/*
187 * Where are files stored?
188 *
189 * Note: These are defaults, which can be overridden by environment
190 * variables at run-time...
191 */
192
536bc2c6
MS
193#define CUPS_BINDIR "C:/CUPS/bin"
194#define CUPS_CACHEDIR "C:/CUPS/cache"
195#define CUPS_DATADIR "C:/CUPS/share"
196#define CUPS_DOCROOT "C:/CUPS/share/doc"
197#define CUPS_FONTPATH "C:/CUPS/share/fonts"
198#define CUPS_LOCALEDIR "C:/CUPS/locale"
199#define CUPS_LOGDIR "C:/CUPS/logs"
200#define CUPS_REQUESTS "C:/CUPS/spool"
201#define CUPS_SBINDIR "C:/CUPS/sbin"
202#define CUPS_SERVERBIN "C:/CUPS/lib"
203#define CUPS_SERVERROOT "C:/CUPS/etc"
204#define CUPS_STATEDIR "C:/CUPS/run"
ef416fc2 205
206
1e564ac8
MS
207/*
208 * Do we have posix_spawn?
209 */
210
211/* #undef HAVE_POSIX_SPAWN */
212
213
ef416fc2 214/*
db8b865d 215 * Do we have ZLIB?
ef416fc2 216 */
217
db8b865d
MS
218#define HAVE_LIBZ 1
219#define HAVE_INFLATECOPY 1
ef416fc2 220
221
222/*
223 * Do we have PAM stuff?
224 */
225
ef416fc2 226#define HAVE_LIBPAM 0
536bc2c6
MS
227/* #undef HAVE_PAM_PAM_APPL_H */
228/* #undef HAVE_PAM_SET_ITEM */
229/* #undef HAVE_PAM_SETCRED */
ef416fc2 230
231
232/*
233 * Do we have <shadow.h>?
234 */
235
536bc2c6 236/* #undef HAVE_SHADOW_H */
ef416fc2 237
238
239/*
240 * Do we have <crypt.h>?
241 */
242
536bc2c6 243/* #undef HAVE_CRYPT_H */
ef416fc2 244
245
f8b3a85b 246/*
db8b865d 247 * Use <stdint.h>?
f8b3a85b
MS
248 */
249
db8b865d 250/* #undef HAVE_STDINT_H */
f8b3a85b
MS
251
252
ef416fc2 253/*
254 * Use <string.h>, <strings.h>, and/or <bstring.h>?
255 */
256
536bc2c6
MS
257#define HAVE_STRING_H 1
258/* #undef HAVE_STRINGS_H */
259/* #undef HAVE_BSTRING_H */
ef416fc2 260
261
262/*
263 * Do we have the long long type?
264 */
265
536bc2c6 266/* #undef HAVE_LONG_LONG */
ef416fc2 267
268#ifdef HAVE_LONG_LONG
269# define CUPS_LLFMT "%lld"
270# define CUPS_LLCAST (long long)
271#else
272# define CUPS_LLFMT "%ld"
273# define CUPS_LLCAST (long)
274#endif /* HAVE_LONG_LONG */
275
276
277/*
278 * Do we have the strtoll() function?
279 */
280
536bc2c6 281/* #undef HAVE_STRTOLL */
ef416fc2 282
283#ifndef HAVE_STRTOLL
284# define strtoll(nptr,endptr,base) strtol((nptr), (endptr), (base))
285#endif /* !HAVE_STRTOLL */
286
287
288/*
289 * Do we have the strXXX() functions?
290 */
291
6d2f911b 292#define HAVE_STRDUP 1
536bc2c6
MS
293/* #undef HAVE_STRLCAT */
294/* #undef HAVE_STRLCPY */
ef416fc2 295
296
297/*
298 * Do we have the geteuid() function?
299 */
300
536bc2c6 301/* #undef HAVE_GETEUID */
ef416fc2 302
303
88f9aafc
MS
304/*
305 * Do we have the setpgid() function?
306 */
307
308/* #undef HAVE_SETPGID */
309
310
ef416fc2 311/*
312 * Do we have the vsyslog() function?
313 */
314
536bc2c6 315/* #undef HAVE_VSYSLOG */
ef416fc2 316
317
318/*
319 * Do we have the (v)snprintf() functions?
320 */
321
536bc2c6
MS
322#define HAVE_SNPRINTF 1
323#define HAVE_VSNPRINTF 1
ef416fc2 324
325
326/*
327 * What signal functions to use?
328 */
329
536bc2c6
MS
330/* #undef HAVE_SIGSET */
331/* #undef HAVE_SIGACTION */
ef416fc2 332
333
334/*
335 * What wait functions to use?
336 */
337
536bc2c6
MS
338/* #undef HAVE_WAITPID */
339/* #undef HAVE_WAIT3 */
ef416fc2 340
341
342/*
343 * Do we have the mallinfo function and malloc.h?
344 */
345
536bc2c6
MS
346/* #undef HAVE_MALLINFO */
347/* #undef HAVE_MALLOC_H */
348
349
350/*
351 * Do we have the POSIX ACL functions?
352 */
353
354/* #undef HAVE_ACL_INIT */
ef416fc2 355
356
357/*
358 * Do we have the langinfo.h header file?
359 */
360
536bc2c6 361/* #undef HAVE_LANGINFO_H */
ef416fc2 362
363
364/*
365 * Which encryption libraries do we have?
366 */
367
536bc2c6
MS
368/* #undef HAVE_CDSASSL */
369/* #undef HAVE_GNUTLS */
cc754834
MS
370#define HAVE_SSPISSL
371#define HAVE_SSL
536bc2c6
MS
372
373
1e564ac8
MS
374/*
375 * Do we have the gnutls_transport_set_pull_timeout_function function?
376 */
377
378/* #undef HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION */
379
380
19ba6878
MS
381/*
382 * Do we have the gnutls_priority_set_direct function?
383 */
384
385/* #undef HAVE_GNUTLS_PRIORITY_SET_DIRECT */
386
387
536bc2c6 388/*
db8b865d 389 * What Security framework headers do we have?
eac3a0a0
MS
390 */
391
db8b865d
MS
392/* #undef HAVE_AUTHORIZATION_H */
393/* #undef HAVE_SECBASEPRIV_H */
394/* #undef HAVE_SECCERTIFICATE_H */
395/* #undef HAVE_SECIDENTITYSEARCHPRIV_H */
396/* #undef HAVE_SECITEM_H */
397/* #undef HAVE_SECITEMPRIV_H */
398/* #undef HAVE_SECPOLICY_H */
399/* #undef HAVE_SECPOLICYPRIV_H */
400/* #undef HAVE_SECURETRANSPORTPRIV_H */
eac3a0a0
MS
401
402
403/*
404 * Do we have the cssmErrorString function?
405 */
406
407/* #undef HAVE_CSSMERRORSTRING */
408
409
1e564ac8
MS
410/*
411 * Do we have the SecGenerateSelfSignedCertificate function?
412 */
413
414/* #undef HAVE_SECGENERATESELFSIGNEDCERTIFICATE */
415
416
417/*
418 * Do we have the SecKeychainOpen function?
419 */
420
421/* #undef HAVE_SECKEYCHAINOPEN */
422
423
536bc2c6 424/*
db8b865d 425 * Do we have libpaper?
536bc2c6
MS
426 */
427
db8b865d 428/* #undef HAVE_LIBPAPER */
ef416fc2 429
430
431/*
db8b865d 432 * Do we have mDNSResponder for DNS Service Discovery (aka Bonjour)?
ef416fc2 433 */
434
db8b865d 435#define HAVE_DNSSD 1
ef416fc2 436
437
438/*
db8b865d 439 * Do we have Avahi for DNS Service Discovery (aka Bonjour)?
ef416fc2 440 */
441
db8b865d 442#undef HAVE_AVAHI
536bc2c6
MS
443
444
445/*
db8b865d 446 * Do we have <sys/ioctl.h>?
536bc2c6
MS
447 */
448
db8b865d 449#undef HAVE_SYS_IOCTL_H
536bc2c6
MS
450
451
eac3a0a0
MS
452/*
453 * Does the "stat" structure contain the "st_gen" member?
454 */
455
456/* #undef HAVE_ST_GEN */
457
458
ef416fc2 459/*
460 * Does the "tm" structure contain the "tm_gmtoff" member?
461 */
462
536bc2c6 463/* #undef HAVE_TM_GMTOFF */
ef416fc2 464
465
466/*
467 * Do we have rresvport_af()?
468 */
469
536bc2c6 470/* #undef HAVE_RRESVPORT_AF */
ef416fc2 471
472
473/*
474 * Do we have getaddrinfo()?
475 */
476
536bc2c6 477#define HAVE_GETADDRINFO 1
ef416fc2 478
479
480/*
481 * Do we have getnameinfo()?
482 */
483
536bc2c6 484#define HAVE_GETNAMEINFO 1
ef416fc2 485
486
487/*
488 * Do we have getifaddrs()?
489 */
490
536bc2c6 491/* #undef HAVE_GETIFADDRS */
ef416fc2 492
493
494/*
495 * Do we have hstrerror()?
496 */
497
536bc2c6
MS
498/* #undef HAVE_HSTRERROR */
499
500
501/*
502 * Do we have res_init()?
503 */
504
505/* #undef HAVE_RES_INIT */
506
507
508/*
509 * Do we have <resolv.h>
510 */
511
512/* #undef HAVE_RESOLV_H */
ef416fc2 513
514
515/*
516 * Do we have the <sys/sockio.h> header file?
517 */
518
536bc2c6 519/* #undef HAVE_SYS_SOCKIO_H */
ef416fc2 520
521
522/*
523 * Does the sockaddr structure contain an sa_len parameter?
524 */
525
536bc2c6 526/* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */
ef416fc2 527
528
ef416fc2 529/*
530 * Do we have pthread support?
531 */
532
536bc2c6
MS
533/* #undef HAVE_PTHREAD_H */
534
535
536/*
537 * Do we have launchd support?
538 */
539
540/* #undef HAVE_LAUNCH_H */
541/* #undef HAVE_LAUNCHD */
ef416fc2 542
543
1e564ac8
MS
544/*
545 * Do we have systemd support?
546 */
547
548/* #undef HAVE_SYSTEMD */
549
550
ef416fc2 551/*
552 * Various scripting languages...
553 */
554
536bc2c6
MS
555/* #undef HAVE_JAVA */
556#define CUPS_JAVA ""
557/* #undef HAVE_PERL */
558#define CUPS_PERL ""
559/* #undef HAVE_PHP */
560#define CUPS_PHP ""
561/* #undef HAVE_PYTHON */
562#define CUPS_PYTHON ""
563
564
536bc2c6
MS
565/*
566 * Do we have CoreFoundation public and private headers?
567 */
568
569/* #undef HAVE_COREFOUNDATION_H */
570/* #undef HAVE_CFPRIV_H */
571/* #undef HAVE_CFBUNDLEPRIV_H */
572
573
6d2f911b
MS
574/*
575 * Do we have ApplicationServices public headers?
576 */
577
578/* #undef HAVE_APPLICATIONSERVICES_H */
579
580
581/*
582 * Do we have the SCDynamicStoreCopyComputerName function?
583 */
584
585/* #undef HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */
586
587
536bc2c6 588/*
f3c17241 589 * Do we have OS X 10.4's mbr_XXX functions?
536bc2c6
MS
590 */
591
592/* #undef HAVE_MEMBERSHIP_H */
593/* #undef HAVE_MEMBERSHIPPRIV_H */
594/* #undef HAVE_MBR_UID_TO_UUID */
595
596
597/*
eac3a0a0 598 * Do we have Darwin's notify_post header and function?
536bc2c6
MS
599 */
600
601/* #undef HAVE_NOTIFY_H */
602/* #undef HAVE_NOTIFY_POST */
603
604
536bc2c6 605/*
eac3a0a0 606 * Do we have DBUS?
536bc2c6
MS
607 */
608
eac3a0a0
MS
609/* #undef HAVE_DBUS */
610/* #undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND */
1e564ac8 611/* #undef HAVE_DBUS_THREADS_INIT */
536bc2c6
MS
612
613
614/*
615 * Do we have the GSSAPI support library (for Kerberos support)?
616 */
617
eac3a0a0
MS
618/* #undef HAVE_GSS_ACQUIRE_CRED_EX_F */
619/* #undef HAVE_GSS_C_NT_HOSTBASED_SERVICE */
620/* #undef HAVE_GSS_GSSAPI_H */
621/* #undef HAVE_GSS_GSSAPI_SPI_H */
536bc2c6 622/* #undef HAVE_GSSAPI */
536bc2c6 623/* #undef HAVE_GSSAPI_GSSAPI_H */
eac3a0a0 624/* #undef HAVE_GSSAPI_H */
536bc2c6
MS
625
626
627/*
628 * Default GSS service name...
629 */
630
f8b3a85b 631#define CUPS_DEFAULT_GSSSERVICENAME "host"
536bc2c6
MS
632
633
634/*
635 * Select/poll interfaces...
636 */
637
638/* #undef HAVE_POLL */
639/* #undef HAVE_EPOLL */
640/* #undef HAVE_KQUEUE */
641
642
643/*
644 * Do we have the <dlfcn.h> header?
645 */
646
647/* #undef HAVE_DLFCN_H */
648
649
650/*
651 * Do we have <sys/param.h>?
652 */
653
654/* #undef HAVE_SYS_PARAM_H */
655
656
657/*
658 * Do we have <sys/ucred.h>?
659 */
660
661/* #undef HAVE_SYS_UCRED_H */
662
663
664/*
665 * Do we have removefile()?
666 */
667
668/* #undef HAVE_REMOVEFILE */
669
670
671/*
672 * Do we have <sandbox.h>?
673 */
674
675/* #undef HAVE_SANDBOX_H */
676
677
678/*
679 * Which random number generator function to use...
680 */
681
f8b3a85b 682/* #undef HAVE_ARC4RANDOM */
536bc2c6 683/* #undef HAVE_RANDOM */
536bc2c6
MS
684/* #undef HAVE_LRAND48 */
685
f8b3a85b
MS
686#ifdef HAVE_ARC4RANDOM
687# define CUPS_RAND() arc4random()
688# define CUPS_SRAND(v) arc4random_stir()
689#elif defined(HAVE_RANDOM)
690# define CUPS_RAND() random()
691# define CUPS_SRAND(v) srandom(v)
692#elif defined(HAVE_LRAND48)
693# define CUPS_RAND() lrand48()
694# define CUPS_SRAND(v) srand48(v)
695#else
696# define CUPS_RAND() rand()
697# define CUPS_SRAND(v) srand(v)
698#endif /* HAVE_ARC4RANDOM */
699
536bc2c6
MS
700
701/*
702 * Do we have vproc_transaction_begin/end?
703 */
704
705/* #undef HAVE_VPROC_TRANSACTION_BEGIN */
706
707
708/*
709 * Do we have libusb?
710 */
711
db8b865d 712/* #undef HAVE_LIBUSB */
536bc2c6
MS
713
714
715/*
716 * Do we have libwrap and tcpd.h?
717 */
718
719/* #undef HAVE_TCPD_H */
ef416fc2 720
721
eac3a0a0
MS
722/*
723 * Do we have <iconv.h>?
724 */
725
726/* #undef HAVE_ICONV_H */
727
728
729/*
730 * Do we have statfs or statvfs and one of the corresponding headers?
731 */
732
733/* #undef HAVE_STATFS */
734/* #undef HAVE_STATVFS */
735/* #undef HAVE_SYS_MOUNT_H */
736/* #undef HAVE_SYS_STATFS_H */
737/* #undef HAVE_SYS_STATVFS_H */
738/* #undef HAVE_SYS_VFS_H */
739
740
741/*
f3c17241 742 * Location of OS X localization bundle, if any.
eac3a0a0
MS
743 */
744
745/* #undef CUPS_BUNDLEDIR */
746
747
748/*
db8b865d 749 * Do we have XPC?
eac3a0a0
MS
750 */
751
db8b865d
MS
752/* #undef HAVE_XPC */
753/* #undef HAVE_XPC_PRIVATE_H */
eac3a0a0
MS
754
755
756/*
db8b865d 757 * Do we have Mini-XML?
eac3a0a0
MS
758 */
759
db8b865d
MS
760/* #undef HAVE_MXML_H */
761
762
763/*
764 * Do we have the C99 abs() function?
765 */
eac3a0a0 766
db8b865d
MS
767/* #undef HAVE_ABS */
768#if !defined(HAVE_ABS) && !defined(abs)
769# if defined(__GNUC__) || __STDC_VERSION__ >= 199901L
770# define abs(x) _cups_abs(x)
771static inline int _cups_abs(int i) { return (i < 0 ? -i : i); }
772# elif defined(_MSC_VER)
773# define abs(x) _cups_abs(x)
774static __inline int _cups_abs(int i) { return (i < 0 ? -i : i); }
775# else
776# define abs(x) ((x) < 0 ? -(x) : (x))
777# endif /* __GNUC__ || __STDC_VERSION__ */
778#endif /* !HAVE_ABS && !abs */
eac3a0a0 779
441de8b2 780#if defined(HAVE_LAUNCHD) || defined(HAVE_SYSTEMD) || defined(HAVE_UPSTART)
c187d9ab
BN
781# define HAVE_ONDEMAND
782#else
783# undef HAVE_ONDEMAND
784#endif
785
ef416fc2 786#endif /* !_CUPS_CONFIG_H_ */