diff options
Diffstat (limited to 'libddekit/ddekit/printf.h')
-rw-r--r-- | libddekit/ddekit/printf.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libddekit/ddekit/printf.h b/libddekit/ddekit/printf.h new file mode 100644 index 00000000..6dafa18d --- /dev/null +++ b/libddekit/ddekit/printf.h @@ -0,0 +1,35 @@ +#ifndef _ddekit_print_h +#define _ddekit_print_h + +#include <stdarg.h> + +/** Print message. + * \ingroup DDEKit_util + */ +int ddekit_print(const char *); + +/** Print message with format. + * \ingroup DDEKit_util + */ +int ddekit_printf(const char *fmt, ...); + +/** Print message with format list. + * \ingroup DDEKit_util + */ +int ddekit_vprintf(const char *fmt, va_list va); + +void dump_stack(void); + +/** Log function and message. + * \ingroup DDEKit_util + */ +#define ddekit_log(doit, msg...) \ + do { \ + if (doit) { \ + ddekit_printf("%s(): ", __func__); \ + ddekit_printf(msg); \ + ddekit_printf("\n"); \ + } \ + } while(0); + +#endif |