It occurred to me that the samba includes.h file should be included in the
[samba.git] / source3 / include / includes.h
1 #ifndef _INCLUDES_H
2 #define _INCLUDES_H
3 /* 
4    Unix SMB/Netbios implementation.
5    Version 1.9.
6    Machine customisation and include handling
7    Copyright (C) Andrew Tridgell 1994-1998
8    
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 2 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23 /*
24    This file does all the #includes's. This makes it easier to
25    port to a new unix. Hopefully a port will only have to edit the Makefile
26    and add a section for the new unix below.
27 */
28
29
30 /* the first OS dependent section is to setup what includes will be used.
31    the main OS dependent section comes later on 
32 */
33
34 #ifdef ALTOS
35 #define NO_UTIMEH
36 #endif
37
38 #ifdef MIPS
39 #define POSIX_H
40 #define NO_UTIMEH
41 #endif
42
43 #ifdef sun386
44 #define NO_UTIMEH
45 #endif
46
47 #ifdef NEXT2
48 #define NO_UTIMEH
49 #endif
50
51 #ifdef NEXT3_0
52 #define NO_UTIMEH
53 #define NO_UNISTDH
54 #endif
55
56 #ifdef APOLLO
57 #define NO_UTIMEH
58 #define NO_SYSMOUNTH
59 #define NO_UNISTDH
60 #endif
61
62 #ifdef AIX
63 #define NO_SYSMOUNTH
64 #endif
65
66 #ifdef M88K_R3
67 #define SVR3H
68 #define NO_RESOURCEH
69 #endif
70
71 #ifdef DNIX
72 #define NO_SYSMOUNTH
73 #define NO_NETIFH
74 #define NO_RESOURCEH
75 #define PRIME_NMBD 0
76 #define NO_SETGROUPS
77 #endif
78
79
80 #ifdef ISC
81 #define SYSSTREAMH
82 #define NO_RESOURCEH
83 #endif
84
85 #ifdef QNX
86 #define NO_RESOURCEH
87 #define NO_SYSMOUNTH
88 #define USE_MMAP 1
89 #ifdef __386__
90    #define __i386__
91 #endif
92 #endif
93
94 #ifdef NEWS42
95 #define NO_UTIMEH
96 #define NO_STRFTIME
97 #define NO_UTIMBUF
98 #define REPLACE_MKTIME
99 #define NO_TM_NAME
100 #endif
101
102 #ifdef OS2
103 #define NO_SYSMOUNTH
104 #define NO_NETIFH
105 #endif
106
107 #ifdef LYNX
108 #define NO_SYSMOUNTH
109 #endif
110
111
112 #if (defined(SHADOW_PWD)||defined(OSF1_ENH_SEC)||defined(SecureWare)||defined(PWDAUTH))
113 #define PASSWORD_LENGTH 16
114 #endif
115
116 /* here is the general includes section - with some ifdefs generated 
117    by the previous section 
118 */
119 #include "local.h"
120 #include <stdio.h>
121 #ifdef POSIX_STDLIBH
122 #include <posix/stdlib.h>
123 #else
124 #include <stdlib.h>
125 #endif
126 #include <ctype.h>
127 #include <time.h>
128 #ifndef NO_UTIMEH
129 #include <utime.h>
130 #endif
131 #include <sys/types.h>
132
133 #ifdef SVR3H
134 #include <sys/statfs.h>
135 #include <sys/stream.h>
136 #include <netinet/types.h>
137 #include <netinet/ether.h>
138 #include <netinet/ip_if.h>
139 #endif
140
141 #include <sys/socket.h>
142 #ifdef AXPROC
143 #include <termio.h>
144 #endif
145 #include <sys/ioctl.h>
146 #include <stddef.h>
147 #ifdef POSIX_H
148 #include <posix/utime.h>
149 #include <bsd/sys/time.h>
150 #include <bsd/netinet/in.h>
151 #else
152 #include <sys/time.h>
153 #include <netinet/in.h>
154 #endif 
155 #include <netdb.h>
156 #include <signal.h>
157 #include <errno.h>
158 #include <sys/file.h>
159 #include <sys/stat.h>
160 #include <sys/param.h>
161 #include <grp.h>
162 #ifndef NO_RESOURCEH
163 #include <sys/resource.h>
164 #endif
165 #ifndef NO_SYSMOUNTH
166 #include <sys/mount.h>
167 #endif
168 #include <pwd.h>
169 #ifdef __STDC__
170 #include <stdarg.h>
171 #else
172 #include <varargs.h>
173 #endif
174 #ifndef NO_UNISTDH
175 #include <unistd.h>
176 #endif
177 #include <sys/wait.h>
178 #ifdef SYSSTREAMH
179 #include <sys/stream.h>
180 #endif
181 #ifndef NO_NETIFH
182 #ifdef POSIX_H
183 #include <bsd/net/if.h>
184 #else
185 #ifdef OSF1
186 #include <net/route.h>
187 #include <sys/mbuf.h>
188 #endif
189 #include <net/if.h>
190 #endif
191 #endif
192
193 #if defined(GETPWANAM)
194 #include <sys/types.h>
195 #include <sys/label.h>
196 #include <sys/audit.h>
197 #include <pwdadj.h>
198 #endif
199
200 #if defined(SHADOW_PWD) && !defined(NETBSD) && !defined(FreeBSD) && !defined(CONVEX) && !defined(__OpenBSD__)
201 #include <shadow.h>
202 #endif
203
204 #ifdef SYSLOG
205 #include <syslog.h>
206 #endif
207
208 #ifdef HAVE_REGEX_H
209 #include <regex.h>
210 #endif
211
212
213 /***************************************************************************
214 Here come some platform specific sections
215 ***************************************************************************/
216
217
218 #ifdef LINUX
219 #include <arpa/inet.h>
220 #include <dirent.h>
221 #include <string.h>
222 #include <sys/vfs.h>
223 #include <netinet/in.h>
224 #ifdef GLIBC2
225 #define _LINUX_C_LIB_VERSION_MAJOR     6
226 #include <termios.h>
227 #include <rpcsvc/ypclnt.h>
228 #include <crypt.h>
229 #include <netinet/tcp.h>
230 #include <netinet/ip.h>
231 #endif
232 #ifndef QSORT_CAST
233 #define QSORT_CAST (int (*)(const void *, const void *))
234 #endif /* QSORT_CAST */
235 #define SIGNAL_CAST (__sighandler_t)
236 #define USE_GETCWD
237 #define USE_SETSID
238 #define HAVE_BZERO
239 #define HAVE_MEMMOVE
240 #define HAVE_VSNPRINTF
241 #define USE_SIGPROCMASK
242 #define USE_WAITPID
243 #define USE_SYSV_IPC
244 #if 0
245 /* SETFS disabled until we can check on some bug reports */
246 #if _LINUX_C_LIB_VERSION_MAJOR >= 5
247 #define USE_SETFS
248 #endif
249 #endif
250 #ifdef SHADOW_PWD
251 #if _LINUX_C_LIB_VERSION_MAJOR < 5
252 #ifndef crypt
253 #define crypt pw_encrypt
254 #endif
255 #endif
256 #endif
257 #endif
258
259 #ifdef SUNOS4
260 #define SIGNAL_CAST (void (*)(int))
261 #include <netinet/tcp.h>
262 #include <dirent.h>
263 #include <sys/acct.h>
264 #include <sys/vfs.h>
265 #include <string.h>
266 #include <strings.h>
267 #include <errno.h>
268 #include <sys/wait.h>
269 #include <signal.h>
270 /* #include <termios.h> */
271 #ifdef sun386
272 #define NO_STRFTIME
273 #define NO_UTIMBUF
274 #define mktime timelocal
275 typedef unsigned short mode_t;
276 #else
277 #include <utime.h>
278 #define NO_STRERROR
279 #endif
280 #ifndef REPLACE_GETPASS
281 #define REPLACE_GETPASS
282 #endif
283 #ifndef BSD_TERMIO
284 #define BSD_TERMIO
285 #endif
286 #ifndef USE_SIGPROCMASK
287 #define USE_SIGPROCMASK
288 #endif
289 #ifndef USE_WAITPID
290 #define USE_WAITPID
291 #endif
292 #define USE_SYSV_IPC
293 /* SunOS doesn't have POSIX atexit */
294 #define atexit on_exit
295 #define NOSTRCASECMP
296 #endif
297
298
299 #ifdef SUNOS5
300 #include <fcntl.h>
301 #include <dirent.h>
302 #include <sys/acct.h>
303 #include <sys/statfs.h>
304 #include <sys/statvfs.h>
305 #include <sys/filio.h>
306 #include <sys/sockio.h>
307 #include <netinet/in_systm.h>
308 #include <netinet/tcp.h>
309 #include <netinet/ip.h>
310 #include <string.h>
311 #include <arpa/inet.h>
312 #include <rpcsvc/ypclnt.h>
313 #include <termios.h>
314 #include <sys/stropts.h>
315 #if !defined(USE_LIBDES) && !defined(KRB4_AUTH)
316 #include <crypt.h>
317 #endif /* !USE_LIBDES && !KRB4_AUTH */
318 extern int gettimeofday (struct timeval *, void *);
319 extern int gethostname (char *name, int namelen);
320 extern int innetgr (const char *, const char *, const char *, const char *);
321 #define USE_SETVBUF
322 #define SIGNAL_CAST (void (*)(int))
323 #ifndef SYSV
324 #define SYSV
325 #endif
326 #define USE_WAITPID
327 #define REPLACE_STRLEN
328 #define USE_STATVFS
329 #define USE_GETCWD
330 #define USE_SETSID
331 #define USE_SYSV_IPC
332 #define NO_SEMUN
333 #ifndef REPLACE_GETPASS
334 #define REPLACE_GETPASS
335 #endif /* REPLACE_GETPASS */
336 #define USE_SIGPROCMASK
337 #ifndef QSORT_CAST
338 #define QSORT_CAST (int (*)(const void *, const void *))
339 #endif /* QSORT_CAST */
340 #endif
341
342
343 #ifdef ULTRIX
344 #include <strings.h>
345 #include <nfs/nfs_clnt.h>
346 #include <nfs/vfs.h>
347 #include <netinet/tcp.h>
348 #ifdef ULTRIX_AUTH
349 #include <auth.h>
350 #endif
351 char *getwd(char *);
352 #define NOSTRDUP
353 #ifdef __STDC__
354 #define SIGNAL_CAST (void(*)(int))
355 #endif
356 #define USE_DIRECT
357 #define USE_WAITPID
358 #endif
359
360 #ifdef SGI4
361 #include <netinet/tcp.h>
362 #include <sys/statfs.h>
363 #include <string.h>
364 #include <signal.h>
365 #ifndef SYSV
366 #define SYSV
367 #endif
368 #define SIGNAL_CAST (void (*)())
369 #define STATFS4
370 #define USE_WAITPID
371 #define USE_DIRECT
372 #define USE_SETSID
373 #define USE_SYSV_IPC
374 #endif
375
376 #if defined(SGI5) || defined(SGI6)
377 #include <arpa/inet.h>
378 #include <netinet/tcp.h>
379 #include <netinet/in_systm.h>
380 #include <netinet/ip.h>
381 #include <sys/statvfs.h>
382 #include <string.h>
383 #include <signal.h>
384 #include <dirent.h>
385 #define USE_WAITPID
386 #define NETGROUP 
387 #ifndef SYSV
388 #define SYSV
389 #endif
390 #define SIGNAL_CAST (void (*)())
391 #define USE_STATVFS
392 #define USE_WAITPID
393 #define USE_SETSID
394 #define USE_SYSV_IPC
395 #ifndef QSORT_CAST
396 #define QSORT_CAST (int (*)(const void *, const void *))
397 #endif /* QSORT_CAST */
398 #endif
399
400
401 #ifdef MIPS
402 #include <bsd/net/soioctl.h>
403 #include <string.h>
404 #include <dirent.h>
405 #include <fcntl.h>
406 #include <sys/statfs.h>
407 #include <sys/wait.h>
408 #include <sys/termio.h>
409 #define SIGNAL_CAST (void (*)())
410 typedef int mode_t;
411 extern struct group *getgrnam();
412 extern struct passwd *getpwnam();
413 #define STATFS4
414 #define NO_STRERROR
415 #define REPLACE_STRSTR
416 #endif /* MIPS */
417
418
419
420 #ifdef DGUX
421 #include <string.h>
422 #include <dirent.h>
423 #include <sys/statfs.h>
424 #include <sys/statvfs.h>
425 #include <fcntl.h>
426 #include <termios.h>
427 #define SYSV
428 #define USE_WAITPID
429 #define SIGNAL_CAST (void (*)(int))
430 #define STATFS4
431 #define USE_GETCWD
432 #endif
433
434
435 #ifdef SVR4
436 #include <string.h>
437 #include <sys/dir.h>
438 #include <dirent.h>
439 #include <sys/statfs.h>
440 #include <sys/statvfs.h>
441 #include <sys/vfs.h>
442 #include <sys/filio.h>
443 #include <fcntl.h>
444 #include <sys/sockio.h>
445 #include <netinet/tcp.h>
446 #include <stropts.h>
447 #include <termios.h>
448 #define SYSV
449 #define USE_WAITPID
450 #define SIGNAL_CAST (void (*)(int))
451 #define USE_STATVFS
452 #define USE_GETCWD
453 #define USE_SETSID
454 #define USE_SYSV_IPC
455 #define NO_SEMUN
456 #endif
457
458
459 #ifdef OSF1
460 #include <termios.h>
461 #include <strings.h>
462 #include <dirent.h>
463 char *getwd(char *);
464 char *mktemp(char *); /* No standard include */
465 #include <netinet/in.h>
466 #include <arpa/inet.h> /* both for inet_ntoa */
467 #define SIGNAL_CAST ( void (*) (int) )
468 #define STATFS3
469 #define USE_F_FSIZE
470 #define USE_SETSID
471 #include <netinet/tcp.h>
472 #ifdef OSF1_ENH_SEC
473 #include <pwd.h>
474 #include <sys/types.h>
475 #include <sys/security.h>
476 #include <prot.h>
477 #include <unistd.h>
478 #define PASSWORD_LENGTH 16
479 #define NEED_AUTH_PARAMETERS
480 #endif  /* OSF1_ENH_SEC */
481 #define USE_SYSV_IPC
482 #define NO_SEMUN
483 #endif
484
485
486 #ifdef CLIX
487 #include <dirent.h>
488 #define SIGNAL_CAST     (void (*)())
489 #include <sys/fcntl.h>
490 #include <sys/statfs.h>
491 #include <string.h>
492 #define NO_EID
493 #define USE_WAITPID
494 #define STATFS4
495 #define NO_FSYNC
496 #define USE_GETCWD
497 #define USE_SETSID
498 #ifndef REPLACE_GETPASS
499 #define REPLACE_GETPASS
500 #endif /* REPLACE_GETPASS */
501 #define NO_GETRLIMIT
502 #endif  /* CLIX */
503
504
505
506 #ifdef BSDI
507 #include <string.h>
508 #include <netinet/tcp.h>
509 #define SIGNAL_CAST (void (*)())
510 #define USE_DIRECT
511 #endif
512
513
514 #ifdef NETBSD  
515 #ifdef NetBSD1_3  
516 #include <string.h>  
517 #ifdef ALLOW_CHANGE_PASSWORD  
518 #include <termios.h>  
519 #endif /* ALLOW_CHANGE_PASSWORD */  
520 #else /* NetBSD1_3 */
521 #include <strings.h>  
522 #endif /* NetBSD1_3 */  
523 #include <netinet/tcp.h>
524 /* you may not need this */
525 #define NO_GETSPNAM 
526 #define SIGNAL_CAST (void (*)())
527 #define USE_DIRECT
528 #define REPLACE_INNETGR
529 #endif
530
531
532 #ifdef FreeBSD
533 #include <arpa/inet.h>
534 #include <strings.h>
535 #include <netinet/tcp.h>
536 #include <netinet/in_systm.h>
537 #include <netinet/ip.h>
538 #include <termios.h>
539 #include <fcntl.h>
540 #if __FreeBSD__ >= 3
541 #include <dirent.h>
542 #else
543 #define USE_DIRECT
544 #endif
545 #define SIGNAL_CAST (void (*)(int))
546 #define USE_SETVBUF
547 #define USE_SETSID
548 #define USE_GETCWD
549 #define USE_WAITPID
550 #define HAVE_MEMMOVE
551 #define HAVE_BZERO
552 #define HAVE_GETTIMEOFDAY
553 #define HAVE_PATHCONF
554 #define HAVE_GETGRNAM 1
555 #define HAVE_VSNPRINTF
556 #define QSORT_CAST (int (*)(const void *, const void *))
557 #if !defined(O_SYNC)
558 #if defined(O_FSYNC)
559 #define O_SYNC O_FSYNC
560 #else /* defined(O_FSYNC) */
561 #define O_SYNC 0
562 #endif /* defined(O_FSYNC) */
563 #endif /* !defined(O_SYNC) */
564 #endif /* FreeBSD */
565
566 #ifdef __OpenBSD__
567 #include <strings.h>
568 #include <netinet/tcp.h>
569 #define NO_GETSPNAM
570 #define SIGNAL_CAST (void (*)())
571 #define USE_DIRECT
572 #define REPLACE_INNETGR
573 #define HAVE_BZERO
574 #define HAVE_PATHCONF
575 #define HAVE_GETGRNAM 1
576 #define HAVE_GETTIMEOFDAY
577 #define HAVE_MEMMOVE
578 #define USE_GETCWD
579 #define USE_SETSID
580 #endif 
581
582 #ifdef AIX
583 #include <strings.h>
584 #include <sys/dir.h>
585 #include <sys/select.h>
586 #include <dirent.h>
587 #include <sys/statfs.h>
588 #include <sys/vfs.h>
589 #include <sys/id.h>
590 #include <sys/priv.h>
591 /* According to AIX 4.1 man pages, inet_ntoa needs the following headers */
592 #include <sys/socket.h>
593 #include <netinet/in.h>
594 #include <arpa/inet.h>
595 #include <netinet/tcp.h>
596 #include <locale.h>
597 #define SYSV
598 #define USE_WAITPID
599 #define USE_SIGBLOCK
600 #define SIGNAL_CAST (void (*)())
601 #define DEFAULT_PRINTING PRINT_AIX
602 /* we undef this because sys/param.h is broken in aix. uggh. */
603 #undef MAXHOSTNAMELEN
604 #endif
605
606
607 #ifdef HPUX
608 #include <string.h>
609 #include <dirent.h>
610 #include <fcntl.h>
611 #include <sys/vfs.h>
612 #include <sys/types.h>
613 #include <sys/termios.h>
614 #include <netinet/tcp.h>
615 #include <arpa/inet.h>                /* needed for inet_ntoa proto */
616 #ifdef HPUX_10_TRUSTED
617 #include <hpsecurity.h>
618 #include <prot.h>
619 #define NEED_AUTH_PARAMETERS
620 #endif
621 #define SIGNAL_CAST (void (*)(__harg))
622 #ifdef HPUX10
623 #include <stropts.h>
624 #else /* HPUX10 */  
625 /* This is only needed for HPUX 9.x */
626 #define SELECT_CAST (int *)
627 #endif /* HPUX10 */
628 #define SYSV
629 #define USE_WAITPID
630 #define WAIT3_CAST2 (int *)
631 #define USE_GETCWD
632 #define USE_SETSID
633 #define USE_SETRES
634 #define USE_SYSV_IPC
635 #define NO_SEMUN
636 #define DEFAULT_PRINTING PRINT_HPUX
637 /* Ken Weiss <krweiss@ucdavis.edu> tells us that SIGCLD_IGNORE is
638    not good for HPUX */
639 /* #define SIGCLD_IGNORE */
640 #define USE_SIGPROCMASK /* Needed to stop zombie processes on HPUX 9.x and 10.x.*/
641 #endif /* HPUX */
642
643
644 #ifdef SEQUENT
645 #include <signal.h>
646 #include <string.h>
647 #include <dirent.h>
648 #include <sys/types.h>
649 #include <sys/statfs.h>
650 #include <sys/stat.h>
651 #include <sys/buf.h>
652 #include <sys/socket.h>
653 #include <unistd.h>
654 #include <fcntl.h>
655 #define SIGNAL_CAST (void (*)(int))
656 #define USE_WAITPID
657 #define USE_GETCWD
658 #define NO_EID
659 #define STATFS4
660 #define USE_DIRECT
661 #ifdef PTX4
662 #undef USE_DIRECT
663 #endif
664 #endif
665
666
667
668 #ifdef SEQUENT_PTX4
669 #include <string.h>
670 #include <sys/dir.h>
671 #include <dirent.h>
672 #include <sys/statfs.h>
673 #include <sys/statvfs.h>
674 #include <sys/vfs.h>
675 #include <fcntl.h>
676 #include <sys/sockio.h>
677 #include <netinet/tcp.h>
678 #include <stropts.h>
679 #include <termios.h>
680 #define SYSV
681 #define USE_WAITPID
682 #define SIGNAL_CAST (void (*)(int))
683 #define USE_STATVFS
684 #define USE_GETCWD
685 #ifndef seteuid
686 #define seteuid(uid) setreuid(-1,uid)
687 #endif
688 #ifndef setegid
689 #define setegid(gid) setregid(-1,gid)
690 #endif
691 #endif
692
693
694 #ifdef NEXT2
695 #include <sys/types.h>
696 #include <strings.h>
697 #include <dirent.h>
698 #include <sys/vfs.h>
699 #define bzero(b,len) memset(b,0,len)
700 #define mode_t int
701 #define NO_UTIMBUF
702 #include <libc.h>
703 #define NOSTRDUP
704 #define USE_DIRECT
705 #define USE_WAITPID
706 #endif 
707
708
709 #ifdef NEXT3_0
710 #include <strings.h>
711 #include <sys/dir.h>
712 #include <sys/vfs.h>
713 #define NO_UTIMBUF
714 #include <libc.h>
715 #define NOSTRDUP
716 #define USE_DIRECT
717 #define mode_t int
718 #define GID_TYPE int
719 #define gid_t int
720 #define pid_t int
721 #define SIGNAL_CAST (void (*)(int))
722 #define WAIT3_CAST1 (union wait *)
723 #define HAVE_GMTOFF
724 #define O_NONBLOCK O_NDELAY
725 #endif
726
727
728
729 #ifdef APOLLO
730 #include <string.h>
731 #include <fcntl.h>
732 #include <sys/statfs.h>
733 #define NO_UTIMBUF
734 #define USE_DIRECT
735 #define USE_GETCWD
736 #define SIGNAL_CAST     (void (*)())
737 #define HAVE_FCNTL_LOCK 0
738 #define HAVE_GETTIMEOFDAY
739 #define STATFS4
740 #endif
741
742
743
744 #ifdef SCO
745 #include <sys/netinet/tcp.h>
746 #include <sys/netinet/in_systm.h>
747 #include <sys/netinet/ip.h>
748 #include <dirent.h>
749 #include <string.h>
750 #include <termios.h>
751 #include <fcntl.h>
752 #include <sys/statfs.h>
753 #include <sys/stropts.h>
754 #include <limits.h>
755 #include <locale.h>
756 #ifdef EVEREST
757 #include <unistd.h> 
758 #endif /* EVEREST */
759 #ifdef NETGROUP
760 #include <rpcsvc/ypclnt.h>
761 #endif /* NETGROUP */
762 #ifdef SecureWare
763 #include <sys/security.h>
764 #include <sys/audit.h>
765 #include <prot.h>
766 #define crypt bigcrypt
767 #endif /* SecureWare */
768 #define SIGNAL_CAST (void (*)(int))
769 #define USE_WAITPID
770 #define USE_GETCWD
771 #define USE_SETSID
772 #ifdef SCO3_2_2
773 #define setuid(u) setreuid(u,-1)
774 #define seteuid(u) setreuid(-1,u)
775 #else /* SCO3_2_2 */
776 #ifndef EVEREST
777 #define ftruncate(f,l) syscall(0x0a28,f,l)
778 #define USE_IFREQ
779 #define NO_INITGROUPS
780 #endif /* EVEREST */
781 #endif /* SCO3_2_2 */
782 #define STATFS4
783 #define NO_FSYNC
784 #define HAVE_PATHCONF
785 #define NO_GETRLIMIT
786 #endif /* SCO */
787
788
789
790 /* Definitions for RiscIX */
791 #ifdef RiscIX
792 #define SIGNAL_CAST (void (*)(int))
793 #include <sys/dirent.h>
794 #include <sys/acct.h>
795 #include <sys/vfs.h>
796 #include <string.h>
797 #include <utime.h>
798 #include <signal.h>
799 #define HAVE_GETTIMEOFDAY
800 #define NOSTRCASECMP
801 #define NOSTRDUP
802 #endif
803
804
805
806 #ifdef ISC
807 #include <net/errno.h>
808 #include <string.h>
809 #include <sys/dir.h>
810 #include <dirent.h>
811 #include <sys/statfs.h>
812 #include <fcntl.h>
813 #include <sys/sioctl.h>
814 #include <stropts.h>
815 #include <limits.h>
816 #include <netinet/tcp.h>
817 #define FIONREAD FIORDCHK
818 #define SYSV
819 #define USE_WAITPID
820 #define SIGNAL_CAST (void (*)(int))
821 #define USE_GETCWD
822 #define USE_SETSID
823 #define USE_IFREQ
824 #define NO_FTRUNCATE
825 #define STATFS4
826 #define NO_FSYNC
827 #endif
828
829
830
831 #ifdef AUX
832 #include <fstab.h>
833 #include <string.h>
834 #include <dirent.h>
835 #include <sys/vfs.h>
836 #include <fcntl.h>
837 #include <termios.h>
838 #define SYSV
839 #define USE_WAITPID
840 #define SIGNAL_CAST (void (*)(int))
841 char *strdup (char *);
842 #define USE_GETCWD
843 #endif
844
845
846 #ifdef M88K_R3
847 #include <string.h>
848 #include <dirent.h>
849 #include <fcntl.h>
850 #include <termios.h>
851 #define STATFS4
852 #define SYSV
853 #define USE_WAITPID
854 #define SIGNAL_CAST (void (*)(int))
855 char *strdup (char *);
856 #define USE_GETCWD
857 #define NO_FSYNC
858 #define NO_EID
859 #endif
860
861
862 #ifdef DNIX
863 #include <dirent.h>
864 #include <string.h>
865 #include <fcntl.h>
866 #include <sys/statfs.h>
867 #include <sys/stropts.h>
868 #define NO_GET_BROADCAST
869 #define USE_WAITPID
870 #define USE_GETCWD
871 #define USE_SETSID
872 #define STATFS4
873 #define NO_EID
874 #define PF_INET AF_INET
875 #define NO_STRERROR
876 #define ftruncate(f,l) chsize(f,l)
877 #endif /* DNIX */
878
879 #ifdef CONVEX
880 #include <netinet/tcp.h>
881 #include <arpa/inet.h>
882 #include <dirent.h>
883 #include <string.h>
884 #include <sys/vfs.h>
885 #include <fcntl.h>
886 #define DONT_REINSTALL_SIG
887 #define USE_SIGBLOCK
888 #define USE_WAITPID
889 #define SIGNAL_CAST (_SigFunc_Ptr_t)
890 #define NO_GETSPNAM
891 #define HAVE_MEMMOVE
892 extern char *mktemp(char *);
893 extern int  fsync(int);
894 extern int  seteuid(uid_t);
895 extern int  setgroups(int, int *);
896 extern int  initgroups(char *, int);
897 extern int  statfs(char *, struct statfs *);
898 extern int  setegid(gid_t);
899 extern int  getopt(int, char *const *, const char *);
900 extern int  chroot(char *);
901 extern int  gettimeofday(struct timeval *, struct timezone *);
902 extern int  gethostname(char *, int);
903 extern char *crypt(char *, char *);
904 extern char *getpass(char *);
905 #endif
906
907
908 #ifdef CRAY
909 #define MAXPATHLEN 1024
910 #include <dirent.h>
911 #include <string.h>
912 #include <fcntl.h>
913 #include <sys/statfs.h>
914 #define SIGNAL_CAST (void (*)(int))
915 #define SIGCLD_IGNORE
916 #define HAVE_FCNTL_LOCK 1
917 #define USE_SETSID
918 #define STATFS4
919 #endif
920
921
922 #ifdef ALTOS
923 #include <unistd.h>
924 #include <string.h>
925 #include <dirent.h>
926 #include <sys/fcntl.h>
927 #include <sys/statfs.h>
928 #define        const
929 #define        uid_t           int
930 #define        gid_t           int
931 #define        mode_t          int
932 #define        ptrdiff_t       int
933 #define HAVE_GETGRNAM  0
934 #define NO_EID
935 #define NO_FSYNC
936 #define        NO_FTRUNCATE
937 #define        NO_GETRLIMIT
938 #define        NO_INITGROUPS
939 #define NO_SELECT
940 #define NO_SETGROUPS
941 #define NO_STRERROR
942 #define NO_STRFTIME
943 #define        NO_TM_NAME
944 #define NO_UTIMEH
945 #define NOSTRCASECMP
946 #define REPLACE_MKTIME
947 #define REPLACE_RENAME
948 #define REPLACE_STRSTR
949 #define STATFS4
950 #define        USE_GETCWD
951 #endif
952
953 #ifdef QNX
954 #define STATFS4
955 #include <sys/statfs.h>
956 #include <sys/select.h>
957 #include <signal.h>
958 #include <sys/dir.h>
959 #define SIGNAL_CAST (void (*)())
960 #define USE_WAITPID
961 #define NO_INITGROUPS
962 #define NO_SETGROUPS
963 #define HAVE_TIMEZONE
964 #define USE_GETCWD
965 #define USE_SETSID
966 #define HAVE_FCNTL_LOCK 1
967 #define DEFAULT_PRINTING PRINT_QNX
968 #endif
969
970
971 #ifdef NEWS42
972 #include <string.h>
973 #include <dirent.h>
974 #include <sys/vfs.h>
975 #include <sys/timeb.h>
976 typedef int mode_t;
977 #endif
978
979 #ifdef OS2
980 #include <dirent.h>
981 #include <sys/statfs.h>
982 #include <string.h>
983 #include <limits.h>
984 #define SIGNAL_CAST (void (*)())
985 #define HAVE_FCNTL_LOCK 0
986 #define USE_WAITPID
987 #define NO_GET_BROADCAST
988 #define NO_EID
989 #define NO_SETGROUPS
990 #define NO_INITGROUPS
991 #define NO_CRYPT
992 #define NO_STATFS
993 #define NO_CHROOT
994 #define NO_CHOWN
995 #define strcasecmp stricmp
996 #define strncasecmp strnicmp
997 #endif
998
999
1000 #ifdef LYNX
1001 #define SIGNAL_CAST (void (*)())
1002 #define WAIT3_CAST1 (union wait *)
1003 #define STATFS4
1004 #include <fcntl.h>
1005 #include <resource.h>
1006 #include <stat.h>
1007 #include <string.h>
1008 #include <dirent.h>
1009 #include <sys/statfs.h>
1010 #define USE_GETCWD
1011 #define USE_GETSID
1012 #endif
1013
1014
1015 #ifdef BOS
1016 #define SIGNAL_CAST (void (*)(int))
1017 #include <string.h>
1018 #include <sys/dir.h>
1019 #include <sys/select.h>
1020 #include <dirent.h>
1021 #include <fcntl.h>
1022 #include <signal.h>
1023 #include <sys/statfs.h>
1024 #include <sys/bsdioctl.h>
1025 #endif
1026
1027 #ifdef AMIGA
1028 #include <arpa/inet.h>
1029 #include <dirent.h>
1030 #include <string.h>
1031 #include <netinet/tcp.h>
1032 #include <sys/acct.h>
1033 #include <sys/fcntl.h>
1034 #include <sys/filio.h>
1035 #include <sys/sockio.h>
1036 #include <netinet/in_systm.h>
1037 #include <netinet/ip.h>
1038 #include <sys/termios.h>
1039 #include <limits.h>
1040 #include <sys/timeb.h>
1041
1042 #define SIGNAL_CAST (void (*)(int))
1043 #define USE_GETCWD
1044 #define HAVE_BZERO
1045 #define HAVE_MEMMOVE
1046 #define USE_SIGPROCMASK
1047 #define USE_WAITPID
1048 #define USE_DIRECT
1049 #define USE_F_FSIZE
1050 #define HAVE_FCNTL_LOCK 0
1051 #define HAVE_GETTIMEOFDAY
1052 #define HAVE_PATHCONF
1053
1054 #define HAVE_NO_PROC
1055 #define NO_FORK_DEBUG
1056 #define HAVE_FORK 0
1057 #define HAVE_VFORK 1
1058 #endif
1059
1060 /* For UnixWare 2.x's ia_uinfo routines. (tangent@cyberport.com) */
1061 #ifdef IA_UINFO
1062 #include <iaf.h>
1063 #include <ia.h>
1064 #endif
1065
1066
1067 /*******************************************************************
1068 end of the platform specific sections
1069 ********************************************************************/
1070
1071 #if (!defined(USE_LDAP_DB) && !defined(USE_NISPLUS_DB))
1072 #define USE_SMBPASS_DB
1073 #endif
1074
1075 #if defined(USE_MMAP) || defined(FAST_SHARE_MODES)
1076 #include <sys/mman.h>
1077 #endif
1078
1079 #ifdef SecureWare
1080 #define NEED_AUTH_PARAMETERS
1081 #endif
1082
1083 #ifdef REPLACE_GETPASS
1084 extern char    *getsmbpass(char *);
1085 #define getpass(s) getsmbpass(s)
1086 #endif
1087
1088 #ifdef REPLACE_INNETGR
1089 #define innetgr(group,host,user,dom) InNetGr(group,host,user,dom)
1090 #endif
1091
1092 #ifndef FD_SETSIZE
1093 #define FD_SETSIZE 255
1094 #endif
1095
1096 #ifndef __STDC__
1097 #define const
1098 #endif
1099
1100 /* Now for some other grungy stuff */
1101 #ifdef NO_GETSPNAM
1102 struct spwd { /* fake shadow password structure */
1103        char *sp_pwdp;
1104 };
1105 #endif
1106
1107 #ifndef HAVE_BZERO
1108 #ifndef bzero
1109 #define bzero(p,s) memset(p,0,s)
1110 #endif
1111 #endif
1112
1113 #ifndef HAVE_MEMMOVE
1114 #ifndef memmove
1115 #define memmove(d,s,n) MemMove(d,s,n)
1116 #endif
1117 #endif
1118
1119 #ifdef USE_DIRECT
1120 #include <sys/dir.h>
1121 #endif
1122
1123 /* some unixes have ENOTTY instead of TIOCNOTTY */
1124 #ifndef TIOCNOTTY
1125 #ifdef ENOTTY
1126 #define TIOCNOTTY ENOTTY
1127 #endif
1128 #endif
1129
1130 #ifndef SIGHUP
1131 #define SIGHUP 1
1132 #endif
1133
1134 /* if undefined then use bsd or sysv printing */
1135 #ifndef DEFAULT_PRINTING
1136 #ifdef SYSV
1137 #define DEFAULT_PRINTING PRINT_SYSV
1138 #else
1139 #define DEFAULT_PRINTING PRINT_BSD
1140 #endif
1141 #endif
1142
1143 /* This defines the name of the printcap file. It is MOST UNLIKELY that
1144    this will change BUT! Specifying a file with the format of a printcap
1145    file but containing only a subset of the printers actually in your real 
1146    printcap file is a quick-n-dirty way to allow dynamic access to a subset
1147    of available printers.
1148 */
1149 #ifndef PRINTCAP_NAME
1150 #ifdef AIX
1151 #define PRINTCAP_NAME "/etc/qconfig"
1152 #elif defined(SYSV)
1153 #define PRINTCAP_NAME "lpstat"
1154 #else
1155 #define PRINTCAP_NAME "/etc/printcap"
1156 #endif
1157 #endif
1158
1159
1160 #ifdef USE_SYSV_IPC
1161 #include <sys/ipc.h>
1162 #include <sys/sem.h>
1163 #include <sys/shm.h>
1164 #ifdef NO_SEMUN
1165 union semun {
1166         int val;
1167         struct semid_ds *buf;
1168         unsigned short *array;
1169 };
1170 #endif
1171 #if defined(HPUX) && defined(HPUX10)
1172 #ifdef SEMMSL
1173 #undef SEMMSL
1174 #endif /* SEMMSL */
1175 #endif /* HPUX && HPUX10 */
1176 #endif
1177
1178 #ifdef AFS_AUTH
1179 #include <afs/stds.h>
1180 #include <afs/kautils.h>
1181 #endif
1182
1183 #ifdef DFS_AUTH
1184 #include <dce/dce_error.h>
1185 #include <dce/sec_login.h>
1186 #endif
1187
1188 #ifdef KRB5_AUTH
1189 #include <krb5.h>
1190 #endif
1191
1192 #ifdef KRB4_AUTH
1193 #include <krb.h>
1194 #endif
1195
1196 #ifdef NO_UTIMBUF
1197 struct utimbuf {
1198   time_t actime;
1199   time_t modtime;
1200 };
1201 #endif
1202
1203 #ifdef NO_STRERROR
1204 #ifndef strerror
1205 extern char *sys_errlist[];
1206 #define strerror(i) sys_errlist[i]
1207 #endif
1208 #endif
1209
1210 #ifndef perror
1211 #define perror(m) printf("%s: %s\n",m,strerror(errno))
1212 #endif
1213
1214 #ifndef MAXHOSTNAMELEN
1215 #define MAXHOSTNAMELEN 255
1216 #endif
1217
1218 #include "version.h"
1219 #include "smb.h"
1220 #include "nameserv.h"
1221
1222 #include "byteorder.h"
1223
1224 #include "kanji.h"
1225 #include "charset.h"
1226
1227 #ifndef MAXCODEPAGELINES
1228 #define MAXCODEPAGELINES 256
1229 #endif
1230
1231 /***** automatically generated prototypes *****/
1232 #include "proto.h"
1233
1234
1235
1236 #ifndef S_IFREG
1237 #define S_IFREG 0100000
1238 #endif
1239
1240 #ifndef S_ISREG
1241 #define S_ISREG(x) ((S_IFREG & (x))!=0)
1242 #endif
1243
1244 #ifndef S_ISDIR
1245 #define S_ISDIR(x) ((S_IFDIR & (x))!=0)
1246 #endif
1247
1248 #if !defined(S_ISLNK) && defined(S_IFLNK)
1249 #define S_ISLNK(x) ((S_IFLNK & (x))!=0)
1250 #endif
1251
1252 #ifdef UFC_CRYPT
1253 #define crypt ufc_crypt
1254 #endif
1255
1256 #ifdef REPLACE_STRLEN
1257 #define strlen(s) Strlen(s)
1258 #endif
1259
1260 #ifdef REPLACE_STRSTR
1261 #define strstr(s,p) Strstr(s,p)
1262 #endif
1263
1264 #ifdef REPLACE_MKTIME
1265 #define mktime(t) Mktime(t)
1266 #endif
1267
1268 #ifndef NGROUPS_MAX
1269 #define NGROUPS_MAX 128
1270 #endif
1271
1272 #ifndef EDQUOT
1273 #define EDQUOT ENOSPC
1274 #endif
1275
1276 #ifndef HAVE_GETGRNAM
1277 #define HAVE_GETGRNAM 1
1278 #endif
1279
1280 #ifndef SOL_TCP
1281 #define SOL_TCP 6
1282 #endif
1283
1284 /* default to using ftruncate workaround as this is safer than assuming
1285 it works and getting lots of bug reports */
1286 #ifndef FTRUNCATE_CAN_EXTEND
1287 #define FTRUNCATE_CAN_EXTEND 0
1288 #endif
1289
1290 /* maybe this unix doesn't separate RD and WR locks? */
1291 #ifndef F_RDLCK
1292 #define F_RDLCK F_WRLCK
1293 #endif
1294
1295 #ifndef ENOTSOCK
1296 #define ENOTSOCK EINVAL
1297 #endif
1298
1299 #ifndef SIGCLD
1300 #define SIGCLD SIGCHLD
1301 #endif 
1302
1303 #ifndef MAP_FILE
1304 #define MAP_FILE 0
1305 #endif
1306
1307 #ifndef HAVE_FCNTL_LOCK
1308 #define HAVE_FCNTL_LOCK 1
1309 #endif
1310
1311 #ifndef WAIT3_CAST2
1312 #define WAIT3_CAST2 (struct rusage *)
1313 #endif
1314
1315 #ifndef WAIT3_CAST1
1316 #define WAIT3_CAST1 (int *)
1317 #endif
1318
1319 #ifndef QSORT_CAST
1320 #define QSORT_CAST (int (*)())
1321 #endif
1322
1323 #ifndef INADDR_LOOPBACK
1324 #define INADDR_LOOPBACK 0x7f000001
1325 #endif /* INADDR_LOOPBACK */
1326
1327 /* this is a rough check to see if this machine has a lstat() call.
1328    it is not guaranteed to work */
1329 #if !defined(S_ISLNK)
1330 #define lstat stat
1331 #endif
1332
1333 /* Not all systems declare ERRNO in errno.h... and some systems #define it! */
1334 #ifndef errno
1335 extern int errno;
1336 #endif 
1337
1338
1339 #ifdef NO_EID
1340 #define geteuid() getuid()
1341 #define getegid() getgid()
1342 #define seteuid(x) setuid(x)
1343 #define setegid(x) setgid(x)
1344 #endif
1345
1346
1347 #if (HAVE_FCNTL_LOCK == 0)
1348 /* since there is no locking available, system includes  */
1349 /* for DomainOS 10.4 do not contain any of the following */
1350 /* #define's. So, to satisfy the compiler, add these     */
1351 /* #define's, although they arn't really necessary.      */
1352 #define F_GETLK 0
1353 #define F_SETLK 0
1354 #define F_WRLCK 0
1355 #define F_UNLCK 0
1356 #endif /* HAVE_FCNTL_LOCK == 0 */
1357
1358 #ifdef NOSTRCASECMP
1359 #define strcasecmp(s1,s2) StrCaseCmp(s1,s2)
1360 #define strncasecmp(s1,s2,n) StrnCaseCmp(s1,s2,n)
1361 #endif
1362
1363 #ifdef strcpy
1364 #undef strcpy
1365 #endif /* strcpy */
1366 #define strcpy(dest,src) __ERROR__XX__NEVER_USE_STRCPY___;
1367
1368 #ifdef strcat
1369 #undef strcat
1370 #endif /* strcat */
1371 #define strcat(dest,src) __ERROR__XX__NEVER_USE_STRCAT___;
1372
1373 #ifdef sprintf
1374 #undef sprintf
1375 #endif /* sprintf */
1376 #define sprintf __ERROR__XX__NEVER_USE_SPRINTF__;
1377
1378 #define pstrcpy(d,s) safe_strcpy((d),(s),sizeof(pstring)-1)
1379 #define pstrcat(d,s) safe_strcat((d),(s),sizeof(pstring)-1)
1380 #define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1)
1381 #define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1)
1382
1383 #if MEM_MAN
1384 #include "mem_man/mem_man.h"
1385 #endif /* MEM_MAN */
1386
1387
1388 /* -------------------------------------------------------------------------- **
1389  * Lists, trees, and caching...
1390  */
1391 #include "ubiqx/ubi_sLinkList.h"
1392 #include "ubiqx/ubi_dLinkList.h"
1393
1394 #ifndef UBI_BINTREE_H
1395 #include "ubiqx/ubi_SplayTree.h"
1396 #include "ubiqx/ubi_Cache.h"
1397 #endif /* UBI_BINTREE_H */
1398
1399 #endif /* _INCLUDES_H */