/*1* Configuration file for CUPS on Windows.2*3* Copyright © 2021-2022 by OpenPrinting4* Copyright © 2007-2019 by Apple Inc.5* Copyright © 1997-2007 by Easy Software Products.6*7* Licensed under Apache License v2.0. See the file "LICENSE" for more8* information.9*/1011#ifndef _CUPS_CONFIG_H_12#define _CUPS_CONFIG_H_1314/*15* Include necessary headers...16*/1718#include <stdio.h>19#include <stdlib.h>20#include <string.h>21#include <stdarg.h>22#include <io.h>23#include <direct.h>242526/*27* Microsoft renames the POSIX functions to _name, and introduces28* a broken compatibility layer using the original names. As a result,29* random crashes can occur when, for example, strdup() allocates memory30* from a different heap than used by malloc() and free().31*32* To avoid moronic problems like this, we #define the POSIX function33* names to the corresponding non-standard Microsoft names.34*/3536#define access _access37#define close _close38#define fileno _fileno39#define lseek _lseek40#define mkdir(d,p) _mkdir(d)41#define open _open42#define read _read43#define rmdir _rmdir44#define snprintf _snprintf45#define strdup _strdup46#define unlink _unlink47#define vsnprintf _vsnprintf48#define write _write495051/*52* Microsoft "safe" functions use a different argument order than POSIX...53*/5455#define gmtime_r(t,tm) gmtime_s(tm,t)56#define localtime_r(t,tm) localtime_s(tm,t)575859/*60* Map the POSIX strcasecmp() and strncasecmp() functions to the Win3261* _stricmp() and _strnicmp() functions...62*/6364#define strcasecmp _stricmp65#define strncasecmp _strnicmp666768/*69* Map the POSIX sleep() and usleep() functions to the Win32 Sleep() function...70*/7172typedef unsigned long useconds_t;73#define sleep(X) Sleep(1000 * (X))74#define usleep(X) Sleep((X)/1000)757677/*78* Map various parameters to Posix style system calls79*/8081# define F_OK 0082# define W_OK 0283# define R_OK 0484# define O_RDONLY _O_RDONLY85# define O_WRONLY _O_WRONLY86# define O_CREAT _O_CREAT87# define O_TRUNC _O_TRUNC888990/*91* Compiler stuff...92*/9394#undef const95#undef __CHAR_UNSIGNED__969798/*99* Version of software...100*/101102#define CUPS_SVERSION "CUPS v2.4.3"103#define CUPS_MINIMAL "CUPS/2.4.3"104105106/*107* Default user and groups...108*/109110#define CUPS_DEFAULT_USER ""111#define CUPS_DEFAULT_GROUP ""112#define CUPS_DEFAULT_SYSTEM_GROUPS ""113#define CUPS_DEFAULT_PRINTOPERATOR_AUTH ""114#define CUPS_DEFAULT_SYSTEM_AUTHKEY ""115116117/*118* Default file permissions...119*/120121#define CUPS_DEFAULT_CONFIG_FILE_PERM 0644122#define CUPS_DEFAULT_LOG_FILE_PERM 0644123124125/*126* Default logging settings...127*/128129#define CUPS_DEFAULT_LOG_LEVEL "warn"130#define CUPS_DEFAULT_ACCESS_LOG_LEVEL "none"131#define CUPS_DEFAULT_MAX_LOG_SIZE "1m"132133134/*135* Default fatal error settings...136*/137138#define CUPS_DEFAULT_FATAL_ERRORS "config"139140141/*142* Default browsing settings...143*/144145#define CUPS_DEFAULT_BROWSING 1146#define CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS "dnssd"147#define CUPS_DEFAULT_DEFAULT_SHARED 1148149150/*151* Default IPP port...152*/153154#define CUPS_DEFAULT_IPP_PORT 631155156157/*158* Default printcap file...159*/160161#define CUPS_DEFAULT_PRINTCAP ""162163164/*165* Default ErrorPolicy value...166*/167168#define CUPS_DEFAULT_ERROR_POLICY "stop-printer"169170171/*172* Default MaxCopies value...173*/174175#define CUPS_DEFAULT_MAX_COPIES 9999176177178/*179* Default SyncOnClose value...180*/181182/* #undef CUPS_DEFAULT_SYNC_ON_CLOSE */183184185/*186* Do we have domain socket support, and if so what is the default one?187*/188189#undef CUPS_DEFAULT_DOMAINSOCKET190191192/*193* Default WebInterface value...194*/195196#define CUPS_DEFAULT_WEBIF 0197198199/*200* Where are files stored?201*202* Note: These are defaults, which can be overridden by environment203* variables at run-time...204*/205206#define CUPS_BINDIR "C:/CUPS/bin"207#define CUPS_CACHEDIR "C:/CUPS/cache"208#define CUPS_DATADIR "C:/CUPS/share"209#define CUPS_DOCROOT "C:/CUPS/share/doc"210#define CUPS_LOCALEDIR "C:/CUPS/locale"211#define CUPS_LOGDIR "C:/CUPS/logs"212#define CUPS_REQUESTS "C:/CUPS/spool"213#define CUPS_SBINDIR "C:/CUPS/sbin"214#define CUPS_SERVERBIN "C:/CUPS/lib"215#define CUPS_SERVERROOT "C:/CUPS/etc"216#define CUPS_STATEDIR "C:/CUPS/run"217218219/*220* Do we have posix_spawn?221*/222223/* #undef HAVE_POSIX_SPAWN */224225226/*227* Do we have ZLIB?228*/229230#define HAVE_LIBZ 1231#define HAVE_INFLATECOPY 1232233234/*235* Do we have PAM stuff?236*/237238#define HAVE_LIBPAM 0239/* #undef HAVE_PAM_PAM_APPL_H */240/* #undef HAVE_PAM_SET_ITEM */241/* #undef HAVE_PAM_SETCRED */242243244/*245* Do we have <shadow.h>?246*/247248/* #undef HAVE_SHADOW_H */249250251/*252* Do we have <crypt.h>?253*/254255/* #undef HAVE_CRYPT_H */256257258/*259* Use <stdint.h>?260*/261262/* #undef HAVE_STDINT_H */263264265/*266* Use <string.h>, <strings.h>, and/or <bstring.h>?267*/268269#define HAVE_STRING_H 1270/* #undef HAVE_STRINGS_H */271/* #undef HAVE_BSTRING_H */272273274/*275* Do we have the long long type?276*/277278/* #undef HAVE_LONG_LONG */279280#ifdef HAVE_LONG_LONG281# define CUPS_LLFMT "%lld"282# define CUPS_LLCAST (long long)283#else284# define CUPS_LLFMT "%ld"285# define CUPS_LLCAST (long)286#endif /* HAVE_LONG_LONG */287288289/*290* Do we have the strtoll() function?291*/292293/* #undef HAVE_STRTOLL */294295#ifndef HAVE_STRTOLL296# define strtoll(nptr,endptr,base) strtol((nptr), (endptr), (base))297#endif /* !HAVE_STRTOLL */298299300/*301* Do we have the strXXX() functions?302*/303304#define HAVE_STRDUP 1305/* #undef HAVE_STRLCAT */306/* #undef HAVE_STRLCPY */307308309/*310* Do we have the geteuid() function?311*/312313/* #undef HAVE_GETEUID */314315316/*317* Do we have the setpgid() function?318*/319320/* #undef HAVE_SETPGID */321322323/*324* Do we have the vsyslog() function?325*/326327/* #undef HAVE_VSYSLOG */328329330/*331* Do we have the systemd journal functions?332*/333334/* #undef HAVE_SYSTEMD_SD_JOURNAL_H */335336337/*338* Do we have the (v)snprintf() functions?339*/340341#define HAVE_SNPRINTF 1342#define HAVE_VSNPRINTF 1343344345/*346* What signal functions to use?347*/348349/* #undef HAVE_SIGSET */350/* #undef HAVE_SIGACTION */351352353/*354* What wait functions to use?355*/356357/* #undef HAVE_WAITPID */358/* #undef HAVE_WAIT3 */359360361/*362* Do we have the mallinfo function and malloc.h?363*/364365/* #undef HAVE_MALLINFO */366/* #undef HAVE_MALLOC_H */367368369/*370* Do we have the POSIX ACL functions?371*/372373/* #undef HAVE_ACL_INIT */374375376/*377* Do we have the langinfo.h header file?378*/379380/* #undef HAVE_LANGINFO_H */381382383/*384* Which encryption libraries do we have?385*/386387#define HAVE_TLS 1388/* #undef HAVE_CDSASSL */389#define HAVE_OPENSSL 1390/* #undef HAVE_GNUTLS */391/* #undef HAVE_SSPISSL */392393394/*395* Do we have the gnutls_transport_set_pull_timeout_function function?396*/397398/* #undef HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION */399400401/*402* Do we have the gnutls_priority_set_direct function?403*/404405/* #undef HAVE_GNUTLS_PRIORITY_SET_DIRECT */406407408/*409* What Security framework headers do we have?410*/411412/* #undef HAVE_AUTHORIZATION_H */413/* #undef HAVE_SECCERTIFICATE_H */414/* #undef HAVE_SECITEM_H */415/* #undef HAVE_SECPOLICY_H */416417418/*419* Do we have the SecGenerateSelfSignedCertificate function?420*/421422/* #undef HAVE_SECGENERATESELFSIGNEDCERTIFICATE */423424425/*426* Do we have libpaper?427*/428429/* #undef HAVE_LIBPAPER */430431432/*433* Do we have DNS Service Discovery (aka Bonjour) support?434*/435436#define HAVE_DNSSD 1437438439/*440* Do we have mDNSResponder for DNS-SD?441*/442443#define HAVE_MDNSRESPONDER 1444445446/*447* Do we have Avahi for DNS-SD?448*/449450/* #undef HAVE_AVAHI */451452453/*454* Do we have <sys/ioctl.h>?455*/456457/* #undef HAVE_SYS_IOCTL_H */458459460/*461* Does the "stat" structure contain the "st_gen" member?462*/463464/* #undef HAVE_ST_GEN */465466467/*468* Does the "tm" structure contain the "tm_gmtoff" member?469*/470471/* #undef HAVE_TM_GMTOFF */472473474/*475* Do we have rresvport_af()?476*/477478/* #undef HAVE_RRESVPORT_AF */479480481/*482* Do we have getaddrinfo()?483*/484485#define HAVE_GETADDRINFO 1486487488/*489* Do we have getnameinfo()?490*/491492#define HAVE_GETNAMEINFO 1493494495/*496* Do we have getifaddrs()?497*/498499/* #undef HAVE_GETIFADDRS */500501502/*503* Do we have hstrerror()?504*/505506/* #undef HAVE_HSTRERROR */507508509/*510* Do we have res_init()?511*/512513/* #undef HAVE_RES_INIT */514515516/*517* Do we have <resolv.h>518*/519520/* #undef HAVE_RESOLV_H */521522523/*524* Do we have the <sys/sockio.h> header file?525*/526527/* #undef HAVE_SYS_SOCKIO_H */528529530/*531* Does the sockaddr structure contain an sa_len parameter?532*/533534/* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */535536537/*538* Do we have pthread support?539*/540541/* #undef HAVE_PTHREAD_H */542543544/*545* Do we have on-demand support (launchd/systemd/upstart)?546*/547548/* #undef HAVE_ONDEMAND */549550551/*552* Do we have launchd support?553*/554555/* #undef HAVE_LAUNCH_H */556/* #undef HAVE_LAUNCHD */557558559/*560* Do we have systemd support?561*/562563/* #undef HAVE_SYSTEMD */564565566/*567* Do we have upstart support?568*/569570/* #undef HAVE_UPSTART */571572573/*574* Do we have CoreFoundation public headers?575*/576577/* #undef HAVE_COREFOUNDATION_H */578579580/*581* Do we have ApplicationServices public headers?582*/583584/* #undef HAVE_APPLICATIONSERVICES_H */585586587/*588* Do we have the SCDynamicStoreCopyComputerName function?589*/590591/* #undef HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */592593594/*595* Do we have the getgrouplist() function?596*/597598#undef HAVE_GETGROUPLIST599600601/*602* Do we have macOS 10.4's mbr_XXX functions?603*/604605/* #undef HAVE_MEMBERSHIP_H */606/* #undef HAVE_MBR_UID_TO_UUID */607608609/*610* Do we have Darwin's notify_post header and function?611*/612613/* #undef HAVE_NOTIFY_H */614/* #undef HAVE_NOTIFY_POST */615616617/*618* Do we have DBUS?619*/620621/* #undef HAVE_DBUS */622/* #undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND */623/* #undef HAVE_DBUS_THREADS_INIT */624625626/*627* Do we have the GSSAPI support library (for Kerberos support)?628*/629630/* #undef HAVE_GSS_ACQUIRE_CRED_EX_F */631/* #undef HAVE_GSS_C_NT_HOSTBASED_SERVICE */632/* #undef HAVE_GSS_GSSAPI_H */633/* #undef HAVE_GSS_GSSAPI_SPI_H */634/* #undef HAVE_GSSAPI */635/* #undef HAVE_GSSAPI_GSSAPI_H */636/* #undef HAVE_GSSAPI_H */637638639/*640* Default GSS service name...641*/642643#define CUPS_DEFAULT_GSSSERVICENAME "host"644645646/*647* Select/poll interfaces...648*/649650/* #undef HAVE_POLL */651/* #undef HAVE_EPOLL */652/* #undef HAVE_KQUEUE */653654655/*656* Do we have the <dlfcn.h> header?657*/658659/* #undef HAVE_DLFCN_H */660661662/*663* Do we have <sys/param.h>?664*/665666/* #undef HAVE_SYS_PARAM_H */667668669/*670* Do we have <sys/ucred.h>?671*/672673/* #undef HAVE_SYS_UCRED_H */674675676/*677* Do we have removefile()?678*/679680/* #undef HAVE_REMOVEFILE */681682683/*684* Do we have <sandbox.h>?685*/686687/* #undef HAVE_SANDBOX_H */688689690/*691* Which random number generator function to use...692*/693694/* #undef HAVE_ARC4RANDOM */695/* #undef HAVE_RANDOM */696/* #undef HAVE_LRAND48 */697698#ifdef HAVE_ARC4RANDOM699# define CUPS_RAND() arc4random()700# define CUPS_SRAND(v)701#elif defined(HAVE_RANDOM)702# define CUPS_RAND() random()703# define CUPS_SRAND(v) srandom(v)704#elif defined(HAVE_LRAND48)705# define CUPS_RAND() lrand48()706# define CUPS_SRAND(v) srand48(v)707#else708# define CUPS_RAND() rand()709# define CUPS_SRAND(v) srand(v)710#endif /* HAVE_ARC4RANDOM */711712713/*714* Do we have libusb?715*/716717/* #undef HAVE_LIBUSB */718719720/*721* Do we have libwrap and tcpd.h?722*/723724/* #undef HAVE_TCPD_H */725726727/*728* Do we have <iconv.h>?729*/730731/* #undef HAVE_ICONV_H */732733734/*735* Do we have statfs or statvfs and one of the corresponding headers?736*/737738/* #undef HAVE_STATFS */739/* #undef HAVE_STATVFS */740/* #undef HAVE_SYS_MOUNT_H */741/* #undef HAVE_SYS_STATFS_H */742/* #undef HAVE_SYS_STATVFS_H */743/* #undef HAVE_SYS_VFS_H */744745746/*747* Location of macOS localization bundle, if any.748*/749750/* #undef CUPS_BUNDLEDIR */751752753/*754* Do we have XPC?755*/756757/* #undef HAVE_XPC */758759760/*761* Do we have the C99 abs() function?762*/763764/* #undef HAVE_ABS */765#if !defined(HAVE_ABS) && !defined(abs)766# if defined(__GNUC__) || __STDC_VERSION__ >= 199901L767# define abs(x) _cups_abs(x)768static inline int _cups_abs(int i) { return (i < 0 ? -i : i); }769# elif defined(_MSC_VER)770# define abs(x) _cups_abs(x)771static __inline int _cups_abs(int i) { return (i < 0 ? -i : i); }772# else773# define abs(x) ((x) < 0 ? -(x) : (x))774# endif /* __GNUC__ || __STDC_VERSION__ */775#endif /* !HAVE_ABS && !abs */776777#endif /* !_CUPS_CONFIG_H_ */778779780