summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_vpath_manager.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-04-01 00:06:47 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-04-01 08:57:09 +0900
commit5e9d838e60809a7dede3e1179ca35ccd02ea6d4d (patch)
treee00b77b1ab209c53a9a09af67c2ba1043dfbc2c9 /src/lib/efl/interfaces/efl_vpath_manager.c
parentbc238146146d2bdd6a36e0aa31b83f9ce59ac98b (diff)
XXX
Diffstat (limited to 'src/lib/efl/interfaces/efl_vpath_manager.c')
-rw-r--r--src/lib/efl/interfaces/efl_vpath_manager.c44
1 files changed, 41 insertions, 3 deletions
diff --git a/src/lib/efl/interfaces/efl_vpath_manager.c b/src/lib/efl/interfaces/efl_vpath_manager.c
index 7905d81..9b0ba7d 100644
--- a/src/lib/efl/interfaces/efl_vpath_manager.c
+++ b/src/lib/efl/interfaces/efl_vpath_manager.c
@@ -3,26 +3,64 @@
3#include "Efl.h" 3#include "Efl.h"
4 4
5typedef struct _Efl_Vpath_Manager_Data Efl_Vpath_Manager_Data; 5typedef struct _Efl_Vpath_Manager_Data Efl_Vpath_Manager_Data;
6typedef struct _Efl_Vpath_Manager_Entry Efl_Vpath_Manager_Entry;
6 7
7struct _Efl_Vpath_Manager_Data 8struct _Efl_Vpath_Manager_Data
8{ 9{
9 Eina_List *list; 10 Eina_List *list;
10}; 11};
11 12
13struct _Efl_Vpath_Manager_Entry
14{
15 Efl_Vpath *vpath;
16 int priority;
17};
18
19static Efl_Vpath_Manager_Data vpath_manager =
20{
21 NULL
22};
23
12EOLIAN static Efl_Vpath_File * 24EOLIAN static Efl_Vpath_File *
13_efl_vpath_manager_fetch(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, const char *path EINA_UNUSED) 25_efl_vpath_manager_fetch(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, const char *path)
14{ 26{
27 Efl_Vpath_Manager_Entry *entry;
28 Eina_List *l;
29 Efl_Vpath_File *file;
30
31 EINA_LIST_FOREACH(vpath_manager.list, l, entry)
32 {
33 file = efl_vpath_fetch(entry->vpath, path);
34 if (file) return file;
35 }
15 return NULL; 36 return NULL;
16} 37}
17 38
18EOLIAN static void 39EOLIAN static void
19_efl_vpath_manager_register(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, int priority EINA_UNUSED, Efl_Vpath *vpath EINA_UNUSED) 40_efl_vpath_manager_register(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, int priority, Efl_Vpath *vpath)
20{ 41{
42 Efl_Vpath_Manager_Entry *entry = malloc(sizeof(Efl_Vpath_Manager_Entry));
43 entry->vpath = vpath;
44 entry->priority = priority;
45 // XXX: inset sorted
46 vpath_manager.list = eina_lisst_prepend(vpath_manager.list, entry);
21} 47}
22 48
23EOLIAN static void 49EOLIAN static void
24_efl_vpath_manager_unregister(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Vpath *vpath EINA_UNUSED) 50_efl_vpath_manager_unregister(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Vpath *vpath)
25{ 51{
52 Efl_Vpath_Manager_Entry *entry;
53 Eina_List *l;
54
55 EINA_LIST_FOREACH(vpath_manager.list, l, entry)
56 {
57 if (entry->vpath == vpath)
58 {
59 vpath_manager.list = eina_list_remove_list(vpath_manager.list, l);
60 free(entry);
61 return;
62 }
63 }
26} 64}
27 65
28#include "interfaces/efl_vpath_manager.eo.c" 66#include "interfaces/efl_vpath_manager.eo.c"