added loads of pointless rpcsvc/ and rpc/ include files, all because
[samba.git] / source / include / includes.h
index 7403fc4b641393cd8c8a07f08ddc57186b886f30..4993a29e2b828800ad21b364bd071e3353b9c82b 100644 (file)
@@ -4,7 +4,7 @@
    Unix SMB/Netbios implementation.
    Version 1.9.
    Machine customisation and include handling
-   Copyright (C) Andrew Tridgell 1994-1997
+   Copyright (C) Andrew Tridgell 1994-1998
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
-/*
-   This file does all the #includes's. This makes it easier to
-   port to a new unix. Hopefully a port will only have to edit the Makefile
-   and add a section for the new unix below.
-*/
-
-
-/* the first OS dependent section is to setup what includes will be used.
-   the main OS dependent section comes later on 
-*/
-
-#ifdef ALTOS
-#define NO_UTIMEH
-#endif
-
-#ifdef MIPS
-#define POSIX_H
-#define NO_UTIMEH
-#endif
-
-#ifdef sun386
-#define NO_UTIMEH
-#endif
-
-#ifdef NEXT2
-#define NO_UTIMEH
-#endif
-
-#ifdef NEXT3_0
-#define NO_UTIMEH
-#define NO_UNISTDH
-#endif
 
-#ifdef APOLLO
-#define NO_UTIMEH
-#define NO_SYSMOUNTH
-#define NO_UNISTDH
-#endif
+#include "config.h"
+#include "local.h"
 
 #ifdef AIX
-#define NO_SYSMOUNTH
-#endif
-
-#ifdef M88K_R3
-#define SVR3H
-#define NO_RESOURCEH
-#endif
-
-#ifdef DNIX
-#define NO_SYSMOUNTH
-#define NO_NETIFH
-#define NO_RESOURCEH
-#define PRIME_NMBD 0
-#define NO_SETGROUPS
+#define DEFAULT_PRINTING PRINT_AIX
 #endif
 
-
-#ifdef ISC
-#define SYSSTREAMH
-#define NO_RESOURCEH
+#ifdef HPUX
+#define DEFAULT_PRINTING PRINT_HPUX
 #endif
 
 #ifdef QNX
-#define NO_RESOURCEH
-#define NO_SYSMOUNTH
-#define USE_MMAP 1
-#ifdef __386__
-   #define __i386__
-#endif
-#endif
-
-#ifdef NEWS42
-#define NO_UTIMEH
-#define NO_STRFTIME
-#define NO_UTIMBUF
-#define REPLACE_MKTIME
-#define NO_TM_NAME
+#define DEFAULT_PRINTING PRINT_QNX
 #endif
 
-#ifdef OS2
-#define NO_SYSMOUNTH
-#define NO_NETIFH
+#ifdef SUNOS4
+#define REPLACE_GETPASS
+/* on SUNOS4 termios.h conflicts with sys/ioctl.h */
+#undef HAVE_TERMIOS_H
 #endif
 
-#ifdef LYNX
-#define NO_SYSMOUNTH
+#ifdef SUNOS5
+#define REPLACE_GETPASS
 #endif
 
 
-#if (defined(SHADOW_PWD)||defined(OSF1_ENH_SEC)||defined(SecureWare)||defined(PWDAUTH))
-#define PASSWORD_LENGTH 16
-#endif
-
-/* here is the general includes section - with some ifdefs generated 
-   by the previous section 
-*/
-#include "local.h"
-#include <stdio.h>
-#ifdef POSIX_STDLIBH
-#include <posix/stdlib.h>
-#else
-#include <stdlib.h>
-#endif
-#include <ctype.h>
-#include <time.h>
-#ifndef NO_UTIMEH
-#include <utime.h>
-#endif
 #include <sys/types.h>
 
-#ifdef SVR3H
-#include <sys/statfs.h>
-#include <sys/stream.h>
-#include <netinet/types.h>
-#include <netinet/ether.h>
-#include <netinet/ip_if.h>
-#endif
-
-#include <sys/socket.h>
-#ifdef AXPROC
-#include <termio.h>
-#endif
-#include <sys/ioctl.h>
-#include <stddef.h>
-#ifdef POSIX_H
-#include <posix/utime.h>
-#include <bsd/sys/time.h>
-#include <bsd/netinet/in.h>
-#else
+#ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
-#include <netinet/in.h>
-#endif 
-#include <netdb.h>
-#include <signal.h>
-#include <errno.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <sys/param.h>
-#include <grp.h>
-#ifndef NO_RESOURCEH
-#include <sys/resource.h>
-#endif
-#ifndef NO_SYSMOUNTH
-#include <sys/mount.h>
-#endif
-#include <pwd.h>
-#ifdef __STDC__
-#include <stdarg.h>
+#include <time.h>
 #else
-#include <varargs.h>
-#endif
-#ifndef NO_UNISTDH
-#include <unistd.h>
-#endif
-#include <sys/wait.h>
-#ifdef SYSSTREAMH
-#include <sys/stream.h>
-#endif
-#ifndef NO_NETIFH
-#ifdef POSIX_H
-#include <bsd/net/if.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
 #else
-#include <net/if.h>
-#endif
+#include <time.h>
 #endif
-
-#if defined(GETPWANAM)
-#include <sys/types.h>
-#include <sys/label.h>
-#include <sys/audit.h>
-#include <pwdadj.h>
 #endif
 
