Merge pull request #11 from esorton/bugfix/add-constexpr-keyword-to-arduino-ctags
[arduino-ctags.git] / debug.h
blob41a6881c7ec7e82298d92ea45499074cbe1c08ef
1 /*
2 * $Id: debug.h 558 2007-06-15 19:17:02Z elliotth $
4 * Copyright (c) 1998-2002, Darren Hiebert
6 * This source code is released for free distribution under the terms of the
7 * GNU General Public License.
9 * External interface to debug.c
11 #ifndef _DEBUG_H
12 #define _DEBUG_H
15 * Include files
17 #include "general.h" /* must always come first */
19 #ifdef DEBUG
20 # include <assert.h>
21 #endif
22 #include "entry.h"
25 * Macros
28 #ifdef DEBUG
29 # define debug(level) ((Option.debugLevel & (long)(level)) != 0)
30 # define DebugStatement(x) x
31 # define PrintStatus(x) if (debug(DEBUG_STATUS)) printf x;
32 # define Assert(c) assert(c)
33 #else
34 # define DebugStatement(x)
35 # define PrintStatus(x)
36 # define Assert(c)
37 # ifndef NDEBUG
38 # define NDEBUG
39 # endif
40 #endif
43 * Data declarations
46 /* Defines the debugging levels.
48 enum eDebugLevels {
49 DEBUG_READ = 0x01, /* echo raw (filtered) characters */
50 DEBUG_PARSE = 0x02, /* echo parsing results */
51 DEBUG_STATUS = 0x04, /* echo file status information */
52 DEBUG_OPTION = 0x08, /* echo option parsing */
53 DEBUG_CPP = 0x10, /* echo characters out of pre-processor */
54 DEBUG_RAW = 0x20 /* echo raw (filtered) characters */
58 * Function prototypes
60 extern void lineBreak (void);
61 extern void debugPrintf (const enum eDebugLevels level, const char *const format, ...) __printf__ (2, 3);
62 extern void debugPutc (const int level, const int c);
63 extern void debugParseNest (const boolean increase, const unsigned int level);
64 extern void debugCppNest (const boolean begin, const unsigned int level);
65 extern void debugCppIgnore (const boolean ignore);
66 extern void debugEntry (const tagEntryInfo *const tag);
68 #endif /* _DEBUG_H */
70 /* vi:set tabstop=4 shiftwidth=4: */