]> git.ipfire.org Git - thirdparty/cups.git/blob - vcnet/config.h
Update all references to OS X to macOS.
[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"
98 #define CUPS_MINIMAL "CUPS/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
110
111 /*
112 * Default file permissions...
113 */
114
115 #define CUPS_DEFAULT_CONFIG_FILE_PERM 0640
116 #define CUPS_DEFAULT_LOG_FILE_PERM 0644
117
118
119 /*
120 * Default logging settings...
121 */
122
123 #define CUPS_DEFAULT_LOG_LEVEL "warn"
124 #define CUPS_DEFAULT_ACCESS_LOG_LEVEL "actions"
125
126
127 /*
128 * Default fatal error settings...
129 */
130
131 #define CUPS_DEFAULT_FATAL_ERRORS "config"
132
133
134 /*
135 * Default browsing settings...
136 */
137
138 #define CUPS_DEFAULT_BROWSING 1
139 #define CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS ""
140 #define CUPS_DEFAULT_DEFAULT_SHARED 1
141
142
143 /*
144 * Default IPP port...
145 */
146
147 #define CUPS_DEFAULT_IPP_PORT 631
148
149
150 /*
151 * Default printcap file...
152 */
153
154 #define CUPS_DEFAULT_PRINTCAP ""
155
156
157 /*
158 * Default Samba and LPD config files...
159 */
160
161 #define CUPS_DEFAULT_SMB_CONFIG_FILE ""
162 #define CUPS_DEFAULT_LPD_CONFIG_FILE ""
163
164
165 /*
166 * Default MaxCopies value...
167 */
168
169 #define CUPS_DEFAULT_MAX_COPIES 9999
170
171
172 /*
173 * Do we have domain socket support, and if so what is the default one?
174 */
175
176 #undef CUPS_DEFAULT_DOMAINSOCKET
177
178
179 /*
180 * Default WebInterface value...
181 */
182
183 #undef CUPS_DEFAULT_WEBIF
184
185
186 /*
187 * Where are files stored?
188 *
189 * Note: These are defaults, which can be overridden by environment
190 * variables at run-time...
191 */
192
193 #define CUPS_BINDIR "C:/CUPS/bin"
194 #define CUPS_CACHEDIR "C:/CUPS/cache"
195 #define CUPS_DATADIR "C:/CUPS/share"
196 #define CUPS_DOCROOT "C:/CUPS/share/doc"
197 #define CUPS_FONTPATH "C:/CUPS/share/fonts"
198 #define CUPS_LOCALEDIR "C:/CUPS/locale"
199 #define CUPS_LOGDIR "C:/CUPS/logs"
200 #define CUPS_REQUESTS "C:/CUPS/spool"
201 #define CUPS_SBINDIR "C:/CUPS/sbin"
202 #define CUPS_SERVERBIN "C:/CUPS/lib"
203 #define CUPS_SERVERROOT "C:/CUPS/etc"
204 #define CUPS_STATEDIR "C:/CUPS/run"
205
206
207 /*
208 * Do we have posix_spawn?
209 */
210
211 /* #undef HAVE_POSIX_SPAWN */
212
213
214 /*
215 * Do we have ZLIB?
216 */
217
218 #define HAVE_LIBZ 1
219 #define HAVE_INFLATECOPY 1
220
221
222 /*
223 * Do we have PAM stuff?
224 */
225
226 #define HAVE_LIBPAM 0
227 /* #undef HAVE_PAM_PAM_APPL_H */
228 /* #undef HAVE_PAM_SET_ITEM */
229 /* #undef HAVE_PAM_SETCRED */
230
231
232 /*
233 * Do we have <shadow.h>?
234 */
235
236 /* #undef HAVE_SHADOW_H */
237
238
239 /*
240 * Do we have <crypt.h>?
241 */
242
243 /* #undef HAVE_CRYPT_H */
244
245
246 /*
247 * Use <stdint.h>?
248 */
249
250 /* #undef HAVE_STDINT_H */
251
252
253 /*
254 * Use <string.h>, <strings.h>, and/or <bstring.h>?
255 */
256
257 #define HAVE_STRING_H 1
258 /* #undef HAVE_STRINGS_H */
259 /* #undef HAVE_BSTRING_H */
260
261
262 /*
263 * Do we have the long long type?
264 */
265
266 /* #undef HAVE_LONG_LONG */
267
268 #ifdef HAVE_LONG_LONG
269 # define CUPS_LLFMT "%lld"
270 # define CUPS_LLCAST (long long)
271 #else
272 # define CUPS_LLFMT "%ld"
273 # define CUPS_LLCAST (long)
274 #endif /* HAVE_LONG_LONG */
275
276
277 /*
278 * Do we have the strtoll() function?
279 */
280
281 /* #undef HAVE_STRTOLL */
282
283 #ifndef HAVE_STRTOLL
284 # define strtoll(nptr,endptr,base) strtol((nptr), (endptr), (base))
285 #endif /* !HAVE_STRTOLL */
286
287
288 /*
289 * Do we have the strXXX() functions?
290 */
291
292 #define HAVE_STRDUP 1
293 /* #undef HAVE_STRLCAT */
294 /* #undef HAVE_STRLCPY */
295
296
297 /*
298 * Do we have the geteuid() function?
299 */
300
301 /* #undef HAVE_GETEUID */
302
303
304 /*
305 * Do we have the setpgid() function?
306 */
307
308 /* #undef HAVE_SETPGID */
309
310
311 /*
312 * Do we have the vsyslog() function?
313 */
314
315 /* #undef HAVE_VSYSLOG */
316
317
318 /*
319 * Do we have the (v)snprintf() functions?
320 */
321
322 #define HAVE_SNPRINTF 1
323 #define HAVE_VSNPRINTF 1
324
325
326 /*
327 * What signal functions to use?
328 */
329
330 /* #undef HAVE_SIGSET */
331 /* #undef HAVE_SIGACTION */
332
333
334 /*
335 * What wait functions to use?
336 */
337
338 /* #undef HAVE_WAITPID */
339 /* #undef HAVE_WAIT3 */
340
341
342 /*
343 * Do we have the mallinfo function and malloc.h?
344 */
345
346 /* #undef HAVE_MALLINFO */
347 /* #undef HAVE_MALLOC_H */
348
349
350 /*
351 * Do we have the POSIX ACL functions?
352 */
353
354 /* #undef HAVE_ACL_INIT */
355
356
357 /*
358 * Do we have the langinfo.h header file?
359 */
360
361 /* #undef HAVE_LANGINFO_H */
362
363
364 /*
365 * Which encryption libraries do we have?
366 */
367
368 /* #undef HAVE_CDSASSL */
369 /* #undef HAVE_GNUTLS */
370 #define HAVE_SSPISSL
371 #define HAVE_SSL
372
373
374 /*
375 * Do we have the gnutls_transport_set_pull_timeout_function function?
376 */
377
378 /* #undef HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION */
379
380
381 /*
382 * Do we have the gnutls_priority_set_direct function?
383 */
384
385 /* #undef HAVE_GNUTLS_PRIORITY_SET_DIRECT */
386
387
388 /*
389 * What Security framework headers do we have?
390 */
391
392 /* #undef HAVE_AUTHORIZATION_H */
393 /* #undef HAVE_SECBASEPRIV_H */
394 /* #undef HAVE_SECCERTIFICATE_H */
395 /* #undef HAVE_SECIDENTITYSEARCHPRIV_H */
396 /* #undef HAVE_SECITEM_H */
397 /* #undef HAVE_SECITEMPRIV_H */
398 /* #undef HAVE_SECPOLICY_H */
399 /* #undef HAVE_SECPOLICYPRIV_H */
400 /* #undef HAVE_SECURETRANSPORTPRIV_H */
401
402
403 /*
404 * Do we have the cssmErrorString function?
405 */
406
407 /* #undef HAVE_CSSMERRORSTRING */
408
409
410 /*
411 * Do we have the SecGenerateSelfSignedCertificate function?
412 */
413
414 /* #undef HAVE_SECGENERATESELFSIGNEDCERTIFICATE */
415
416
417 /*
418 * Do we have the SecKeychainOpen function?
419 */
420
421 /* #undef HAVE_SECKEYCHAINOPEN */
422
423
424 /*
425 * Do we have libpaper?
426 */
427
428 /* #undef HAVE_LIBPAPER */
429
430
431 /*
432 * Do we have mDNSResponder for DNS Service Discovery (aka Bonjour)?
433 */
434
435 #define HAVE_DNSSD 1
436
437
438 /*
439 * Do we have Avahi for DNS Service Discovery (aka Bonjour)?
440 */
441
442 #undef HAVE_AVAHI
443
444
445 /*
446 * Do we have <sys/ioctl.h>?
447 */
448
449 #undef HAVE_SYS_IOCTL_H
450
451
452 /*
453 * Does the "stat" structure contain the "st_gen" member?
454 */
455
456 /* #undef HAVE_ST_GEN */
457
458
459 /*
460 * Does the "tm" structure contain the "tm_gmtoff" member?
461 */
462
463 /* #undef HAVE_TM_GMTOFF */
464
465
466 /*
467 * Do we have rresvport_af()?
468 */
469
470 /* #undef HAVE_RRESVPORT_AF */
471
472
473 /*
474 * Do we have getaddrinfo()?
475 */
476
477 #define HAVE_GETADDRINFO 1
478
479
480 /*
481 * Do we have getnameinfo()?
482 */
483
484 #define HAVE_GETNAMEINFO 1
485
486
487 /*
488 * Do we have getifaddrs()?
489 */
490
491 /* #undef HAVE_GETIFADDRS */
492
493
494 /*
495 * Do we have hstrerror()?
496 */
497
498 /* #undef HAVE_HSTRERROR */
499
500
501 /*
502 * Do we have res_init()?
503 */
504
505 /* #undef HAVE_RES_INIT */
506
507
508 /*
509 * Do we have <resolv.h>
510 */
511
512 /* #undef HAVE_RESOLV_H */
513
514
515 /*
516 * Do we have the <sys/sockio.h> header file?
517 */
518
519 /* #undef HAVE_SYS_SOCKIO_H */
520
521
522 /*
523 * Does the sockaddr structure contain an sa_len parameter?
524 */
525
526 /* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */
527
528
529 /*
530 * Do we have pthread support?
531 */
532
533 /* #undef HAVE_PTHREAD_H */
534
535
536 /*
537 * Do we have launchd support?
538 */
539
540 /* #undef HAVE_LAUNCH_H */
541 /* #undef HAVE_LAUNCHD */
542
543
544 /*
545 * Do we have systemd support?
546 */
547
548 /* #undef HAVE_SYSTEMD */
549
550
551 /*
552 * Various scripting languages...
553 */
554
555 /* #undef HAVE_JAVA */
556 #define CUPS_JAVA ""
557 /* #undef HAVE_PERL */
558 #define CUPS_PERL ""
559 /* #undef HAVE_PHP */
560 #define CUPS_PHP ""
561 /* #undef HAVE_PYTHON */
562 #define CUPS_PYTHON ""
563
564
565 /*
566 * Do we have CoreFoundation public and private headers?
567 */
568
569 /* #undef HAVE_COREFOUNDATION_H */
570 /* #undef HAVE_CFPRIV_H */
571 /* #undef HAVE_CFBUNDLEPRIV_H */
572
573
574 /*
575 * Do we have ApplicationServices public headers?
576 */
577
578 /* #undef HAVE_APPLICATIONSERVICES_H */
579
580
581 /*
582 * Do we have the SCDynamicStoreCopyComputerName function?
583 */
584
585 /* #undef HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */
586
587
588 /*
589 * Do we have the getgrouplist() function?
590 */
591
592 #undef HAVE_GETGROUPLIST
593
594
595 /*
596 * Do we have macOS 10.4's mbr_XXX functions?
597 */
598
599 /* #undef HAVE_MEMBERSHIP_H */
600 /* #undef HAVE_MEMBERSHIPPRIV_H */
601 /* #undef HAVE_MBR_UID_TO_UUID */
602
603
604 /*
605 * Do we have Darwin's notify_post header and function?
606 */
607
608 /* #undef HAVE_NOTIFY_H */
609 /* #undef HAVE_NOTIFY_POST */
610
611
612 /*
613 * Do we have DBUS?
614 */
615
616 /* #undef HAVE_DBUS */
617 /* #undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND */
618 /* #undef HAVE_DBUS_THREADS_INIT */
619
620
621 /*
622 * Do we have the GSSAPI support library (for Kerberos support)?
623 */
624
625 /* #undef HAVE_GSS_ACQUIRE_CRED_EX_F */
626 /* #undef HAVE_GSS_C_NT_HOSTBASED_SERVICE */
627 /* #undef HAVE_GSS_GSSAPI_H */
628 /* #undef HAVE_GSS_GSSAPI_SPI_H */
629 /* #undef HAVE_GSSAPI */
630 /* #undef HAVE_GSSAPI_GSSAPI_H */
631 /* #undef HAVE_GSSAPI_H */
632
633
634 /*
635 * Default GSS service name...
636 */
637
638 #define CUPS_DEFAULT_GSSSERVICENAME "host"
639
640
641 /*
642 * Select/poll interfaces...
643 */
644
645 /* #undef HAVE_POLL */
646 /* #undef HAVE_EPOLL */
647 /* #undef HAVE_KQUEUE */
648
649
650 /*
651 * Do we have the <dlfcn.h> header?
652 */
653
654 /* #undef HAVE_DLFCN_H */
655
656
657 /*
658 * Do we have <sys/param.h>?
659 */
660
661 /* #undef HAVE_SYS_PARAM_H */
662
663
664 /*
665 * Do we have <sys/ucred.h>?
666 */
667
668 /* #undef HAVE_SYS_UCRED_H */
669
670
671 /*
672 * Do we have removefile()?
673 */
674
675 /* #undef HAVE_REMOVEFILE */
676
677
678 /*
679 * Do we have <sandbox.h>?
680 */
681
682 /* #undef HAVE_SANDBOX_H */
683
684
685 /*
686 * Which random number generator function to use...
687 */
688
689 /* #undef HAVE_ARC4RANDOM */
690 /* #undef HAVE_RANDOM */
691 /* #undef HAVE_LRAND48 */
692
693 #ifdef HAVE_ARC4RANDOM
694 # define CUPS_RAND() arc4random()
695 # define CUPS_SRAND(v) arc4random_stir()
696 #elif defined(HAVE_RANDOM)
697 # define CUPS_RAND() random()
698 # define CUPS_SRAND(v) srandom(v)
699 #elif defined(HAVE_LRAND48)
700 # define CUPS_RAND() lrand48()
701 # define CUPS_SRAND(v) srand48(v)
702 #else
703 # define CUPS_RAND() rand()
704 # define CUPS_SRAND(v) srand(v)
705 #endif /* HAVE_ARC4RANDOM */
706
707
708 /*
709 * Do we have vproc_transaction_begin/end?
710 */
711
712 /* #undef HAVE_VPROC_TRANSACTION_BEGIN */
713
714
715 /*
716 * Do we have libusb?
717 */
718
719 /* #undef HAVE_LIBUSB */
720
721
722 /*
723 * Do we have libwrap and tcpd.h?
724 */
725
726 /* #undef HAVE_TCPD_H */
727
728
729 /*
730 * Do we have <iconv.h>?
731 */
732
733 /* #undef HAVE_ICONV_H */
734
735
736 /*
737 * Do we have statfs or statvfs and one of the corresponding headers?
738 */
739
740 /* #undef HAVE_STATFS */
741 /* #undef HAVE_STATVFS */
742 /* #undef HAVE_SYS_MOUNT_H */
743 /* #undef HAVE_SYS_STATFS_H */
744 /* #undef HAVE_SYS_STATVFS_H */
745 /* #undef HAVE_SYS_VFS_H */
746
747
748 /*
749 * Location of macOS localization bundle, if any.
750 */
751
752 /* #undef CUPS_BUNDLEDIR */
753
754
755 /*
756 * Do we have XPC?
757 */
758
759 /* #undef HAVE_XPC */
760 /* #undef HAVE_XPC_PRIVATE_H */
761
762
763 /*
764 * Do we have Mini-XML?
765 */
766
767 /* #undef HAVE_MXML_H */
768
769
770 /*
771 * Do we have the C99 abs() function?
772 */
773
774 /* #undef HAVE_ABS */
775 #if !defined(HAVE_ABS) && !defined(abs)
776 # if defined(__GNUC__) || __STDC_VERSION__ >= 199901L
777 # define abs(x) _cups_abs(x)
778 static inline int _cups_abs(int i) { return (i < 0 ? -i : i); }
779 # elif defined(_MSC_VER)
780 # define abs(x) _cups_abs(x)
781 static __inline int _cups_abs(int i) { return (i < 0 ? -i : i); }
782 # else
783 # define abs(x) ((x) < 0 ? -(x) : (x))
784 # endif /* __GNUC__ || __STDC_VERSION__ */
785 #endif /* !HAVE_ABS && !abs */
786
787 #endif /* !_CUPS_CONFIG_H_ */