Herb's warning fixes. Also the POSIX locking fix.
[samba.git] / source3 / include / includes.h
index 5bc4797cb4ec9917d782dc44d46ff97ec06e44ea..da365ab953d674cab4c4dd4bf9170c820fc12eee 100644 (file)
 #endif
 
 #ifdef LINUX
+#ifndef DEFAULT_PRINTING
 #define DEFAULT_PRINTING PRINT_BSD
+#endif
+#ifndef PRINTCAP_NAME
 #define PRINTCAP_NAME "/etc/printcap"
 #endif
+#endif
 
 #ifdef RELIANTUNIX
 /*
 #endif
 #endif /* RELIANTUNIX */
 
-#ifdef HAVE_SYSV_IPC
-#define USE_SYSV_IPC
-#endif
-
-#ifdef HAVE_SHARED_MMAP
-#define USE_SHARED_MMAP
-#endif
-
-
-/* if we have both SYSV IPC and shared mmap then we need to choose */
-#if (defined(USE_SYSV_IPC) && defined(USE_SHARED_MMAP))
-#  undef USE_SHARED_MMAP
-#endif
-
 #include <sys/types.h>
 
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/mman.h>
 #endif
 
-#ifdef HAVE_SYSV_IPC
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/sem.h>
-
-/*
- * The following is needed if compiling
- * with gcc on SGI IRIX 6.5.x systems as
- * the structure packing for system calls is
- * different between IRIX cc and gcc.
- */
-
-#ifdef NEED_SGI_SEMUN_HACK
-union semun_hack {
-        int val;
-        struct semid_ds *buf;
-        unsigned short *array;
-       char __dummy[5];
-};
-#define semun semun_hack
-#endif /* NEED_SGI_SEMUN_HACK */
-#endif /* HAVE_SYSV_IPC */
-
 #ifdef HAVE_NET_IF_H
 #include <net/if.h>
 #endif
@@ -634,7 +601,7 @@ extern int errno;
 #define NGROUPS_MAX 32 /* Guess... */
 #endif
 
-/* Lists, trees, caching, datbase... */
+/* Lists, trees, caching, database... */
 #include "ubi_sLinkList.h"
 #include "ubi_dLinkList.h"
 #include "dlinklist.h"
@@ -642,12 +609,11 @@ extern int errno;
 #include "talloc.h"
 #include "interfaces.h"
 #include "hash.h"
-
-#ifdef HAVE_FNMATCH
-#include <fnmatch.h>
-#else
-#include "fnmatch.h"
-#endif
+#include "trans2.h"
+#include "nterr.h"
+#include "secrets.h"
+#include "messages.h"
+#include "util_list.h"
 
 #ifndef UBI_BINTREE_H
 #include "ubi_Cache.h"
@@ -665,13 +631,11 @@ extern int errno;
 #include "kanji.h"
 #include "charset.h"
 
-#include "nterr.h"
+#include "ntdomain.h"
 
 #include "msdfs.h"
 
-#ifdef WITH_PROFILE
 #include "profile.h"
-#endif
 
 #ifndef MAXCODEPAGELINES
 #define MAXCODEPAGELINES 256
@@ -707,6 +671,20 @@ typedef struct smb_wpasswd {
 #define UNI_XDIGIT   0x8
 #define UNI_SPACE    0x10
 
+#ifdef HAVE_NSS_H
+#include <nss.h>
+#else
+
+/* Minimal needed to compile.. */
+
+enum nss_status {
+       NSS_STATUS_SUCCESS,
+       NSS_STATUS_NOTFOUND,
+       NSS_STATUS_UNAVAIL
+};
+
+#endif
+
 /***** automatically generated prototypes *****/
 #include "proto.h"
 
@@ -748,24 +726,10 @@ typedef struct smb_wpasswd {
 #define SIGCLD SIGCHLD
 #endif
 
-#if (defined(HAVE_SYSV_IPC) || defined(HAVE_SHARED_MMAP))
-#define FAST_SHARE_MODES 1
-#endif
-
 #ifndef MAP_FILE
 #define MAP_FILE 0
 #endif
 
-#ifdef HAVE_SYSV_IPC
-#ifndef HAVE_UNION_SEMUN
-union semun {
-       int val;
-       struct semid_ds *buf;
-       unsigned short *array;
-};
-#endif
-#endif
-
 #if (!defined(WITH_NISPLUS) && !defined(WITH_LDAP))
 #define USE_SMBPASS_DB 1
 #endif
@@ -918,4 +882,85 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
 #include <dlfcn.h>
 #endif
 
+/* Some POSIX definitions for those without */
+#ifndef S_IFDIR
+#define S_IFDIR         0x4000
+#endif
+#ifndef S_ISDIR
+#define S_ISDIR(mode)   ((mode & 0xF000) == S_IFDIR)
+#endif
+#ifndef S_IRWXU
+#define S_IRWXU 00700           /* read, write, execute: owner */
+#endif
+#ifndef S_IRUSR
+#define S_IRUSR 00400           /* read permission: owner */
+#endif
+#ifndef S_IWUSR
+#define S_IWUSR 00200           /* write permission: owner */
+#endif
+#ifndef S_IXUSR
+#define S_IXUSR 00100           /* execute permission: owner */
+#endif
+#ifndef S_IRWXG
+#define S_IRWXG 00070           /* read, write, execute: group */
+#endif
+#ifndef S_IRGRP
+#define S_IRGRP 00040           /* read permission: group */
+#endif
+#ifndef S_IWGRP
+#define S_IWGRP 00020           /* write permission: group */
+#endif
+#ifndef S_IXGRP
+#define S_IXGRP 00010           /* execute permission: group */
+#endif
+#ifndef S_IRWXO
+#define S_IRWXO 00007           /* read, write, execute: other */
+#endif
+#ifndef S_IROTH
+#define S_IROTH 00004           /* read permission: other */
+#endif
+#ifndef S_IWOTH
+#define S_IWOTH 00002           /* write permission: other */
+#endif
+#ifndef S_IXOTH
+#define S_IXOTH 00001           /* execute permission: other */
+#endif
+
+/* Some systems (SCO) treat UNIX domain sockets as FIFOs */
+
+#ifndef S_IFSOCK
+#define S_IFSOCK S_IFIFO
+#endif
+#ifndef S_ISSOCK
+#define S_ISSOCK(mode)  ((mode & S_IFSOCK) == S_IFSOCK)
+#endif
+
+#if HAVE_KERNEL_SHARE_MODES
+#ifndef LOCK_MAND 
+#define LOCK_MAND      32      /* This is a mandatory flock */
+#define LOCK_READ      64      /* ... Which allows concurrent read operations */
+#define LOCK_WRITE     128     /* ... Which allows concurrent write operations */
+#define LOCK_RW                192     /* ... Which allows concurrent read & write ops */
+#endif
+#endif
+
+extern int DEBUGLEVEL;
+
+#define MAX_SEC_CTX_DEPTH 8    /* Maximum number of security contexts */
+
+
+#ifdef GLIBC_HACK_FCNTL64
+/* this is a gross hack. 64 bit locking is completely screwed up on
+   i386 Linux in glibc 2.1.95 (which ships with RedHat 7.0). This hack
+   "fixes" the problem with the current 2.4.0test kernels 
+*/
+#define fcntl fcntl64
+#undef F_SETLKW 
+#undef F_SETLK 
+#define F_SETLK 13
+#define F_SETLKW 14
+#endif
+
 #endif /* _INCLUDES_H */
+