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