-#if defined(SHADOW_PWD) && !defined(NETBSD) && !defined(FreeBSD) && !defined(CONVEX)
-#include <shadow.h>
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
 #endif
 
-#ifdef SYSLOG
-#include <syslog.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
 #endif
 
+#include <stdio.h>
+#include <stddef.h>
 
-
-/***************************************************************************
-Here come some platform specific sections
-***************************************************************************/
-
-
-#ifdef LINUX
-#include <arpa/inet.h>
-#include <dirent.h>
-#include <string.h>
-#include <sys/vfs.h>
-#include <netinet/in.h>
-#ifndef NO_ASMSIGNALH
-#include <asm/signal.h>
-#endif
-#define SIGNAL_CAST (__sighandler_t)
-#define USE_GETCWD
-#define USE_SETSID
-#define HAVE_BZERO
-#define HAVE_MEMMOVE
-#define USE_SIGPROCMASK
-#define USE_WAITPID
-#if 0
-/* SETFS disabled until we can check on some bug reports */
-#if _LINUX_C_LIB_VERSION_MAJOR >= 5
-#define USE_SETFS
-#endif
-#endif
-#ifdef SHADOW_PWD
-#if _LINUX_C_LIB_VERSION_MAJOR < 5
-#ifndef crypt
-#define crypt pw_encrypt
-#endif
-#endif
-#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
 #endif
 
-#ifdef SUNOS4
-#define SIGNAL_CAST (void (*)(int))
-#include <netinet/tcp.h>
-#include <dirent.h>
-#include <sys/acct.h>
-#include <sys/vfs.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/wait.h>
-#include <signal.h>
-/* #include <termios.h> */
-#ifdef sun386
-#define NO_STRFTIME
-#define NO_UTIMBUF
-#define mktime timelocal
-typedef unsigned short mode_t;
-#else
-#include <utime.h>
-#define NO_STRERROR
-#endif
-#ifndef REPLACE_GETPASS
-#define REPLACE_GETPASS
-#endif
-#ifndef BSD_TERMIO
-#define BSD_TERMIO
-#endif
-#ifndef USE_SIGPROCMASK
-#define USE_SIGPROCMASK
-#endif
-#ifndef USE_WAITPID
-#define USE_WAITPID
-#endif
-/* SunOS doesn't have POSIX atexit */
-#define atexit on_exit
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
 #endif
 
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
 
-#ifdef SUNOS5
-#include <fcntl.h>
-#include <dirent.h>
-#include <sys/acct.h>
-#include <sys/statfs.h>
-#include <sys/statvfs.h>
-#include <sys/filio.h>
-#include <sys/sockio.h>
-#include <netinet/in_systm.h>
-#include <netinet/tcp.h>
-#include <netinet/ip.h>
+#ifdef HAVE_STRING_H
 #include <string.h>
-#include <arpa/inet.h>
-#include <rpcsvc/ypclnt.h>
-#include <termios.h>
-#ifndef USE_LIBDES
-#include <crypt.h>
-#endif /* USE_LIBDES */
-extern int gettimeofday (struct timeval *, void *);
-extern int gethostname (char *name, int namelen);
-extern int innetgr (const char *, const char *, const char *, const char *);
-#define USE_SETVBUF
-#define SIGNAL_CAST (void (*)(int))
-#ifndef SYSV
-#define SYSV
-#endif
-#define USE_WAITPID
-#define REPLACE_STRLEN
-#define USE_STATVFS
-#define USE_GETCWD
-#define USE_SETSID
-#define REPLACE_GETPASS
-#define USE_SIGPROCMASK
 #endif
 
-
-#ifdef ULTRIX
+#ifdef HAVE_STRINGS_H
 #include <strings.h>
-#include <nfs/nfs_clnt.h>
-#include <nfs/vfs.h>
-#include <netinet/tcp.h>
-#ifdef ULTRIX_AUTH
-#include <auth.h>
-#endif
-char *getwd(char *);
-#define NOSTRDUP
-#ifdef __STDC__
-#define SIGNAL_CAST (void(*)(int))
-#endif
-#define USE_DIRECT
-#define USE_WAITPID
 #endif
 
-#ifdef SGI
-#include <netinet/tcp.h>
-#include <sys/statfs.h>
-#include <string.h>
-#include <signal.h>
-#ifndef SYSV
-#define SYSV
-#endif
-#define SIGNAL_CAST (void (*)())
-#define STATFS4
-#define USE_WAITPID
-#define USE_DIRECT
-#define USE_SETSID
+#ifdef HAVE_MEMORY_H
+#include <memory.h>
 #endif
 
-#ifdef SGI5
-#include <arpa/inet.h>
-#include <netinet/tcp.h>
-#include <sys/statvfs.h>
-#include <string.h>
-#include <signal.h>
-#include <dirent.h>
-#define USE_WAITPID
-#define NETGROUP 
-#ifndef SYSV
-#define SYSV
-#endif
-#define SIGNAL_CAST (void (*)())
-#define USE_STATVFS
-#define USE_WAITPID
-#define USE_SETSID
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
 #endif
 
