1 /*
2 * \brief Formatted output
3 * \author Christian Helmuth
4 * \date 2008-08-15
5 */
6
7 /*
8 * Copyright (C) 2008-2013 Genode Labs GmbH
9 *
10 * This file is part of the Genode OS framework, which is distributed
11 * under the terms of the GNU General Public License version 2.
12 */
13
14 #ifndef _INCLUDE__DDE_KIT__PRINTF_H_
15 #define _INCLUDE__DDE_KIT__PRINTF_H_
16
17 #include <stdarg.h>
18
19 /**
20 * Print message
21 *
22 * \param msg message string
23 */
24 void dde_kit_print(const char *msg);
25
26 /**
27 * Print formatted message (varargs variant)
28 *
29 * \param fmt format string
30 */
31 void dde_kit_printf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
32
33 /**
34 * Print formatted message (va_list variant)
35 *
36 * \param fmt format string
37 * \param va variable argument list
38 */
39 void dde_kit_vprintf(const char *fmt, va_list va) __attribute__ ((format (printf, 1, 0)));
40
41 /**
42 * Log current function and message
43 *
44 * \param doit if false logging is suppressed
45 * \param msg format string plus arguments
46 */
47 #define dde_kit_log(doit, msg...) \
48 do { \
49 if (doit) { \
50 dde_kit_printf("%s(): ", __func__); \
51 dde_kit_printf(msg); \
52 dde_kit_printf("\n"); \
53 } \
54 } while(0);
55
56 #endif /* _INCLUDE__DDE_KIT__PRINTF_H_ */