aboutsummaryrefslogtreecommitdiffstats
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
parentEvas gl: Fix shader generation with out of source builds. (diff)
downloadefl-2c5ec0b132222131306514d578b6f604c00b61b1.tar.gz
Eolian: Add API to retrieve an event of a class by its name
@feature
Diffstat (limited to 'src/lib/eolian/database_event_api.c')
-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)
while ((tmp = strpbrk(tmp, ".,"))) *tmp = '_';
return eina_stringshare_add(buf);
}
+
+EAPI const Eolian_Event *
+eolian_class_event_get_by_name(const Eolian_Class *klass, const char *event_name)
+{
+ Eina_List *itr;
+ Eolian_Event *event = NULL;
+ if (!klass) return NULL;
+ Eina_Stringshare *shr_ev = eina_stringshare_add(event_name);
+
+ EINA_LIST_FOREACH(klass->events, itr, event)
+ {
+ if (event->name == shr_ev)
+ goto end;
+ }
+
+ event = NULL;
+end:
+ eina_stringshare_del(shr_ev);
+ return event;
+}