summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas/ecore_evas_module.c
diff options
context:
space:
mode:
authorFlavio Vinicius Alvares Ceolin <flavio.ceolin@profusion.mobi>2012-12-06 20:39:20 +0000
committerFlavio Vinicius Alvares Ceolin <flavio.ceolin@profusion.mobi>2012-12-06 20:39:20 +0000
commit186156afbca0b7e7ec8002112055429afd9e7e6b (patch)
tree1a52547cd72b0f633bdae860539a762c4cc9ed76 /src/lib/ecore_evas/ecore_evas_module.c
parent10ed77919c5e1776bbaa1d7a611fa380fe6ba018 (diff)
ecore_evas: Removing warning about unused function
Now the engines are modules, the checking for the engine is not done in the compile time anymore, so we're removing these checks. SVN revision: 80389
Diffstat (limited to 'src/lib/ecore_evas/ecore_evas_module.c')
-rw-r--r--src/lib/ecore_evas/ecore_evas_module.c52
1 files changed, 50 insertions, 2 deletions
diff --git a/src/lib/ecore_evas/ecore_evas_module.c b/src/lib/ecore_evas/ecore_evas_module.c
index 1e399b07d6..c4e960910c 100644
--- a/src/lib/ecore_evas/ecore_evas_module.c
+++ b/src/lib/ecore_evas/ecore_evas_module.c
@@ -5,8 +5,9 @@
5#include "Ecore_Evas.h" 5#include "Ecore_Evas.h"
6#include "ecore_evas_private.h" 6#include "ecore_evas_private.h"
7 7
8Eina_Hash *_registered_engines = NULL; 8static Eina_Hash *_registered_engines = NULL;
9Eina_List *_engines_paths = NULL; 9static Eina_List *_engines_paths = NULL;
10static Eina_List *_engines_available = NULL;
10 11
11#if defined(__CEGCC__) || defined(__MINGW32CE__) || defined(_WIN32) 12#if defined(__CEGCC__) || defined(__MINGW32CE__) || defined(_WIN32)
12# define ECORE_EVAS_ENGINE_NAME "module.dll" 13# define ECORE_EVAS_ENGINE_NAME "module.dll"
@@ -93,4 +94,51 @@ _ecore_evas_engine_shutdown(void)
93 94
94 EINA_LIST_FREE(_engines_paths, path) 95 EINA_LIST_FREE(_engines_paths, path)
95 free(path); 96 free(path);
97
98 EINA_LIST_FREE(_engines_available, path)
99 eina_stringshare_del(path);
100}
101
102static Eina_Bool
103_file_exists(const char *file)
104{
105 struct stat st;
106 if (!file) return EINA_FALSE;
107
108 if (stat(file, &st) < 0) return EINA_FALSE;
109 return EINA_TRUE;
110}
111
112const Eina_List *
113_ecore_evas_available_engines_get(void)
114{
115 Eina_File_Direct_Info *info;
116 Eina_Iterator *it;
117 Eina_List *l = NULL, *result = NULL;
118 const char *path;
119
120 if (_engines_available) return _engines_available;
121
122 EINA_LIST_FOREACH(_engines_paths, l, path)
123 {
124 it = eina_file_direct_ls(path);
125
126 if (it)
127 {
128 EINA_ITERATOR_FOREACH(it, info)
129 {
130 char tmp[PATH_MAX];
131 snprintf(tmp, sizeof (tmp), "%s/%s/" ECORE_EVAS_ENGINE_NAME,
132 info->path, MODULE_ARCH);
133
134 if (_file_exists(tmp))
135 result = eina_list_append(result,
136 eina_stringshare_add(info->path + info->name_start));
137 }
138 eina_iterator_free(it);
139 }
140 }
141
142 _engines_available = result;
143 return result;
96} 144}