-
-#ifdef MIPS
-#include <bsd/net/soioctl.h>
-#include <string.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <sys/statfs.h>
-#include <sys/wait.h>
-#include <sys/termio.h>
-#define SIGNAL_CAST (void (*)())
-typedef int mode_t;
-extern struct group *getgrnam();
-extern struct passwd *getpwnam();
-#define STATFS4
-#define NO_STRERROR
-#define REPLACE_STRSTR
-#endif /* MIPS */
-
-
-
-#ifdef DGUX
-#include <string.h>
-#include <dirent.h>
-#include <sys/statfs.h>
-#include <sys/statvfs.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
-#include <termios.h>
-#define SYSV
-#define USE_WAITPID
-#define SIGNAL_CAST (void (*)(int))
-#define STATFS4
-#define USE_GETCWD
-#endif
-
-
-#ifdef SVR4
-#include <string.h>
-#include <sys/dir.h>
-#include <dirent.h>
-#include <sys/statfs.h>
-#include <sys/statvfs.h>
-#include <sys/vfs.h>
-#include <sys/filio.h>
-#include <fcntl.h>
-#include <sys/sockio.h>
-#include <netinet/tcp.h>
-#include <stropts.h>
-#include <termios.h>
-#define SYSV
-#define USE_WAITPID
-#define SIGNAL_CAST (void (*)(int))
-#define USE_STATVFS
-#define USE_GETCWD
-#define USE_SETSID
+#else
+#ifdef HAVE_SYS_FCNTL_H
+#include <sys/fcntl.h>
 #endif
-
-
-#ifdef OSF1
-#include <termios.h>
-#include <strings.h>
-#include <dirent.h>
-char *getwd(char *);
-char *mktemp(char *); /* No standard include */
-#include <netinet/in.h>
-#include <arpa/inet.h> /* both for inet_ntoa */
-#define SIGNAL_CAST ( void (*) (int) )
-#define STATFS3
-#define USE_F_FSIZE
-#define USE_SETSID
-#include <netinet/tcp.h>
-#ifdef OSF1_ENH_SEC
-#include <pwd.h>
-#include <sys/types.h>
-#include <sys/security.h>
-#include <prot.h>
-#include <unistd.h>
-#define PASSWORD_LENGTH 16
-#define NEED_AUTH_PARAMETERS
-#endif  /* OSF1_ENH_SEC */
 #endif
 
+#include <sys/stat.h>
 
-#ifdef CLIX
-#include <dirent.h>
-#define SIGNAL_CAST    (void (*)())
-#include <sys/fcntl.h>
-#include <sys/statfs.h>
-#include <string.h>
-#define NO_EID
-#define USE_WAITPID
-#define STATFS4
-#define NO_FSYNC
-#define USE_GETCWD
-#define USE_SETSID
-#define REPLACE_GETPASS
-#define NO_GETRLIMIT
-#endif /* CLIX */
-
-
-
-#ifdef BSDI
-#include <string.h>
-#include <netinet/tcp.h>
-#define SIGNAL_CAST (void (*)())
-#define USE_DIRECT
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
 #endif
 
-
-#ifdef NETBSD
-#include <strings.h>
-#include <netinet/tcp.h>
-/* you may not need this */
-#define NO_GETSPNAM
-#define SIGNAL_CAST (void (*)())
-#define USE_DIRECT
-#define REPLACE_INNETGR
-#endif 
-
-
-
-#ifdef FreeBSD
-#include <arpa/inet.h>
-#include <strings.h>
-#include <netinet/tcp.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#define SIGNAL_CAST (void (*)())
-#define USE_SETVBUF
-#define USE_SETSID
-#define USE_GETCWD
-#define USE_WAITPID
-#define USE_DIRECT
-#define HAVE_MEMMOVE
-#define HAVE_BZERO
-#define HAVE_GETTIMEOFDAY
-#define HAVE_PATHCONF
-#define HAVE_GETGRNAM 1
-#endif 
-
-
-
-#ifdef AIX
-#include <strings.h>
-#include <sys/dir.h>
-#include <sys/select.h>
-#include <dirent.h>
-#include <sys/statfs.h>
-#include <sys/vfs.h>
-#include <sys/id.h>
-#include <sys/priv.h>
-#include <netinet/tcp.h>
-#include <locale.h>
-#define SYSV
-#define USE_WAITPID
-#define USE_SIGBLOCK
-#define SIGNAL_CAST (void (*)())
-#define DEFAULT_PRINTING PRINT_AIX
-/* we undef this because sys/param.h is broken in aix. uggh. */
-#undef MAXHOSTNAMELEN
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
 #endif
 
-
-#ifdef HPUX
-#include <string.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <sys/vfs.h>
-#include <sys/types.h>
-#include <sys/termios.h>
-#include <netinet/tcp.h>
-#ifdef HPUX_10_TRUSTED
-#include <hpsecurity.h>
-#include <prot.h>
-#define NEED_AUTH_PARAMETERS
-#endif
-#define SIGNAL_CAST (void (*)(__harg))
-#define SELECT_CAST (int *)
-#define SYSV
-#define USE_WAITPID
-#define WAIT3_CAST2 (int *)
-#define USE_GETCWD
-#define USE_SETSID
-#define USE_SETRES
-#define DEFAULT_PRINTING PRINT_HPUX
-#define SIGCLD_IGNORE
+#ifdef HAVE_SYS_FILIO_H
+#include <sys/filio.h>
 #endif
 
-
-#ifdef SEQUENT
 #include <signal.h>
-#include <string.h>
-#include <dirent.h>
-#include <sys/types.h>
-#include <sys/statfs.h>
-#include <sys/stat.h>
-#include <sys/buf.h>
-#include <sys/socket.h>
-#include <unistd.h>
-#include <fcntl.h>
-#define SIGNAL_CAST (void (*)(int))
-#define USE_WAITPID
-#define USE_GETCWD
-#define NO_EID
-#define STATFS4
-#define USE_DIRECT
-#ifdef PTX4
-#undef USE_DIRECT
-#endif
-#endif
-
-
 
