]>
git.ipfire.org Git - thirdparty/cups.git/blob - vcnet/config.h
c1df0c95ec7307d6f8b769bac755023490675f33
2 * Configuration file for CUPS on Windows.
4 * Copyright © 2021-2025 by OpenPrinting
5 * Copyright © 2007-2019 by Apple Inc.
6 * Copyright © 1997-2007 by Easy Software Products.
8 * Licensed under Apache License v2.0. See the file "LICENSE" for more
12 #ifndef _CUPS_CONFIG_H_
13 #define _CUPS_CONFIG_H_
25 * Microsoft renames the POSIX functions to _name, and introduces
26 * a broken compatibility layer using the original names. As a result,
27 * random crashes can occur when, for example, strdup() allocates memory
28 * from a different heap than used by malloc() and free().
30 * To avoid moronic problems like this, we #define the POSIX function
31 * names to the corresponding non-standard Microsoft names.
34 #define access _access
36 #define fileno _fileno
38 #define mkdir(d,p) _mkdir(d)
43 #define snprintf _snprintf
44 #define strdup _strdup
45 #define unlink _unlink
46 #define vsnprintf _vsnprintf
51 * Microsoft "safe" functions use a different argument order than POSIX...
54 #define gmtime_r(t,tm) gmtime_s(tm,t)
55 #define localtime_r(t,tm) localtime_s(tm,t)
59 * Map the POSIX strcasecmp() and strncasecmp() functions to the Win32
60 * _stricmp() and _strnicmp() functions...
63 #define strcasecmp _stricmp
64 #define strncasecmp _strnicmp
68 * Map the POSIX sleep() and usleep() functions to the Win32 Sleep() function...
71 typedef unsigned long useconds_t
;
72 #define sleep(X) Sleep(1000 * (X))
73 #define usleep(X) Sleep((X)/1000)
77 * Map various parameters to Posix style system calls
83 # define O_RDONLY _O_RDONLY
84 # define O_WRONLY _O_WRONLY
85 # define O_CREAT _O_CREAT
86 # define O_TRUNC _O_TRUNC
94 #undef __CHAR_UNSIGNED__
98 * Version of software...
101 #define CUPS_SVERSION "CUPS v2.5b1"
102 #define CUPS_MINIMAL "CUPS/2.5b1"
106 * Default user and groups...
109 #define CUPS_DEFAULT_USER ""
110 #define CUPS_DEFAULT_GROUP ""
111 #define CUPS_DEFAULT_SYSTEM_GROUPS ""
112 #define CUPS_DEFAULT_PRINTOPERATOR_AUTH ""
113 #define CUPS_DEFAULT_SYSTEM_AUTHKEY ""
117 * Default file permissions...
120 #define CUPS_DEFAULT_CONFIG_FILE_PERM 0644
121 #define CUPS_DEFAULT_LOG_FILE_PERM 0644
125 * Default logging settings...
128 #define CUPS_DEFAULT_LOG_LEVEL "warn"
129 #define CUPS_DEFAULT_ACCESS_LOG_LEVEL "none"
130 #define CUPS_DEFAULT_MAX_LOG_SIZE "1m"
134 * Default fatal error settings...
137 #define CUPS_DEFAULT_FATAL_ERRORS "config"
141 * Default browsing settings...
144 #define CUPS_DEFAULT_BROWSING 1
145 #define CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS "dnssd"
146 #define CUPS_DEFAULT_DEFAULT_SHARED 1
150 * Default IPP port...
153 #define CUPS_DEFAULT_IPP_PORT 631
157 * Default printcap file...
160 #define CUPS_DEFAULT_PRINTCAP ""
164 * Default ErrorPolicy value...
167 #define CUPS_DEFAULT_ERROR_POLICY "stop-printer"
171 * Default MaxCopies value...
174 #define CUPS_DEFAULT_MAX_COPIES 9999
178 * Default SyncOnClose value...
181 /* #undef CUPS_DEFAULT_SYNC_ON_CLOSE */
185 * Do we have domain socket support, and if so what is the default one?
188 #undef CUPS_DEFAULT_DOMAINSOCKET
192 * Default WebInterface value...
195 #define CUPS_DEFAULT_WEBIF 0
199 * Where are files stored?
201 * Note: These are defaults, which can be overridden by environment
202 * variables at run-time...
205 #define CUPS_BINDIR "C:/CUPS/bin"
206 #define CUPS_CACHEDIR "C:/CUPS/cache"
207 #define CUPS_DATADIR "C:/CUPS/share"
208 #define CUPS_DOCROOT "C:/CUPS/share/doc"
209 #define CUPS_LOCALEDIR "C:/CUPS/locale"
210 #define CUPS_LOGDIR "C:/CUPS/logs"
211 #define CUPS_REQUESTS "C:/CUPS/spool"
212 #define CUPS_SBINDIR "C:/CUPS/sbin"
213 #define CUPS_SERVERBIN "C:/CUPS/lib"
214 #define CUPS_SERVERROOT "C:/CUPS/etc"
215 #define CUPS_STATEDIR "C:/CUPS/run"
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 */
232 /* #undef HAVE_STDINT_H */
236 * Use <string.h>, <strings.h>, and/or <bstring.h>?
239 #define HAVE_STRING_H 1
240 /* #undef HAVE_STRINGS_H */
241 /* #undef HAVE_BSTRING_H */
245 * Do we have the long long type?
248 /* #undef HAVE_LONG_LONG */
250 #ifdef HAVE_LONG_LONG
251 # define CUPS_LLFMT "%lld"
252 # define CUPS_LLCAST (long long)
254 # define CUPS_LLFMT "%ld"
255 # define CUPS_LLCAST (long)
256 #endif /* HAVE_LONG_LONG */
260 * Do we have the strtoll() function?
263 /* #undef HAVE_STRTOLL */
266 # define strtoll(nptr,endptr,base) strtol((nptr), (endptr), (base))
267 #endif /* !HAVE_STRTOLL */
271 * Do we have the geteuid() function?
274 /* #undef HAVE_GETEUID */
278 * Do we have the setpgid() function?
281 /* #undef HAVE_SETPGID */
285 * Do we have the vsyslog() function?
288 /* #undef HAVE_VSYSLOG */
292 * Do we have the systemd journal functions?
295 /* #undef HAVE_SYSTEMD_SD_JOURNAL_H */
299 * What wait functions to use?
302 /* #undef HAVE_WAITPID */
303 /* #undef HAVE_WAIT3 */
307 * Do we have the mallinfo function and malloc.h?
310 /* #undef HAVE_MALLINFO */
311 /* #undef HAVE_MALLOC_H */
315 * Do we have the POSIX ACL functions?
318 /* #undef HAVE_ACL_INIT */
322 * Do we have the langinfo.h header file?
325 /* #undef HAVE_LANGINFO_H */
329 * Which encryption libraries do we have?
332 #define HAVE_OPENSSL 1
333 /* #undef HAVE_GNUTLS */
337 * Do we have the gnutls_transport_set_pull_timeout_function function?
340 /* #undef HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION */
344 * Do we have the gnutls_priority_set_direct function?
347 /* #undef HAVE_GNUTLS_PRIORITY_SET_DIRECT */
351 * What Security framework headers do we have?
354 /* #undef HAVE_AUTHORIZATION_H */
355 /* #undef HAVE_SECCERTIFICATE_H */
356 /* #undef HAVE_SECITEM_H */
357 /* #undef HAVE_SECPOLICY_H */
361 * Do we have the SecGenerateSelfSignedCertificate function?
364 /* #undef HAVE_SECGENERATESELFSIGNEDCERTIFICATE */
368 * Do we have libpaper?
371 /* #undef HAVE_LIBPAPER */
375 * Do we have mDNSResponder for DNS-SD?
378 /* #undef HAVE_MDNSRESPONDER */
382 * Do we have Avahi for DNS-SD?
385 /* #undef HAVE_AVAHI */
389 * Do we have <sys/ioctl.h>?
392 /* #undef HAVE_SYS_IOCTL_H */
396 * Does the "stat" structure contain the "st_gen" member?
399 /* #undef HAVE_ST_GEN */
403 * Does the "tm" structure contain the "tm_gmtoff" member?
406 /* #undef HAVE_TM_GMTOFF */
410 * Do we have the timegm function?
413 /*#undef HAVE_TIMEGM */
417 * Do we have getifaddrs()?
420 /* #undef HAVE_GETIFADDRS */
424 * Do we have hstrerror()?
427 /* #undef HAVE_HSTRERROR */
431 * Do we have res_init()?
434 /* #undef HAVE_RES_INIT */
438 * Do we have <resolv.h>
441 /* #undef HAVE_RESOLV_H */
445 * Do we have the <sys/sockio.h> header file?
448 /* #undef HAVE_SYS_SOCKIO_H */
452 * Does the sockaddr structure contain an sa_len parameter?
455 /* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */
459 * Do we have pthread support?
462 /* #undef HAVE_PTHREAD_H */
466 * Do we have on-demand support (launchd/systemd/upstart)?
469 /* #undef HAVE_ONDEMAND */
473 * Do we have launchd support?
476 /* #undef HAVE_LAUNCH_H */
477 /* #undef HAVE_LAUNCHD */
481 * Do we have systemd support?
484 /* #undef HAVE_SYSTEMD */
488 * Do we have upstart support?
491 /* #undef HAVE_UPSTART */
495 * Do we have CoreFoundation public headers?
498 /* #undef HAVE_COREFOUNDATION_H */
502 * Do we have ApplicationServices public headers?
505 /* #undef HAVE_APPLICATIONSERVICES_H */
509 * Do we have the SCDynamicStoreCopyComputerName function?
512 /* #undef HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */
516 * Do we have the getgrouplist() function?
519 #undef HAVE_GETGROUPLIST
523 * Do we have macOS 10.4's mbr_XXX functions?
526 /* #undef HAVE_MEMBERSHIP_H */
527 /* #undef HAVE_MBR_UID_TO_UUID */
531 * Do we have Darwin's notify_post header and function?
534 /* #undef HAVE_NOTIFY_H */
535 /* #undef HAVE_NOTIFY_POST */
542 /* #undef HAVE_DBUS */
543 /* #undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND */
544 /* #undef HAVE_DBUS_THREADS_INIT */
548 * Do we have the GSSAPI support library (for Kerberos support)?
551 /* #undef HAVE_GSS_ACQUIRE_CRED_EX_F */
552 /* #undef HAVE_GSS_C_NT_HOSTBASED_SERVICE */
553 /* #undef HAVE_GSS_GSSAPI_H */
554 /* #undef HAVE_GSS_GSSAPI_SPI_H */
555 /* #undef HAVE_GSSAPI */
556 /* #undef HAVE_GSSAPI_GSSAPI_H */
557 /* #undef HAVE_GSSAPI_H */
561 * Default GSS service name...
564 #define CUPS_DEFAULT_GSSSERVICENAME "host"
568 * Do we have the <dlfcn.h> header?
571 /* #undef HAVE_DLFCN_H */
575 * Do we have <sys/param.h>?
578 /* #undef HAVE_SYS_PARAM_H */
582 * Do we have <sys/ucred.h>?
585 /* #undef HAVE_SYS_UCRED_H */
589 * Do we have removefile()?
592 /* #undef HAVE_REMOVEFILE */
596 * Do we have <sandbox.h>?
599 /* #undef HAVE_SANDBOX_H */
603 * Which random number generator function to use...
606 /* #undef HAVE_ARC4RANDOM */
607 /* #undef HAVE_RANDOM */
608 /* #undef HAVE_LRAND48 */
610 #ifdef HAVE_ARC4RANDOM
611 # define CUPS_RAND() arc4random()
612 # define CUPS_SRAND(v)
613 #elif defined(HAVE_RANDOM)
614 # define CUPS_RAND() random()
615 # define CUPS_SRAND(v) srandom(v)
616 #elif defined(HAVE_LRAND48)
617 # define CUPS_RAND() lrand48()
618 # define CUPS_SRAND(v) srand48(v)
620 # define CUPS_RAND() rand()
621 # define CUPS_SRAND(v) srand(v)
622 #endif /* HAVE_ARC4RANDOM */
629 /* #undef HAVE_LIBUSB */
633 * Do we have libwrap and tcpd.h?
636 /* #undef HAVE_TCPD_H */
640 * Do we have <iconv.h>?
643 /* #undef HAVE_ICONV_H */
647 * Do we have statfs or statvfs and one of the corresponding headers?
650 /* #undef HAVE_STATFS */
651 /* #undef HAVE_STATVFS */
652 /* #undef HAVE_SYS_MOUNT_H */
653 /* #undef HAVE_SYS_STATFS_H */
654 /* #undef HAVE_SYS_STATVFS_H */
655 /* #undef HAVE_SYS_VFS_H */
662 /* #undef HAVE_XPC */
666 * Do we have the C99 abs() function?
669 /* #undef HAVE_ABS */
670 #if !defined(HAVE_ABS) && !defined(abs)
671 # if defined(__GNUC__) || __STDC_VERSION__ >= 199901L
672 # define abs(x) _cups_abs(x)
673 static inline int _cups_abs(int i
) { return (i
< 0 ? -i
: i
); }
674 # elif defined(_MSC_VER)
675 # define abs(x) _cups_abs(x)
676 static __inline
int _cups_abs(int i
) { return (i
< 0 ? -i
: i
); }
678 # define abs(x) ((x) < 0 ? -(x) : (x))
679 # endif /* __GNUC__ || __STDC_VERSION__ */
680 #endif /* !HAVE_ABS && !abs */
682 #endif /* !_CUPS_CONFIG_H_ */