RIP BOOL. Convert BOOL -> bool. I found a few interesting
[mat/samba.git] / source3 / include / debug.h
index d4f45539f45d2fa50bd94d4cd100a671798c9d88..51850925e8c203286dc7b68a08e0138f03e5c013 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,
@@ -17,8 +17,7 @@
    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/>.
 */
 
 #ifndef _DEBUG_H
  * diffferent prototype declarations), so we must do these by hand.
  */
 /* I know the __attribute__ stuff is ugly, but it does ensure we get the 
-   arguemnts to DEBUG() right. We have got them wrong too often in the 
+   arguments to DEBUG() right. We have got them wrong too often in the 
    past.
+   The PRINTFLIKE comment does the equivalent for SGI MIPSPro.
  */
+/* PRINTFLIKE1 */
 int  Debug1( const char *, ... ) PRINTF_ATTRIBUTE(1,2);
-BOOL dbgtext( const char *, ... ) PRINTF_ATTRIBUTE(1,2);
-BOOL dbghdr( int level, const char *file, const char *func, int line );
+/* PRINTFLIKE1 */
+bool dbgtext( const char *, ... ) PRINTF_ATTRIBUTE(1,2);
+bool dbghdr( int level, int cls, const char *file, const char *func, int line );
+
+#if defined(sgi) && (_COMPILER_VERSION >= 730)
+#pragma mips_frequency_hint NEVER Debug1
+#pragma mips_frequency_hint NEVER dbgtext
+#pragma mips_frequency_hint NEVER dbghdr
+#endif
 
 extern XFILE *dbf;
 extern pstring debugf;
@@ -88,6 +96,13 @@ extern int DEBUGLEVEL;
 #define DBGC_AUTH              10
 #define DBGC_WINBIND           11
 #define DBGC_VFS               12
+#define DBGC_IDMAP             13
+#define DBGC_QUOTA             14
+#define DBGC_ACLS              15
+#define DBGC_LOCKING           16
+#define DBGC_MSDFS             17
+#define DBGC_DMAPI             18
+#define DBGC_REGISTRY          19
 
 /* So you can define DBGC_CLASS before including debug.h */
 #ifndef DBGC_CLASS
@@ -95,7 +110,7 @@ extern int DEBUGLEVEL;
 #endif
 
 extern int  *DEBUGLEVEL_CLASS;
-extern BOOL *DEBUGLEVEL_CLASS_ISSET;
+extern bool *DEBUGLEVEL_CLASS_ISSET;
 
 /* Debugging macros
  *
@@ -152,7 +167,7 @@ extern BOOL *DEBUGLEVEL_CLASS_ISSET;
      ((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))||  \
      (!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \
       DEBUGLEVEL_CLASS[ DBGC_ALL   ] >= (level))  ) \
-   && dbghdr( level, __FILE__, FUNCTION_MACRO, (__LINE__) ) )
+   && dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) ) )
 
 
 #define DEBUGLVLC( dbgc_class, level ) \
@@ -160,7 +175,7 @@ extern BOOL *DEBUGLEVEL_CLASS_ISSET;
      ((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))||  \
      (!DEBUGLEVEL_CLASS_ISSET[ dbgc_class ] && \
       DEBUGLEVEL_CLASS[ DBGC_ALL   ] >= (level))  ) \
-   && dbghdr( level, __FILE__, FUNCTION_MACRO, (__LINE__) ) )
+   && dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) ) )
 
 
 #define DEBUG( level, body ) \
@@ -168,7 +183,7 @@ extern BOOL *DEBUGLEVEL_CLASS_ISSET;
            ((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))||  \
            (!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \
             DEBUGLEVEL_CLASS[ DBGC_ALL   ] >= (level))  ) \
-       && (dbghdr( level, __FILE__, FUNCTION_MACRO, (__LINE__) )) \
+       && (dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) )) \
        && (dbgtext body) )
 
 #define DEBUGC( dbgc_class, level, body ) \
@@ -176,7 +191,7 @@ extern BOOL *DEBUGLEVEL_CLASS_ISSET;
            ((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))||  \
            (!DEBUGLEVEL_CLASS_ISSET[ dbgc_class ] && \
            DEBUGLEVEL_CLASS[ DBGC_ALL   ] >= (level))  ) \
-       && (dbghdr( level, __FILE__, FUNCTION_MACRO, (__LINE__) )) \
+       && (dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) )) \
        && (dbgtext body) )
 
 #define DEBUGADD( level, body ) \
@@ -193,4 +208,8 @@ extern BOOL *DEBUGLEVEL_CLASS_ISSET;
             DEBUGLEVEL_CLASS[ DBGC_ALL   ] >= (level))  ) \
        && (dbgtext body) )
 
+/* Print a separator to the debug log. */
+#define DEBUGSEP(level)\
+       DEBUG((level),("===============================================================\n"))
+
 #endif