diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-09-22 17:07:51 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-10-09 14:08:33 +0200 |
commit | 1430e5aca4864a093534a0c91f056a97a4a26056 (patch) | |
tree | c3ad95024bfd78bad09e5ef8443c41bf204a90c7 | |
parent | 7682c2aacb3efd6abed3dee43f8a03d7646d8153 (diff) |
Add function afb_evt_eventid_addref
Change-Id: I737f3ceaa41b5ec9a200a615dbc29965ed11c17c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r-- | src/afb-evt.c | 9 | ||||
-rw-r--r-- | src/afb-evt.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/afb-evt.c b/src/afb-evt.c index 18f4bca6..9937c1a6 100644 --- a/src/afb-evt.c +++ b/src/afb-evt.c @@ -738,3 +738,12 @@ void afb_evt_eventid_unref(struct afb_eventid *eventid) if (evtid) afb_evt_evtid_unref(evtid); } + +struct afb_eventid *afb_evt_eventid_addref(struct afb_eventid *eventid) +{ + struct afb_evtid *evtid = afb_evt_eventid_to_evtid(eventid); + if (evtid) + afb_evt_evtid_addref(evtid); + return eventid; +} + diff --git a/src/afb-evt.h b/src/afb-evt.h index a6bfda1e..2d888fa1 100644 --- a/src/afb-evt.h +++ b/src/afb-evt.h @@ -67,6 +67,7 @@ extern void afb_evt_update_hooks(); extern struct afb_eventid *afb_evt_eventid_create(const char *fullname); extern const char *afb_evt_eventid_fullname(struct afb_eventid *eventid); extern int afb_evt_eventid_id(struct afb_eventid *eventid); +extern struct afb_eventid *afb_evt_eventid_addref(struct afb_eventid *eventid); extern void afb_evt_eventid_unref(struct afb_eventid *eventid); extern int afb_evt_eventid_push(struct afb_eventid *eventid, struct json_object *object); |