summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2015-07-29 11:03:11 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2015-07-29 11:31:20 +0300
commitcc885384763a091f09786e8cbf28110784fcfd38 (patch)
tree06c2302bbe7db433efb265f1718aec56617c4559
parentff456f5da13423ca519abdfb8275ae1783c9837a (diff)
Preload: Catch eo_add + object info handling
-rw-r--r--src/lib/edbg_preload.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/lib/edbg_preload.c b/src/lib/edbg_preload.c
index e69de29..69fdd41 100644
--- a/src/lib/edbg_preload.c
+++ b/src/lib/edbg_preload.c
@@ -0,0 +1,37 @@
1#define _GNU_SOURCE
2#include <dlfcn.h>
3
4#include <Eo.h>
5#include <Eolian.h>
6
7typedef struct
8{
9 Eo *ptr;
10 const char *kl_name;
11} Obj_Info;
12
13static Eina_List *objs_list = NULL; /* List of Obj_Info */
14
15static Eina_Bool
16_info_del(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
17{
18 objs_list = eina_list_remove(objs_list, data);
19 return EINA_TRUE;
20}
21
22EAPI Eo *
23_eo_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo *parent_id, Eina_Bool ref)
24{
25 Eo *ret = NULL;
26 Eo *(*_eo_add_start)(const char *, int, const Eo_Class *, Eo *, Eina_Bool) = dlsym(RTLD_NEXT, __func__);
27 ret = _eo_add_start(file, line, klass_id, parent_id, ref);
28
29 Obj_Info *info = calloc(1, sizeof(info));
30 info->ptr = ret;
31 info->kl_name = eo_class_name_get(ret);
32 objs_list = eina_list_append(objs_list, info);
33
34 eo_do(ret, eo_event_callback_add(EO_EV_DEL, _info_del, info));
35
36 return ret;
37}