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