-#ifdef SEQUENT_PTX4
-#include <string.h>
-#include <sys/dir.h>
-#include <dirent.h>
-#include <sys/statfs.h>
-#include <sys/statvfs.h>
-#include <sys/vfs.h>
-#include <fcntl.h>
-#include <sys/sockio.h>
-#include <netinet/tcp.h>
-#include <stropts.h>
-#include <termios.h>
-#define SYSV
-#define USE_WAITPID
-#define SIGNAL_CAST (void (*)(int))
-#define USE_STATVFS
-#define USE_GETCWD
-#ifndef seteuid
-#define seteuid(uid) setreuid(-1,uid)
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
 #endif
-#ifndef setegid
-#define setegid(gid) setregid(-1,gid)
+#ifdef HAVE_CTYPE_H
+#include <ctype.h>
 #endif
+#ifdef HAVE_GRP_H
+#include <grp.h>
 #endif
-
-
-#ifdef NEXT2
-#include <sys/types.h>
-#include <strings.h>
-#include <dirent.h>
-#include <sys/vfs.h>
-#define bzero(b,len) memset(b,0,len)
-#define mode_t int
-#define NO_UTIMBUF
-#include <libc.h>
-#define NOSTRDUP
-#define USE_DIRECT
-#define USE_WAITPID
-#endif 
-
-
-#ifdef NEXT3_0
-#include <strings.h>
-#include <sys/dir.h>
-#include <sys/vfs.h>
-#define bzero(b,len) memset(b,0,len)
-#define NO_UTIMBUF
-#include <libc.h>
-#define NOSTRDUP
-#define USE_DIRECT
-#define mode_t int
-#define GID_TYPE int
-#define gid_t int
-#define pid_t int
-#define SIGNAL_CAST (void (*)(int))
-#define WAIT3_CAST1 (union wait *)
-#define HAVE_GMTOFF
+#ifdef HAVE_SYS_ID_H
+#include <sys/id.h>
 #endif
 
+#include <errno.h>
 
-
-#ifdef APOLLO
-#include <string.h>
-#include <fcntl.h>
-#include <sys/statfs.h>
-#define NO_UTIMBUF
-#define USE_DIRECT
-#define USE_GETCWD
-#define SIGNAL_CAST     (void (*)())
-#define HAVE_FCNTL_LOCK 0
-#define HAVE_GETTIMEOFDAY
-#define STATFS4
+#ifdef HAVE_UTIME_H
+#include <utime.h>
 #endif
 
-
-
-#ifdef SCO
-#include <sys/netinet/tcp.h>
-#include <sys/netinet/in_systm.h>
-#include <sys/netinet/ip.h>
-#include <dirent.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/statfs.h>
-#include <sys/stropts.h>
-#include <limits.h>
-#include <locale.h>
-#ifdef EVEREST
-#include <unistd.h> 
-#endif
-#ifdef NETGROUP
-#include <rpcsvc/ypclnt.h>
-#endif
-#ifdef SecureWare
-#include <sys/security.h>
-#include <sys/audit.h>
-#include <prot.h>
-#define crypt bigcrypt
-#endif
-#ifndef EVEREST
- #define ftruncate(f,l) syscall(0x0a28,f,l)
-#endif 
-#define SIGNAL_CAST (void (*)(int))
-#define USE_WAITPID
-#define USE_GETCWD
-#define USE_SETSID
-#ifdef SCO3_2_2
-#define NO_EID
-#else
-#ifndef EVEREST
-#define USE_IFREQ
-#endif
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
 #endif
-#define STATFS4
-#define NO_FSYNC
-#ifndef EVEREST
-#define NO_INITGROUPS
+
+#ifdef HAVE_SYS_MODE_H
+/* apparently AIX needs this for S_ISLNK */
+#ifndef S_ISLNK
+#include <sys/mode.h>
 #endif
-#define HAVE_PATHCONF
-#define NO_GETRLIMIT
 #endif
 
+#ifdef HAVE_GLOB
+#include <glob.h>
+#endif
 
+#include <pwd.h>
+#include <grp.h>
 
-/* Definitions for RiscIX */
-#ifdef RiscIX
-#define SIGNAL_CAST (void (*)(int))
-#include <sys/dirent.h>
-#include <sys/acct.h>
-#include <sys/vfs.h>
-#include <string.h>
-#include <utime.h>
-#include <signal.h>
-#define HAVE_GETTIMEOFDAY
-#define NOSTRCASECMP
-#define NOSTRDUP
+#ifdef HAVE_STDARG_H
+#include <stdarg.h>
+#else
+#include <varargs.h>
 #endif
 
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <syslog.h>
+#include <sys/file.h>
 
-
-#ifdef ISC
-#include <net/errno.h>
-#include <string.h>
-#include <sys/dir.h>
-#include <dirent.h>
-#include <sys/statfs.h>
-#include <fcntl.h>
-#include <sys/sioctl.h>
-#include <stropts.h>
-#include <limits.h>
+#ifdef HAVE_NETINET_TCP_H
 #include <netinet/tcp.h>
-#define FIONREAD FIORDCHK
-#define SYSV
-#define USE_WAITPID
-#define SIGNAL_CAST (void (*)(int))
-#define USE_GETCWD
-#define USE_SETSID
-#define USE_IFREQ
-#define NO_FTRUNCATE
-#define STATFS4
-#define NO_FSYNC
 #endif
 
