summaryrefslogtreecommitdiff
path: root/src/lib/eolian/database_event_api.c
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2015-04-28 14:27:01 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2015-05-07 09:57:15 +0300
commit2c5ec0b132222131306514d578b6f604c00b61b1 (patch)
tree668628039bfc294e38544c9840431990a079b264 /src/lib/eolian/database_event_api.c
parent7c2d0453757fd6fc712f5dcef70f33daa2871fb3 (diff)
Eolian: Add API to retrieve an event of a class by its name
@feature
Diffstat (limited to '')
-rw-r--r--src/lib/eolian/database_event_api.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/eolian/database_event_api.c b/src/lib/eolian/database_event_api.c
index f2c98a7133..0a6b22dcff 100644
--- a/src/lib/eolian/database_event_api.c
+++ b/src/lib/eolian/database_event_api.c
@@ -44,3 +44,23 @@ eolian_event_c_name_get(const Eolian_Event *event)
44 while ((tmp = strpbrk(tmp, ".,"))) *tmp = '_'; 44 while ((tmp = strpbrk(tmp, ".,"))) *tmp = '_';
45 return eina_stringshare_add(buf); 45 return eina_stringshare_add(buf);
46} 46}
47
48EAPI const Eolian_Event *
49eolian_class_event_get_by_name(const Eolian_Class *klass, const char *event_name)
50{
51 Eina_List *itr;
52 Eolian_Event *event = NULL;
53 if (!klass) return NULL;
54 Eina_Stringshare *shr_ev = eina_stringshare_add(event_name);
55
56 EINA_LIST_FOREACH(klass->events, itr, event)
57 {
58 if (event->name == shr_ev)
59 goto end;
60 }
61
62 event = NULL;
63end:
64 eina_stringshare_del(shr_ev);
65 return event;
66}