]>
git.ipfire.org Git - thirdparty/cups.git/blob - vcnet/config.h
2 * Configuration file for CUPS on Windows.
4 * Copyright © 2007-2019 by Apple Inc.
5 * Copyright © 1997-2007 by Easy Software Products.
7 * Licensed under Apache License v2.0. See the file "LICENSE" for more
11 #ifndef _CUPS_CONFIG_H_
12 #define _CUPS_CONFIG_H_
15 * Include necessary headers...
27 * Microsoft renames the POSIX functions to _name, and introduces
28 * a broken compatibility layer using the original names. As a result,
29 * random crashes can occur when, for example, strdup() allocates memory
30 * from a different heap than used by malloc() and free().
32 * To avoid moronic problems like this, we #define the POSIX function
33 * names to the corresponding non-standard Microsoft names.
36 #define access _access
38 #define fileno _fileno
40 #define mkdir(d,p) _mkdir(d)
44 #define strdup _strdup
45 #define unlink _unlink
50 * Map the POSIX strcasecmp() and strncasecmp() functions to the Win32
51 * _stricmp() and _strnicmp() functions...
54 #define strcasecmp _stricmp
55 #define strncasecmp _strnicmp
59 * Map the POSIX sleep() and usleep() functions to the Win32 Sleep() function...
62 typedef unsigned long useconds_t
;
63 #define sleep(X) Sleep(1000 * (X))
64 #define usleep(X) Sleep((X)/1000)
68 * Map various parameters to Posix style system calls
74 # define O_RDONLY _O_RDONLY
75 # define O_WRONLY _O_WRONLY
76 # define O_CREAT _O_CREAT
77 # define O_TRUNC _O_TRUNC
85 #undef __CHAR_UNSIGNED__
89 * Version of software...
92 #define CUPS_SVERSION "CUPS v2.3.1"
93 #define CUPS_MINIMAL "CUPS/2.3.1"
97 * Default user and groups...
100 #define CUPS_DEFAULT_USER ""
101 #define CUPS_DEFAULT_GROUP ""
102 #define CUPS_DEFAULT_SYSTEM_GROUPS ""
103 #define CUPS_DEFAULT_PRINTOPERATOR_AUTH ""
104 #define CUPS_DEFAULT_SYSTEM_AUTHKEY ""
108 * Default file permissions...
111 #define CUPS_DEFAULT_CONFIG_FILE_PERM 0644
112 #define CUPS_DEFAULT_LOG_FILE_PERM 0644
116 * Default logging settings...
119 #define CUPS_DEFAULT_LOG_LEVEL "warn"
120 #define CUPS_DEFAULT_ACCESS_LOG_LEVEL "none"
124 * Default fatal error settings...
127 #define CUPS_DEFAULT_FATAL_ERRORS "config"
131 * Default browsing settings...
134 #define CUPS_DEFAULT_BROWSING 1
135 #define CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS "dnssd"
136 #define CUPS_DEFAULT_DEFAULT_SHARED 1
140 * Default IPP port...
143 #define CUPS_DEFAULT_IPP_PORT 631
147 * Default printcap file...
150 #define CUPS_DEFAULT_PRINTCAP ""
154 * Default Samba and LPD config files...
157 #define CUPS_DEFAULT_SMB_CONFIG_FILE ""
158 #define CUPS_DEFAULT_LPD_CONFIG_FILE ""
162 * Default MaxCopies value...
165 #define CUPS_DEFAULT_MAX_COPIES 9999
169 * Do we have domain socket support, and if so what is the default one?
172 #undef CUPS_DEFAULT_DOMAINSOCKET
176 * Default WebInterface value...
179 #define CUPS_DEFAULT_WEBIF 0
183 * Where are files stored?
185 * Note: These are defaults, which can be overridden by environment
186 * variables at run-time...
189 #define CUPS_BINDIR "C:/CUPS/bin"
190 #define CUPS_CACHEDIR "C:/CUPS/cache"
191 #define CUPS_DATADIR "C:/CUPS/share"
192 #define CUPS_DOCROOT "C:/CUPS/share/doc"
193 #define CUPS_FONTPATH "C:/CUPS/share/fonts"
194 #define CUPS_LOCALEDIR "C:/CUPS/locale"
195 #define CUPS_LOGDIR "C:/CUPS/logs"
196 #define CUPS_REQUESTS "C:/CUPS/spool"
197 #define CUPS_SBINDIR "C:/CUPS/sbin"
198 #define CUPS_SERVERBIN "C:/CUPS/lib"
199 #define CUPS_SERVERROOT "C:/CUPS/etc"
200 #define CUPS_STATEDIR "C:/CUPS/run"
204 * Do we have posix_spawn?
207 /* #undef HAVE_POSIX_SPAWN */
215 #define HAVE_INFLATECOPY 1
219 * Do we have PAM stuff?
222 #define HAVE_LIBPAM 0
223 /* #undef HAVE_PAM_PAM_APPL_H */
224 /* #undef HAVE_PAM_SET_ITEM */
225 /* #undef HAVE_PAM_SETCRED */
229 * Do we have <shadow.h>?
232 /* #undef HAVE_SHADOW_H */
236 * Do we have <crypt.h>?
239 /* #undef HAVE_CRYPT_H */
246 /* #undef HAVE_STDINT_H */
250 * Use <string.h>, <strings.h>, and/or <bstring.h>?
253 #define HAVE_STRING_H 1
254 /* #undef HAVE_STRINGS_H */
255 /* #undef HAVE_BSTRING_H */
259 * Do we have the long long type?
262 /* #undef HAVE_LONG_LONG */
264 #ifdef HAVE_LONG_LONG
265 # define CUPS_LLFMT "%lld"
266 # define CUPS_LLCAST (long long)
268 # define CUPS_LLFMT "%ld"
269 # define CUPS_LLCAST (long)
270 #endif /* HAVE_LONG_LONG */
274 * Do we have the strtoll() function?
277 /* #undef HAVE_STRTOLL */
280 # define strtoll(nptr,endptr,base) strtol((nptr), (endptr), (base))
281 #endif /* !HAVE_STRTOLL */
285 * Do we have the strXXX() functions?
288 #define HAVE_STRDUP 1
289 /* #undef HAVE_STRLCAT */
290 /* #undef HAVE_STRLCPY */
294 * Do we have the geteuid() function?
297 /* #undef HAVE_GETEUID */
301 * Do we have the setpgid() function?
304 /* #undef HAVE_SETPGID */
308 * Do we have the vsyslog() function?
311 /* #undef HAVE_VSYSLOG */
315 * Do we have the systemd journal functions?
318 /* #undef HAVE_SYSTEMD_SD_JOURNAL_H */
322 * Do we have the (v)snprintf() functions?
325 /* Windows snprintf/vsnprintf are non-conforming */
326 /* #undef HAVE_SNPRINTF */
327 /* #undef HAVE_VSNPRINTF */
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_fips140_set_mode function?
382 /* #undef HAVE_GNUTLS_FIPS140_SET_MODE */
386 * Do we have the gnutls_transport_set_pull_timeout_function function?
389 /* #undef HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION */
393 * Do we have the gnutls_priority_set_direct function?
396 /* #undef HAVE_GNUTLS_PRIORITY_SET_DIRECT */
400 * What Security framework headers do we have?
403 /* #undef HAVE_AUTHORIZATION_H */
404 /* #undef HAVE_SECCERTIFICATE_H */
405 /* #undef HAVE_SECITEM_H */
406 /* #undef HAVE_SECPOLICY_H */
410 * Do we have the SecGenerateSelfSignedCertificate function?
413 /* #undef HAVE_SECGENERATESELFSIGNEDCERTIFICATE */
417 * Do we have libpaper?
420 /* #undef HAVE_LIBPAPER */
424 * Do we have mDNSResponder for DNS Service Discovery (aka Bonjour)?
431 * Do we have Avahi for DNS Service Discovery (aka Bonjour)?
438 * Do we have <sys/ioctl.h>?
441 #undef HAVE_SYS_IOCTL_H
445 * Does the "stat" structure contain the "st_gen" member?
448 /* #undef HAVE_ST_GEN */
452 * Does the "tm" structure contain the "tm_gmtoff" member?
455 /* #undef HAVE_TM_GMTOFF */
459 * Do we have rresvport_af()?
462 /* #undef HAVE_RRESVPORT_AF */
466 * Do we have getaddrinfo()?
469 #define HAVE_GETADDRINFO 1
473 * Do we have getnameinfo()?
476 #define HAVE_GETNAMEINFO 1
480 * Do we have getifaddrs()?
483 /* #undef HAVE_GETIFADDRS */
487 * Do we have hstrerror()?
490 /* #undef HAVE_HSTRERROR */
494 * Do we have res_init()?
497 /* #undef HAVE_RES_INIT */
501 * Do we have <resolv.h>
504 /* #undef HAVE_RESOLV_H */
508 * Do we have the <sys/sockio.h> header file?
511 /* #undef HAVE_SYS_SOCKIO_H */
515 * Does the sockaddr structure contain an sa_len parameter?
518 /* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */
522 * Do we have pthread support?
525 /* #undef HAVE_PTHREAD_H */
529 * Do we have on-demand support (launchd/systemd/upstart)?
532 /* #undef HAVE_ONDEMAND */
536 * Do we have launchd support?
539 /* #undef HAVE_LAUNCH_H */
540 /* #undef HAVE_LAUNCHD */
544 * Do we have systemd support?
547 /* #undef HAVE_SYSTEMD */
551 * Do we have upstart support?
554 /* #undef HAVE_UPSTART */
558 * Do we have CoreFoundation public headers?
561 /* #undef HAVE_COREFOUNDATION_H */
565 * Do we have ApplicationServices public headers?
568 /* #undef HAVE_APPLICATIONSERVICES_H */
572 * Do we have the SCDynamicStoreCopyComputerName function?
575 /* #undef HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */
579 * Do we have the getgrouplist() function?
582 #undef HAVE_GETGROUPLIST
586 * Do we have macOS 10.4's mbr_XXX functions?
589 /* #undef HAVE_MEMBERSHIP_H */
590 /* #undef HAVE_MBR_UID_TO_UUID */
594 * Do we have Darwin's notify_post header and function?
597 /* #undef HAVE_NOTIFY_H */
598 /* #undef HAVE_NOTIFY_POST */
605 /* #undef HAVE_DBUS */
606 /* #undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND */
607 /* #undef HAVE_DBUS_THREADS_INIT */
611 * Do we have the GSSAPI support library (for Kerberos support)?
614 /* #undef HAVE_GSS_ACQUIRE_CRED_EX_F */
615 /* #undef HAVE_GSS_C_NT_HOSTBASED_SERVICE */
616 /* #undef HAVE_GSS_GSSAPI_H */
617 /* #undef HAVE_GSS_GSSAPI_SPI_H */
618 /* #undef HAVE_GSSAPI */
619 /* #undef HAVE_GSSAPI_GSSAPI_H */
620 /* #undef HAVE_GSSAPI_H */
624 * Default GSS service name...
627 #define CUPS_DEFAULT_GSSSERVICENAME "host"
631 * Select/poll interfaces...
634 /* #undef HAVE_POLL */
635 /* #undef HAVE_EPOLL */
636 /* #undef HAVE_KQUEUE */
640 * Do we have the <dlfcn.h> header?
643 /* #undef HAVE_DLFCN_H */
647 * Do we have <sys/param.h>?
650 /* #undef HAVE_SYS_PARAM_H */
654 * Do we have <sys/ucred.h>?
657 /* #undef HAVE_SYS_UCRED_H */
661 * Do we have removefile()?
664 /* #undef HAVE_REMOVEFILE */
668 * Do we have <sandbox.h>?
671 /* #undef HAVE_SANDBOX_H */
675 * Which random number generator function to use...
678 /* #undef HAVE_ARC4RANDOM */
679 /* #undef HAVE_RANDOM */
680 /* #undef HAVE_LRAND48 */
682 #ifdef HAVE_ARC4RANDOM
683 # define CUPS_RAND() arc4random()
684 # define CUPS_SRAND(v)
685 #elif defined(HAVE_RANDOM)
686 # define CUPS_RAND() random()
687 # define CUPS_SRAND(v) srandom(v)
688 #elif defined(HAVE_LRAND48)
689 # define CUPS_RAND() lrand48()
690 # define CUPS_SRAND(v) srand48(v)
692 # define CUPS_RAND() rand()
693 # define CUPS_SRAND(v) srand(v)
694 #endif /* HAVE_ARC4RANDOM */
701 /* #undef HAVE_LIBUSB */
705 * Do we have libwrap and tcpd.h?
708 /* #undef HAVE_TCPD_H */
712 * Do we have <iconv.h>?
715 /* #undef HAVE_ICONV_H */
719 * Do we have statfs or statvfs and one of the corresponding headers?
722 /* #undef HAVE_STATFS */
723 /* #undef HAVE_STATVFS */
724 /* #undef HAVE_SYS_MOUNT_H */
725 /* #undef HAVE_SYS_STATFS_H */
726 /* #undef HAVE_SYS_STATVFS_H */
727 /* #undef HAVE_SYS_VFS_H */
731 * Location of macOS localization bundle, if any.
734 /* #undef CUPS_BUNDLEDIR */
741 /* #undef HAVE_XPC */
745 * Do we have the C99 abs() function?
748 /* #undef HAVE_ABS */
749 #if !defined(HAVE_ABS) && !defined(abs)
750 # if defined(__GNUC__) || __STDC_VERSION__ >= 199901L
751 # define abs(x) _cups_abs(x)
752 static inline int _cups_abs(int i
) { return (i
< 0 ? -i
: i
); }
753 # elif defined(_MSC_VER)
754 # define abs(x) _cups_abs(x)
755 static __inline
int _cups_abs(int i
) { return (i
< 0 ? -i
: i
); }
757 # define abs(x) ((x) < 0 ? -(x) : (x))
758 # endif /* __GNUC__ || __STDC_VERSION__ */
759 #endif /* !HAVE_ABS && !abs */
761 #endif /* !_CUPS_CONFIG_H_ */