diff options
Diffstat (limited to 'libddekit/include/ddekit/printf.h')
-rw-r--r-- | libddekit/include/ddekit/printf.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libddekit/include/ddekit/printf.h b/libddekit/include/ddekit/printf.h new file mode 100644 index 00000000..35b0dfa1 --- /dev/null +++ b/libddekit/include/ddekit/printf.h @@ -0,0 +1,33 @@ +#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); + +/** 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 |