1/*
2 * "$Id: config.h 12142 2014-08-30 02:35:43Z msweet $"
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
69typedef 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.0.0"
100#define CUPS_MINIMAL "CUPS/2.0.0"
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 * What Security framework headers do we have?
385 */
386
387/* #undef HAVE_AUTHORIZATION_H */
388/* #undef HAVE_SECBASEPRIV_H */
389/* #undef HAVE_SECCERTIFICATE_H */
390/* #undef HAVE_SECIDENTITYSEARCHPRIV_H */
391/* #undef HAVE_SECITEM_H */
392/* #undef HAVE_SECITEMPRIV_H */
393/* #undef HAVE_SECPOLICY_H */
394/* #undef HAVE_SECPOLICYPRIV_H */
395/* #undef HAVE_SECURETRANSPORTPRIV_H */
396
397
398/*
399 * Do we have the cssmErrorString function?
400 */
401
402/* #undef HAVE_CSSMERRORSTRING */
403
404
405/*
406 * Do we have the SecGenerateSelfSignedCertificate function?
407 */
408
409/* #undef HAVE_SECGENERATESELFSIGNEDCERTIFICATE */
410
411
412/*
413 * Do we have the SecKeychainOpen function?
414 */
415
416/* #undef HAVE_SECKEYCHAINOPEN */
417
418
419/*
420 * Do we have libpaper?
421 */
422
423/* #undef HAVE_LIBPAPER */
424
425
426/*
427 * Do we have mDNSResponder for DNS Service Discovery (aka Bonjour)?
428 */
429
430#define HAVE_DNSSD 1
431
432
433/*
434 * Do we have Avahi for DNS Service Discovery (aka Bonjour)?
435 */
436
437#undef HAVE_AVAHI
438
439
440/*
441 * Do we have <sys/ioctl.h>?
442 */
443
444#undef HAVE_SYS_IOCTL_H
445
446
447/*
448 * Does the "stat" structure contain the "st_gen" member?
449 */
450
451/* #undef HAVE_ST_GEN */
452
453
454/*
455 * Does the "tm" structure contain the "tm_gmtoff" member?
456 */
457
458/* #undef HAVE_TM_GMTOFF */
459
460
461/*
462 * Do we have rresvport_af()?
463 */
464
465/* #undef HAVE_RRESVPORT_AF */
466
467
468/*
469 * Do we have getaddrinfo()?
470 */
471
472#define HAVE_GETADDRINFO 1
473
474
475/*
476 * Do we have getnameinfo()?
477 */
478
479#define HAVE_GETNAMEINFO 1
480
481
482/*
483 * Do we have getifaddrs()?
484 */
485
486/* #undef HAVE_GETIFADDRS */
487
488
489/*
490 * Do we have hstrerror()?
491 */
492
493/* #undef HAVE_HSTRERROR */
494
495
496/*
497 * Do we have res_init()?
498 */
499
500/* #undef HAVE_RES_INIT */
501
502
503/*
504 * Do we have <resolv.h>
505 */
506
507/* #undef HAVE_RESOLV_H */
508
509
510/*
511 * Do we have the <sys/sockio.h> header file?
512 */
513
514/* #undef HAVE_SYS_SOCKIO_H */
515
516
517/*
518 * Does the sockaddr structure contain an sa_len parameter?
519 */
520
521/* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */
522
523
524/*
525 * Do we have pthread support?
526 */
527
528/* #undef HAVE_PTHREAD_H */
529
530
531/*
532 * Do we have launchd support?
533 */
534
535/* #undef HAVE_LAUNCH_H */
536/* #undef HAVE_LAUNCHD */
537
538
539/*
540 * Do we have systemd support?
541 */
542
543/* #undef HAVE_SYSTEMD */
544
545
546/*
547 * Various scripting languages...
548 */
549
550/* #undef HAVE_JAVA */
551#define CUPS_JAVA	""
552/* #undef HAVE_PERL */
553#define CUPS_PERL	""
554/* #undef HAVE_PHP */
555#define CUPS_PHP	""
556/* #undef HAVE_PYTHON */
557#define CUPS_PYTHON	""
558
559
560/*
561 * Location of the poppler/Xpdf pdftops program...
562 */
563
564/* #undef HAVE_PDFTOPS */
565/* #undef HAVE_PDFTOPS_WITH_ORIGPAGESIZES */
566#define CUPS_PDFTOPS ""
567
568
569/*
570 * Location of the Ghostscript gs program...
571 */
572
573/* #undef HAVE_GHOSTSCRIPT */
574#define CUPS_GHOSTSCRIPT ""
575
576
577/*
578 * Do we have CoreFoundation public and private headers?
579 */
580
581/* #undef HAVE_COREFOUNDATION_H */
582/* #undef HAVE_CFPRIV_H */
583/* #undef HAVE_CFBUNDLEPRIV_H */
584
585
586/*
587 * Do we have ApplicationServices public headers?
588 */
589
590/* #undef HAVE_APPLICATIONSERVICES_H */
591
592
593/*
594 * Do we have the SCDynamicStoreCopyComputerName function?
595 */
596
597/* #undef HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */
598
599
600/*
601 * Do we have OS X 10.4's mbr_XXX functions?
602 */
603
604/* #undef HAVE_MEMBERSHIP_H */
605/* #undef HAVE_MEMBERSHIPPRIV_H */
606/* #undef HAVE_MBR_UID_TO_UUID */
607
608
609/*
610 * Do we have Darwin's notify_post header and function?
611 */
612
613/* #undef HAVE_NOTIFY_H */
614/* #undef HAVE_NOTIFY_POST */
615
616
617/*
618 * Do we have DBUS?
619 */
620
621/* #undef HAVE_DBUS */
622/* #undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND */
623/* #undef HAVE_DBUS_THREADS_INIT */
624
625
626/*
627 * Do we have the GSSAPI support library (for Kerberos support)?
628 */
629
630/* #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 */
637
638
639/*
640 * Default GSS service name...
641 */
642
643#define CUPS_DEFAULT_GSSSERVICENAME "host"
644
645
646/*
647 * Select/poll interfaces...
648 */
649
650/* #undef HAVE_POLL */
651/* #undef HAVE_EPOLL */
652/* #undef HAVE_KQUEUE */
653
654
655/*
656 * Do we have the <dlfcn.h> header?
657 */
658
659/* #undef HAVE_DLFCN_H */
660
661
662/*
663 * Do we have <sys/param.h>?
664 */
665
666/* #undef HAVE_SYS_PARAM_H */
667
668
669/*
670 * Do we have <sys/ucred.h>?
671 */
672
673/* #undef HAVE_SYS_UCRED_H */
674
675
676/*
677 * Do we have removefile()?
678 */
679
680/* #undef HAVE_REMOVEFILE */
681
682
683/*
684 * Do we have <sandbox.h>?
685 */
686
687/* #undef HAVE_SANDBOX_H */
688
689
690/*
691 * Which random number generator function to use...
692 */
693
694/* #undef HAVE_ARC4RANDOM */
695/* #undef HAVE_RANDOM */
696/* #undef HAVE_LRAND48 */
697
698#ifdef HAVE_ARC4RANDOM
699#  define CUPS_RAND() arc4random()
700#  define CUPS_SRAND(v) arc4random_stir()
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#else
708#  define CUPS_RAND() rand()
709#  define CUPS_SRAND(v) srand(v)
710#endif /* HAVE_ARC4RANDOM */
711
712
713/*
714 * Do we have vproc_transaction_begin/end?
715 */
716
717/* #undef HAVE_VPROC_TRANSACTION_BEGIN */
718
719
720/*
721 * Do we have libusb?
722 */
723
724/* #undef HAVE_LIBUSB */
725
726
727/*
728 * Do we have libwrap and tcpd.h?
729 */
730
731/* #undef HAVE_TCPD_H */
732
733
734/*
735 * Do we have <iconv.h>?
736 */
737
738/* #undef HAVE_ICONV_H */
739
740
741/*
742 * Do we have statfs or statvfs and one of the corresponding headers?
743 */
744
745/* #undef HAVE_STATFS */
746/* #undef HAVE_STATVFS */
747/* #undef HAVE_SYS_MOUNT_H */
748/* #undef HAVE_SYS_STATFS_H */
749/* #undef HAVE_SYS_STATVFS_H */
750/* #undef HAVE_SYS_VFS_H */
751
752
753/*
754 * Location of OS X localization bundle, if any.
755 */
756
757/* #undef CUPS_BUNDLEDIR */
758
759
760/*
761 * Do we have XPC?
762 */
763
764/* #undef HAVE_XPC */
765/* #undef HAVE_XPC_PRIVATE_H */
766
767
768/*
769 * Do we have Mini-XML?
770 */
771
772/* #undef HAVE_MXML_H */
773
774
775/*
776 * Do we have the C99 abs() function?
777 */
778
779/* #undef HAVE_ABS */
780#if !defined(HAVE_ABS) && !defined(abs)
781#  if defined(__GNUC__) || __STDC_VERSION__ >= 199901L
782#    define abs(x) _cups_abs(x)
783static inline int _cups_abs(int i) { return (i < 0 ? -i : i); }
784#  elif defined(_MSC_VER)
785#    define abs(x) _cups_abs(x)
786static __inline int _cups_abs(int i) { return (i < 0 ? -i : i); }
787#  else
788#    define abs(x) ((x) < 0 ? -(x) : (x))
789#  endif /* __GNUC__ || __STDC_VERSION__ */
790#endif /* !HAVE_ABS && !abs */
791
792#endif /* !_CUPS_CONFIG_H_ */
793
794/*
795 * End of "$Id: config.h 12142 2014-08-30 02:35:43Z msweet $".
796 */
797