Rabbit Tree
Radix bit tries for implementing associative arrays and sets in C.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros
debug.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define debug_print(msg)
 
#define debug_print_func(func, print_newline,...)
 
#define debug_print_prefix   debug_print_prefix_flat
 
#define debug_print_prefix_flat
 
#define debug_printf(fmt,...)
 
#define error_print(msg)
 
#define error_printf(fmt,...)
 
#define RBT_DEBUG   0
 
#define RBT_DEBUG_FD   stderr
 
#define RBT_DEBUG_INDENT   0
 

Detailed Description

Author
Xyne

Macro Definition Documentation

#define debug_print (   msg)
Value:
do \
{ \
if (RBT_DEBUG) \
{ \
fprintf(\
msg \
); \
} \
} while (0)
#define RBT_DEBUG_FD
Definition: debug.h:27
#define debug_print_prefix
Definition: debug.h:124
#define RBT_DEBUG
Definition: debug.h:20

Print a debugging message.

Parameters
msgThe string to print.
#define debug_print_func (   func,
  print_newline,
  ... 
)
Value:
do \
{ \
if (RBT_DEBUG) \
{ \
func(RBT_DEBUG_FD, ##__VA_ARGS__); \
if (print_newline) \
{ \
fprintf(RBT_DEBUG_FD, "\n"); \
} \
} \
} while (0)
#define RBT_DEBUG_FD
Definition: debug.h:27
#define debug_print_prefix
Definition: debug.h:124
#define RBT_DEBUG
Definition: debug.h:20

Print the debugging prefix then invoke a function to print the rest of the message.

Parameters
funcA function that accepts a file descriptor as its first argument.
print_newlineA boolean parameter. If it evaluates to non-zero, a newline will be printed after the function call.
...Additional arguments to pass to the function.
#define debug_print_prefix   debug_print_prefix_flat

Precede debug_print_prefix_flat with indentation to represent the nesting level, if RBT_DEBUG_INDENT is greater than 0, otherwise this is the same as debug_print_prefix_flat.

#define debug_print_prefix_flat
Value:
fprintf(\
"%s%s %s%d %s%s(): %s", \
RBT_DEBUG_FILENAME_COLOR, \
__FILE__, \
RBT_DEBUG_LINENUMBER_COLOR, \
__LINE__, \
RBT_DEBUG_FUNCTIONNAME_COLOR, \
__func__, \
RBT_DEBUG_RESET_COLOR \
)
#define RBT_DEBUG_FD
Definition: debug.h:27

Print the file name, line number and function name.

#define debug_printf (   fmt,
  ... 
)
Value:
do \
{ \
if (RBT_DEBUG) \
{ \
fprintf(\
fmt, \
__VA_ARGS__ \
); \
} \
} while (0)
#define RBT_DEBUG_FD
Definition: debug.h:27
#define debug_print_prefix
Definition: debug.h:124
#define RBT_DEBUG
Definition: debug.h:20

Print a debugging message.

Parameters
fmtA printf format string.
...Parameters to pass to printf.
#define error_print (   msg)
Value:
do \
{ \
fprintf( \
"%s %d %s(): %s", \
__FILE__, __LINE__, __func__, msg \
); \
} \
while (0) \
#define RBT_DEBUG_FD
Definition: debug.h:27

Identical to debug_print except that it is independent of RBT_DEBUG.

Parameters
msgThe string to print.
#define error_printf (   fmt,
  ... 
)
Value:
do \
{ \
fprintf( \
"%s %d %s(): " fmt, \
__FILE__, __LINE__, __func__, fmt, __VA_ARGS__ \
); \
} \
while (0) \
#define RBT_DEBUG_FD
Definition: debug.h:27

Identical to debug_printf except that it is independent of RBT_DEBUG.

Parameters
fmtA printf format string.
...Parameters to pass to printf.
#define RBT_DEBUG   0

Enable debugging messages if non-zero.

#define RBT_DEBUG_FD   stderr

The file descriptor to use for printing debugging messages.

#define RBT_DEBUG_INDENT   0

Use indentation to represent the nesting level of function calls.