-
-
-#ifdef AUX
-#include <fstab.h>
-#include <string.h>
-#include <dirent.h>
-#include <sys/vfs.h>
-#include <fcntl.h>
+#ifdef HAVE_TERMIOS_H
 #include <termios.h>
-#define SYSV
-#define USE_WAITPID
-#define SIGNAL_CAST (void (*)(int))
-char *strdup (char *);
-#define USE_GETCWD
 #endif
 
-
-#ifdef M88K_R3
-#include <string.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <termios.h>
-#define STATFS4
-#define SYSV
-#define USE_WAITPID
-#define SIGNAL_CAST (void (*)(int))
-char *strdup (char *);
-#define USE_GETCWD
-#define NO_FSYNC
-#define NO_EID
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# if HAVE_SYS_NDIR_H
+#  include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+#  include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+#  include <ndir.h>
+# endif
+#endif
+
+#ifdef HAVE_SHARED_MMAP
+#include <sys/mman.h>
 #endif
 
-
-#ifdef DNIX
-#include <dirent.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/statfs.h>
-#include <sys/stropts.h>
-#define NO_GET_BROADCAST
-#define USE_WAITPID
-#define USE_GETCWD
-#define USE_SETSID
-#define STATFS4
-#define NO_EID
-#define PF_INET AF_INET
-#define NO_STRERROR
-#define ftruncate(f,l) chsize(f,l)
-#endif /* DNIX */
-
-#ifdef CONVEX
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <dirent.h>
-#include <string.h>
-#include <sys/vfs.h>
-#include <fcntl.h>
-#define DONT_REINSTALL_SIG
-#define USE_SIGBLOCK
-#define USE_WAITPID
-#define SIGNAL_CAST (_SigFunc_Ptr_t)
-#define NO_GETSPNAM
-#define HAVE_MEMMOVE
-extern char *mktemp(char *);
-extern int  fsync(int);
-extern int  seteuid(uid_t);
-extern int  setgroups(int, int *);
-extern int  initgroups(char *, int);
-extern int  statfs(char *, struct statfs *);
-extern int  setegid(gid_t);
-extern int  getopt(int, char *const *, const char *);
-extern int  chroot(char *);
-extern int  gettimeofday(struct timeval *, struct timezone *);
-extern int  gethostname(char *, int);
-extern char *crypt(char *, char *);
-extern char *getpass(char *);
-#endif
-
-
-#ifdef CRAY
-#define MAXPATHLEN 1024
-#include <dirent.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/statfs.h>
-#define SIGNAL_CAST (void (*)(int))
-#define SIGCLD_IGNORE
-#define HAVE_FCNTL_LOCK 1
-#define USE_SETSID
-#define STATFS4
+#ifdef HAVE_SYSV_IPC
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#include <sys/sem.h>
 #endif
 
-
-#ifdef ALTOS
-#include <unistd.h>
-#include <string.h>
-#include <dirent.h>
-#include <sys/fcntl.h>
-#include <sys/statfs.h>
-#define        const
-#define        uid_t           int
-#define        gid_t           int
-#define        mode_t          int
-#define        ptrdiff_t       int
-#define HAVE_GETGRNAM  0
-#define NO_EID
-#define NO_FSYNC
-#define        NO_FTRUNCATE
-#define        NO_GETRLIMIT
-#define        NO_INITGROUPS
-#define NO_SELECT
-#define NO_SETGROUPS
-#define NO_STRERROR
-#define NO_STRFTIME
-#define        NO_TM_NAME
-#define NO_UTIMEH
-#define NOSTRCASECMP
-#define REPLACE_MKTIME
-#define REPLACE_RENAME
-#define REPLACE_STRSTR
-#define STATFS4
-#define        USE_GETCWD
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
 #endif
 
-#ifdef QNX
-#define STATFS4
-#include <sys/statfs.h>
-#include <sys/select.h>
-#include <signal.h>
-#include <sys/dir.h>
-#define SIGNAL_CAST (void (*)())
-#define USE_WAITPID
-#define NO_INITGROUPS
-#define NO_SETGROUPS
-#define HAVE_TIMEZONE
-#define USE_GETCWD
-#define USE_SETSID
-#define HAVE_FCNTL_LOCK 1
-#define DEFAULT_PRINTING PRINT_QNX
-#endif
 
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
 
-#ifdef NEWS42
-#include <string.h>
-#include <dirent.h>
+#ifdef HAVE_SYS_VFS_H
 #include <sys/vfs.h>
-#include <sys/timeb.h>
-typedef int mode_t;
 #endif
 
-#ifdef OS2
-#include <dirent.h>
-#include <sys/statfs.h>
-#include <string.h>
-#include <limits.h>
-#define SIGNAL_CAST (void (*)())
-#define HAVE_FCNTL_LOCK 0
-#define USE_WAITPID
-#define NO_GET_BROADCAST
-#define NO_EID
-#define NO_SETGROUPS
-#define NO_INITGROUPS
-#define NO_CRYPT
-#define NO_STATFS
-#define NO_CHROOT
-#define NO_CHOWN
-#define strcasecmp stricmp
-#define strncasecmp strnicmp
-#endif
-
-
-#ifdef LYNX
-#define SIGNAL_CAST (void (*)())
-#define WAIT3_CAST1 (union wait *)
-#define STATFS4
-#include <fcntl.h>
-#include <resource.h>
-#include <stat.h>
-#include <string.h>
-#include <dirent.h>
-#include <sys/statfs.h>
-#define USE_GETCWD
-#define USE_GETSID
+#ifdef HAVE_SYS_FS_S5PARAM_H 
+#include <sys/fs/s5param.h>
 #endif
 
