X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-xreq.c;h=80fa9636c416be3aaec36e8b4f7dd64dcbbd58c8;hb=c6380108964e71f533d8c672bb9c217020a95e8d;hp=9c4cab8fdae8af88f07aa4bc15da591022d46ab8;hpb=d3c80685ed6067f4899635c0328bbd8b70a2ed90;p=src%2Fapp-framework-binder.git diff --git a/src/afb-xreq.c b/src/afb-xreq.c index 9c4cab8f..80fa9636 100644 --- a/src/afb-xreq.c +++ b/src/afb-xreq.c @@ -279,6 +279,12 @@ static void xreq_vverbose_cb(void*closure, int level, const char *file, int line vverbose(level, file, line, func, fmt, args); } +static struct afb_stored_req *xreq_store_cb(void *closure) +{ + xreq_addref_cb(closure); + return closure; +} + /******************************************************************************/ static struct json_object *xreq_hooked_json_cb(void *closure) @@ -429,6 +435,14 @@ static void xreq_hooked_vverbose_cb(void*closure, int level, const char *file, i va_end(ap); } +static struct afb_stored_req *xreq_hooked_store_cb(void *closure) +{ + struct afb_xreq *xreq = closure; + struct afb_stored_req *r = xreq_store_cb(closure); + afb_hook_xreq_store(xreq, r); + return r; +} + /******************************************************************************/ const struct afb_req_itf xreq_itf = { @@ -448,7 +462,8 @@ const struct afb_req_itf xreq_itf = { .unsubscribe = xreq_unsubscribe_cb, .subcall = xreq_subcall_cb, .subcallsync = xreq_subcallsync_cb, - .vverbose = xreq_vverbose_cb + .vverbose = xreq_vverbose_cb, + .store = xreq_store_cb }; const struct afb_req_itf xreq_hooked_itf = { @@ -468,7 +483,8 @@ const struct afb_req_itf xreq_hooked_itf = { .unsubscribe = xreq_hooked_unsubscribe_cb, .subcall = xreq_hooked_subcall_cb, .subcallsync = xreq_hooked_subcallsync_cb, - .vverbose = xreq_hooked_vverbose_cb + .vverbose = xreq_hooked_vverbose_cb, + .store = xreq_hooked_store_cb }; static inline struct afb_req to_req(struct afb_xreq *xreq) @@ -478,6 +494,14 @@ static inline struct afb_req to_req(struct afb_xreq *xreq) /******************************************************************************/ +struct afb_req afb_xreq_unstore(struct afb_stored_req *sreq) +{ + struct afb_xreq *xreq = (struct afb_xreq *)sreq; + if (xreq->hookflags) + afb_hook_xreq_unstore(xreq); + return to_req(xreq); +} + struct json_object *afb_xreq_json(struct afb_xreq *xreq) { return afb_req_json(to_req(xreq));