void libnd_debug_enter (const char *function); void libnd_debug_return (const char *function); gboolean libnd_debuggable (void); #define D (x) #define D_ASSERT (exp, msg) #define D_ASSERT_PTR (ptr) #define D_ENTER #define D_RETURN #define D_RETURN_ (x) |
#define D(x) |
Use this macro to output debugging information. x is
the content as you would pass it to printf()
debugging information.
#define D_ASSERT(exp, msg) |
The macro outputs msg if the expression exp evaluates to FALSE.
expression to evaluate.
message to output if exp fails.
#define D_ASSERT_PTR(ptr) |
The macro asserts the existence (i.e. non-NULL-ness) of the given pointer, and outpus a message if it is NULL.
pointer to check.
#define D_ENTER |
The macro updates internal debugging state when entering the function where this macro is used. Use it at the beginning of a function, but don't forget to properly match up D_ENTER with D_RETURN! The macro outpus the name of the entered function indented by the current nesting level.
#define D_RETURN |
The macro updates internal debugging state when leaving the function where this macro is used. Use this macro wherever the function can be left, and don't forget D_ENTER.