-
-#ifdef BOS
-#define SIGNAL_CAST (void (*)(int))
-#include <string.h>
-#include <sys/dir.h>
-#include <sys/select.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/statfs.h>
-#include <sys/bsdioctl.h>
+#if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY)
+#include <sys/filsys.h> 
 #endif
 
-#ifdef AMIGA
-#include <arpa/inet.h>
-#include <dirent.h>
-#include <string.h>
-#include <netinet/tcp.h>
-#include <sys/acct.h>
-#include <sys/fcntl.h>
-#include <sys/filio.h>
-#include <sys/sockio.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <sys/termios.h>
-#include <limits.h>
-#include <sys/timeb.h>
-
-#define SIGNAL_CAST (void (*)(int))
-#define USE_GETCWD
-#define HAVE_BZERO
-#define HAVE_MEMMOVE
-#define USE_SIGPROCMASK
-#define USE_WAITPID
-#define USE_DIRECT
-#define USE_F_FSIZE
-#define HAVE_FCNTL_LOCK 0
-#define HAVE_GETTIMEOFDAY
-#define HAVE_PATHCONF
-
-#define HAVE_NO_PROC
-#define NO_FORK_DEBUG
-#define HAVE_FORK 0
-#define HAVE_VFORK 1
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
 #endif
 
-
-/*******************************************************************
-end of the platform specific sections
-********************************************************************/
-
-#if defined(USE_MMAP) || defined(FAST_SHARE_MODES)
-#include <sys/mman.h>
+#ifdef HAVE_DUSTAT_H              
+#include <sys/dustat.h>
 #endif
 
-#ifdef SecureWare
-#define NEED_AUTH_PARAMETERS
+#ifdef HAVE_SYS_STATVFS_H          
+#include <sys/statvfs.h>
 #endif
 
-#ifdef REPLACE_GETPASS
-extern char    *getsmbpass(char *);
-#define getpass(s) getsmbpass(s)
+#ifdef HAVE_SHADOW_H
+#include <shadow.h>
 #endif
 
-#ifdef REPLACE_INNETGR
-#define innetgr(group,host,user,dom) InNetGr(group,host,user,dom)
-#endif
+#ifdef HAVE_SYS_SECURITY_H
+#include <sys/security.h>
+#include <prot.h>
+#define PASSWORD_LENGTH 16
+#endif  /* HAVE_SYS_SECURITY_H */
 
-#ifndef FD_SETSIZE
-#define FD_SETSIZE 255
+#ifdef HAVE_COMPAT_H
+#include <compat.h>
 #endif
 
-#ifndef __STDC__
-#define const
+#ifdef HAVE_RPC_TYPES_H
+#include <rpc/types.h>
 #endif
 
-/* Now for some other grungy stuff */
-#ifdef NO_GETSPNAM
-struct spwd { /* fake shadow password structure */
-       char *sp_pwdp;
-};
+#ifdef HAVE_RPC_XDR_H
+#include <rpc/xdr.h>
 #endif
 
-#ifndef HAVE_BZERO
-#ifndef bzero
-#define bzero(p,s) memset(p,0,s)
-#endif
+#ifdef HAVE_RPC_AUTH_H
+#include <rpc/auth.h>
 #endif
 
-#ifndef HAVE_MEMMOVE
-#ifndef memmove
-#define memmove(d,s,n) MemMove(d,s,n)
-#endif
+#ifdef HAVE_RPC_CLNT_H
+#include <rpc/clnt.h>
 #endif
 
-#ifdef USE_DIRECT
-#include <sys/dir.h>
+#ifdef HAVE_RPCSVC_YP_PROT_H
+#include <rpcsvc/yp_prot.h>
 #endif
 
-/* some unixes have ENOTTY instead of TIOCNOTTY */
-#ifndef TIOCNOTTY
-#ifdef ENOTTY
-#define TIOCNOTTY ENOTTY
-#endif
+#ifdef HAVE_RPCSVC_YPCLNT_H
+#include <rpcsvc/ypclnt.h>
 #endif
 
-#ifndef SIGHUP
-#define SIGHUP 1
+#ifndef uchar
+#define uchar unsigned char
 #endif
 
-/* if undefined then use bsd or sysv printing */
-#ifndef DEFAULT_PRINTING
-#ifdef SYSV
-#define DEFAULT_PRINTING PRINT_SYSV
+#ifdef HAVE_UNSIGNED_CHAR
+#define schar signed char
 #else
-#define DEFAULT_PRINTING PRINT_BSD
-#endif
+#define schar char
 #endif
 
+#ifndef int32
+#if (SIZEOF_INT == 4)
+#define int32 int
+#elif (SIZEOF_LONG == 4)
+#define int32 long
+#elif (SIZEOF_SHORT == 4)
+#define int32 short
+#endif
+#endif
 
-#ifdef AFS_AUTH
-#include <afs/stds.h>
-#include <afs/kautils.h>
+#ifndef uint32
+#define uint32 unsigned int32
 #endif
 
