aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-evt.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-06-17 22:06:41 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-06-17 22:08:58 +0200
commitb0848149c1ef5236791c0ba5196540d05d9f15fd (patch)
treeaed121d97730579fd26281e614a88011f1b389f0 /src/afb-evt.c
parent31f85d741a3f35f853114e0bc299213f4456fcbc (diff)
evt: exposes name of events
Change-Id: I1976848be0e8aeb170da37e1254208035e0e741a Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-evt.c')
-rw-r--r--src/afb-evt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/afb-evt.c b/src/afb-evt.c
index a99dc894..53ab0e0b 100644
--- a/src/afb-evt.c
+++ b/src/afb-evt.c
@@ -205,6 +205,14 @@ struct afb_event afb_evt_create_event(const char *name)
}
/*
+ * 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'.
* Returns NULL in case of memory depletion.