summaryrefslogtreecommitdiff
path: root/libddekit/ddekit/printf.h
blob: 6dafa18d8d3e911811ceab4b6d966e1039a0397b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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