-#ifdef DFS_AUTH
-#include <dce/dce_error.h>
-#include <dce/sec_login.h>
+#ifndef MIN
+#define MIN(a,b) ((a)<(b)?(a):(b))
 #endif
 
-#ifdef NO_UTIMBUF
-struct utimbuf {
-  time_t actime;
-  time_t modtime;
-};
+#ifndef MAX
+#define MAX(a,b) ((a)>(b)?(a):(b))
 #endif
 
-#ifdef NO_STRERROR
-#ifndef strerror
+#ifndef HAVE_STRERROR
 extern char *sys_errlist[];
 #define strerror(i) sys_errlist[i]
 #endif
+
+#ifndef HAVE_STRCHR
+# define strchr                 index
+# define strrchr                rindex
 #endif
 
-#ifndef perror
-#define perror(m) printf("%s: %s\n",m,strerror(errno))
+#ifndef HAVE_ERRNO_DECL
+extern int errno;
 #endif
 
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 255
+#ifdef HAVE_BROKEN_GETGROUPS
+#define GID_T int
+#else
+#define GID_T gid_t
 #endif
 
+
+/* Lists, trees, caching, datbase... */
+#include "ubi_sLinkList.h"
+#include "ubi_dLinkList.h"
+#include "dlinklist.h"
+
+#ifndef UBI_BINTREE_H
+#include "ubi_Cache.h"
+#endif /* UBI_BINTREE_H */
+
 #include "version.h"
 #include "smb.h"
 #include "nameserv.h"
-#include "proto.h"
+
 #include "byteorder.h"
 
 #include "kanji.h"
 #include "charset.h"
 
-#ifndef S_IFREG
-#define S_IFREG 0100000
-#endif
+#include "nterr.h"
 
-#ifndef S_ISREG
-#define S_ISREG(x) ((S_IFREG & x)!=0)
+#ifndef MAXCODEPAGELINES
+#define MAXCODEPAGELINES 256
 #endif
 
-#ifndef S_ISDIR
-#define S_ISDIR(x) ((S_IFDIR & x)!=0)
-#endif
+/***** automatically generated prototypes *****/
+#include "proto.h"
 
-#ifdef UFC_CRYPT
-#define crypt ufc_crypt
-#endif
+#ifdef strcpy
+#undef strcpy
+#endif /* strcpy */
+#define strcpy(dest,src) __ERROR__XX__NEVER_USE_STRCPY___;
 
-#ifdef REPLACE_STRLEN
-#define strlen(s) Strlen(s)
-#endif
+#ifdef strcat
+#undef strcat
+#endif /* strcat */
+#define strcat(dest,src) __ERROR__XX__NEVER_USE_STRCAT___;
 
-#ifdef REPLACE_STRSTR
-#define strstr(s,p) Strstr(s,p)
-#endif
+#ifdef sprintf
+#undef sprintf
+#endif /* sprintf */
+#define sprintf __ERROR__XX__NEVER_USE_SPRINTF__;
 
-#ifdef REPLACE_MKTIME
-#define mktime(t) Mktime(t)
-#endif
+#define pstrcpy(d,s) safe_strcpy((d),(s),sizeof(pstring)-1)
+#define pstrcat(d,s) safe_strcat((d),(s),sizeof(pstring)-1)
+#define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1)
+#define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1)
 
-#ifndef NGROUPS_MAX
-#define NGROUPS_MAX 128
+#ifdef __COMPAR_FN_T
+#define QSORT_CAST (__compar_fn_t)
 #endif
 
-#ifndef EDQUOT
-#define EDQUOT ENOSPC
+#ifndef QSORT_CAST
+#define QSORT_CAST (int (*)(const void *, const void *))
 #endif
 
-#ifndef HAVE_GETGRNAM
-#define HAVE_GETGRNAM 1
+/* this guess needs to be improved (tridge) */
+#if defined(STAT_STATVFS) && !defined(SYSV)
+#define SYSV 1
 #endif
 
-#ifndef SOL_TCP
-#define SOL_TCP 6
+#ifndef DEFAULT_PRINTING
+#ifdef SYSV
+#define DEFAULT_PRINTING PRINT_SYSV
+#else
+#define DEFAULT_PRINTING PRINT_BSD
 #endif
-
-/* default to using ftruncate workaround as this is safer than assuming
-it works and getting lots of bug reports */
-#ifndef FTRUNCATE_CAN_EXTEND
-#define FTRUNCATE_CAN_EXTEND 0
 #endif
 
-/* maybe this unix doesn't separate RD and WR locks? */
-#ifndef F_RDLCK
-#define F_RDLCK F_WRLCK
+#ifndef SIGCLD
+#define SIGCLD SIGCHLD
 #endif
 
-#ifndef ENOTSOCK
-#define ENOTSOCK EINVAL
+#if (defined(HAVE_SYSV_IPC) || defined(HAVE_SHARED_MMAP))
+#define FAST_SHARE_MODES 1
 #endif
 
-#ifndef SIGCLD
-#define SIGCLD SIGCHLD
-#endif 
-
 #ifndef MAP_FILE
 #define MAP_FILE 0
 #endif
 
-#ifndef HAVE_FCNTL_LOCK
-#define HAVE_FCNTL_LOCK 1
+#ifdef HAVE_SYSV_IPC
+#ifndef HAVE_UNION_SEMUN
+union semun {
+       int val;
+       struct semid_ds *buf;
+       unsigned short *array;
+};
 #endif
-
-#ifndef WAIT3_CAST2
-#define WAIT3_CAST2 (struct rusage *)
 #endif
 
