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