X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-ditf.c;h=3eedbdb80433e5f0fe7a0798039241fc47c85c28;hb=59db7c73c9d98414be9edf7056d7afe025512b3e;hp=414824f5fc64228a6c60f51cccbdf3e2ce361840;hpb=4846cec0be7f41f992b9f89b7adb97033e15b1a0;p=src%2Fapp-framework-binder.git diff --git a/src/afb-ditf.c b/src/afb-ditf.c index 414824f5..3eedbdb8 100644 --- a/src/afb-ditf.c +++ b/src/afb-ditf.c @@ -29,35 +29,24 @@ #include "verbose.h" -static struct afb_event event_make_cb(void *closure, const char *name); -static int event_broadcast_cb(void *closure, const char *name, struct json_object *object); -static void vverbose_cb(void *closure, int level, const char *file, int line, const char *fmt, va_list args); -static int rootdir_open_locale_cb(void *closure, const char *filename, int flags, const char *locale); - -static const struct afb_daemon_itf daemon_itf = { - .vverbose = vverbose_cb, - .event_make = event_make_cb, - .event_broadcast = event_broadcast_cb, - .get_event_loop = afb_common_get_event_loop, - .get_user_bus = afb_common_get_user_bus, - .get_system_bus = afb_common_get_system_bus, - .rootdir_get_fd = afb_common_rootdir_get_fd, - .rootdir_open_locale = rootdir_open_locale_cb -}; - -static void vverbose_cb(void *closure, int level, const char *file, int line, const char *fmt, va_list args) +static void vverbose_cb(void *closure, int level, const char *file, int line, const char *function, const char *fmt, va_list args) { char *p; struct afb_ditf *ditf = closure; if (vasprintf(&p, fmt, args) < 0) - vverbose(level, file, line, fmt, args); + vverbose(level, file, line, function, fmt, args); else { - verbose(level, file, line, "%s {binding %s}", p, ditf->prefix); + verbose(level, file, line, function, "%s {binding %s}", p, ditf->prefix); free(p); } } +static void old_vverbose_cb(void *closure, int level, const char *file, int line, const char *fmt, va_list args) +{ + vverbose_cb(closure, level, file, line, "?", fmt, args); +} + static struct afb_event event_make_cb(void *closure, const char *name) { size_t plen, nlen; @@ -99,6 +88,17 @@ static int rootdir_open_locale_cb(void *closure, const char *filename, int flags return afb_common_rootdir_open_locale(filename, flags, locale); } +static const struct afb_daemon_itf daemon_itf = { + .vverbose = old_vverbose_cb, + .event_make = event_make_cb, + .event_broadcast = event_broadcast_cb, + .get_event_loop = afb_common_get_event_loop, + .get_user_bus = afb_common_get_user_bus, + .get_system_bus = afb_common_get_system_bus, + .rootdir_get_fd = afb_common_rootdir_get_fd, + .rootdir_open_locale = rootdir_open_locale_cb +}; + void afb_ditf_init(struct afb_ditf *ditf, const char *prefix) { ditf->interface.verbosity = verbosity;