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