lst_debug

Name

lst_debug -- 

Synopsis



void        lst_debug_print_tree            (LST_STree *tree);
#define     D_PRINT_TREE                    (tree)
char*       lst_debug_print_substring       (LST_String *string,
                                             u_int start_index,
                                             u_int end_index,
                                             u_int extra_index);
#define     lst_stderr                      (...)
#define     D                               (x)
#define     D_ASSERT                        (exp, msg)
#define     D_ASSERT_PTR                    (ptr)

Description

Details

lst_debug_print_tree ()

void        lst_debug_print_tree            (LST_STree *tree);

We make this always available, not only with -DDEBUG.

tree :

tree to print.


D_PRINT_TREE()

#define     D_PRINT_TREE(tree)

This is just a wrapper around lst_debug_print_tree(), so nothing will be printed if debugging isn't enabled.

tree :

tree to print.


lst_debug_print_substring ()

char*       lst_debug_print_substring       (LST_String *string,
                                             u_int start_index,
                                             u_int end_index,
                                             u_int extra_index);

string :

start_index :

end_index :

extra_index :

Returns :


lst_stderr()

#define lst_stderr(...) fprintf(stderr, __VA_ARGS__)

... :


D()

#define     D(x)

Use this macro to output debugging information. x is the content as you would pass it to printf(), including braces to make the arguments appear as one argument to the macro. The macro is automatically deleted if -DDEBUG is not passed at build time.

x :

debugging information.


D_ASSERT()

#define     D_ASSERT(exp, msg)

The macro outputs msg if the expression exp evaluates to FALSE.

exp :

expression to evaluate.

msg :

message to output if exp fails.


D_ASSERT_PTR()

#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.

ptr :

pointer to check.