Move the fancy NT_STATUS macros to a new file, so we can include them earlier
authorAndrew Bartlett <abartlet@samba.org>
Thu, 5 Sep 2002 15:47:22 +0000 (15:47 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 5 Sep 2002 15:47:22 +0000 (15:47 +0000)
in includes.h

Andrew Bartlett
(This used to be commit ed184ed1905b49956528b6835f48a69ba3c1a045)

source3/include/includes.h
source3/include/nt_status.h [new file with mode: 0644]
source3/include/smb.h

index 544487f273d0421e4ef95c11f6f56e55a3481527..b07b0c36492663225b52d2900a4c0a3118f7dcf0 100644 (file)
@@ -702,6 +702,7 @@ extern int errno;
 #include "../tdb/spinlock.h"
 #include "../tdb/tdbutil.h"
 #include "talloc.h"
+#include "nt_status.h"
 #include "ads.h"
 #include "interfaces.h"
 #include "hash.h"
diff --git a/source3/include/nt_status.h b/source3/include/nt_status.h
new file mode 100644 (file)
index 0000000..1c80c5e
--- /dev/null
@@ -0,0 +1,62 @@
+/* 
+   Unix SMB/CIFS implementation.
+   SMB parameters and setup, plus a whole lot more.
+   
+   Copyright (C) Andrew Tridgell              2001
+   
+   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
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   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.
+*/
+
+#ifndef _NT_STATUS_H
+#define _NT_STATUS_H
+
+/* The Splint code analysis tool doesn't like immediate structures. */
+
+#ifdef _SPLINT_                      /* http://www.splint.org */
+#undef HAVE_IMMEDIATE_STRUCTURES
+#endif
+
+/* the following rather strange looking definitions of NTSTATUS and WERROR
+   and there in order to catch common coding errors where different error types
+   are mixed up. This is especially important as we slowly convert Samba
+   from using BOOL for internal functions 
+*/
+
+#if defined(HAVE_IMMEDIATE_STRUCTURES)
+typedef struct {uint32 v;} NTSTATUS;
+#define NT_STATUS(x) ((NTSTATUS) { x })
+#define NT_STATUS_V(x) ((x).v)
+#else
+typedef uint32 NTSTATUS;
+#define NT_STATUS(x) (x)
+#define NT_STATUS_V(x) (x)
+#endif
+
+#if defined(HAVE_IMMEDIATE_STRUCTURES)
+typedef struct {uint32 v;} WERROR;
+#define W_ERROR(x) ((WERROR) { x })
+#define W_ERROR_V(x) ((x).v)
+#else
+typedef uint32 WERROR;
+#define W_ERROR(x) (x)
+#define W_ERROR_V(x) (x)
+#endif
+
+#define NT_STATUS_IS_OK(x) (NT_STATUS_V(x) == 0)
+#define NT_STATUS_IS_ERR(x) ((NT_STATUS_V(x) & 0xc0000000) == 0xc0000000)
+#define NT_STATUS_EQUAL(x,y) (NT_STATUS_V(x) == NT_STATUS_V(y))
+#define W_ERROR_IS_OK(x) (W_ERROR_V(x) == 0)
+
+#endif
index 909c1a57ecda87c9eee63171439b126242d83a93..2ee2f0cb7245e294ec0b542ece131afc6f4e10d2 100644 (file)
@@ -193,44 +193,6 @@ typedef struct nttime_info
 } NTTIME;
 
 
-/* The Splint code analysis tool doesn't like immediate structures. */
-
-#ifdef _SPLINT_                      /* http://www.splint.org */
-#undef HAVE_IMMEDIATE_STRUCTURES
-#endif
-
-/* the following rather strange looking definitions of NTSTATUS and WERROR
-   and there in order to catch common coding errors where different error types
-   are mixed up. This is especially important as we slowly convert Samba
-   from using BOOL for internal functions 
-*/
-
-#if defined(HAVE_IMMEDIATE_STRUCTURES)
-typedef struct {uint32 v;} NTSTATUS;
-#define NT_STATUS(x) ((NTSTATUS) { x })
-#define NT_STATUS_V(x) ((x).v)
-#else
-typedef uint32 NTSTATUS;
-#define NT_STATUS(x) (x)
-#define NT_STATUS_V(x) (x)
-#endif
-
-#if defined(HAVE_IMMEDIATE_STRUCTURES)
-typedef struct {uint32 v;} WERROR;
-#define W_ERROR(x) ((WERROR) { x })
-#define W_ERROR_V(x) ((x).v)
-#else
-typedef uint32 WERROR;
-#define W_ERROR(x) (x)
-#define W_ERROR_V(x) (x)
-#endif
-
-#define NT_STATUS_IS_OK(x) (NT_STATUS_V(x) == 0)
-#define NT_STATUS_IS_ERR(x) ((NT_STATUS_V(x) & 0xc0000000) == 0xc0000000)
-#define NT_STATUS_EQUAL(x,y) (NT_STATUS_V(x) == NT_STATUS_V(y))
-#define W_ERROR_IS_OK(x) (W_ERROR_V(x) == 0)
-
-
 /* Allowable account control bits */
 #define ACB_DISABLED   0x0001  /* 1 = User account disabled */
 #define ACB_HOMDIRREQ  0x0002  /* 1 = Home directory required */