-#ifndef WAIT3_CAST1
-#define WAIT3_CAST1 (int *)
+#if (!defined(WITH_NISPLUS) && !defined(WITH_LDAP))
+#define USE_SMBPASS_DB 1
 #endif
 
-#ifndef QSORT_CAST
-#define QSORT_CAST (int (*)())
+#if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS)
+#define OSF1_ENH_SEC 1
 #endif
 
-/* this is a rough check to see if this machine has a lstat() call.
-   it is not guaranteed to work */
-#if !(defined(S_ISLNK) || defined(S_IFLNK))
-#define lstat stat
+#if defined(HAVE_PAM_AUTHENTICATE) && defined(HAVE_SECURITY_PAM_APPL_H)
+#define HAVE_PAM 1
 #endif
 
-/* Not all systems declare ERRNO in errno.h... and some systems #define it! */
-#ifndef errno
-extern int errno;
-#endif 
-
-
-#ifdef NO_EID
-#define geteuid() getuid()
-#define getegid() getgid()
-#define seteuid(x) setuid(x)
-#define setegid(x) setgid(x)
+#if defined(HAVE_YP_GET_DEFAULT_DOMAIN)
+#define HAVE_NETGROUP 1
 #endif
 
+#ifndef ALLOW_CHANGE_PASSWORD
+#if (defined(HAVE_TERMIOS_H) && defined(HAVE_DUP2) && defined(HAVE_SETSID))
+#define ALLOW_CHANGE_PASSWORD 1
+#endif
+#endif
 
-#if (HAVE_FCNTL_LOCK == 0)
-/* since there is no locking available, system includes  */
-/* for DomainOS 10.4 do not contain any of the following */
-/* #define's. So, to satisfy the compiler, add these     */
-/* #define's, although they arn't really necessary.      */
-#define F_GETLK 0
-#define F_SETLK 0
-#define F_WRLCK 0
-#define F_UNLCK 0
-#endif /* HAVE_FCNTL_LOCK == 0 */
+/* what is the longest significant password available on your system? 
+ Knowing this speeds up password searches a lot */
+#ifndef PASSWORD_LENGTH
+#define PASSWORD_LENGTH 8
+#endif
 
-#ifdef NOSTRCASECMP
-#define strcasecmp(s1,s2) StrCaseCmp(s1,s2)
-#define strncasecmp(s1,s2,n) StrnCaseCmp(s1,s2,n)
+#ifdef REPLACE_INET_NTOA
+#define inet_ntoa rep_inet_ntoa
 #endif
 
-#ifndef strcpy
-#define strcpy(dest,src) StrCpy(dest,src)
+#ifndef HAVE_PIPE
+#define SYNC_DNS 1
 #endif
 
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 256
+#endif
 
-/* possibly wrap the malloc calls */
-#if WRAP_MALLOC
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#endif
 
-/* undo the old malloc def if necessary */
-#ifdef malloc
-#define xx_old_malloc malloc
-#undef malloc
+#ifndef INADDR_LOOPBACK
+#define INADDR_LOOPBACK 0x7f000001
 #endif
 
-#define malloc(size) malloc_wrapped(size,__FILE__,__LINE__)
+#ifndef INADDR_NONE
+#define INADDR_NONE 0xffffffff
+#endif
 
-/* undo the old realloc def if necessary */
-#ifdef realloc
-#define xx_old_realloc realloc
-#undef realloc
+#ifndef HAVE_CRYPT
+#define crypt ufc_crypt
 #endif
 
-#define realloc(ptr,size) realloc_wrapped(ptr,size,__FILE__,__LINE__)
+#if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID)
+#define ULTRIX_AUTH 1
+#endif
 
-/* undo the old free def if necessary */
-#ifdef free
-#define xx_old_free free
-#undef free
+#ifndef HAVE_STRDUP
+char *strdup(const char *s);
 #endif
 
-#define free(ptr) free_wrapped(ptr,__FILE__,__LINE__)
+#ifndef HAVE_MEMMOVE
+void *memmove(void *dest,const void *src,int size);
+#endif
 
-/* and the malloc prototypes */
-void *malloc_wrapped(int,char *,int);
-void *realloc_wrapped(void *,int,char *,int);
-void free_wrapped(void *,char *,int);
+#ifndef HAVE_INITGROUPS
+int initgroups(char *name,gid_t id);
+#endif
 
+#ifndef HAVE_RENAME
+int rename(const char *zfrom, const char *zto);
 #endif
 
+#ifndef HAVE_MKTIME
+time_t mktime(struct tm *t);
+#endif
 
-#if WRAP_MEMCPY
-/* undo the old memcpy def if necessary */
-#ifdef memcpy
-#define xx_old_memcpy memcpy
-#undef memcpy
+#ifndef HAVE_FTRUNCATE
+int ftruncate(int f,long l);
 #endif
 
-#define memcpy(d,s,l) memcpy_wrapped(d,s,l,__FILE__,__LINE__)
-void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line);
+#if (defined(HAVE_SETRESUID) && !defined(HAVE_SETRESUID_DECL))
+/* stupid glibc */
+int setresuid(uid_t ruid, uid_t euid, uid_t suid);
+int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
 #endif
 
+#if !defined(HAVE_BZERO) && defined(HAVE_MEMSET)
+#define bzero(a,b) memset((a),'\0',(b))
 #endif
+
+#endif /* _INCLUDES_H */