]>
git.ipfire.org Git - thirdparty/cups.git/blob - vcnet/config.h
2 * Configuration file for CUPS on Windows.
4 * Copyright 2007-2018 by Apple Inc.
5 * Copyright 1997-2007 by Easy Software Products.
7 * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
10 #ifndef _CUPS_CONFIG_H_
11 #define _CUPS_CONFIG_H_
14 * Include necessary headers...
26 * Microsoft renames the POSIX functions to _name, and introduces
27 * a broken compatibility layer using the original names. As a result,
28 * random crashes can occur when, for example, strdup() allocates memory
29 * from a different heap than used by malloc() and free().
31 * To avoid moronic problems like this, we #define the POSIX function
32 * names to the corresponding non-standard Microsoft names.
35 #define access _access
37 #define fileno _fileno
39 #define mkdir(d,p) _mkdir(d)
43 #define snprintf _snprintf
44 #define strdup _strdup
45 #define unlink _unlink
46 #define vsnprintf _vsnprintf
51 * Map the POSIX strcasecmp() and strncasecmp() functions to the Win32
52 * _stricmp() and _strnicmp() functions...
55 #define strcasecmp _stricmp
56 #define strncasecmp _strnicmp
60 * Map the POSIX sleep() and usleep() functions to the Win32 Sleep() function...
63 typedef unsigned long useconds_t
;
64 #define sleep(X) Sleep(1000 * (X))
65 #define usleep(X) Sleep((X)/1000)
69 * Map various parameters to Posix style system calls
75 # define O_RDONLY _O_RDONLY
76 # define O_WRONLY _O_WRONLY
77 # define O_CREAT _O_CREAT
78 # define O_TRUNC _O_TRUNC
86 #undef __CHAR_UNSIGNED__
90 * Version of software...
93 #define CUPS_SVERSION "CUPS v2.3.0"
94 #define CUPS_MINIMAL "CUPS/2.3.0"
98 * Default user and groups...
101 #define CUPS_DEFAULT_USER ""
102 #define CUPS_DEFAULT_GROUP ""
103 #define CUPS_DEFAULT_SYSTEM_GROUPS ""
104 #define CUPS_DEFAULT_PRINTOPERATOR_AUTH ""
105 #define CUPS_DEFAULT_SYSTEM_AUTHKEY ""
109 * Default file permissions...
112 #define CUPS_DEFAULT_CONFIG_FILE_PERM 0644
113 #define CUPS_DEFAULT_LOG_FILE_PERM 0644
117 * Default logging settings...
120 #define CUPS_DEFAULT_LOG_LEVEL "warn"
121 #define CUPS_DEFAULT_ACCESS_LOG_LEVEL "none"
125 * Default fatal error settings...
128 #define CUPS_DEFAULT_FATAL_ERRORS "config"
132 * Default browsing settings...
135 #define CUPS_DEFAULT_BROWSING 1
136 #define CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS "dnssd"
137 #define CUPS_DEFAULT_DEFAULT_SHARED 1
141 * Default IPP port...
144 #define CUPS_DEFAULT_IPP_PORT 631
148 * Default printcap file...
151 #define CUPS_DEFAULT_PRINTCAP ""
155 * Default Samba and LPD config files...
158 #define CUPS_DEFAULT_SMB_CONFIG_FILE ""
159 #define CUPS_DEFAULT_LPD_CONFIG_FILE ""
163 * Default MaxCopies value...
166 #define CUPS_DEFAULT_MAX_COPIES 9999
170 * Do we have domain socket support, and if so what is the default one?
173 #undef CUPS_DEFAULT_DOMAINSOCKET
177 * Default WebInterface value...
180 #define CUPS_DEFAULT_WEBIF 0
184 * Where are files stored?
186 * Note: These are defaults, which can be overridden by environment
187 * variables at run-time...
190 #define CUPS_BINDIR "C:/CUPS/bin"
191 #define CUPS_CACHEDIR "C:/CUPS/cache"
192 #define CUPS_DATADIR "C:/CUPS/share"
193 #define CUPS_DOCROOT "C:/CUPS/share/doc"
194 #define CUPS_FONTPATH "C:/CUPS/share/fonts"
195 #define CUPS_LOCALEDIR "C:/CUPS/locale"
196 #define CUPS_LOGDIR "C:/CUPS/logs"
197 #define CUPS_REQUESTS "C:/CUPS/spool"
198 #define CUPS_SBINDIR "C:/CUPS/sbin"
199 #define CUPS_SERVERBIN "C:/CUPS/lib"
200 #define CUPS_SERVERROOT "C:/CUPS/etc"
201 #define CUPS_STATEDIR "C:/CUPS/run"
205 * Do we have posix_spawn?
208 /* #undef HAVE_POSIX_SPAWN */
216 #define HAVE_INFLATECOPY 1
220 * Do we have PAM stuff?
223 #define HAVE_LIBPAM 0
224 /* #undef HAVE_PAM_PAM_APPL_H */
225 /* #undef HAVE_PAM_SET_ITEM */
226 /* #undef HAVE_PAM_SETCRED */
230 * Do we have <shadow.h>?
233 /* #undef HAVE_SHADOW_H */
237 * Do we have <crypt.h>?
240 /* #undef HAVE_CRYPT_H */
247 /* #undef HAVE_STDINT_H */
251 * Use <string.h>, <strings.h>, and/or <bstring.h>?
254 #define HAVE_STRING_H 1
255 /* #undef HAVE_STRINGS_H */
256 /* #undef HAVE_BSTRING_H */
260 * Do we have the long long type?
263 /* #undef HAVE_LONG_LONG */
265 #ifdef HAVE_LONG_LONG
266 # define CUPS_LLFMT "%lld"
267 # define CUPS_LLCAST (long long)
269 # define CUPS_LLFMT "%ld"
270 # define CUPS_LLCAST (long)
271 #endif /* HAVE_LONG_LONG */
275 * Do we have the strtoll() function?
278 /* #undef HAVE_STRTOLL */
281 # define strtoll(nptr,endptr,base) strtol((nptr), (endptr), (base))
282 #endif /* !HAVE_STRTOLL */
286 * Do we have the strXXX() functions?
289 #define HAVE_STRDUP 1
290 /* #undef HAVE_STRLCAT */
291 /* #undef HAVE_STRLCPY */
295 * Do we have the geteuid() function?
298 /* #undef HAVE_GETEUID */
302 * Do we have the setpgid() function?
305 /* #undef HAVE_SETPGID */
309 * Do we have the vsyslog() function?
312 /* #undef HAVE_VSYSLOG */
316 * Do we have the systemd journal functions?
319 /* #undef HAVE_SYSTEMD_SD_JOURNAL_H */
323 * Do we have the (v)snprintf() functions?
326 #define HAVE_SNPRINTF 1
327 #define HAVE_VSNPRINTF 1
331 * What signal functions to use?
334 /* #undef HAVE_SIGSET */
335 /* #undef HAVE_SIGACTION */
339 * What wait functions to use?
342 /* #undef HAVE_WAITPID */
343 /* #undef HAVE_WAIT3 */
347 * Do we have the mallinfo function and malloc.h?
350 /* #undef HAVE_MALLINFO */
351 /* #undef HAVE_MALLOC_H */
355 * Do we have the POSIX ACL functions?
358 /* #undef HAVE_ACL_INIT */
362 * Do we have the langinfo.h header file?
365 /* #undef HAVE_LANGINFO_H */
369 * Which encryption libraries do we have?
372 /* #undef HAVE_CDSASSL */
373 /* #undef HAVE_GNUTLS */
374 #define HAVE_SSPISSL 1
379 * Do we have the gnutls_transport_set_pull_timeout_function function?
382 /* #undef HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION */
386 * Do we have the gnutls_priority_set_direct function?
389 /* #undef HAVE_GNUTLS_PRIORITY_SET_DIRECT */
393 * What Security framework headers do we have?
396 /* #undef HAVE_AUTHORIZATION_H */
397 /* #undef HAVE_SECBASEPRIV_H */
398 /* #undef HAVE_SECCERTIFICATE_H */
399 /* #undef HAVE_SECIDENTITYSEARCHPRIV_H */
400 /* #undef HAVE_SECITEM_H */
401 /* #undef HAVE_SECITEMPRIV_H */
402 /* #undef HAVE_SECPOLICY_H */
403 /* #undef HAVE_SECPOLICYPRIV_H */
404 /* #undef HAVE_SECURETRANSPORTPRIV_H */
408 * Do we have the cssmErrorString function?
411 /* #undef HAVE_CSSMERRORSTRING */
415 * Do we have the SecGenerateSelfSignedCertificate function?
418 /* #undef HAVE_SECGENERATESELFSIGNEDCERTIFICATE */
422 * Do we have the SecKeychainOpen function?
425 /* #undef HAVE_SECKEYCHAINOPEN */
429 * Do we have (a working) SSLSetEnabledCiphers function?
432 #define HAVE_SSLSETENABLEDCIPHERS 1
436 * Do we have libpaper?
439 /* #undef HAVE_LIBPAPER */
443 * Do we have mDNSResponder for DNS Service Discovery (aka Bonjour)?
450 * Do we have Avahi for DNS Service Discovery (aka Bonjour)?
457 * Do we have <sys/ioctl.h>?
460 #undef HAVE_SYS_IOCTL_H
464 * Does the "stat" structure contain the "st_gen" member?
467 /* #undef HAVE_ST_GEN */
471 * Does the "tm" structure contain the "tm_gmtoff" member?
474 /* #undef HAVE_TM_GMTOFF */
478 * Do we have rresvport_af()?
481 /* #undef HAVE_RRESVPORT_AF */
485 * Do we have getaddrinfo()?
488 #define HAVE_GETADDRINFO 1
492 * Do we have getnameinfo()?
495 #define HAVE_GETNAMEINFO 1
499 * Do we have getifaddrs()?
502 /* #undef HAVE_GETIFADDRS */
506 * Do we have hstrerror()?
509 /* #undef HAVE_HSTRERROR */
513 * Do we have res_init()?
516 /* #undef HAVE_RES_INIT */
520 * Do we have <resolv.h>
523 /* #undef HAVE_RESOLV_H */
527 * Do we have the <sys/sockio.h> header file?
530 /* #undef HAVE_SYS_SOCKIO_H */
534 * Does the sockaddr structure contain an sa_len parameter?
537 /* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */
541 * Do we have pthread support?
544 /* #undef HAVE_PTHREAD_H */
548 * Do we have on-demand support (launchd/systemd/upstart)?
551 /* #undef HAVE_ONDEMAND */
555 * Do we have launchd support?
558 /* #undef HAVE_LAUNCH_H */
559 /* #undef HAVE_LAUNCHD */
563 * Do we have systemd support?
566 /* #undef HAVE_SYSTEMD */
570 * Do we have upstart support?
573 /* #undef HAVE_UPSTART */
577 * Do we have CoreFoundation public and private headers?
580 /* #undef HAVE_COREFOUNDATION_H */
581 /* #undef HAVE_CFPRIV_H */
582 /* #undef HAVE_CFBUNDLEPRIV_H */
586 * Do we have ApplicationServices public headers?
589 /* #undef HAVE_APPLICATIONSERVICES_H */
593 * Do we have the SCDynamicStoreCopyComputerName function?
596 /* #undef HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */
600 * Do we have the getgrouplist() function?
603 #undef HAVE_GETGROUPLIST
607 * Do we have macOS 10.4's mbr_XXX functions?
610 /* #undef HAVE_MEMBERSHIP_H */
611 /* #undef HAVE_MEMBERSHIPPRIV_H */
612 /* #undef HAVE_MBR_UID_TO_UUID */
616 * Do we have Darwin's notify_post header and function?
619 /* #undef HAVE_NOTIFY_H */
620 /* #undef HAVE_NOTIFY_POST */
627 /* #undef HAVE_DBUS */
628 /* #undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND */
629 /* #undef HAVE_DBUS_THREADS_INIT */
633 * Do we have the GSSAPI support library (for Kerberos support)?
636 /* #undef HAVE_GSS_ACQUIRE_CRED_EX_F */
637 /* #undef HAVE_GSS_C_NT_HOSTBASED_SERVICE */
638 /* #undef HAVE_GSS_GSSAPI_H */
639 /* #undef HAVE_GSS_GSSAPI_SPI_H */
640 /* #undef HAVE_GSSAPI */
641 /* #undef HAVE_GSSAPI_GSSAPI_H */
642 /* #undef HAVE_GSSAPI_H */
646 * Default GSS service name...
649 #define CUPS_DEFAULT_GSSSERVICENAME "host"
653 * Select/poll interfaces...
656 /* #undef HAVE_POLL */
657 /* #undef HAVE_EPOLL */
658 /* #undef HAVE_KQUEUE */
662 * Do we have the <dlfcn.h> header?
665 /* #undef HAVE_DLFCN_H */
669 * Do we have <sys/param.h>?
672 /* #undef HAVE_SYS_PARAM_H */
676 * Do we have <sys/ucred.h>?
679 /* #undef HAVE_SYS_UCRED_H */
683 * Do we have removefile()?
686 /* #undef HAVE_REMOVEFILE */
690 * Do we have <sandbox.h>?
693 /* #undef HAVE_SANDBOX_H */
697 * Which random number generator function to use...
700 /* #undef HAVE_ARC4RANDOM */
701 /* #undef HAVE_RANDOM */
702 /* #undef HAVE_LRAND48 */
704 #ifdef HAVE_ARC4RANDOM
705 # define CUPS_RAND() arc4random()
706 # define CUPS_SRAND(v)
707 #elif defined(HAVE_RANDOM)
708 # define CUPS_RAND() random()
709 # define CUPS_SRAND(v) srandom(v)
710 #elif defined(HAVE_LRAND48)
711 # define CUPS_RAND() lrand48()
712 # define CUPS_SRAND(v) srand48(v)
714 # define CUPS_RAND() rand()
715 # define CUPS_SRAND(v) srand(v)
716 #endif /* HAVE_ARC4RANDOM */
723 /* #undef HAVE_LIBUSB */
727 * Do we have libwrap and tcpd.h?
730 /* #undef HAVE_TCPD_H */
734 * Do we have <iconv.h>?
737 /* #undef HAVE_ICONV_H */
741 * Do we have statfs or statvfs and one of the corresponding headers?
744 /* #undef HAVE_STATFS */
745 /* #undef HAVE_STATVFS */
746 /* #undef HAVE_SYS_MOUNT_H */
747 /* #undef HAVE_SYS_STATFS_H */
748 /* #undef HAVE_SYS_STATVFS_H */
749 /* #undef HAVE_SYS_VFS_H */
753 * Location of macOS localization bundle, if any.
756 /* #undef CUPS_BUNDLEDIR */
763 /* #undef HAVE_XPC */
764 /* #undef HAVE_XPC_PRIVATE_H */
768 * Do we have Mini-XML?
771 /* #undef HAVE_MXML_H */
775 * Do we have the C99 abs() function?
778 /* #undef HAVE_ABS */
779 #if !defined(HAVE_ABS) && !defined(abs)
780 # if defined(__GNUC__) || __STDC_VERSION__ >= 199901L
781 # define abs(x) _cups_abs(x)
782 static inline int _cups_abs(int i
) { return (i
< 0 ? -i
: i
); }
783 # elif defined(_MSC_VER)
784 # define abs(x) _cups_abs(x)
785 static __inline
int _cups_abs(int i
) { return (i
< 0 ? -i
: i
); }
787 # define abs(x) ((x) < 0 ? -(x) : (x))
788 # endif /* __GNUC__ || __STDC_VERSION__ */
789 #endif /* !HAVE_ABS && !abs */
791 #endif /* !_CUPS_CONFIG_H_ */