Add function afb_evt_eventid_addref
authorJosé Bollo <jose.bollo@iot.bzh>
Fri, 22 Sep 2017 15:07:51 +0000 (17:07 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Mon, 9 Oct 2017 12:08:33 +0000 (14:08 +0200)
Change-Id: I737f3ceaa41b5ec9a200a615dbc29965ed11c17c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/afb-evt.c
src/afb-evt.h

index 18f4bca..9937c1a 100644 (file)
@@ -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;
+}
+
index a6bfda1..2d888fa 100644 (file)
@@ -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);