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