evt: exposes name of events
[src/app-framework-binder.git] / src / afb-evt.c
index a99dc89..53ab0e0 100644 (file)
@@ -204,6 +204,14 @@ struct afb_event afb_evt_create_event(const char *name)
        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'.