X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-hook.c;h=bafbbe90f5cf4426b73b30fb58bfbba77f896308;hb=4846cec0be7f41f992b9f89b7adb97033e15b1a0;hp=e16d67049373ac2763d62a68f786c1753cb89191;hpb=522569c5a9da8566f5213fa5b9b3abadf746331d;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hook.c b/src/afb-hook.c index e16d6704..bafbbe90 100644 --- a/src/afb-hook.c +++ b/src/afb-hook.c @@ -174,6 +174,16 @@ static void hook_xreq_subcall_result_default_cb(void * closure, const struct afb _hook_xreq_(xreq, " ...subcall... -> %d: %s", status, json_object_to_json_string(result)); } +static void hook_xreq_subcallsync_default_cb(void * closure, const struct afb_xreq *xreq, const char *api, const char *verb, struct json_object *args) +{ + _hook_xreq_(xreq, "subcallsync(%s/%s, %s) ...", api, verb, json_object_to_json_string(args)); +} + +static void hook_xreq_subcallsync_result_default_cb(void * closure, const struct afb_xreq *xreq, int status, struct json_object *result) +{ + _hook_xreq_(xreq, " ...subcallsync... -> %d: %s", status, json_object_to_json_string(result)); +} + static struct afb_hook_xreq_itf hook_xreq_default_itf = { .hook_xreq_begin = hook_xreq_begin_default_cb, .hook_xreq_end = hook_xreq_end_default_cb, @@ -193,6 +203,8 @@ static struct afb_hook_xreq_itf hook_xreq_default_itf = { .hook_xreq_unsubscribe = hook_xreq_unsubscribe_default_cb, .hook_xreq_subcall = hook_xreq_subcall_default_cb, .hook_xreq_subcall_result = hook_xreq_subcall_result_default_cb, + .hook_xreq_subcallsync = hook_xreq_subcallsync_default_cb, + .hook_xreq_subcallsync_result = hook_xreq_subcallsync_result_default_cb, }; /****************************************************************************** @@ -313,6 +325,17 @@ void afb_hook_xreq_subcall_result(const struct afb_xreq *xreq, int status, struc _HOOK_XREQ_(subcall_result, xreq, status, result); } +void afb_hook_xreq_subcallsync(const struct afb_xreq *xreq, const char *api, const char *verb, struct json_object *args) +{ + _HOOK_XREQ_(subcallsync, xreq, api, verb, args); +} + +int afb_hook_xreq_subcallsync_result(const struct afb_xreq *xreq, int status, struct json_object *result) +{ + _HOOK_XREQ_(subcallsync_result, xreq, status, result); + return status; +} + /****************************************************************************** * section: *****************************************************************************/