X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=include%2Fafb-req-itf.h;h=df133f5c18ddd56f00a0d50aa06d658e809a83a2;hb=82adb27966eace72f810716c19c660efd7c8b15a;hp=f03ce868e0709661f67a3ead772df54c7d18334a;hpb=46d9538587a3521caa1e3b20bf337a53ed400777;p=src%2Fapp-framework-binder.git diff --git a/include/afb-req-itf.h b/include/afb-req-itf.h index f03ce868..df133f5c 100644 --- a/include/afb-req-itf.h +++ b/include/afb-req-itf.h @@ -44,6 +44,7 @@ struct afb_req { void *req_closure; void *ctx_closure; }; + static inline struct afb_arg afb_req_get(struct afb_req req, const char *name) { return req.itf->get(req.req_closure, name); @@ -120,12 +121,28 @@ static inline void afb_req_session_close(struct afb_req req) req.itf->session_close(req.req_closure); } +#include + +static inline struct afb_req *afb_req_store(struct afb_req req) +{ + struct afb_req *result = malloc(sizeof *result); + if (result != NULL) + *result = req; + return result; +} + +static inline struct afb_req afb_req_unstore(struct afb_req *req) +{ + struct afb_req result = *req; + free(req); + return result; +} + #if !defined(_GNU_SOURCE) # error "_GNU_SOURCE must be defined for using vasprintf" #endif #include -#include #include static inline void afb_req_fail_v(struct afb_req req, const char *status, const char *info, va_list args)