A quickie lib to help debug

basic use:
1) #include <libdebug.h>  (-I </path/to/libdebug>/include)
2) replace all debuggable calls in your code with 
   dbg_ versions of the same call  (look at libdebug.h for the list)
3) call memdebug_dump() at the end of your program for memdebug info
4) compile with -DUSE_LIBDEBUG=1
5) link with -ldebug (-L </path/to/libdebug>)
6) run
7) watch stderr

or you can let libdebug override your calls to debuggable functions - no
major source changes.

merely:
1) include:
  #include <libdebug.h>
2) call memdebug_dump() at the end of your program for memdebug info
3) compile with -DUSE_LIBDEBUG=1 and optionally -DUSE_MEMDEBUG=1
4) link with -ldebug (-L </path/to/libdebug>)
5) run
6) watch stderr


other features:
* To change the "DEBUG" prefix to debugging lines:
  #undef DEBUG_STR
  #define DEBUG_STR "SOME PREFIX"
  #include <libdebug.h>

* To change the file descriptor to which libdebug delivers:
  libdebug_init(fd);		at the start of your program or
  libdebug_set_fd(fd);		anywhere in your program
