r24712: No longer expose the 'BOOL' data type in any interfaces.
[abartlet/samba.git/.git] / source4 / include / includes.h
index 43e07ad4823c9e43cdb10568a29ef644ca459dd2..ac6204921c1ab01662dca6305729f3e894e3aed3 100644 (file)
@@ -8,7 +8,7 @@
    
    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
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include "lib/replace/replace.h"
+
+/* make sure we have included the correct config.h */
 #ifndef NO_CONFIG_H /* for some tests */
-#include "config.h"
+#ifndef CONFIG_H_IS_FROM_SAMBA
+#error "make sure you have removed all config.h files from standalone builds!"
+#error "the included config.h isn't from samba!"
 #endif
+#endif /* NO_CONFIG_H */
 
 #include "local.h"
 
@@ -45,7 +50,7 @@
 #endif
 
 #ifndef PRINTF_ATTRIBUTE
-#if !defined(NO_PRINTF_ATTRIBUTE) && (__GNUC__ >= 3)
+#if __GNUC__ >= 3
 /** 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. Note that some gcc 2.x versions don't handle this
 #endif
 #endif
 
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <sys/time.h>
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
+#ifndef _DEPRECATED_
+#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#define _DEPRECATED_ __attribute__ ((deprecated))
+#else
+#define _DEPRECATED_
+#endif
 #endif
 
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
+#ifndef _WARN_UNUSED_RESULT_
+#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#define _WARN_UNUSED_RESULT_ __attribute__ ((warn_unused_result))
+#else
+#define _WARN_UNUSED_RESULT_
+#endif
 #endif
 
-#ifdef HAVE_STRING_H
-#include <string.h>
+#ifndef _NORETURN_
+#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#define _NORETURN_ __attribute__ ((noreturn))
+#else
+#define _NORETURN_
+#endif
 #endif
 
-#include <signal.h>
-#include <errno.h>
+#ifndef _PURE_
+#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1)
+#define _PURE_ __attribute__((pure))
+#else
+#define _PURE_
+#endif
+#endif
 
-#ifdef HAVE_STDARG_H
-#include <stdarg.h>
+#ifndef NONNULL
+#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1)
+#define NONNULL(param) param __attribute__((nonnull))
 #else
-#include <varargs.h>
-#endif
-
-/* protocol types. It assumes that higher protocols include lower protocols
-   as subsets. FIXME: Move to one of the smb-specific headers */
-enum protocol_types {
-       PROTOCOL_NONE,
-       PROTOCOL_CORE,
-       PROTOCOL_COREPLUS,
-       PROTOCOL_LANMAN1,
-       PROTOCOL_LANMAN2,
-       PROTOCOL_NT1,
-       PROTOCOL_SMB2
-};
-
-/* passed to br lock code. FIXME: Move to one of the smb-specific headers */
-enum brl_type {
-       READ_LOCK,
-       WRITE_LOCK,
-       PENDING_READ_LOCK,
-       PENDING_WRITE_LOCK
-};
+#define NONNULL(param) param
+#endif
+#endif
+
+#include "system/time.h"
+#include "system/wait.h"
 
+#ifndef _PRINTF_ATTRIBUTE
 #define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2)
-#include "lib/replace/replace.h"
+#endif
 
 /* Lists, trees, caching, database... */
-#include "libcli/util/nt_status.h"
 #include "talloc/talloc.h"
 #include "core.h"
+#include <stdbool.h>
 #include "charset/charset.h"
 #include "util/util.h"
 #include "param/param.h"
-#include "libcli/util/nterr.h"
-#include "libcli/util/doserr.h"
-#include "librpc/ndr/libndr.h"
-#include "librpc/ndr/ndr_orpc.h"
-#include "librpc/rpc/dcerpc.h"
-#include "libcli/nbt/libnbt.h"
-#include "libcli/util/proto.h"
+#include "librpc/gen_ndr/misc.h"
+
+typedef bool BOOL;
+
+#define False false
+#define True true
+
+struct smbcli_tree;
+#include "libcli/util/error.h"
 
 /* String routines */
 #include "util/safe_string.h"