Fix macro name controlling inclusion of DMALLOC.
[ira/wip.git] / source3 / include / includes.h
index 8b138030ef9c9987d0e5f982d35b660b7fd17c6e..6021ebb83b090654fb43df19d87cfbe7b8a755bb 100644 (file)
 #endif
 #endif
 
-/* use gcc attribute to check printf fns */
 #ifdef __GNUC__
+/** Use gcc attribute to check printf fns.  a1 is the 1-based index of
+ * the parameter containing the format, and a2 the index of the first
+ * argument.  **/
 #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
 #else
 #define PRINTF_ATTRIBUTE(a1, a2)
 #endif
 
 #ifdef HAVE_SYS_CAPABILITY_H
+
+#if defined(BROKEN_REDHAT_7_SYSTEM_HEADERS) && !defined(_I386_STATFS_H)
+#define _I386_STATFS_H
+#define BROKEN_REDHAT_7_STATFS_WORKAROUND
+#endif
+
 #include <sys/capability.h>
+
+#ifdef BROKEN_REDHAT_7_STATFS_WORKAROUND
+#undef _I386_STATFS_H
+#undef BROKEN_REDHAT_7_STATFS_WORKAROUND
+#endif
+
 #endif
 
 #if defined(HAVE_RPC_RPC_H)
 #include <iconv.h>
 #endif
 
+#if HAVE_KRB5_H
+#include <krb5.h>
+#else
+#undef HAVE_KRB5
+#endif
+
+#if HAVE_LBER_H
+#include <lber.h>
+#endif
+
+#if HAVE_LDAP_H
+#include <ldap.h>
+#else
+#undef HAVE_LDAP
+#endif
+
+#if HAVE_GSSAPI_GSSAPI_H
+#include <gssapi/gssapi.h>
+#else
+#undef HAVE_KRB5
+#endif
+
+#if HAVE_GSSAPI_GSSAPI_GENERIC_H
+#include <gssapi/gssapi_generic.h>
+#else
+#undef HAVE_KRB5
+#endif
+
+/* we support ADS if we have krb5 and ldap libs */
+#if defined(HAVE_KRB5) && defined(HAVE_LDAP) && defined(HAVE_GSSAPI)
+#define HAVE_ADS
+#endif
+
 /*
  * Define VOLATILE if needed.
  */
@@ -440,7 +487,7 @@ typedef int socklen_t;
 #define int32 short
 #else
 /* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */
-#define uint32 int
+#define int32 int
 #endif
 #endif
 
@@ -626,12 +673,15 @@ extern int errno;
 #endif
 
 /* Lists, trees, caching, database... */
+#include "xfile.h"
+#include "intl.h"
 #include "ubi_sLinkList.h"
 #include "ubi_dLinkList.h"
 #include "dlinklist.h"
 #include "../tdb/tdb.h"
 #include "../tdb/spinlock.h"
 #include "talloc.h"
+#include "ads.h"
 #include "interfaces.h"
 #include "hash.h"
 #include "trans2.h"
@@ -639,6 +689,8 @@ extern int errno;
 #include "secrets.h"
 #include "messages.h"
 #include "util_list.h"
+#include "charset.h"
+#include "dynconfig.h"
 
 #include "util_getent.h"
 
@@ -659,10 +711,12 @@ extern int errno;
 
 #include "msdfs.h"
 
-#include "profile.h"
+#include "smbprofile.h"
 
 #include "mapping.h"
 
+#include "rap.h"
+
 #include "md5.h"
 #include "hmacmd5.h"
 
@@ -670,6 +724,10 @@ extern int errno;
 
 #include "session.h"
 
+#include "asn_1.h"
+
+#include "popt.h"
+
 #ifndef MAXCODEPAGELINES
 #define MAXCODEPAGELINES 256
 #endif
@@ -697,6 +755,13 @@ typedef struct smb_wpasswd {
        wpstring       pw_shell;
 } SMB_STRUCT_WPASSWD;
 
