libnd_debug

Name

libnd_debug -- 

Synopsis

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)

Description

Details

libnd_debug_enter ()

void                libnd_debug_enter                   (const char *function);


libnd_debug_return ()

void                libnd_debug_return                  (const char *function);


libnd_debuggable ()

gboolean            libnd_debuggable                    (void);


D()

#define D(x)                  if (libnd_debuggable()) { libnd_debug_printf("%s/%i: ", __FILE__, __LINE__); libnd_debug_printf x ; }


D_ASSERT()

#define D_ASSERT(exp, msg)    if (!(exp) && libnd_debuggable()) { libnd_debug_printf("%s/%i: %s\n", __FILE__, __LINE__, msg); }


D_ASSERT_PTR()

#define D_ASSERT_PTR(ptr)     D_ASSERT(ptr, "pointer is NULL.")


D_ENTER

#define D_ENTER               libnd_debug_enter(__FUNCTION__)


D_RETURN

#define D_RETURN              do { libnd_debug_return(__FUNCTION__); return; } while (0)


D_RETURN_()

#define D_RETURN_(x)          do { libnd_debug_return(__FUNCTION__); return (x); } while (0)