diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-09-22 09:37:54 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-10-09 14:08:32 +0200 |
commit | be63003e3f1841b43614f0e11b0a291e11f1dad1 (patch) | |
tree | 58bfc359398ccdb3a5976f3204ee17f535f15569 /include | |
parent | 59d4e6a0654d361de19fbbfa65daf6c1dabd55a0 (diff) |
Provide conversions for afb_event and afb_req
Provision is made here to convert, trivially:
afb_event -> afb_eventid*
afb_req -> afb_request*
The opposite conversions aren't provided to
favor new interfaces.
Change-Id: Ib67c2317f782e2edfd1ba0e49e10b321a3b770a3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'include')
-rw-r--r-- | include/afb/afb-event.h | 8 | ||||
-rw-r--r-- | include/afb/afb-req.h | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/afb/afb-event.h b/include/afb/afb-event.h index c3686fdd..2e7f6ab9 100644 --- a/include/afb/afb-event.h +++ b/include/afb/afb-event.h @@ -29,6 +29,14 @@ struct afb_event }; /* + * Converts the 'event' to an afb_eventid. + */ +static inline struct afb_eventid *afb_event_to_eventid(struct afb_event event) +{ + return event.closure; +} + +/* * Checks wether the 'event' is valid or not. * * Returns 0 if not valid or 1 if valid. diff --git a/include/afb/afb-req.h b/include/afb/afb-req.h index 71dd31d1..6f98e900 100644 --- a/include/afb/afb-req.h +++ b/include/afb/afb-req.h @@ -31,6 +31,14 @@ struct afb_req }; /* + * Converts the 'req' to an afb_request. + */ +static inline struct afb_request *afb_req_to_request(struct afb_req req) +{ + return req.closure; +} + +/* * Checks whether the request 'req' is valid or not. * * Returns 0 if not valid or 1 if valid. |