Next: , Previous: Debug, Up: Debug


9.1 debug_init

parse debug flags and initialize internals

Synopsis

     #include <suplib/debug.h>
     
     
     
int debug_init(const char *debug_flags);

Parameters

const char *debug_flags
a comma delimited list of debug flags

Description

debug_init and dbflag comprise a simple system for allowing users to specify debug flags to a program in a human understandable fashion.

debug_init parses a string for debug flags. The flags are comma separated tokens of any characters (preferrably alphanumeric). It builds an internal list of the specified flags, which can be tested with the dbflag function.

There is but a single list kept per process, and subsequent calls to debug_init will overwrite the list.

To free the memory associated with the internal list, debug_init should be called with debug_flags set to NULL.

Returns

It returns zero upon success, nonzero if it ran out of memory

Author

Diab Jerius