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