geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

debug.h
Go to the documentation of this file.
1/*
2* Copyright (c) 1998-2002, Darren Hiebert
3*
4* This source code is released for free distribution under the terms of the
5* GNU General Public License version 2 or (at your option) any later version.
6*
7* External interface to debug.c
8*/
9#ifndef CTAGS_MAIN_DEBUG_H
10#define CTAGS_MAIN_DEBUG_H
11
12/*
13* Include files
14*/
15#include "general.h" /* must always come first */
16
17#include "gvars.h"
18#include "types.h"
19#ifdef DEBUG
20# include <assert.h>
21#endif
22
23/*
24* Macros
25*/
26
27#ifdef DEBUG
28# define debug(level) ((ctags_debugLevel & (long)(level)) != 0)
29# define DebugStatement(x) x
30# define PrintStatus(x) if (debug(DEBUG_STATUS)) printf x;
31# ifdef NDEBUG
32# define Assert(c) do {} while(0)
33# define AssertNotReached() do {} while(0)
34# else
35 /* We expect cc supports c99 standard. */
36# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
37# define ASSERT_FUNCTION __func__
38# else
39# define ASSERT_FUNCTION ((const char*)0)
40# endif
41# define Assert(c) ((c) ? ((void)0) : debugAssert(#c, __FILE__, __LINE__, ASSERT_FUNCTION))
42# define AssertNotReached() Assert(!"The control reaches unexpected place")
43# endif
44#else
45# define DebugStatement(x)
46# define PrintStatus(x)
47# define Assert(c) do {} while(0)
48# define AssertNotReached() do {} while(0)
49# ifndef NDEBUG
50# define NDEBUG
51# endif
52#endif
53
54#ifdef DEBUG
55/* This makes valgrind report an error earlier. */
56#define DISABLE_OBJPOOL
57#endif
58/*
59* Data declarations
60*/
61
62/* Defines the debugging levels.
63 */
65 DEBUG_READ = 0x01, /* echo raw (filtered) characters */
66 DEBUG_PARSE = 0x02, /* echo parsing results */
67 DEBUG_STATUS = 0x04, /* echo file status information */
68 DEBUG_OPTION = 0x08, /* echo option parsing */
69 DEBUG_CPP = 0x10, /* echo characters out of pre-processor */
70 DEBUG_RAW = 0x20 /* echo raw (filtered) characters */
71};
72
73/*
74* Function prototypes
75*/
76extern void lineBreak (void);
77extern void debugPrintf (const enum eDebugLevels level, const char *const format, ...) CTAGS_ATTR_PRINTF (2, 3);
78extern void debugPutc (const int level, const int c);
79extern void debugParseNest (const bool increase, const unsigned int level);
80extern void debugCppNest (const bool begin, const unsigned int level);
81extern void debugCppIgnore (const bool ignore);
82extern void debugEntry (const tagEntryInfo *const tag);
83extern void debugAssert (const char *assertion, const char *file, unsigned int line, const char *function) attr__noreturn;
84
85#ifdef DEBUG
86#define DEBUG_INIT() debugInit()
87extern void debugInit (void);
88extern void debugIndent(void);
89extern void debugInc(void);
90extern void debugDec(void);
91
92struct circularRefChecker;
93extern struct circularRefChecker * circularRefCheckerNew (void);
94extern void circularRefCheckerDestroy (struct circularRefChecker * checker);
95extern int circularRefCheckerCheck (struct circularRefChecker *c, void *ptr);
96extern int circularRefCheckerGetCurrent (struct circularRefChecker *c);
97extern void circularRefCheckClear (struct circularRefChecker *c);
98
99#else
100#define DEBUG_INIT() do { } while(0)
101#endif /* DEBUG */
102#endif /* CTAGS_MAIN_DEBUG_H */
GeanyBuildCommand ** ptr
Definition: build.c:2679
void lineBreak(void)
void debugCppIgnore(const bool ignore)
void debugCppNest(const bool begin, const unsigned int level)
eDebugLevels
Definition: debug.h:64
@ DEBUG_CPP
Definition: debug.h:69
@ DEBUG_PARSE
Definition: debug.h:66
@ DEBUG_OPTION
Definition: debug.h:68
@ DEBUG_READ
Definition: debug.h:65
@ DEBUG_STATUS
Definition: debug.h:67
@ DEBUG_RAW
Definition: debug.h:70
void debugPrintf(const enum eDebugLevels level, const char *const format,...)
void debugPutc(const int level, const int c)
void debugParseNest(const bool increase, const unsigned int level)
void debugEntry(const tagEntryInfo *const tag)
void debugAssert(const char *assertion, const char *file, unsigned int line, const char *function)
#define attr__noreturn
Definition: gcc-attr.h:25
#define CTAGS_ATTR_PRINTF(s, f)
Definition: gcc-attr.h:23
vString * line
Definition: geany_cobol.c:133
CobolFormat format
Definition: geany_cobol.c:137