X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-xreq.h;h=e2b09db0d1873cf0307e84e6f83f32321627bc7f;hb=e12c3008f10cf5d61cc3235af6562a007ff08e76;hp=4e79686c847985ff721e39f44ed82e4209c1cd41;hpb=4c7b7d3adcc10fbcf64d790a4e7c194ff3d5c6de;p=src%2Fapp-framework-binder.git diff --git a/src/afb-xreq.h b/src/afb-xreq.h index 4e79686c..e2b09db0 100644 --- a/src/afb-xreq.h +++ b/src/afb-xreq.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 "IoT.bzh" + * Copyright (C) 2017, 2018 "IoT.bzh" * Author José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,6 +18,7 @@ #pragma once #include +#include #include "afb-context.h" struct json_object; @@ -147,6 +148,13 @@ extern void afb_xreq_call_verb_v1(struct afb_xreq *xreq, const struct afb_verb_d extern void afb_xreq_call_verb_v2(struct afb_xreq *xreq, const struct afb_verb_v2 *verb); extern void afb_xreq_call_verb_vdyn(struct afb_xreq *xreq, const struct afb_api_dyn_verb *verb); +/******************************************************************************/ + +static inline struct afb_req xreq_to_req(struct afb_xreq *xreq) +{ + return (struct afb_req){ .itf = xreq->request.itf, .closure = &xreq->request }; +} + static inline struct afb_request *xreq_to_request(struct afb_xreq *xreq) { return &xreq->request;