aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/api/debug.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2016-04-05 06:56:47 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2016-04-05 06:56:47 -0400
commit6ea7e3873e52902af9ee8c0837450fdb69d54140 (patch)
treeb291dad174446387a166763cfbf3dd351148ecbe /tools/lib/api/debug.c
parent5ddfe0858ea7848c5d4efe3f4319e7543522e0ee (diff)
parentf55532a0c0b8bb6148f4e07853b876ef73bc69ca (diff)
Merge branch 'fixes-base' into fixes
Diffstat (limited to 'tools/lib/api/debug.c')
-rw-r--r--tools/lib/api/debug.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/lib/api/debug.c b/tools/lib/api/debug.c
new file mode 100644
index 000000000000..5fa5cf500a1f
--- /dev/null
+++ b/tools/lib/api/debug.c
@@ -0,0 +1,28 @@
1#include <stdio.h>
2#include <stdarg.h>
3#include "debug.h"
4#include "debug-internal.h"
5
6static int __base_pr(const char *format, ...)
7{
8 va_list args;
9 int err;
10
11 va_start(args, format);
12 err = vfprintf(stderr, format, args);
13 va_end(args);
14 return err;
15}
16
17libapi_print_fn_t __pr_warning = __base_pr;
18libapi_print_fn_t __pr_info = __base_pr;
19libapi_print_fn_t __pr_debug;
20
21void libapi_set_print(libapi_print_fn_t warn,
22 libapi_print_fn_t info,
23 libapi_print_fn_t debug)
24{
25 __pr_warning = warn;
26 __pr_info = info;
27 __pr_debug = debug;
28}