+/* used in net.c */
+struct functable {
+       char *funcname;
+       int (*fn)(int argc, const char **argv);
+};
+
+
 /* Defines for wisXXX functions. */
 #define UNI_UPPER    0x1
 #define UNI_LOWER    0x2
@@ -704,40 +769,7 @@ typedef struct smb_wpasswd {
 #define UNI_XDIGIT   0x8
 #define UNI_SPACE    0x10
 
-#ifdef HAVE_NSS_COMMON_H
-
-/* Sun Solaris */
-
-#include <nss_common.h>
-#include <nss_dbdefs.h>
-#include <nsswitch.h>
-
-typedef nss_status_t NSS_STATUS;
-
-#define NSS_STATUS_SUCCESS     NSS_SUCCESS
-#define NSS_STATUS_NOTFOUND    NSS_NOTFOUND
-#define NSS_STATUS_UNAVAIL     NSS_UNAVAIL
-#define NSS_STATUS_TRYAGAIN    NSS_TRYAGAIN
-
-#elif HAVE_NSS_H
-
-/* GNU */
-
-#include <nss.h>
-
-typedef enum nss_status NSS_STATUS;
-
-#else /* Nothing's defined. Neither gnu nor sun */
-
-typedef enum
-{
-  NSS_STATUS_SUCCESS,
-  NSS_STATUS_NOTFOUND,
-  NSS_STATUS_UNAVAIL,
-  NSS_STATUS_TRYAGAIN
-} NSS_STATUS;
-
-#endif
+#include "nsswitch/nss.h"
 
 /***** automatically generated prototypes *****/
 #include "proto.h"
@@ -760,7 +792,7 @@ typedef enum
 #endif
 
 #ifndef DEFAULT_PRINTING
-#ifdef HAVE_LIBCUPS
+#ifdef HAVE_CUPS
 #define DEFAULT_PRINTING PRINT_CUPS
 #define PRINTCAP_NAME "cups"
 #elif defined(SYSV)
@@ -784,7 +816,7 @@ typedef enum
 #define MAP_FILE 0
 #endif
 
-#if (!defined(WITH_NISPLUS) && !defined(WITH_LDAP) && !defined(WITH_TDBPWD))
+#if (!defined(WITH_NISPLUS) && !defined(WITH_LDAP) && !defined(WITH_TDB_SAM))
 #define USE_SMBPASS_DB 1
 #endif
 
@@ -878,6 +910,14 @@ int rename(const char *zfrom, const char *zto);
 time_t mktime(struct tm *t);
 #endif
 
+#ifndef HAVE_STRLCPY
+size_t strlcpy(char *d, const char *s, size_t bufsize);
+#endif
+
+#ifndef HAVE_STRLCAT
+size_t strlcat(char *d, const char *s, size_t bufsize);
+#endif
+
 #ifndef HAVE_FTRUNCATE
 int ftruncate(int f,long l);
 #endif
@@ -939,6 +979,13 @@ int vasprintf(char **ptr, const char *format, va_list ap);
 #include <dlfcn.h>
 #endif
 
+/* dmalloc -- free heap debugger (dmalloc.org).  This should be near
+ * the *bottom* of include files so as not to conflict. */
+#ifdef ENABLE_DMALLOC
+#  include <dmalloc.h>
+#endif
+
+
 /* Some POSIX definitions for those without */
  
 #ifndef S_IFDIR
@@ -1040,7 +1087,9 @@ extern int DEBUGLEVEL;
 #endif
 
 /* add varargs prototypes with printf checking */
-int fdprintf(int , char *, ...) PRINTF_ATTRIBUTE(2,3);
+int fdprintf(int , const char *, ...) PRINTF_ATTRIBUTE(2,3);
+int d_printf(const char *, ...) PRINTF_ATTRIBUTE(1,2);
+int d_fprintf(FILE *f, const char *, ...) PRINTF_ATTRIBUTE(2,3);
 #ifndef HAVE_SNPRINTF_DECL
 int snprintf(char *,size_t ,const char *, ...) PRINTF_ATTRIBUTE(3,4);
 #endif