Change-Id: I1976848be0e8aeb170da37e1254208035e0e741a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
return (struct afb_event){ .itf = &afb_evt_event_itf, .closure = evt };
}
+/*
+ * Returns the name of the 'event'
+ */
+const char *afb_evt_event_name(struct afb_event event)
+{
+ return (event.itf != &afb_evt_event_itf) ? NULL : ((struct afb_evt_event *)event.closure)->name;
+}
+
/*
* Returns an instance of the listener defined by the 'send' callback
* and the 'closure'.
extern void afb_evt_listener_unref(struct afb_evt_listener *listener);
extern struct afb_event afb_evt_create_event(const char *name);
+extern const char *afb_evt_event_name(struct afb_event event);
extern int afb_evt_add_watch(struct afb_evt_listener *listener, struct afb_event event);
extern int afb_evt_remove_watch(struct afb_evt_listener *listener, struct afb_event event);