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