]> git.ipfire.org Git - thirdparty/cups.git/blame - vcnet/config.h
Fix source file header text duplication text duplication.
[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
57b7b66b 11 * 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
61b7ebde
MS
97#define CUPS_SVERSION "CUPS v2.2.2"
98#define CUPS_MINIMAL "CUPS/2.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 ""
61b7ebde 109#define CUPS_DEFAULT_SYSTEM_AUTHKEY ""
536bc2c6
MS
110
111
112/*
113 * Default file permissions...
114 */
115
61b7ebde 116#define CUPS_DEFAULT_CONFIG_FILE_PERM 0644
536bc2c6
MS
117#define CUPS_DEFAULT_LOG_FILE_PERM 0644
118
119
120/*
121 * Default logging settings...
122 */
123
124#define CUPS_DEFAULT_LOG_LEVEL "warn"
61b7ebde 125#define CUPS_DEFAULT_ACCESS_LOG_LEVEL "none"
536bc2c6
MS
126
127
128/*
129 * Default fatal error settings...
130 */
131
132#define CUPS_DEFAULT_FATAL_ERRORS "config"
133
134
135/*
136 * Default browsing settings...
137 */
138
139#define CUPS_DEFAULT_BROWSING 1
61b7ebde 140#define CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS "dnssd"
536bc2c6 141#define CUPS_DEFAULT_DEFAULT_SHARED 1
ef416fc2 142
143
144/*
145 * Default IPP port...
146 */
147
536bc2c6
MS
148#define CUPS_DEFAULT_IPP_PORT 631
149
150
151/*
152 * Default printcap file...
153 */
154
155#define CUPS_DEFAULT_PRINTCAP ""
ef416fc2 156
157
158/*
536bc2c6 159 * Default Samba and LPD config files...
ef416fc2 160 */
161
536bc2c6
MS
162#define CUPS_DEFAULT_SMB_CONFIG_FILE ""
163#define CUPS_DEFAULT_LPD_CONFIG_FILE ""
164
165
166/*
167 * Default MaxCopies value...
168 */
169
170#define CUPS_DEFAULT_MAX_COPIES 9999
ef416fc2 171
172
173/*
1e564ac8 174 * Do we have domain socket support, and if so what is the default one?
ef416fc2 175 */
176
177#undef CUPS_DEFAULT_DOMAINSOCKET
178
179
db8b865d
MS
180/*
181 * Default WebInterface value...
182 */
183
61b7ebde 184#define CUPS_DEFAULT_WEBIF 0
db8b865d
MS
185
186
ef416fc2 187/*
188 * Where are files stored?
189 *
190 * Note: These are defaults, which can be overridden by environment
191 * variables at run-time...
192 */
193
536bc2c6
MS
194#define CUPS_BINDIR "C:/CUPS/bin"
195#define CUPS_CACHEDIR "C:/CUPS/cache"
196#define CUPS_DATADIR "C:/CUPS/share"
197#define CUPS_DOCROOT "C:/CUPS/share/doc"
198#define CUPS_FONTPATH "C:/CUPS/share/fonts"
199#define CUPS_LOCALEDIR "C:/CUPS/locale"
200#define CUPS_LOGDIR "C:/CUPS/logs"
201#define CUPS_REQUESTS "C:/CUPS/spool"
202#define CUPS_SBINDIR "C:/CUPS/sbin"
203#define CUPS_SERVERBIN "C:/CUPS/lib"
204#define CUPS_SERVERROOT "C:/CUPS/etc"
205#define CUPS_STATEDIR "C:/CUPS/run"
ef416fc2 206
207
1e564ac8
MS
208/*
209 * Do we have posix_spawn?
210 */
211
212/* #undef HAVE_POSIX_SPAWN */
213
214
ef416fc2 215/*
db8b865d 216 * Do we have ZLIB?
ef416fc2 217 */
218
db8b865d
MS
219#define HAVE_LIBZ 1
220#define HAVE_INFLATECOPY 1
ef416fc2 221
222
223/*
224 * Do we have PAM stuff?
225 */
226
ef416fc2 227#define HAVE_LIBPAM 0
536bc2c6
MS
228/* #undef HAVE_PAM_PAM_APPL_H */
229/* #undef HAVE_PAM_SET_ITEM */
230/* #undef HAVE_PAM_SETCRED */
ef416fc2 231
232
233/*
234 * Do we have <shadow.h>?
235 */
236
536bc2c6 237/* #undef HAVE_SHADOW_H */
ef416fc2 238
239
240/*
241 * Do we have <crypt.h>?
242 */
243
536bc2c6 244/* #undef HAVE_CRYPT_H */
ef416fc2 245
246
f8b3a85b 247/*
db8b865d 248 * Use <stdint.h>?
f8b3a85b
MS
249 */
250
db8b865d 251/* #undef HAVE_STDINT_H */
f8b3a85b
MS
252
253
ef416fc2 254/*
255 * Use <string.h>, <strings.h>, and/or <bstring.h>?
256 */
257
536bc2c6
MS
258#define HAVE_STRING_H 1
259/* #undef HAVE_STRINGS_H */
260/* #undef HAVE_BSTRING_H */
ef416fc2 261
262
263/*
264 * Do we have the long long type?
265 */
266
536bc2c6 267/* #undef HAVE_LONG_LONG */
ef416fc2 268
269#ifdef HAVE_LONG_LONG
270# define CUPS_LLFMT "%lld"
271# define CUPS_LLCAST (long long)
272#else
273# define CUPS_LLFMT "%ld"
274# define CUPS_LLCAST (long)
275#endif /* HAVE_LONG_LONG */
276
277
278/*
279 * Do we have the strtoll() function?
280 */
281
536bc2c6 282/* #undef HAVE_STRTOLL */
ef416fc2 283
284#ifndef HAVE_STRTOLL
285# define strtoll(nptr,endptr,base) strtol((nptr), (endptr), (base))
286#endif /* !HAVE_STRTOLL */
287
288
289/*
290 * Do we have the strXXX() functions?
291 */
292
6d2f911b 293#define HAVE_STRDUP 1
536bc2c6
MS
294/* #undef HAVE_STRLCAT */
295/* #undef HAVE_STRLCPY */
ef416fc2 296
297
298/*
299 * Do we have the geteuid() function?
300 */
301
536bc2c6 302/* #undef HAVE_GETEUID */
ef416fc2 303
304
88f9aafc
MS
305/*
306 * Do we have the setpgid() function?
307 */
308
309/* #undef HAVE_SETPGID */
310
311
ef416fc2 312/*
313 * Do we have the vsyslog() function?
314 */
315
536bc2c6 316/* #undef HAVE_VSYSLOG */
ef416fc2 317
318
61b7ebde
MS
319/*
320 * Do we have the systemd journal functions?
321 */
322
323/* #undef HAVE_SYSTEMD_SD_JOURNAL_H */
324
325
ef416fc2 326/*
327 * Do we have the (v)snprintf() functions?
328 */
329
536bc2c6
MS
330#define HAVE_SNPRINTF 1
331#define HAVE_VSNPRINTF 1
ef416fc2 332
333
334/*
335 * What signal functions to use?
336 */
337
536bc2c6
MS
338/* #undef HAVE_SIGSET */
339/* #undef HAVE_SIGACTION */
ef416fc2 340
341
342/*
343 * What wait functions to use?
344 */
345
536bc2c6
MS
346/* #undef HAVE_WAITPID */
347/* #undef HAVE_WAIT3 */
ef416fc2 348
349
350/*
351 * Do we have the mallinfo function and malloc.h?
352 */
353
536bc2c6
MS
354/* #undef HAVE_MALLINFO */
355/* #undef HAVE_MALLOC_H */
356
357
358/*
359 * Do we have the POSIX ACL functions?
360 */
361
362/* #undef HAVE_ACL_INIT */
ef416fc2 363
364
365/*
366 * Do we have the langinfo.h header file?
367 */
368
536bc2c6 369/* #undef HAVE_LANGINFO_H */
ef416fc2 370
371
372/*
373 * Which encryption libraries do we have?
374 */
375
536bc2c6
MS
376/* #undef HAVE_CDSASSL */
377/* #undef HAVE_GNUTLS */
61b7ebde
MS
378#define HAVE_SSPISSL 1
379#define HAVE_SSL 1
536bc2c6
MS
380
381
1e564ac8
MS
382/*
383 * Do we have the gnutls_transport_set_pull_timeout_function function?
384 */
385
386/* #undef HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION */
387
388
19ba6878
MS
389/*
390 * Do we have the gnutls_priority_set_direct function?
391 */
392
393/* #undef HAVE_GNUTLS_PRIORITY_SET_DIRECT */
394
395
536bc2c6 396/*
db8b865d 397 * What Security framework headers do we have?
eac3a0a0
MS
398 */
399
db8b865d
MS
400/* #undef HAVE_AUTHORIZATION_H */
401/* #undef HAVE_SECBASEPRIV_H */
402/* #undef HAVE_SECCERTIFICATE_H */
403/* #undef HAVE_SECIDENTITYSEARCHPRIV_H */
404/* #undef HAVE_SECITEM_H */
405/* #undef HAVE_SECITEMPRIV_H */
406/* #undef HAVE_SECPOLICY_H */
407/* #undef HAVE_SECPOLICYPRIV_H */
408/* #undef HAVE_SECURETRANSPORTPRIV_H */
eac3a0a0
MS
409
410
411/*
412 * Do we have the cssmErrorString function?
413 */
414
415/* #undef HAVE_CSSMERRORSTRING */
416
417
1e564ac8
MS
418/*
419 * Do we have the SecGenerateSelfSignedCertificate function?
420 */
421
422/* #undef HAVE_SECGENERATESELFSIGNEDCERTIFICATE */
423
424
425/*
426 * Do we have the SecKeychainOpen function?
427 */
428
429/* #undef HAVE_SECKEYCHAINOPEN */
430
431
61b7ebde
MS
432/*
433 * Do we have (a working) SSLSetEnabledCiphers function?
434 */
435
436#define HAVE_SSLSETENABLEDCIPHERS 1
437
438
536bc2c6 439/*
db8b865d 440 * Do we have libpaper?
536bc2c6
MS
441 */
442
db8b865d 443/* #undef HAVE_LIBPAPER */
ef416fc2 444
445
446/*
db8b865d 447 * Do we have mDNSResponder for DNS Service Discovery (aka Bonjour)?
ef416fc2 448 */
449
db8b865d 450#define HAVE_DNSSD 1
ef416fc2 451
452
453/*
db8b865d 454 * Do we have Avahi for DNS Service Discovery (aka Bonjour)?
ef416fc2 455 */
456
db8b865d 457#undef HAVE_AVAHI
536bc2c6
MS
458
459
460/*
db8b865d 461 * Do we have <sys/ioctl.h>?
536bc2c6
MS
462 */
463
db8b865d 464#undef HAVE_SYS_IOCTL_H
536bc2c6
MS
465
466
eac3a0a0
MS
467/*
468 * Does the "stat" structure contain the "st_gen" member?
469 */
470
471/* #undef HAVE_ST_GEN */
472
473
ef416fc2 474/*
475 * Does the "tm" structure contain the "tm_gmtoff" member?
476 */
477
536bc2c6 478/* #undef HAVE_TM_GMTOFF */
ef416fc2 479
480
481/*
482 * Do we have rresvport_af()?
483 */
484
536bc2c6 485/* #undef HAVE_RRESVPORT_AF */
ef416fc2 486
487
488/*
489 * Do we have getaddrinfo()?
490 */
491
536bc2c6 492#define HAVE_GETADDRINFO 1
ef416fc2 493
494
495/*
496 * Do we have getnameinfo()?
497 */
498
536bc2c6 499#define HAVE_GETNAMEINFO 1
ef416fc2 500
501
502/*
503 * Do we have getifaddrs()?
504 */
505
536bc2c6 506/* #undef HAVE_GETIFADDRS */
ef416fc2 507
508
509/*
510 * Do we have hstrerror()?
511 */
512
536bc2c6
MS
513/* #undef HAVE_HSTRERROR */
514
515
516/*
517 * Do we have res_init()?
518 */
519
520/* #undef HAVE_RES_INIT */
521
522
523/*
524 * Do we have <resolv.h>
525 */
526
527/* #undef HAVE_RESOLV_H */
ef416fc2 528
529
530/*
531 * Do we have the <sys/sockio.h> header file?
532 */
533
536bc2c6 534/* #undef HAVE_SYS_SOCKIO_H */
ef416fc2 535
536
537/*
538 * Does the sockaddr structure contain an sa_len parameter?
539 */
540
536bc2c6 541/* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */
ef416fc2 542
543
ef416fc2 544/*
545 * Do we have pthread support?
546 */
547
536bc2c6
MS
548/* #undef HAVE_PTHREAD_H */
549
550
1166bf58
MS
551/*
552 * Do we have on-demand support (launchd/systemd/upstart)?
553 */
554
555/* #undef HAVE_ONDEMAND */
556
557
536bc2c6
MS
558/*
559 * Do we have launchd support?
560 */
561
562/* #undef HAVE_LAUNCH_H */
563/* #undef HAVE_LAUNCHD */
ef416fc2 564
565
1e564ac8
MS
566/*
567 * Do we have systemd support?
568 */
569
570/* #undef HAVE_SYSTEMD */
571
572
1166bf58
MS
573/*
574 * Do we have upstart support?
575 */
576
577/* #undef HAVE_UPSTART */
578
579
ef416fc2 580/*
581 * Various scripting languages...
582 */
583
536bc2c6
MS
584/* #undef HAVE_JAVA */
585#define CUPS_JAVA ""
586/* #undef HAVE_PERL */
587#define CUPS_PERL ""
588/* #undef HAVE_PHP */
589#define CUPS_PHP ""
590/* #undef HAVE_PYTHON */
591#define CUPS_PYTHON ""
592
593
536bc2c6
MS
594/*
595 * Do we have CoreFoundation public and private headers?
596 */
597
598/* #undef HAVE_COREFOUNDATION_H */
599/* #undef HAVE_CFPRIV_H */
600/* #undef HAVE_CFBUNDLEPRIV_H */
601
602
6d2f911b
MS
603/*
604 * Do we have ApplicationServices public headers?
605 */
606
607/* #undef HAVE_APPLICATIONSERVICES_H */
608
609
610/*
611 * Do we have the SCDynamicStoreCopyComputerName function?
612 */
613
614/* #undef HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */
615
616
6eb98aee
MS
617/*
618 * Do we have the getgrouplist() function?
619 */
620
621#undef HAVE_GETGROUPLIST
622
623
536bc2c6 624/*
8072030b 625 * Do we have macOS 10.4's mbr_XXX functions?
536bc2c6
MS
626 */
627
628/* #undef HAVE_MEMBERSHIP_H */
629/* #undef HAVE_MEMBERSHIPPRIV_H */
630/* #undef HAVE_MBR_UID_TO_UUID */
631
632
633/*
eac3a0a0 634 * Do we have Darwin's notify_post header and function?
536bc2c6
MS
635 */
636
637/* #undef HAVE_NOTIFY_H */
638/* #undef HAVE_NOTIFY_POST */
639
640
536bc2c6 641/*
eac3a0a0 642 * Do we have DBUS?
536bc2c6
MS
643 */
644
eac3a0a0
MS
645/* #undef HAVE_DBUS */
646/* #undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND */
1e564ac8 647/* #undef HAVE_DBUS_THREADS_INIT */
536bc2c6
MS
648
649
650/*
651 * Do we have the GSSAPI support library (for Kerberos support)?
652 */
653
eac3a0a0
MS
654/* #undef HAVE_GSS_ACQUIRE_CRED_EX_F */
655/* #undef HAVE_GSS_C_NT_HOSTBASED_SERVICE */
656/* #undef HAVE_GSS_GSSAPI_H */
657/* #undef HAVE_GSS_GSSAPI_SPI_H */
536bc2c6 658/* #undef HAVE_GSSAPI */
536bc2c6 659/* #undef HAVE_GSSAPI_GSSAPI_H */
eac3a0a0 660/* #undef HAVE_GSSAPI_H */
536bc2c6
MS
661
662
663/*
664 * Default GSS service name...
665 */
666
f8b3a85b 667#define CUPS_DEFAULT_GSSSERVICENAME "host"
536bc2c6
MS
668
669
670/*
671 * Select/poll interfaces...
672 */
673
674/* #undef HAVE_POLL */
675/* #undef HAVE_EPOLL */
676/* #undef HAVE_KQUEUE */
677
678
679/*
680 * Do we have the <dlfcn.h> header?
681 */
682
683/* #undef HAVE_DLFCN_H */
684
685
686/*
687 * Do we have <sys/param.h>?
688 */
689
690/* #undef HAVE_SYS_PARAM_H */
691
692
693/*
694 * Do we have <sys/ucred.h>?
695 */
696
697/* #undef HAVE_SYS_UCRED_H */
698
699
700/*
701 * Do we have removefile()?
702 */
703
704/* #undef HAVE_REMOVEFILE */
705
706
707/*
708 * Do we have <sandbox.h>?
709 */
710
711/* #undef HAVE_SANDBOX_H */
712
713
714/*
715 * Which random number generator function to use...
716 */
717
f8b3a85b 718/* #undef HAVE_ARC4RANDOM */
536bc2c6 719/* #undef HAVE_RANDOM */
536bc2c6
MS
720/* #undef HAVE_LRAND48 */
721
f8b3a85b
MS
722#ifdef HAVE_ARC4RANDOM
723# define CUPS_RAND() arc4random()
61b7ebde 724# define CUPS_SRAND(v)
f8b3a85b
MS
725#elif defined(HAVE_RANDOM)
726# define CUPS_RAND() random()
727# define CUPS_SRAND(v) srandom(v)
728#elif defined(HAVE_LRAND48)
729# define CUPS_RAND() lrand48()
730# define CUPS_SRAND(v) srand48(v)
731#else
732# define CUPS_RAND() rand()
733# define CUPS_SRAND(v) srand(v)
734#endif /* HAVE_ARC4RANDOM */
735
536bc2c6 736
536bc2c6
MS
737/*
738 * Do we have libusb?
739 */
740
db8b865d 741/* #undef HAVE_LIBUSB */
536bc2c6
MS
742
743
744/*
745 * Do we have libwrap and tcpd.h?
746 */
747
748/* #undef HAVE_TCPD_H */
ef416fc2 749
750
eac3a0a0
MS
751/*
752 * Do we have <iconv.h>?
753 */
754
755/* #undef HAVE_ICONV_H */
756
757
758/*
759 * Do we have statfs or statvfs and one of the corresponding headers?
760 */
761
762/* #undef HAVE_STATFS */
763/* #undef HAVE_STATVFS */
764/* #undef HAVE_SYS_MOUNT_H */
765/* #undef HAVE_SYS_STATFS_H */
766/* #undef HAVE_SYS_STATVFS_H */
767/* #undef HAVE_SYS_VFS_H */
768
769
770/*
8072030b 771 * Location of macOS localization bundle, if any.
eac3a0a0
MS
772 */
773
774/* #undef CUPS_BUNDLEDIR */
775
776
777/*
db8b865d 778 * Do we have XPC?
eac3a0a0
MS
779 */
780
db8b865d
MS
781/* #undef HAVE_XPC */
782/* #undef HAVE_XPC_PRIVATE_H */
eac3a0a0
MS
783
784
785/*
db8b865d 786 * Do we have Mini-XML?
eac3a0a0
MS
787 */
788
db8b865d
MS
789/* #undef HAVE_MXML_H */
790
791
792/*
793 * Do we have the C99 abs() function?
794 */
eac3a0a0 795
db8b865d
MS
796/* #undef HAVE_ABS */
797#if !defined(HAVE_ABS) && !defined(abs)
798# if defined(__GNUC__) || __STDC_VERSION__ >= 199901L
799# define abs(x) _cups_abs(x)
800static inline int _cups_abs(int i) { return (i < 0 ? -i : i); }
801# elif defined(_MSC_VER)
802# define abs(x) _cups_abs(x)
803static __inline int _cups_abs(int i) { return (i < 0 ? -i : i); }
804# else
805# define abs(x) ((x) < 0 ? -(x) : (x))
806# endif /* __GNUC__ || __STDC_VERSION__ */
807#endif /* !HAVE_ABS && !abs */
eac3a0a0 808
ef416fc2 809#endif /* !_CUPS_CONFIG_H_ */