diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2009-02-25 11:03:47 +0000 |
---|---|---|
committer | Cedric BAIL <cedric.bail@free.fr> | 2009-02-25 11:03:47 +0000 |
commit | 6978e98dc6247373e7a2a3ec2ec58b37ff404c01 (patch) | |
tree | bf9d12da012faab9bc4c2bd925b864c19a38d8d9 /legacy/ecore/src/lib | |
parent | e31b5e961eff9b2c8d5c6a5419502d391e12ca00 (diff) |
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
Diffstat (limited to 'legacy/ecore/src/lib')
23 files changed, 221 insertions, 332 deletions
diff --git a/legacy/ecore/src/lib/ecore/Ecore_Data.h b/legacy/ecore/src/lib/ecore/Ecore_Data.h index 2a8331e647..2397ccb410 100644 --- a/legacy/ecore/src/lib/ecore/Ecore_Data.h +++ b/legacy/ecore/src/lib/ecore/Ecore_Data.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _ECORE_DATA_H | 1 | #ifndef _ECORE_DATA_H |
2 | # define _ECORE_DATA_H | 2 | # define _ECORE_DATA_H |
3 | 3 | ||
4 | #include <Eina.h> | ||
5 | |||
6 | #ifdef EAPI | 4 | #ifdef EAPI |
7 | # undef EAPI | 5 | # undef EAPI |
8 | #endif | 6 | #endif |
@@ -32,6 +30,8 @@ | |||
32 | /* we need this for size_t */ | 30 | /* we need this for size_t */ |
33 | #include <stddef.h> | 31 | #include <stddef.h> |
34 | 32 | ||
33 | #include <Eina.h> | ||
34 | |||
35 | /** | 35 | /** |
36 | * @file Ecore_Data.h | 36 | * @file Ecore_Data.h |
37 | * @brief Contains threading, list, hash, debugging and tree functions. | 37 | * @brief Contains threading, list, hash, debugging and tree functions. |
@@ -300,7 +300,7 @@ extern "C" { | |||
300 | 300 | ||
301 | struct _ecore_path_group | 301 | struct _ecore_path_group |
302 | { | 302 | { |
303 | Ecore_List *paths; | 303 | Eina_List *paths; |
304 | }; | 304 | }; |
305 | 305 | ||
306 | /* | 306 | /* |
@@ -331,7 +331,7 @@ extern "C" { | |||
331 | /* | 331 | /* |
332 | * Get a list of all the available files in a path set | 332 | * Get a list of all the available files in a path set |
333 | */ | 333 | */ |
334 | EAPI Ecore_List * ecore_path_group_available_get(Ecore_Path_Group *group); | 334 | EAPI Eina_List * ecore_path_group_available_get(Ecore_Path_Group *group); |
335 | 335 | ||
336 | 336 | ||
337 | typedef struct _ecore_plugin Ecore_Plugin; | 337 | typedef struct _ecore_plugin Ecore_Plugin; |
@@ -355,7 +355,7 @@ extern "C" { | |||
355 | */ | 355 | */ |
356 | EAPI void *ecore_plugin_symbol_get(Ecore_Plugin * plugin, const char *symbol_name); | 356 | EAPI void *ecore_plugin_symbol_get(Ecore_Plugin * plugin, const char *symbol_name); |
357 | 357 | ||
358 | EAPI Ecore_List *ecore_plugin_available_get(Ecore_Path_Group *group); | 358 | EAPI Eina_List *ecore_plugin_available_get(Ecore_Path_Group *group); |
359 | 359 | ||
360 | 360 | ||
361 | typedef struct _ecore_heap Ecore_Sheap; | 361 | typedef struct _ecore_heap Ecore_Sheap; |
diff --git a/legacy/ecore/src/lib/ecore/ecore_getopt.c b/legacy/ecore/src/lib/ecore/ecore_getopt.c index fc897c81d6..75c198c025 100644 --- a/legacy/ecore/src/lib/ecore/ecore_getopt.c +++ b/legacy/ecore/src/lib/ecore/ecore_getopt.c | |||
@@ -1635,11 +1635,10 @@ ecore_getopt_parse(const Ecore_Getopt *parser, Ecore_Getopt_Value *values, int a | |||
1635 | Eina_List * | 1635 | Eina_List * |
1636 | ecore_getopt_list_free(Eina_List *list) | 1636 | ecore_getopt_list_free(Eina_List *list) |
1637 | { | 1637 | { |
1638 | while (list) | 1638 | void *data; |
1639 | { | 1639 | |
1640 | free(list->data); | 1640 | EINA_LIST_FREE(list, data) |
1641 | list = eina_list_remove_list(list, list); | 1641 | free(data); |
1642 | } | ||
1643 | return NULL; | 1642 | return NULL; |
1644 | } | 1643 | } |
1645 | 1644 | ||
diff --git a/legacy/ecore/src/lib/ecore/ecore_path.c b/legacy/ecore/src/lib/ecore/ecore_path.c index ea1431e091..bb1f195bff 100644 --- a/legacy/ecore/src/lib/ecore/ecore_path.c +++ b/legacy/ecore/src/lib/ecore/ecore_path.c | |||
@@ -45,11 +45,12 @@ ecore_path_group_new(void) | |||
45 | EAPI void | 45 | EAPI void |
46 | ecore_path_group_del(Ecore_Path_Group *group) | 46 | ecore_path_group_del(Ecore_Path_Group *group) |
47 | { | 47 | { |
48 | CHECK_PARAM_POINTER("group", group); | 48 | char *path; |
49 | 49 | ||
50 | if (group->paths) | 50 | CHECK_PARAM_POINTER("group", group); |
51 | ecore_list_destroy(group->paths); | ||
52 | 51 | ||
52 | EINA_LIST_FREE(group->paths, path) | ||
53 | free(path); | ||
53 | free(group); | 54 | free(group); |
54 | } | 55 | } |
55 | 56 | ||
@@ -65,13 +66,7 @@ ecore_path_group_add(Ecore_Path_Group *group, const char *path) | |||
65 | CHECK_PARAM_POINTER("group", group); | 66 | CHECK_PARAM_POINTER("group", group); |
66 | CHECK_PARAM_POINTER("path", path); | 67 | CHECK_PARAM_POINTER("path", path); |
67 | 68 | ||
68 | if (!group->paths) | 69 | group->paths = eina_list_append(group->paths, strdup(path)); |
69 | { | ||
70 | group->paths = ecore_list_new(); | ||
71 | ecore_list_free_cb_set(group->paths, free); | ||
72 | } | ||
73 | |||
74 | ecore_list_append(group->paths, strdup(path)); | ||
75 | } | 70 | } |
76 | 71 | ||
77 | /** | 72 | /** |
@@ -94,16 +89,16 @@ ecore_path_group_remove(Ecore_Path_Group *group, const char *path) | |||
94 | /* | 89 | /* |
95 | * Find the path in the list of available paths | 90 | * Find the path in the list of available paths |
96 | */ | 91 | */ |
97 | ecore_list_first_goto(group->paths); | 92 | found = eina_list_search_unsorted(group->paths, strcmp, path); |
98 | |||
99 | while ((found = ecore_list_current(group->paths)) && strcmp(found, path)) | ||
100 | ecore_list_next(group->paths); | ||
101 | 93 | ||
102 | /* | 94 | /* |
103 | * If the path is found, remove and free it | 95 | * If the path is found, remove and free it |
104 | */ | 96 | */ |
105 | if (found) | 97 | if (found) |
106 | ecore_list_remove_destroy(group->paths); | 98 | { |
99 | group->paths = eina_list_remove(group->paths, found); | ||
100 | free(found); | ||
101 | } | ||
107 | } | 102 | } |
108 | 103 | ||
109 | /** | 104 | /** |
@@ -117,6 +112,7 @@ ecore_path_group_remove(Ecore_Path_Group *group, const char *path) | |||
117 | EAPI char * | 112 | EAPI char * |
118 | ecore_path_group_find(Ecore_Path_Group *group, const char *name) | 113 | ecore_path_group_find(Ecore_Path_Group *group, const char *name) |
119 | { | 114 | { |
115 | Eina_List *l; | ||
120 | int r; | 116 | int r; |
121 | char *p; | 117 | char *p; |
122 | struct stat st; | 118 | struct stat st; |
@@ -131,15 +127,13 @@ ecore_path_group_find(Ecore_Path_Group *group, const char *name) | |||
131 | /* | 127 | /* |
132 | * Search the paths of the path group for the specified file name | 128 | * Search the paths of the path group for the specified file name |
133 | */ | 129 | */ |
134 | ecore_list_first_goto(group->paths); | 130 | EINA_LIST_FOREACH(group->paths, l, p) |
135 | p = ecore_list_next(group->paths); | ||
136 | do | ||
137 | { | 131 | { |
138 | snprintf(path, PATH_MAX, "%s/%s", p, name); | 132 | snprintf(path, PATH_MAX, "%s/%s", p, name); |
139 | r = stat(path, &st); | 133 | r = stat(path, &st); |
134 | if ((r >= 0) && S_ISREG(st.st_mode)) | ||
135 | break; | ||
140 | } | 136 | } |
141 | while (((r < 0) || !S_ISREG(st.st_mode)) && | ||
142 | (p = ecore_list_next(group->paths))); | ||
143 | 137 | ||
144 | if (p) | 138 | if (p) |
145 | p = strdup(path); | 139 | p = strdup(path); |
@@ -154,20 +148,19 @@ ecore_path_group_find(Ecore_Path_Group *group, const char *name) | |||
154 | * identified by @p group_id. @c NULL otherwise. | 148 | * identified by @p group_id. @c NULL otherwise. |
155 | * @ingroup Ecore_Path_Group | 149 | * @ingroup Ecore_Path_Group |
156 | */ | 150 | */ |
157 | EAPI Ecore_List * | 151 | EAPI Eina_List * |
158 | ecore_path_group_available_get(Ecore_Path_Group *group) | 152 | ecore_path_group_available_get(Ecore_Path_Group *group) |
159 | { | 153 | { |
160 | Ecore_List *avail = NULL; | 154 | Eina_List *avail = NULL; |
155 | Eina_List *l; | ||
161 | char *path; | 156 | char *path; |
162 | 157 | ||
163 | CHECK_PARAM_POINTER_RETURN("group", group, NULL); | 158 | CHECK_PARAM_POINTER_RETURN("group", group, NULL); |
164 | 159 | ||
165 | if (!group->paths || ecore_list_empty_is(group->paths)) | 160 | if (!group->paths || !eina_list_count(group->paths)) |
166 | return NULL; | 161 | return NULL; |
167 | 162 | ||
168 | ecore_list_first_goto(group->paths); | 163 | EINA_LIST_FOREACH(group->paths, l, path) |
169 | |||
170 | while ((path = ecore_list_next(group->paths)) != NULL) | ||
171 | { | 164 | { |
172 | DIR *dir; | 165 | DIR *dir; |
173 | struct stat st; | 166 | struct stat st; |
@@ -203,13 +196,11 @@ ecore_path_group_available_get(Ecore_Path_Group *group) | |||
203 | 196 | ||
204 | strncpy(n, d->d_name, l - 2); | 197 | strncpy(n, d->d_name, l - 2); |
205 | */ | 198 | */ |
206 | if (!avail) | 199 | /* avail = eina_list_append(avail, strdup(n));*/ |
207 | avail = ecore_list_new(); | 200 | avail = eina_list_append(avail, strdup(d->d_name)); |
208 | |||
209 | /* ecore_list_append(avail, strdup(n));*/ | ||
210 | ecore_list_append(avail, strdup(d->d_name)); | ||
211 | } | 201 | } |
212 | } | 202 | } |
213 | 203 | ||
214 | return avail; | 204 | return avail; |
215 | } | 205 | } |
206 | |||
diff --git a/legacy/ecore/src/lib/ecore/ecore_plugin.c b/legacy/ecore/src/lib/ecore/ecore_plugin.c index 0162a27b68..8b79dc134f 100644 --- a/legacy/ecore/src/lib/ecore/ecore_plugin.c +++ b/legacy/ecore/src/lib/ecore/ecore_plugin.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "ecore_private.h" | 28 | #include "ecore_private.h" |
29 | 29 | ||
30 | 30 | ||
31 | static Ecore_List *loaded_plugins = NULL; | 31 | static Eina_List *loaded_plugins = NULL; |
32 | 32 | ||
33 | static Eina_Bool _hash_keys(const Eina_Hash *hash, | 33 | static Eina_Bool _hash_keys(const Eina_Hash *hash, |
34 | const char *key, | 34 | const char *key, |
@@ -106,10 +106,8 @@ ecore_plugin_load(Ecore_Path_Group *group, const char *plugin_name, const char * | |||
106 | /* | 106 | /* |
107 | * Now add it to the list of the groups loaded plugins | 107 | * Now add it to the list of the groups loaded plugins |
108 | */ | 108 | */ |
109 | if (!loaded_plugins) | ||
110 | loaded_plugins = ecore_list_new(); | ||
111 | 109 | ||
112 | ecore_list_append(loaded_plugins, plugin); | 110 | loaded_plugins = eina_list_append(loaded_plugins, plugin); |
113 | 111 | ||
114 | FREE(path); | 112 | FREE(path); |
115 | 113 | ||
@@ -129,14 +127,7 @@ ecore_plugin_unload(Ecore_Plugin *plugin) | |||
129 | if (!plugin->handle) | 127 | if (!plugin->handle) |
130 | return; | 128 | return; |
131 | 129 | ||
132 | if (ecore_list_goto(loaded_plugins, plugin)) | 130 | loaded_plugins = eina_list_remove(loaded_plugins, plugin); |
133 | ecore_list_remove(loaded_plugins); | ||
134 | |||
135 | if (ecore_list_empty_is(loaded_plugins)) | ||
136 | { | ||
137 | ecore_list_destroy(loaded_plugins); | ||
138 | loaded_plugins = NULL; | ||
139 | } | ||
140 | 131 | ||
141 | dlclose(plugin->handle); | 132 | dlclose(plugin->handle); |
142 | 133 | ||
@@ -173,23 +164,23 @@ ecore_plugin_symbol_get(Ecore_Plugin *plugin, const char *symbol_name) | |||
173 | * paths identified by @p group_id. @c NULL otherwise. | 164 | * paths identified by @p group_id. @c NULL otherwise. |
174 | * @ingroup Ecore_Plugin | 165 | * @ingroup Ecore_Plugin |
175 | */ | 166 | */ |
176 | EAPI Ecore_List * | 167 | EAPI Eina_List * |
177 | ecore_plugin_available_get(Ecore_Path_Group *group) | 168 | ecore_plugin_available_get(Ecore_Path_Group *group) |
178 | { | 169 | { |
179 | Ecore_List *avail = NULL; | 170 | Eina_List *avail = NULL; |
171 | Eina_List *l; | ||
180 | Eina_Hash *plugins = NULL; | 172 | Eina_Hash *plugins = NULL; |
181 | Eina_Iterator *it = NULL; | 173 | Eina_Iterator *it = NULL; |
182 | char *path; | 174 | char *path; |
183 | 175 | ||
184 | CHECK_PARAM_POINTER_RETURN("group", group, NULL); | 176 | CHECK_PARAM_POINTER_RETURN("group", group, NULL); |
185 | 177 | ||
186 | if (!group->paths || ecore_list_empty_is(group->paths)) | 178 | if (!group->paths || !eina_list_count(group->paths)) |
187 | return NULL; | 179 | return NULL; |
188 | 180 | ||
189 | ecore_list_first_goto(group->paths); | ||
190 | plugins = eina_hash_string_superfast_new(NULL); | 181 | plugins = eina_hash_string_superfast_new(NULL); |
191 | 182 | ||
192 | while ((path = ecore_list_next(group->paths)) != NULL) | 183 | EINA_LIST_FOREACH(group->paths, l, path) |
193 | { | 184 | { |
194 | DIR *dir; | 185 | DIR *dir; |
195 | struct stat st; | 186 | struct stat st; |
@@ -239,14 +230,10 @@ ecore_plugin_available_get(Ecore_Path_Group *group) | |||
239 | closedir(dir); | 230 | closedir(dir); |
240 | } | 231 | } |
241 | 232 | ||
242 | avail = ecore_list_new(); | ||
243 | ecore_list_free_cb_set(avail, free); | ||
244 | |||
245 | |||
246 | it = eina_hash_iterator_data_new(plugins); | 233 | it = eina_hash_iterator_data_new(plugins); |
247 | if (it) | 234 | if (it) |
248 | { | 235 | { |
249 | eina_iterator_foreach(it, EINA_EACH(_hash_keys), avail); | 236 | eina_iterator_foreach(it, EINA_EACH(_hash_keys), &avail); |
250 | eina_iterator_free(it); | 237 | eina_iterator_free(it); |
251 | } | 238 | } |
252 | 239 | ||
@@ -259,6 +246,6 @@ ecore_plugin_available_get(Ecore_Path_Group *group) | |||
259 | static Eina_Bool | 246 | static Eina_Bool |
260 | _hash_keys(const Eina_Hash *hash __UNUSED__, const char *key, void *list) | 247 | _hash_keys(const Eina_Hash *hash __UNUSED__, const char *key, void *list) |
261 | { | 248 | { |
262 | ecore_list_append(list, strdup(key)); | 249 | *(Eina_List **)list = eina_list_append(*(Eina_List **)list, key); |
263 | return EINA_TRUE; | 250 | return EINA_TRUE; |
264 | } | 251 | } |
diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con.c b/legacy/ecore/src/lib/ecore_con/ecore_con.c index 5b83ed4738..d9199ef5a4 100644 --- a/legacy/ecore/src/lib/ecore_con/ecore_con.c +++ b/legacy/ecore/src/lib/ecore_con/ecore_con.c | |||
@@ -57,7 +57,7 @@ EAPI int ECORE_CON_EVENT_SERVER_DEL = 0; | |||
57 | EAPI int ECORE_CON_EVENT_CLIENT_DATA = 0; | 57 | EAPI int ECORE_CON_EVENT_CLIENT_DATA = 0; |
58 | EAPI int ECORE_CON_EVENT_SERVER_DATA = 0; | 58 | EAPI int ECORE_CON_EVENT_SERVER_DATA = 0; |
59 | 59 | ||
60 | static Ecore_List *servers = NULL; | 60 | static Eina_List *servers = NULL; |
61 | static int init_count = 0; | 61 | static int init_count = 0; |
62 | 62 | ||
63 | #define LENGTH_OF_SOCKADDR_UN(s) (strlen((s)->sun_path) + (size_t)(((struct sockaddr_un *)NULL)->sun_path)) | 63 | #define LENGTH_OF_SOCKADDR_UN(s) (strlen((s)->sun_path) + (size_t)(((struct sockaddr_un *)NULL)->sun_path)) |
@@ -94,8 +94,6 @@ ecore_con_init(void) | |||
94 | ecore_con_dns_init(); | 94 | ecore_con_dns_init(); |
95 | ecore_con_info_init(); | 95 | ecore_con_info_init(); |
96 | 96 | ||
97 | servers = ecore_list_new(); | ||
98 | |||
99 | return init_count; | 97 | return init_count; |
100 | } | 98 | } |
101 | 99 | ||
@@ -110,10 +108,8 @@ ecore_con_shutdown(void) | |||
110 | { | 108 | { |
111 | if (--init_count != 0) return init_count; | 109 | if (--init_count != 0) return init_count; |
112 | 110 | ||
113 | while (!ecore_list_empty_is(servers)) | 111 | while (servers) |
114 | _ecore_con_server_free(ecore_list_first_remove(servers)); | 112 | _ecore_con_server_free(eina_list_data_get(servers)); |
115 | ecore_list_destroy(servers); | ||
116 | servers = NULL; | ||
117 | 113 | ||
118 | ecore_con_info_shutdown(); | 114 | ecore_con_info_shutdown(); |
119 | ecore_con_dns_shutdown(); | 115 | ecore_con_dns_shutdown(); |
@@ -239,7 +235,7 @@ ecore_con_server_add(Ecore_Con_Type compl_type, const char *name, int port, | |||
239 | socket_unix.sun_family = AF_UNIX; | 235 | socket_unix.sun_family = AF_UNIX; |
240 | if (type == ECORE_CON_LOCAL_ABSTRACT) | 236 | if (type == ECORE_CON_LOCAL_ABSTRACT) |
241 | { | 237 | { |
242 | #ifdef HAVE_ABSTRACT_SOCKETS | 238 | #ifdef HAVE_ABSTRACT_SOCKET |
243 | /* . is a placeholder */ | 239 | /* . is a placeholder */ |
244 | snprintf(socket_unix.sun_path, sizeof(socket_unix.sun_path), ".%s", name); | 240 | snprintf(socket_unix.sun_path, sizeof(socket_unix.sun_path), ".%s", name); |
245 | /* first char null indicates abstract namespace */ | 241 | /* first char null indicates abstract namespace */ |
@@ -285,7 +281,7 @@ ecore_con_server_add(Ecore_Con_Type compl_type, const char *name, int port, | |||
285 | if (!ecore_con_info_udp_listen(svr, _ecore_con_cb_udp_listen, svr)) goto error; | 281 | if (!ecore_con_info_udp_listen(svr, _ecore_con_cb_udp_listen, svr)) goto error; |
286 | } | 282 | } |
287 | 283 | ||
288 | ecore_list_append(servers, svr); | 284 | servers = eina_list_append(servers, svr); |
289 | ECORE_MAGIC_SET(svr, ECORE_MAGIC_CON_SERVER); | 285 | ECORE_MAGIC_SET(svr, ECORE_MAGIC_CON_SERVER); |
290 | 286 | ||
291 | return svr; | 287 | return svr; |
@@ -463,7 +459,7 @@ ecore_con_server_connect(Ecore_Con_Type compl_type, const char *name, int port, | |||
463 | if (!ecore_con_info_udp_connect(svr, _ecore_con_cb_udp_connect, svr)) goto error; | 459 | if (!ecore_con_info_udp_connect(svr, _ecore_con_cb_udp_connect, svr)) goto error; |
464 | } | 460 | } |
465 | 461 | ||
466 | ecore_list_append(servers, svr); | 462 | servers = eina_list_append(servers, svr); |
467 | ECORE_MAGIC_SET(svr, ECORE_MAGIC_CON_SERVER); | 463 | ECORE_MAGIC_SET(svr, ECORE_MAGIC_CON_SERVER); |
468 | 464 | ||
469 | return svr; | 465 | return svr; |
@@ -494,6 +490,8 @@ ecore_con_server_del(Ecore_Con_Server *svr) | |||
494 | ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, "ecore_con_server_del"); | 490 | ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, "ecore_con_server_del"); |
495 | return NULL; | 491 | return NULL; |
496 | } | 492 | } |
493 | if (svr->delete_me) return NULL; | ||
494 | |||
497 | data = svr->data; | 495 | data = svr->data; |
498 | svr->data = NULL; | 496 | svr->data = NULL; |
499 | svr->delete_me = 1; | 497 | svr->delete_me = 1; |
@@ -508,7 +506,6 @@ ecore_con_server_del(Ecore_Con_Server *svr) | |||
508 | else | 506 | else |
509 | { | 507 | { |
510 | _ecore_con_server_free(svr); | 508 | _ecore_con_server_free(svr); |
511 | if (ecore_list_goto(servers, svr)) ecore_list_remove(servers); | ||
512 | } | 509 | } |
513 | return data; | 510 | return data; |
514 | } | 511 | } |
@@ -886,12 +883,8 @@ _ecore_con_server_free(Ecore_Con_Server *svr) | |||
886 | } | 883 | } |
887 | } | 884 | } |
888 | if (svr->write_buf) free(svr->write_buf); | 885 | if (svr->write_buf) free(svr->write_buf); |
889 | while (svr->clients) | 886 | EINA_LIST_FREE(svr->clients, cl) |
890 | { | ||
891 | cl = eina_list_data_get(svr->clients); | ||
892 | svr->clients = eina_list_remove(svr->clients, cl); | ||
893 | _ecore_con_client_free(cl); | 887 | _ecore_con_client_free(cl); |
894 | } | ||
895 | if ((svr->created) && (svr->path) && (svr->ppid == getpid())) | 888 | if ((svr->created) && (svr->path) && (svr->ppid == getpid())) |
896 | unlink(svr->path); | 889 | unlink(svr->path); |
897 | if (svr->fd >= 0) close(svr->fd); | 890 | if (svr->fd >= 0) close(svr->fd); |
@@ -900,6 +893,7 @@ _ecore_con_server_free(Ecore_Con_Server *svr) | |||
900 | if (svr->path) free(svr->path); | 893 | if (svr->path) free(svr->path); |
901 | if (svr->ip) free(svr->ip); | 894 | if (svr->ip) free(svr->ip); |
902 | if (svr->fd_handler) ecore_main_fd_handler_del(svr->fd_handler); | 895 | if (svr->fd_handler) ecore_main_fd_handler_del(svr->fd_handler); |
896 | servers = eina_list_remove(servers, svr); | ||
903 | free(svr); | 897 | free(svr); |
904 | } | 898 | } |
905 | 899 | ||
@@ -1389,7 +1383,7 @@ static int | |||
1389 | _ecore_con_svr_udp_handler(void *data, Ecore_Fd_Handler *fd_handler) | 1383 | _ecore_con_svr_udp_handler(void *data, Ecore_Fd_Handler *fd_handler) |
1390 | { | 1384 | { |
1391 | Ecore_Con_Server *svr; | 1385 | Ecore_Con_Server *svr; |
1392 | Ecore_Con_Client *cl; | 1386 | Ecore_Con_Client *cl = NULL; |
1393 | 1387 | ||
1394 | svr = data; | 1388 | svr = data; |
1395 | if (svr->dead) return 1; | 1389 | if (svr->dead) return 1; |
diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con_info.c b/legacy/ecore/src/lib/ecore_con/ecore_con_info.c index de21a00e10..019dd99c47 100644 --- a/legacy/ecore/src/lib/ecore_con/ecore_con_info.c +++ b/legacy/ecore/src/lib/ecore_con/ecore_con_info.c | |||
@@ -198,9 +198,10 @@ ecore_con_info_get(Ecore_Con_Server *svr, | |||
198 | char service[NI_MAXSERV]; | 198 | char service[NI_MAXSERV]; |
199 | char hbuf[NI_MAXHOST]; | 199 | char hbuf[NI_MAXHOST]; |
200 | char sbuf[NI_MAXSERV]; | 200 | char sbuf[NI_MAXSERV]; |
201 | void *tosend; | 201 | void *tosend = NULL; |
202 | int tosend_len; | 202 | int tosend_len; |
203 | int canonname_len = 0; | 203 | int canonname_len = 0; |
204 | int err; | ||
204 | 205 | ||
205 | /* FIXME with EINA */ | 206 | /* FIXME with EINA */ |
206 | snprintf(service, NI_MAXSERV, "%i", svr->port); | 207 | snprintf(service, NI_MAXSERV, "%i", svr->port); |
@@ -210,12 +211,13 @@ ecore_con_info_get(Ecore_Con_Server *svr, | |||
210 | if (result->ai_canonname) | 211 | if (result->ai_canonname) |
211 | canonname_len = strlen(result->ai_canonname) + 1; | 212 | canonname_len = strlen(result->ai_canonname) + 1; |
212 | tosend_len = sizeof(Ecore_Con_Info) + result->ai_addrlen + canonname_len; | 213 | tosend_len = sizeof(Ecore_Con_Info) + result->ai_addrlen + canonname_len; |
213 | tosend = malloc(tosend_len); | 214 | |
215 | if ((tosend = malloc(tosend_len))); | ||
216 | goto on_error; | ||
217 | memset(tosend, 0, tosend_len); | ||
214 | container = (Ecore_Con_Info *)tosend; | 218 | container = (Ecore_Con_Info *)tosend; |
215 | 219 | ||
216 | container->size = tosend_len; | 220 | container->size = tosend_len; |
217 | memset(container->ip, 0, sizeof(container->ip)); | ||
218 | memset(container->service, 0, sizeof(container->service)); | ||
219 | 221 | ||
220 | memcpy(&container->info, result, sizeof(struct addrinfo)); | 222 | memcpy(&container->info, result, sizeof(struct addrinfo)); |
221 | memcpy(tosend + sizeof(Ecore_Con_Info), result->ai_addr, result->ai_addrlen); | 223 | memcpy(tosend + sizeof(Ecore_Con_Info), result->ai_addr, result->ai_addrlen); |
@@ -228,13 +230,14 @@ ecore_con_info_get(Ecore_Con_Server *svr, | |||
228 | memcpy(container->ip, hbuf, sizeof(container->ip)); | 230 | memcpy(container->ip, hbuf, sizeof(container->ip)); |
229 | memcpy(container->service, sbuf, sizeof(container->service)); | 231 | memcpy(container->service, sbuf, sizeof(container->service)); |
230 | } | 232 | } |
231 | write(fd[1], tosend, tosend_len); | 233 | err = write(fd[1], tosend, tosend_len); |
232 | 234 | ||
233 | free(tosend); | 235 | free(tosend); |
234 | } | 236 | } |
235 | else | 237 | else |
236 | write(fd[1], "", 1); | 238 | err = write(fd[1], "", 1); |
237 | 239 | ||
240 | on_error: | ||
238 | close(fd[1]); | 241 | close(fd[1]); |
239 | # ifdef __USE_ISOC99 | 242 | # ifdef __USE_ISOC99 |
240 | _Exit(0); | 243 | _Exit(0); |
diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con_url.c b/legacy/ecore/src/lib/ecore_con/ecore_con_url.c index 9461aa6313..bbff69036c 100644 --- a/legacy/ecore/src/lib/ecore_con/ecore_con_url.c +++ b/legacy/ecore/src/lib/ecore_con/ecore_con_url.c | |||
@@ -80,7 +80,7 @@ static void _ecore_con_event_url_free(void *data __UNUSED__, void *ev); | |||
80 | static int _ecore_con_url_process_completed_jobs(Ecore_Con_Url *url_con_to_match); | 80 | static int _ecore_con_url_process_completed_jobs(Ecore_Con_Url *url_con_to_match); |
81 | 81 | ||
82 | static Ecore_Idler *_fd_idler_handler = NULL; | 82 | static Ecore_Idler *_fd_idler_handler = NULL; |
83 | static Ecore_List *_url_con_list = NULL; | 83 | static Eina_List *_url_con_list = NULL; |
84 | static CURLM *curlm = NULL; | 84 | static CURLM *curlm = NULL; |
85 | static fd_set _current_fd_set; | 85 | static fd_set _current_fd_set; |
86 | static int init_count = 0; | 86 | static int init_count = 0; |
@@ -129,6 +129,8 @@ EAPI int | |||
129 | ecore_con_url_init(void) | 129 | ecore_con_url_init(void) |
130 | { | 130 | { |
131 | #ifdef HAVE_CURL | 131 | #ifdef HAVE_CURL |
132 | Ecore_Con_Url *url_con; | ||
133 | |||
132 | if (!ECORE_CON_EVENT_URL_DATA) | 134 | if (!ECORE_CON_EVENT_URL_DATA) |
133 | { | 135 | { |
134 | ECORE_CON_EVENT_URL_DATA = ecore_event_type_new(); | 136 | ECORE_CON_EVENT_URL_DATA = ecore_event_type_new(); |
@@ -136,27 +138,21 @@ ecore_con_url_init(void) | |||
136 | ECORE_CON_EVENT_URL_PROGRESS = ecore_event_type_new(); | 138 | ECORE_CON_EVENT_URL_PROGRESS = ecore_event_type_new(); |
137 | } | 139 | } |
138 | 140 | ||
139 | if (!_url_con_list) | ||
140 | { | ||
141 | _url_con_list = ecore_list_new(); | ||
142 | if (!_url_con_list) return 0; | ||
143 | } | ||
144 | |||
145 | if (!curlm) | 141 | if (!curlm) |
146 | { | 142 | { |
147 | FD_ZERO(&_current_fd_set); | 143 | FD_ZERO(&_current_fd_set); |
148 | if (curl_global_init(CURL_GLOBAL_NOTHING)) | 144 | if (curl_global_init(CURL_GLOBAL_NOTHING)) |
149 | { | 145 | { |
150 | ecore_list_destroy(_url_con_list); | 146 | EINA_LIST_FREE(_url_con_list, url_con) |
151 | _url_con_list = NULL; | 147 | ecore_con_url_destroy(url_con); |
152 | return 0; | 148 | return 0; |
153 | } | 149 | } |
154 | 150 | ||
155 | curlm = curl_multi_init(); | 151 | curlm = curl_multi_init(); |
156 | if (!curlm) | 152 | if (!curlm) |
157 | { | 153 | { |
158 | ecore_list_destroy(_url_con_list); | 154 | EINA_LIST_FREE(_url_con_list, url_con) |
159 | _url_con_list = NULL; | 155 | ecore_con_url_destroy(url_con); |
160 | return 0; | 156 | return 0; |
161 | } | 157 | } |
162 | } | 158 | } |
@@ -176,24 +172,14 @@ EAPI int | |||
176 | ecore_con_url_shutdown(void) | 172 | ecore_con_url_shutdown(void) |
177 | { | 173 | { |
178 | #ifdef HAVE_CURL | 174 | #ifdef HAVE_CURL |
175 | Ecore_Con_Url *url_con; | ||
179 | 176 | ||
180 | if (!init_count) | 177 | if (!init_count) |
181 | return 0; | 178 | return 0; |
182 | 179 | ||
183 | init_count--; | 180 | init_count--; |
184 | if (_url_con_list) | 181 | EINA_LIST_FREE(_url_con_list, url_con) |
185 | { | ||
186 | if (!ecore_list_empty_is(_url_con_list)) | ||
187 | { | ||
188 | Ecore_Con_Url *url_con; | ||
189 | while ((url_con = ecore_list_first(_url_con_list))) | ||
190 | { | ||
191 | ecore_con_url_destroy(url_con); | 182 | ecore_con_url_destroy(url_con); |
192 | } | ||
193 | } | ||
194 | ecore_list_destroy(_url_con_list); | ||
195 | _url_con_list = NULL; | ||
196 | } | ||
197 | 183 | ||
198 | if (curlm) | 184 | if (curlm) |
199 | { | 185 | { |
@@ -286,8 +272,7 @@ ecore_con_url_destroy(Ecore_Con_Url *url_con) | |||
286 | { | 272 | { |
287 | if (url_con->active) | 273 | if (url_con->active) |
288 | { | 274 | { |
289 | if (ecore_list_find(_url_con_list, ecore_direct_compare, url_con) == url_con) | 275 | _url_con_list = eina_list_remove(_url_con_list, url_con); |
290 | ecore_list_remove(_url_con_list); | ||
291 | url_con->active = 0; | 276 | url_con->active = 0; |
292 | 277 | ||
293 | curl_multi_remove_handle(curlm, url_con->curl_easy); | 278 | curl_multi_remove_handle(curlm, url_con->curl_easy); |
@@ -615,14 +600,14 @@ ecore_con_url_ftp_use_epsv_set(Ecore_Con_Url *url_con, int use_epsv) | |||
615 | static int | 600 | static int |
616 | _ecore_con_url_suspend_fd_handler(void) | 601 | _ecore_con_url_suspend_fd_handler(void) |
617 | { | 602 | { |
603 | Eina_List *l; | ||
618 | Ecore_Con_Url *url_con; | 604 | Ecore_Con_Url *url_con; |
619 | int deleted = 0; | 605 | int deleted = 0; |
620 | 606 | ||
621 | if (!_url_con_list) | 607 | if (!_url_con_list) |
622 | return 0; | 608 | return 0; |
623 | 609 | ||
624 | ecore_list_first_goto(_url_con_list); | 610 | EINA_LIST_FOREACH(_url_con_list, l, url_con) |
625 | while ((url_con = ecore_list_current(_url_con_list))) | ||
626 | { | 611 | { |
627 | if (url_con->active && url_con->fd_handler) | 612 | if (url_con->active && url_con->fd_handler) |
628 | { | 613 | { |
@@ -630,7 +615,6 @@ _ecore_con_url_suspend_fd_handler(void) | |||
630 | url_con->fd_handler = NULL; | 615 | url_con->fd_handler = NULL; |
631 | deleted++; | 616 | deleted++; |
632 | } | 617 | } |
633 | ecore_list_next(_url_con_list); | ||
634 | } | 618 | } |
635 | 619 | ||
636 | return deleted; | 620 | return deleted; |
@@ -639,25 +623,23 @@ _ecore_con_url_suspend_fd_handler(void) | |||
639 | static int | 623 | static int |
640 | _ecore_con_url_restart_fd_handler(void) | 624 | _ecore_con_url_restart_fd_handler(void) |
641 | { | 625 | { |
626 | Eina_List *l; | ||
642 | Ecore_Con_Url *url_con; | 627 | Ecore_Con_Url *url_con; |
643 | int activated = 0; | 628 | int activated = 0; |
644 | 629 | ||
645 | if (!_url_con_list) | 630 | if (!_url_con_list) |
646 | return 0; | 631 | return 0; |
647 | 632 | ||
648 | ecore_list_first_goto(_url_con_list); | 633 | EINA_LIST_FOREACH(_url_con_list, l, url_con) |
649 | while ((url_con = ecore_list_current(_url_con_list))) | ||
650 | { | 634 | { |
651 | if (url_con->fd_handler == NULL | 635 | if (url_con->fd_handler == NULL && url_con->fd != -1) |
652 | && url_con->fd != -1) | ||
653 | { | 636 | { |
654 | url_con->fd_handler = ecore_main_fd_handler_add(url_con->fd, | 637 | url_con->fd_handler == ecore_main_fd_handler_add(url_con->fd, |
655 | url_con->flags, | 638 | url_con->flags, |
656 | _ecore_con_url_fd_handler, | 639 | _ecore_con_url_fd_handler, |
657 | NULL, NULL, NULL); | 640 | NULL, NULL, NULL); |
658 | activated++; | 641 | activated++; |
659 | } | 642 | } |
660 | ecore_list_next(_url_con_list); | ||
661 | } | 643 | } |
662 | 644 | ||
663 | return activated; | 645 | return activated; |
@@ -781,7 +763,7 @@ _ecore_con_url_perform(Ecore_Con_Url *url_con) | |||
781 | int still_running; | 763 | int still_running; |
782 | int completed_immediately = 0; | 764 | int completed_immediately = 0; |
783 | 765 | ||
784 | ecore_list_append(_url_con_list, url_con); | 766 | _url_con_list = eina_list_append(_url_con_list, url_con); |
785 | 767 | ||
786 | url_con->active = 1; | 768 | url_con->active = 1; |
787 | curl_multi_add_handle(curlm, url_con->curl_easy); | 769 | curl_multi_add_handle(curlm, url_con->curl_easy); |
@@ -874,7 +856,9 @@ _ecore_con_url_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __ | |||
874 | static int | 856 | static int |
875 | _ecore_con_url_process_completed_jobs(Ecore_Con_Url *url_con_to_match) | 857 | _ecore_con_url_process_completed_jobs(Ecore_Con_Url *url_con_to_match) |
876 | { | 858 | { |
859 | Eina_List *l; | ||
877 | Ecore_Con_Url *url_con; | 860 | Ecore_Con_Url *url_con; |
861 | Ecore_Con_Event_Url_Complete *e; | ||
878 | CURLMsg *curlmsg; | 862 | CURLMsg *curlmsg; |
879 | int n_remaining; | 863 | int n_remaining; |
880 | int job_matched = 0; | 864 | int job_matched = 0; |
@@ -885,16 +869,13 @@ _ecore_con_url_process_completed_jobs(Ecore_Con_Url *url_con_to_match) | |||
885 | if (curlmsg->msg != CURLMSG_DONE) continue; | 869 | if (curlmsg->msg != CURLMSG_DONE) continue; |
886 | 870 | ||
887 | /* find the job which is done */ | 871 | /* find the job which is done */ |
888 | ecore_list_first_goto(_url_con_list); | 872 | EINA_LIST_FOREACH(_url_con_list, l, url_con) |
889 | while ((url_con = ecore_list_current(_url_con_list))) | ||
890 | { | 873 | { |
891 | if (curlmsg->easy_handle == url_con->curl_easy) | 874 | if (curlmsg->easy_handle == url_con->curl_easy) |
892 | { | 875 | { |
893 | /* We have found the completed job in our job list */ | 876 | if (url_con_to_match && (url_con == url_con_to_match)) |
894 | if (url_con_to_match && (url_con == url_con_to_match)) { | ||
895 | job_matched = 1; | 877 | job_matched = 1; |
896 | } | 878 | if(url_con->fd != -1) |
897 | if (url_con->fd != -1) | ||
898 | { | 879 | { |
899 | FD_CLR(url_con->fd, &_current_fd_set); | 880 | FD_CLR(url_con->fd, &_current_fd_set); |
900 | if (url_con->fd_handler) | 881 | if (url_con->fd_handler) |
@@ -902,27 +883,22 @@ _ecore_con_url_process_completed_jobs(Ecore_Con_Url *url_con_to_match) | |||
902 | url_con->fd = -1; | 883 | url_con->fd = -1; |
903 | url_con->fd_handler = NULL; | 884 | url_con->fd_handler = NULL; |
904 | } | 885 | } |
905 | ecore_list_remove(_url_con_list); | 886 | _url_con_list = eina_list_remove(_url_con_list, url_con); |
906 | url_con->active = 0; | 887 | url_con->active = 0; |
907 | { | ||
908 | Ecore_Con_Event_Url_Complete *e; | ||
909 | e = calloc(1, sizeof(Ecore_Con_Event_Url_Complete)); | 888 | e = calloc(1, sizeof(Ecore_Con_Event_Url_Complete)); |
910 | if (e) | 889 | if (e) |
911 | { | 890 | { |
912 | e->url_con = url_con; | 891 | e->url_con = url_con; |
913 | |||
914 | e->status = 0; | 892 | e->status = 0; |
915 | curl_easy_getinfo(curlmsg->easy_handle, CURLINFO_RESPONSE_CODE, &e->status); | 893 | curl_easy_getinfo(curlmsg->easy_handle, CURLINFO_RESPONSE_CODE, &e->status); |
916 | |||
917 | _url_complete_push_event(ECORE_CON_EVENT_URL_COMPLETE, e); | 894 | _url_complete_push_event(ECORE_CON_EVENT_URL_COMPLETE, e); |
918 | } | 895 | } |
919 | } | ||
920 | curl_multi_remove_handle(curlm, url_con->curl_easy); | 896 | curl_multi_remove_handle(curlm, url_con->curl_easy); |
921 | break; | 897 | break; |
922 | } | 898 | } |
923 | ecore_list_next(_url_con_list); | ||
924 | } | 899 | } |
925 | } | 900 | } |
901 | |||
926 | return job_matched; | 902 | return job_matched; |
927 | } | 903 | } |
928 | 904 | ||
diff --git a/legacy/ecore/src/lib/ecore_config/ecore_config_ipc_ecore.c b/legacy/ecore/src/lib/ecore_config/ecore_config_ipc_ecore.c index ad4ec35a0b..bd2ec03022 100644 --- a/legacy/ecore/src/lib/ecore_config/ecore_config_ipc_ecore.c +++ b/legacy/ecore/src/lib/ecore_config/ecore_config_ipc_ecore.c | |||
@@ -364,6 +364,7 @@ _ecore_config_ipc_ecore_exit(void **data) | |||
364 | } | 364 | } |
365 | 365 | ||
366 | ecore_ipc_shutdown(); | 366 | ecore_ipc_shutdown(); |
367 | ecore_shutdown(); | ||
367 | 368 | ||
368 | return ret; | 369 | return ret; |
369 | } | 370 | } |
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_fb.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas_fb.c index e97d864ad5..6c187a8000 100644 --- a/legacy/ecore/src/lib/ecore_evas/ecore_evas_fb.c +++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_fb.c | |||
@@ -23,7 +23,7 @@ static int _ecore_evas_init_count = 0; | |||
23 | 23 | ||
24 | static int _ecore_evas_fps_debug = 0; | 24 | static int _ecore_evas_fps_debug = 0; |
25 | static char *ecore_evas_default_display = "0"; | 25 | static char *ecore_evas_default_display = "0"; |
26 | static Ecore_List *ecore_evas_input_devices = NULL; | 26 | static Eina_List *ecore_evas_input_devices = NULL; |
27 | static Ecore_Evas *ecore_evases = NULL; | 27 | static Ecore_Evas *ecore_evases = NULL; |
28 | static Ecore_Event_Handler *ecore_evas_event_handlers[6] = {NULL, NULL, NULL, NULL, NULL, NULL}; | 28 | static Ecore_Event_Handler *ecore_evas_event_handlers[6] = {NULL, NULL, NULL, NULL, NULL, NULL}; |
29 | static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL; | 29 | static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL; |
@@ -76,6 +76,7 @@ static void | |||
76 | _ecore_evas_fb_lose(void *data __UNUSED__) | 76 | _ecore_evas_fb_lose(void *data __UNUSED__) |
77 | { | 77 | { |
78 | Ecore_List2 *l; | 78 | Ecore_List2 *l; |
79 | Eina_List *ll; | ||
79 | Ecore_Fb_Input_Device *dev; | 80 | Ecore_Fb_Input_Device *dev; |
80 | 81 | ||
81 | for (l = (Ecore_List2 *)ecore_evases; l; l = l->next) | 82 | for (l = (Ecore_List2 *)ecore_evases; l; l = l->next) |
@@ -87,8 +88,7 @@ _ecore_evas_fb_lose(void *data __UNUSED__) | |||
87 | } | 88 | } |
88 | if (ecore_evas_input_devices) | 89 | if (ecore_evas_input_devices) |
89 | { | 90 | { |
90 | ecore_list_first_goto(ecore_evas_input_devices); | 91 | EINA_LIST_FOREACH(ecore_evas_input_devices, ll, dev) |
91 | while ((dev = ecore_list_next(ecore_evas_input_devices))) | ||
92 | ecore_fb_input_device_listen(dev, 0); | 92 | ecore_fb_input_device_listen(dev, 0); |
93 | } | 93 | } |
94 | } | 94 | } |
@@ -97,6 +97,7 @@ static void | |||
97 | _ecore_evas_fb_gain(void *data __UNUSED__) | 97 | _ecore_evas_fb_gain(void *data __UNUSED__) |
98 | { | 98 | { |
99 | Ecore_List2 *l; | 99 | Ecore_List2 *l; |
100 | Eina_List *l; | ||
100 | Ecore_Fb_Input_Device *dev; | 101 | Ecore_Fb_Input_Device *dev; |
101 | 102 | ||
102 | for (l = (Ecore_List2 *)ecore_evases; l; l = l->next) | 103 | for (l = (Ecore_List2 *)ecore_evases; l; l = l->next) |
@@ -112,8 +113,7 @@ _ecore_evas_fb_gain(void *data __UNUSED__) | |||
112 | } | 113 | } |
113 | if (ecore_evas_input_devices) | 114 | if (ecore_evas_input_devices) |
114 | { | 115 | { |
115 | ecore_list_first_goto(ecore_evas_input_devices); | 116 | EINA_LIST_FOREACH(ecore_evas_input_devices, ll, dev) |
116 | while ((dev = ecore_list_next(ecore_evas_input_devices))) | ||
117 | ecore_fb_input_device_listen(dev, 1); | 117 | ecore_fb_input_device_listen(dev, 1); |
118 | } | 118 | } |
119 | } | 119 | } |
@@ -274,7 +274,6 @@ _ecore_evas_fb_init(int w, int h) | |||
274 | input_dir = opendir("/dev/input/"); | 274 | input_dir = opendir("/dev/input/"); |
275 | if (!input_dir) return _ecore_evas_init_count; | 275 | if (!input_dir) return _ecore_evas_init_count; |
276 | 276 | ||
277 | ecore_evas_input_devices = ecore_list_new(); | ||
278 | while ((input_entry = readdir(input_dir))) | 277 | while ((input_entry = readdir(input_dir))) |
279 | { | 278 | { |
280 | char device_path[256]; | 279 | char device_path[256]; |
@@ -295,7 +294,7 @@ _ecore_evas_fb_init(int w, int h) | |||
295 | { | 294 | { |
296 | ecore_fb_input_device_axis_size_set(device, w, h); | 295 | ecore_fb_input_device_axis_size_set(device, w, h); |
297 | ecore_fb_input_device_listen(device,1); | 296 | ecore_fb_input_device_listen(device,1); |
298 | ecore_list_append(ecore_evas_input_devices, device); | 297 | ecore_evas_input_devices = eina_list_append(ecore_evas_input_devices, device); |
299 | if (!mouse_handled) | 298 | if (!mouse_handled) |
300 | { | 299 | { |
301 | ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_FB_EVENT_MOUSE_BUTTON_DOWN, _ecore_evas_event_mouse_button_down, NULL); | 300 | ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_FB_EVENT_MOUSE_BUTTON_DOWN, _ecore_evas_event_mouse_button_down, NULL); |
@@ -309,7 +308,7 @@ _ecore_evas_fb_init(int w, int h) | |||
309 | else if ((caps & ECORE_FB_INPUT_DEVICE_CAP_KEYS_OR_BUTTONS) && !(caps & ECORE_FB_INPUT_DEVICE_CAP_ABSOLUTE)) | 308 | else if ((caps & ECORE_FB_INPUT_DEVICE_CAP_KEYS_OR_BUTTONS) && !(caps & ECORE_FB_INPUT_DEVICE_CAP_ABSOLUTE)) |
310 | { | 309 | { |
311 | ecore_fb_input_device_listen(device,1); | 310 | ecore_fb_input_device_listen(device,1); |
312 | ecore_list_append(ecore_evas_input_devices, device); | 311 | ecore_evas_input_devices = eina_list_append(ecore_evas_input_devices, device); |
313 | if (!keyboard_handled) | 312 | if (!keyboard_handled) |
314 | { | 313 | { |
315 | ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_FB_EVENT_KEY_DOWN, _ecore_evas_event_key_down, NULL); | 314 | ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_FB_EVENT_KEY_DOWN, _ecore_evas_event_key_down, NULL); |
@@ -480,6 +479,7 @@ _ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int h | |||
480 | static void | 479 | static void |
481 | _ecore_evas_fullscreen_set(Ecore_Evas *ee, int on) | 480 | _ecore_evas_fullscreen_set(Ecore_Evas *ee, int on) |
482 | { | 481 | { |
482 | Eina_List *l; | ||
483 | int resized = 0; | 483 | int resized = 0; |
484 | 484 | ||
485 | if (((ee->prop.fullscreen) && (on)) || | 485 | if (((ee->prop.fullscreen) && (on)) || |
@@ -520,9 +520,8 @@ _ecore_evas_fullscreen_set(Ecore_Evas *ee, int on) | |||
520 | { | 520 | { |
521 | Ecore_Fb_Input_Device *dev; | 521 | Ecore_Fb_Input_Device *dev; |
522 | 522 | ||
523 | ecore_list_first_goto(ecore_evas_input_devices); | 523 | EINA_LIST_FOREACH(ecore_evas_input_devices, l, dev) |
524 | while ((dev = ecore_list_next(ecore_evas_input_devices))) | 524 | ecore_fb_input_device_axis_size_set(dev, ee->wn ee->h); |
525 | ecore_fb_input_device_axis_size_set(dev, ee->w, ee->h); | ||
526 | } | 525 | } |
527 | if (resized) | 526 | if (resized) |
528 | { | 527 | { |
diff --git a/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c b/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c index bc0e11f009..547aef42dd 100644 --- a/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c +++ b/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c | |||
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | #define CLICK_THRESHOLD_DEFAULT 0.25 | 12 | #define CLICK_THRESHOLD_DEFAULT 0.25 |
13 | 13 | ||
14 | static Ecore_List *_ecore_fb_li_devices = NULL; | 14 | static Eina_List *_ecore_fb_li_devices = NULL; |
15 | 15 | ||
16 | static const char *_ecore_fb_li_kbd_syms[128 * 6] = | 16 | static const char *_ecore_fb_li_kbd_syms[128 * 6] = |
17 | { | 17 | { |
@@ -374,9 +374,6 @@ ecore_fb_input_device_open(const char *dev) | |||
374 | device = calloc(1, sizeof(Ecore_Fb_Input_Device)); | 374 | device = calloc(1, sizeof(Ecore_Fb_Input_Device)); |
375 | if(!device) return NULL; | 375 | if(!device) return NULL; |
376 | 376 | ||
377 | if(!_ecore_fb_li_devices) | ||
378 | _ecore_fb_li_devices = ecore_list_new(); | ||
379 | |||
380 | if((fd = open(dev, O_RDONLY, O_NONBLOCK)) < 0) | 377 | if((fd = open(dev, O_RDONLY, O_NONBLOCK)) < 0) |
381 | { | 378 | { |
382 | fprintf(stderr, "[ecore_fb_li:device_open] %s %s", dev, strerror(errno)); | 379 | fprintf(stderr, "[ecore_fb_li:device_open] %s %s", dev, strerror(errno)); |
@@ -433,7 +430,7 @@ ecore_fb_input_device_open(const char *dev) | |||
433 | break; | 430 | break; |
434 | } | 431 | } |
435 | } | 432 | } |
436 | ecore_list_append(_ecore_fb_li_devices, device); | 433 | _ecore_fb_li_devices = eina_list_append(_ecore_fb_li_devices, device); |
437 | return device; | 434 | return device; |
438 | 435 | ||
439 | error_caps: | 436 | error_caps: |
@@ -450,8 +447,7 @@ ecore_fb_input_device_close(Ecore_Fb_Input_Device *dev) | |||
450 | /* close the fd */ | 447 | /* close the fd */ |
451 | close(dev->fd); | 448 | close(dev->fd); |
452 | /* remove the element from the list */ | 449 | /* remove the element from the list */ |
453 | if(ecore_list_goto(_ecore_fb_li_devices, dev)) | 450 | _ecore_fb_li_devices = eina_list_remove(_ecore_fb_li_devices, dev); |
454 | ecore_list_remove(_ecore_fb_li_devices); | ||
455 | free(dev); | 451 | free(dev); |
456 | } | 452 | } |
457 | 453 | ||
diff --git a/legacy/ecore/src/lib/ecore_file/Ecore_File.h b/legacy/ecore/src/lib/ecore_file/Ecore_File.h index 03c2355f22..5bb8f0b1da 100644 --- a/legacy/ecore/src/lib/ecore_file/Ecore_File.h +++ b/legacy/ecore/src/lib/ecore_file/Ecore_File.h | |||
@@ -84,7 +84,7 @@ extern "C" { | |||
84 | EAPI int ecore_file_can_write (const char *file); | 84 | EAPI int ecore_file_can_write (const char *file); |
85 | EAPI int ecore_file_can_exec (const char *file); | 85 | EAPI int ecore_file_can_exec (const char *file); |
86 | EAPI char *ecore_file_readlink (const char *link); | 86 | EAPI char *ecore_file_readlink (const char *link); |
87 | EAPI Ecore_List *ecore_file_ls (const char *dir); | 87 | EAPI Eina_List *ecore_file_ls (const char *dir); |
88 | EAPI char *ecore_file_app_exe_get (const char *app); | 88 | EAPI char *ecore_file_app_exe_get (const char *app); |
89 | EAPI char *ecore_file_escape_name (const char *filename); | 89 | EAPI char *ecore_file_escape_name (const char *filename); |
90 | EAPI char *ecore_file_strip_ext (const char *file); | 90 | EAPI char *ecore_file_strip_ext (const char *file); |
@@ -100,7 +100,7 @@ extern "C" { | |||
100 | 100 | ||
101 | EAPI int ecore_file_path_dir_exists(const char *in_dir); | 101 | EAPI int ecore_file_path_dir_exists(const char *in_dir); |
102 | EAPI int ecore_file_app_installed(const char *exe); | 102 | EAPI int ecore_file_app_installed(const char *exe); |
103 | EAPI Ecore_List *ecore_file_app_list(void); | 103 | EAPI Eina_List *ecore_file_app_list(void); |
104 | 104 | ||
105 | EAPI int ecore_file_download(const char *url, const char *dst, | 105 | EAPI int ecore_file_download(const char *url, const char *dst, |
106 | void (*completion_cb)(void *data, | 106 | void (*completion_cb)(void *data, |
diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file.c b/legacy/ecore/src/lib/ecore_file/ecore_file.c index eb3f4f0982..6efe5e0502 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file.c | |||
@@ -509,36 +509,32 @@ ecore_file_readlink(const char *link) | |||
509 | * For more information see the manual pages of strcoll and setlocale. | 509 | * For more information see the manual pages of strcoll and setlocale. |
510 | * The list will not contain the directory entries for '.' and '..'. | 510 | * The list will not contain the directory entries for '.' and '..'. |
511 | * @param dir The name of the directory to list | 511 | * @param dir The name of the directory to list |
512 | * @return Return an Ecore_List containing all the files in the directory; | 512 | * @return Return an Eina_List containing all the files in the directory; |
513 | * on failure it returns NULL. | 513 | * on failure it returns NULL. |
514 | */ | 514 | */ |
515 | EAPI Ecore_List * | 515 | EAPI Eina_List * |
516 | ecore_file_ls(const char *dir) | 516 | ecore_file_ls(const char *dir) |
517 | { | 517 | { |
518 | char *f; | 518 | char *f; |
519 | DIR *dirp; | 519 | DIR *dirp; |
520 | struct dirent *dp; | 520 | struct dirent *dp; |
521 | Ecore_List *list; | 521 | Eina_List *list = NULL; |
522 | 522 | ||
523 | dirp = opendir(dir); | 523 | dirp = opendir(dir); |
524 | if (!dirp) return NULL; | 524 | if (!dirp) return NULL; |
525 | 525 | ||
526 | list = ecore_list_new(); | ||
527 | ecore_list_free_cb_set(list, free); | ||
528 | |||
529 | while ((dp = readdir(dirp))) | 526 | while ((dp = readdir(dirp))) |
530 | { | 527 | { |
531 | if ((strcmp(dp->d_name, ".")) && (strcmp(dp->d_name, ".."))) | 528 | if ((strcmp(dp->d_name, ".")) && (strcmp(dp->d_name, ".."))) |
532 | { | 529 | { |
533 | f = strdup(dp->d_name); | 530 | f = strdup(dp->d_name); |
534 | ecore_list_append(list, f); | 531 | list = eina_list_append(list, f); |
535 | } | 532 | } |
536 | } | 533 | } |
537 | closedir(dirp); | 534 | closedir(dirp); |
538 | 535 | ||
539 | ecore_list_sort(list, ECORE_COMPARE_CB(strcoll), ECORE_SORT_MIN); | 536 | list = eina_list_sort(list, ECORE_SORT_MIN, ECORE_COMPARE_CB(strcoll)); |
540 | 537 | ||
541 | ecore_list_first_goto(list); | ||
542 | return list; | 538 | return list; |
543 | } | 539 | } |
544 | 540 | ||
diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file_download.c b/legacy/ecore/src/lib/ecore_file/ecore_file_download.c index 4506f72f7f..c855c7135e 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file_download.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file_download.c | |||
@@ -45,7 +45,7 @@ static void _ecore_file_download_abort(Ecore_File_Download_Job *job); | |||
45 | static int init = 0; | 45 | static int init = 0; |
46 | static Ecore_Event_Handler *_url_complete_handler = NULL; | 46 | static Ecore_Event_Handler *_url_complete_handler = NULL; |
47 | static Ecore_Event_Handler *_url_progress_download = NULL; | 47 | static Ecore_Event_Handler *_url_progress_download = NULL; |
48 | static Ecore_List *_job_list; | 48 | static Eina_List *_job_list; |
49 | 49 | ||
50 | EAPI int | 50 | EAPI int |
51 | ecore_file_download_init(void) | 51 | ecore_file_download_init(void) |
@@ -60,11 +60,6 @@ ecore_file_download_init(void) | |||
60 | _url_progress_download = ecore_event_handler_add(ECORE_CON_EVENT_URL_PROGRESS, _ecore_file_download_url_progress_cb, NULL); | 60 | _url_progress_download = ecore_event_handler_add(ECORE_CON_EVENT_URL_PROGRESS, _ecore_file_download_url_progress_cb, NULL); |
61 | #endif | 61 | #endif |
62 | } | 62 | } |
63 | if (!_job_list) | ||
64 | { | ||
65 | _job_list = ecore_list_new(); | ||
66 | if (!_job_list) return 0; | ||
67 | } | ||
68 | 63 | ||
69 | return 1; | 64 | return 1; |
70 | #else | 65 | #else |
@@ -84,9 +79,7 @@ ecore_file_download_shutdown(void) | |||
84 | ecore_event_handler_del(_url_progress_download); | 79 | ecore_event_handler_del(_url_progress_download); |
85 | _url_complete_handler = NULL; | 80 | _url_complete_handler = NULL; |
86 | _url_progress_download = NULL; | 81 | _url_progress_download = NULL; |
87 | if (_job_list) | 82 | ecore_file_download_abort_all(); |
88 | ecore_list_destroy(_job_list); | ||
89 | _job_list = NULL; | ||
90 | } | 83 | } |
91 | 84 | ||
92 | return ecore_con_url_shutdown(); | 85 | return ecore_con_url_shutdown(); |
@@ -98,16 +91,10 @@ ecore_file_download_shutdown(void) | |||
98 | EAPI void | 91 | EAPI void |
99 | ecore_file_download_abort_all(void) | 92 | ecore_file_download_abort_all(void) |
100 | { | 93 | { |
101 | if (!ecore_list_empty_is(_job_list)) | ||
102 | { | ||
103 | Ecore_File_Download_Job *job; | 94 | Ecore_File_Download_Job *job; |
104 | 95 | ||
105 | while ((job = ecore_list_first_remove(_job_list))) | 96 | EINA_LIST_FREE(_job_list, job) |
106 | { | ||
107 | _ecore_file_download_abort(job); | 97 | _ecore_file_download_abort(job); |
108 | } | ||
109 | } | ||
110 | ecore_list_clear(_job_list); | ||
111 | } | 98 | } |
112 | 99 | ||
113 | /** | 100 | /** |
@@ -212,10 +199,10 @@ _ecore_file_download_url_complete_cb(void *data, int type, void *event) | |||
212 | Ecore_Con_Event_Url_Complete *ev = event; | 199 | Ecore_Con_Event_Url_Complete *ev = event; |
213 | Ecore_File_Download_Job *job; | 200 | Ecore_File_Download_Job *job; |
214 | 201 | ||
215 | job = ecore_list_find(_job_list, _ecore_file_download_url_compare_job, ev->url_con); | 202 | job = eina_list_search_unsorted(_job_list, _ecore_file_download_url_compare_job, ev->url_con); |
216 | if (!ECORE_MAGIC_CHECK(job, ECORE_MAGIC_FILE_DOWNLOAD_JOB)) return 1; | 203 | if (!ECORE_MAGIC_CHECK(job, ECORE_MAGIC_FILE_DOWNLOAD_JOB)) return 1; |
217 | 204 | ||
218 | ecore_list_remove(_job_list); | 205 | _job_list = eina_list_remove(_job_list, job); |
219 | 206 | ||
220 | if (job->completion_cb) | 207 | if (job->completion_cb) |
221 | job->completion_cb(ecore_con_url_data_get(job->url_con), job->dst, !ev->status); | 208 | job->completion_cb(ecore_con_url_data_get(job->url_con), job->dst, !ev->status); |
@@ -233,7 +220,7 @@ _ecore_file_download_url_progress_cb(void *data, int type, void *event) | |||
233 | Ecore_Con_Event_Url_Progress *ev = event; | 220 | Ecore_Con_Event_Url_Progress *ev = event; |
234 | Ecore_File_Download_Job *job; | 221 | Ecore_File_Download_Job *job; |
235 | 222 | ||
236 | job = ecore_list_find(_job_list, _ecore_file_download_url_compare_job, ev->url_con); | 223 | job = eina_list_search_unsorted(_job_list, _ecore_file_download_url_compare_job, ev->url_con); |
237 | if (!ECORE_MAGIC_CHECK(job, ECORE_MAGIC_FILE_DOWNLOAD_JOB)) return 1; | 224 | if (!ECORE_MAGIC_CHECK(job, ECORE_MAGIC_FILE_DOWNLOAD_JOB)) return 1; |
238 | 225 | ||
239 | if (job->progress_cb) | 226 | if (job->progress_cb) |
@@ -241,7 +228,7 @@ _ecore_file_download_url_progress_cb(void *data, int type, void *event) | |||
241 | (long int) ev->down.total, (long int) ev->down.now, | 228 | (long int) ev->down.total, (long int) ev->down.now, |
242 | (long int) ev->up.total, (long int) ev->up.now) != 0) | 229 | (long int) ev->up.total, (long int) ev->up.now) != 0) |
243 | { | 230 | { |
244 | ecore_list_remove(_job_list); | 231 | _job_list = eina_list_remove(_job_list, job); |
245 | _ecore_file_download_abort(job); | 232 | _ecore_file_download_abort(job); |
246 | } | 233 | } |
247 | 234 | ||
@@ -285,7 +272,7 @@ _ecore_file_download_curl(const char *url, const char *dst, | |||
285 | 272 | ||
286 | job->completion_cb = completion_cb; | 273 | job->completion_cb = completion_cb; |
287 | job->progress_cb = progress_cb; | 274 | job->progress_cb = progress_cb; |
288 | ecore_list_append(_job_list, job); | 275 | _job_list = eina_list_append(_job_list, job); |
289 | 276 | ||
290 | ecore_con_url_send(job->url_con, NULL, 0, NULL); | 277 | ecore_con_url_send(job->url_con, NULL, 0, NULL); |
291 | 278 | ||
diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file_monitor_poll.c b/legacy/ecore/src/lib/ecore_file/ecore_file_monitor_poll.c index 6573539dc1..76bdc702ea 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file_monitor_poll.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file_monitor_poll.c | |||
@@ -117,29 +117,28 @@ ecore_file_monitor_poll_add(const char *path, | |||
117 | if (ecore_file_is_dir(em->path)) | 117 | if (ecore_file_is_dir(em->path)) |
118 | { | 118 | { |
119 | /* Check for subdirs */ | 119 | /* Check for subdirs */ |
120 | Ecore_List *files; | 120 | Eina_List *files; |
121 | char *file; | 121 | char *file; |
122 | 122 | ||
123 | files = ecore_file_ls(em->path); | 123 | files = ecore_file_ls(em->path); |
124 | if (files) | 124 | EINA_LIST_FREE(files, file) |
125 | { | ||
126 | while ((file = ecore_list_next(files))) | ||
127 | { | 125 | { |
128 | Ecore_File *f; | 126 | Ecore_File *f; |
129 | char buf[PATH_MAX]; | 127 | char buf[PATH_MAX]; |
130 | 128 | ||
131 | f = calloc(1, sizeof(Ecore_File)); | 129 | f = calloc(1, sizeof(Ecore_File)); |
132 | if (!f) | 130 | if (!f) |
131 | { | ||
132 | free(file); | ||
133 | continue; | 133 | continue; |
134 | } | ||
134 | 135 | ||
135 | snprintf(buf, sizeof(buf), "%s/%s", em->path, file); | 136 | snprintf(buf, sizeof(buf), "%s/%s", em->path, file); |
136 | f->name = strdup(file); | 137 | f->name = file; |
137 | f->mtime = ecore_file_mod_time(buf); | 138 | f->mtime = ecore_file_mod_time(buf); |
138 | f->is_dir = ecore_file_is_dir(buf); | 139 | f->is_dir = ecore_file_is_dir(buf); |
139 | em->files = _ecore_list2_append(em->files, f); | 140 | em->files = _ecore_list2_append(em->files, f); |
140 | } | 141 | } |
141 | ecore_list_destroy(files); | ||
142 | } | ||
143 | } | 142 | } |
144 | } | 143 | } |
145 | else | 144 | else |
@@ -307,7 +306,8 @@ _ecore_file_monitor_poll_check(Ecore_File_Monitor *em) | |||
307 | /* Check for new files */ | 306 | /* Check for new files */ |
308 | if (ECORE_FILE_MONITOR_POLL(em)->mtime < mtime) | 307 | if (ECORE_FILE_MONITOR_POLL(em)->mtime < mtime) |
309 | { | 308 | { |
310 | Ecore_List *files; | 309 | Eina_List *files; |
310 | Eina_List *l; | ||
311 | char *file; | 311 | char *file; |
312 | 312 | ||
313 | /* Files have been added or removed */ | 313 | /* Files have been added or removed */ |
@@ -315,7 +315,7 @@ _ecore_file_monitor_poll_check(Ecore_File_Monitor *em) | |||
315 | if (files) | 315 | if (files) |
316 | { | 316 | { |
317 | /* Are we a directory? We should check first, rather than rely on null here*/ | 317 | /* Are we a directory? We should check first, rather than rely on null here*/ |
318 | while ((file = ecore_list_next(files))) | 318 | EINA_LIST_FOREACH(files, l, file) |
319 | { | 319 | { |
320 | Ecore_File *f; | 320 | Ecore_File *f; |
321 | char buf[PATH_MAX]; | 321 | char buf[PATH_MAX]; |
@@ -331,7 +331,7 @@ _ecore_file_monitor_poll_check(Ecore_File_Monitor *em) | |||
331 | 331 | ||
332 | f->name = strdup(file); | 332 | f->name = strdup(file); |
333 | f->mtime = ecore_file_mod_time(buf); | 333 | f->mtime = ecore_file_mod_time(buf); |
334 | f->is_dir = ecore_file_is_dir(buf); | 334 | f->is_dir = ecore_file_mod_time(buf); |
335 | if (f->is_dir) | 335 | if (f->is_dir) |
336 | event = ECORE_FILE_EVENT_CREATED_DIRECTORY; | 336 | event = ECORE_FILE_EVENT_CREATED_DIRECTORY; |
337 | else | 337 | else |
@@ -339,7 +339,12 @@ _ecore_file_monitor_poll_check(Ecore_File_Monitor *em) | |||
339 | em->func(em->data, em, event, buf); | 339 | em->func(em->data, em, event, buf); |
340 | em->files = _ecore_list2_append(em->files, f); | 340 | em->files = _ecore_list2_append(em->files, f); |
341 | } | 341 | } |
342 | ecore_list_destroy(files); | 342 | while (files) |
343 | { | ||
344 | file = eina_list_data_get(files); | ||
345 | free(file); | ||
346 | files = eina_list_remove_list(files, files); | ||
347 | } | ||
343 | } | 348 | } |
344 | 349 | ||
345 | if (!ecore_file_is_dir(em->path)) | 350 | if (!ecore_file_is_dir(em->path)) |
diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file_path.c b/legacy/ecore/src/lib/ecore_file/ecore_file_path.c index de2b4dc4d4..dd1e95f0ec 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file_path.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file_path.c | |||
@@ -12,36 +12,35 @@ | |||
12 | #include "ecore_file_private.h" | 12 | #include "ecore_file_private.h" |
13 | 13 | ||
14 | static int init = 0; | 14 | static int init = 0; |
15 | static Ecore_List *__ecore_file_path_bin = NULL; | 15 | static Eina_List *__ecore_file_path_bin = NULL; |
16 | 16 | ||
17 | static Ecore_List *_ecore_file_path_from_env(const char *env); | 17 | static Eina_List *_ecore_file_path_from_env(const char *env); |
18 | 18 | ||
19 | int | 19 | int |
20 | ecore_file_path_init(void) | 20 | ecore_file_path_init(void) |
21 | { | 21 | { |
22 | if (++init != 1) return init; | 22 | if (++init != 1) return init; |
23 | __ecore_file_path_bin = _ecore_file_path_from_env("PATH"); | 23 | __ecore_file_path_bin = _ecore_file_path_from_env("PATH"); |
24 | ecore_list_free_cb_set(__ecore_file_path_bin, free); | ||
25 | return init; | 24 | return init; |
26 | } | 25 | } |
27 | 26 | ||
28 | int | 27 | int |
29 | ecore_file_path_shutdown(void) | 28 | ecore_file_path_shutdown(void) |
30 | { | 29 | { |
30 | char *dir; | ||
31 | |||
31 | if (--init != 0) return init; | 32 | if (--init != 0) return init; |
32 | ecore_list_destroy(__ecore_file_path_bin); | 33 | EINA_LIST_FREE(__ecore_file_path_bin, dir) |
33 | __ecore_file_path_bin = NULL; | 34 | free(dir); |
34 | return init; | 35 | return init; |
35 | } | 36 | } |
36 | 37 | ||
37 | Ecore_List * | 38 | Eina_List * |
38 | _ecore_file_path_from_env(const char *env) | 39 | _ecore_file_path_from_env(const char *env) |
39 | { | 40 | { |
40 | Ecore_List *path; | 41 | Eina_List *path = NULL; |
41 | char *env_path, *p, *last; | 42 | char *env_path, *p, *last; |
42 | 43 | ||
43 | path = ecore_list_new(); | ||
44 | |||
45 | env_path = getenv(env); | 44 | env_path = getenv(env); |
46 | if (!env_path) | 45 | if (!env_path) |
47 | return path; | 46 | return path; |
@@ -56,12 +55,12 @@ _ecore_file_path_from_env(const char *env) | |||
56 | if (!*p) | 55 | if (!*p) |
57 | { | 56 | { |
58 | if (!ecore_file_path_dir_exists(last)) | 57 | if (!ecore_file_path_dir_exists(last)) |
59 | ecore_list_append(path, strdup(last)); | 58 | path = eina_list_append(path, strdup(last)); |
60 | last = p + 1; | 59 | last = p + 1; |
61 | } | 60 | } |
62 | } | 61 | } |
63 | if (p > last) | 62 | if (p > last) |
64 | ecore_list_append(path, strdup(last)); | 63 | path = eina_list_append(path, strdup(last)); |
65 | 64 | ||
66 | free(env_path); | 65 | free(env_path); |
67 | return path; | 66 | return path; |
@@ -75,14 +74,16 @@ _ecore_file_path_from_env(const char *env) | |||
75 | EAPI int | 74 | EAPI int |
76 | ecore_file_path_dir_exists(const char *in_dir) | 75 | ecore_file_path_dir_exists(const char *in_dir) |
77 | { | 76 | { |
77 | Eina_List *l; | ||
78 | char *dir; | 78 | char *dir; |
79 | 79 | ||
80 | if (!__ecore_file_path_bin) return 0; | 80 | if (!__ecore_file_path_bin) return 0; |
81 | ecore_list_first_goto(__ecore_file_path_bin); | 81 | EINA_LIST_FOREACH(__ecore_file_path_bin, l, dir) |
82 | while ((dir = ecore_list_next(__ecore_file_path_bin)) != NULL) | ||
83 | { | 82 | { |
84 | if (!strcmp(dir, in_dir)) return 1; | 83 | if (strcmp(dir, in_dir)) |
84 | return 1; | ||
85 | } | 85 | } |
86 | |||
86 | return 0; | 87 | return 0; |
87 | } | 88 | } |
88 | 89 | ||
@@ -96,50 +97,47 @@ ecore_file_path_dir_exists(const char *in_dir) | |||
96 | EAPI int | 97 | EAPI int |
97 | ecore_file_app_installed(const char *exe) | 98 | ecore_file_app_installed(const char *exe) |
98 | { | 99 | { |
100 | Eina_List *l; | ||
99 | char *dir; | 101 | char *dir; |
100 | char buf[PATH_MAX]; | 102 | char buf[PATH_MAX]; |
101 | 103 | ||
102 | if (!exe) return 0; | 104 | if (!exe) return 0; |
103 | if (ecore_file_can_exec(exe)) return 1; | 105 | if (ecore_file_can_exec(exe)) return 1; |
104 | 106 | ||
105 | ecore_list_first_goto(__ecore_file_path_bin); | 107 | EINA_LIST_FOREACH(__ecore_file_path_bin, l, dir) |
106 | while ((dir = ecore_list_next(__ecore_file_path_bin)) != NULL) | ||
107 | { | 108 | { |
108 | snprintf(buf, sizeof(buf), "%s/%s", dir, exe); | 109 | snprintf(buf, sizeof(buf), "%s/%s", dir, exe); |
109 | if (ecore_file_can_exec(buf)) return 1; | 110 | if (ecore_file_can_exec(buf)) |
111 | return 1; | ||
110 | } | 112 | } |
113 | |||
111 | return 0; | 114 | return 0; |
112 | } | 115 | } |
113 | 116 | ||
114 | /** | 117 | /** |
115 | * Get a list of all the applications installed on the system | 118 | * Get a list of all the applications installed on the system |
116 | * @return An Ecore_List containing all the executable files in the system | 119 | * @return An Eina_List containing all the executable files in the system |
117 | */ | 120 | */ |
118 | EAPI Ecore_List * | 121 | EAPI Eina_List * |
119 | ecore_file_app_list(void) | 122 | ecore_file_app_list(void) |
120 | { | 123 | { |
121 | Ecore_List *list, *files; | 124 | Eina_List *list = NULL; |
125 | Eina_List *files; | ||
126 | Eina_List *l; | ||
122 | char buf[PATH_MAX], *dir, *exe; | 127 | char buf[PATH_MAX], *dir, *exe; |
123 | 128 | ||
124 | list = ecore_list_new(); | 129 | EINA_LIST_FOREACH(__ecore_file_path_bin, l, dir) |
125 | if (!list) return NULL; | ||
126 | ecore_list_free_cb_set(list, free); | ||
127 | ecore_list_first_goto(__ecore_file_path_bin); | ||
128 | while ((dir = ecore_list_next(__ecore_file_path_bin)) != NULL) | ||
129 | { | 130 | { |
130 | files = ecore_file_ls(dir); | 131 | files = ecore_file_ls(dir); |
131 | if (files) | 132 | EINA_LIST_FREE(files, exe) |
132 | { | ||
133 | ecore_list_first_goto(files); | ||
134 | while ((exe = ecore_list_next(files)) != NULL) | ||
135 | { | 133 | { |
136 | snprintf(buf, sizeof(buf), "%s/%s", dir, exe); | 134 | snprintf(buf, sizeof(buf), "%s/%s", dir, exe); |
137 | if ((ecore_file_can_exec(buf)) && | 135 | if ((ecore_file_can_exec(buf)) && |
138 | (!ecore_file_is_dir(buf))) | 136 | (!ecore_file_is_dir(buf))) |
139 | ecore_list_append(list, strdup(buf)); | 137 | list = eina_list_append(list, strdup(buf)); |
140 | } | 138 | free(exe); |
141 | ecore_list_destroy(files); | ||
142 | } | 139 | } |
143 | } | 140 | } |
141 | |||
144 | return list; | 142 | return list; |
145 | } | 143 | } |
diff --git a/legacy/ecore/src/lib/ecore_imf/Ecore_IMF.h b/legacy/ecore/src/lib/ecore_imf/Ecore_IMF.h index 71f890f27c..1ae870846f 100644 --- a/legacy/ecore/src/lib/ecore_imf/Ecore_IMF.h +++ b/legacy/ecore/src/lib/ecore_imf/Ecore_IMF.h | |||
@@ -294,8 +294,8 @@ extern "C" { | |||
294 | EAPI int ecore_imf_init(void); | 294 | EAPI int ecore_imf_init(void); |
295 | EAPI int ecore_imf_shutdown(void); | 295 | EAPI int ecore_imf_shutdown(void); |
296 | 296 | ||
297 | EAPI Ecore_List *ecore_imf_context_available_ids_get(void); | 297 | EAPI Eina_List *ecore_imf_context_available_ids_get(void); |
298 | EAPI Ecore_List *ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type); | 298 | EAPI Eina_List *ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type); |
299 | EAPI const char *ecore_imf_context_default_id_get(void); | 299 | EAPI const char *ecore_imf_context_default_id_get(void); |
300 | EAPI const char *ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type); | 300 | EAPI const char *ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type); |
301 | EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_by_id_get(const char *id); | 301 | EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_by_id_get(const char *id); |
diff --git a/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c b/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c index 827b794ec1..d8b7ce1104 100644 --- a/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c +++ b/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c | |||
@@ -24,20 +24,20 @@ | |||
24 | /** | 24 | /** |
25 | * Get the list of the available Input Method Context ids. | 25 | * Get the list of the available Input Method Context ids. |
26 | * | 26 | * |
27 | * Note that the caller is responsible for freeing the Ecore_List | 27 | * Note that the caller is responsible for freeing the Eina_List |
28 | * when finished with it. There is no need to finish the list strings. | 28 | * when finished with it. There is no need to finish the list strings. |
29 | * | 29 | * |
30 | * @return Return an Ecore_List of strings; | 30 | * @return Return an EIna_List of strings; |
31 | * on failure it returns NULL. | 31 | * on failure it returns NULL. |
32 | * @ingroup Ecore_IMF_Context_Group | 32 | * @ingroup Ecore_IMF_Context_Group |
33 | */ | 33 | */ |
34 | EAPI Ecore_List * | 34 | EAPI Eina_List * |
35 | ecore_imf_context_available_ids_get(void) | 35 | ecore_imf_context_available_ids_get(void) |
36 | { | 36 | { |
37 | return ecore_imf_module_context_ids_get(); | 37 | return ecore_imf_module_context_ids_get(); |
38 | } | 38 | } |
39 | 39 | ||
40 | EAPI Ecore_List * | 40 | EAPI Eina_List * |
41 | ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type) | 41 | ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type) |
42 | { | 42 | { |
43 | return ecore_imf_module_context_ids_by_canvas_type_get(canvas_type); | 43 | return ecore_imf_module_context_ids_by_canvas_type_get(canvas_type); |
@@ -85,7 +85,7 @@ EAPI const char * | |||
85 | ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type) | 85 | ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type) |
86 | { | 86 | { |
87 | const char *id; | 87 | const char *id; |
88 | Ecore_List *modules; | 88 | Eina_List *modules; |
89 | Ecore_IMF_Module *module; | 89 | Ecore_IMF_Module *module; |
90 | char *locale; | 90 | char *locale; |
91 | char *tmp; | 91 | char *tmp; |
@@ -113,8 +113,7 @@ ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type) | |||
113 | 113 | ||
114 | id = NULL; | 114 | id = NULL; |
115 | 115 | ||
116 | ecore_list_first_goto(modules); | 116 | EINA_LIST_FREE(modules, module) |
117 | while ((module = ecore_list_next(modules))) | ||
118 | { | 117 | { |
119 | if (canvas_type && | 118 | if (canvas_type && |
120 | strcmp(module->info->canvas_type, canvas_type) == 0) | 119 | strcmp(module->info->canvas_type, canvas_type) == 0) |
@@ -135,7 +134,6 @@ ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type) | |||
135 | p = q ? q + 1 : NULL; | 134 | p = q ? q + 1 : NULL; |
136 | } | 135 | } |
137 | } | 136 | } |
138 | ecore_list_destroy(modules); | ||
139 | 137 | ||
140 | free(locale); | 138 | free(locale); |
141 | return id; | 139 | return id; |
diff --git a/legacy/ecore/src/lib/ecore_imf/ecore_imf_module.c b/legacy/ecore/src/lib/ecore_imf/ecore_imf_module.c index 78de2dc98e..07fd849168 100644 --- a/legacy/ecore/src/lib/ecore_imf/ecore_imf_module.c +++ b/legacy/ecore/src/lib/ecore_imf/ecore_imf_module.c | |||
@@ -66,33 +66,25 @@ ecore_imf_module_shutdown(void) | |||
66 | static Eina_Bool | 66 | static Eina_Bool |
67 | _hash_module_available_get(const Eina_Hash *hash, int *data, void *list) | 67 | _hash_module_available_get(const Eina_Hash *hash, int *data, void *list) |
68 | { | 68 | { |
69 | ecore_list_append(list, data); | 69 | *(Eina_List**)list = eina_list_append(*(Eina_List**)list, data); |
70 | return EINA_TRUE; | 70 | return EINA_TRUE; |
71 | } | 71 | } |
72 | 72 | ||
73 | Ecore_List * | 73 | Eina_List * |
74 | ecore_imf_module_available_get(void) | 74 | ecore_imf_module_available_get(void) |
75 | { | 75 | { |
76 | Ecore_List *values; | 76 | Eina_List *values = NULL; |
77 | Eina_Iterator *it = NULL; | 77 | Eina_Iterator *it = NULL; |
78 | 78 | ||
79 | if (!modules) return NULL; | 79 | if (!modules) return NULL; |
80 | 80 | ||
81 | values = ecore_list_new(); | ||
82 | if (!values) return NULL; | ||
83 | |||
84 | it = eina_hash_iterator_data_new(modules); | 81 | it = eina_hash_iterator_data_new(modules); |
85 | if (!it) | 82 | if (!it) |
86 | { | ||
87 | ecore_list_destroy(values); | ||
88 | return NULL; | 83 | return NULL; |
89 | } | ||
90 | 84 | ||
91 | eina_iterator_foreach(it, EINA_EACH(_hash_module_available_get), values); | 85 | eina_iterator_foreach(it, EINA_EACH(_hash_module_available_get), &values); |
92 | eina_iterator_free(it); | 86 | eina_iterator_free(it); |
93 | 87 | ||
94 | ecore_list_first_goto(values); | ||
95 | |||
96 | return values; | 88 | return values; |
97 | } | 89 | } |
98 | 90 | ||
@@ -128,29 +120,23 @@ ecore_imf_module_context_create(const char *ctx_id) | |||
128 | static Eina_Bool | 120 | static Eina_Bool |
129 | _hash_ids_get(const Eina_Hash *hash, const char *key, void *list) | 121 | _hash_ids_get(const Eina_Hash *hash, const char *key, void *list) |
130 | { | 122 | { |
131 | ecore_list_append(list, key); | 123 | *(Eina_List**)list = eina_list_append(*(Eina_List**)list, key); |
132 | return EINA_TRUE; | 124 | return EINA_TRUE; |
133 | } | 125 | } |
134 | 126 | ||
135 | Ecore_List * | 127 | Eina_List * |
136 | ecore_imf_module_context_ids_get(void) | 128 | ecore_imf_module_context_ids_get(void) |
137 | { | 129 | { |
138 | Ecore_List *l = NULL; | 130 | Eina_List *l = NULL; |
139 | Eina_Iterator *it = NULL; | 131 | Eina_Iterator *it = NULL; |
140 | 132 | ||
141 | if (!modules) return NULL; | 133 | if (!modules) return NULL; |
142 | 134 | ||
143 | l = ecore_list_new(); | ||
144 | if (!l) return NULL; | ||
145 | |||
146 | it = eina_hash_iterator_key_new(modules); | 135 | it = eina_hash_iterator_key_new(modules); |
147 | if (!it) | 136 | if (!it) |
148 | { | ||
149 | ecore_list_destroy(l); | ||
150 | return NULL; | 137 | return NULL; |
151 | } | ||
152 | 138 | ||
153 | eina_iterator_foreach(it, EINA_EACH(_hash_ids_get), l); | 139 | eina_iterator_foreach(it, EINA_EACH(_hash_ids_get), &l); |
154 | eina_iterator_free(it); | 140 | eina_iterator_free(it); |
155 | 141 | ||
156 | return l; | 142 | return l; |
@@ -163,16 +149,16 @@ _hash_ids_by_canvas_type_get(const Eina_Hash *hash, void *data, void *fdata) | |||
163 | Ecore_IMF_Selector *selector = fdata; | 149 | Ecore_IMF_Selector *selector = fdata; |
164 | 150 | ||
165 | if (!strcmp(module->info->canvas_type, selector->toselect)) | 151 | if (!strcmp(module->info->canvas_type, selector->toselect)) |
166 | ecore_list_append(selector->selected, (void *)module->info->id); | 152 | selector->selected = eina_list_append(selector->selected, (void *)module->info->id); |
167 | 153 | ||
168 | return EINA_TRUE; | 154 | return EINA_TRUE; |
169 | } | 155 | } |
170 | 156 | ||
171 | Ecore_List * | 157 | Eina_List * |
172 | ecore_imf_module_context_ids_by_canvas_type_get(const char *canvas_type) | 158 | ecore_imf_module_context_ids_by_canvas_type_get(const char *canvas_type) |
173 | { | 159 | { |
174 | Ecore_IMF_Selector selector; | 160 | Ecore_IMF_Selector selector; |
175 | Ecore_List *values; | 161 | Eina_List *values = NULL; |
176 | Eina_Iterator *it = NULL; | 162 | Eina_Iterator *it = NULL; |
177 | 163 | ||
178 | if (!modules) return NULL; | 164 | if (!modules) return NULL; |
@@ -180,30 +166,22 @@ ecore_imf_module_context_ids_by_canvas_type_get(const char *canvas_type) | |||
180 | if (!canvas_type) | 166 | if (!canvas_type) |
181 | return ecore_imf_module_context_ids_get(); | 167 | return ecore_imf_module_context_ids_get(); |
182 | 168 | ||
183 | values = ecore_list_new(); | ||
184 | if (!values) return NULL; | ||
185 | |||
186 | it = eina_hash_iterator_data_new(modules); | 169 | it = eina_hash_iterator_data_new(modules); |
187 | if (!it) | 170 | if (!it) |
188 | { | ||
189 | ecore_list_destroy(values); | ||
190 | return NULL; | 171 | return NULL; |
191 | } | ||
192 | 172 | ||
193 | selector.toselect = canvas_type; | 173 | selector.toselect = canvas_type; |
194 | selector.selected = values; | 174 | selector.selected = values; |
195 | eina_iterator_foreach(it, EINA_EACH(_hash_ids_by_canvas_type_get), &selector); | 175 | eina_iterator_foreach(it, EINA_EACH(_hash_ids_by_canvas_type_get), &selector); |
196 | eina_iterator_free(it); | 176 | eina_iterator_free(it); |
197 | 177 | ||
198 | ecore_list_first_goto(values); | ||
199 | |||
200 | return values; | 178 | return values; |
201 | } | 179 | } |
202 | 180 | ||
203 | static void | 181 | static void |
204 | _ecore_imf_module_load_all(void) | 182 | _ecore_imf_module_load_all(void) |
205 | { | 183 | { |
206 | Ecore_List *avail; | 184 | Eina_List *avail; |
207 | char *filename; | 185 | char *filename; |
208 | Ecore_Plugin *plugin; | 186 | Ecore_Plugin *plugin; |
209 | const Ecore_IMF_Context_Info *info = NULL; | 187 | const Ecore_IMF_Context_Info *info = NULL; |
@@ -213,8 +191,7 @@ _ecore_imf_module_load_all(void) | |||
213 | avail = ecore_plugin_available_get(ecore_imf_modules_path); | 191 | avail = ecore_plugin_available_get(ecore_imf_modules_path); |
214 | if (!avail) return; | 192 | if (!avail) return; |
215 | 193 | ||
216 | ecore_list_first_goto(avail); | 194 | EINA_LIST_FREE(avail, filename) |
217 | while ((filename = ecore_list_next(avail))) | ||
218 | { | 195 | { |
219 | plugin = ecore_plugin_load(ecore_imf_modules_path, filename, NULL); | 196 | plugin = ecore_plugin_load(ecore_imf_modules_path, filename, NULL); |
220 | if (!plugin) | 197 | if (!plugin) |
@@ -255,8 +232,6 @@ _ecore_imf_module_load_all(void) | |||
255 | 232 | ||
256 | _ecore_imf_module_append(plugin, info, imf_module_create); | 233 | _ecore_imf_module_append(plugin, info, imf_module_create); |
257 | } | 234 | } |
258 | |||
259 | ecore_list_destroy(avail); | ||
260 | } | 235 | } |
261 | 236 | ||
262 | static void | 237 | static void |
@@ -267,7 +242,7 @@ _ecore_imf_module_append(Ecore_Plugin *plugin, | |||
267 | Ecore_IMF_Module *module; | 242 | Ecore_IMF_Module *module; |
268 | 243 | ||
269 | if (!modules) | 244 | if (!modules) |
270 | modules = eina_hash_string_superfast_new(_ecore_imf_module_free); | 245 | modules = eina_hash_string_superfast_new(EINA_FREE_CB(_ecore_imf_module_free)); |
271 | 246 | ||
272 | module = malloc(sizeof(Ecore_IMF_Module)); | 247 | module = malloc(sizeof(Ecore_IMF_Module)); |
273 | module->plugin = plugin; | 248 | module->plugin = plugin; |
diff --git a/legacy/ecore/src/lib/ecore_imf/ecore_imf_private.h b/legacy/ecore/src/lib/ecore_imf/ecore_imf_private.h index dd951e2c89..e6812e7866 100644 --- a/legacy/ecore/src/lib/ecore_imf/ecore_imf_private.h +++ b/legacy/ecore/src/lib/ecore_imf/ecore_imf_private.h | |||
@@ -29,10 +29,10 @@ struct _Ecore_IMF_Module | |||
29 | 29 | ||
30 | void ecore_imf_module_init(void); | 30 | void ecore_imf_module_init(void); |
31 | void ecore_imf_module_shutdown(void); | 31 | void ecore_imf_module_shutdown(void); |
32 | Ecore_List *ecore_imf_module_available_get(void); | 32 | Eina_List *ecore_imf_module_available_get(void); |
33 | Ecore_IMF_Module *ecore_imf_module_get(const char *ctx_id); | 33 | Ecore_IMF_Module *ecore_imf_module_get(const char *ctx_id); |
34 | Ecore_IMF_Context *ecore_imf_module_context_create(const char *ctx_id); | 34 | Ecore_IMF_Context *ecore_imf_module_context_create(const char *ctx_id); |
35 | Ecore_List *ecore_imf_module_context_ids_get(void); | 35 | Eina_List *ecore_imf_module_context_ids_get(void); |
36 | Ecore_List *ecore_imf_module_context_ids_by_canvas_type_get(const char *canvas_type); | 36 | Eina_List *ecore_imf_module_context_ids_by_canvas_type_get(const char *canvas_type); |
37 | 37 | ||
38 | #endif | 38 | #endif |
diff --git a/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h b/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h index 8e07366880..9c26a749d8 100644 --- a/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h +++ b/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h | |||
@@ -297,7 +297,7 @@ EAPI unsigned long long _ecore_ipc_swap_64(unsigned long long v); | |||
297 | EAPI void *ecore_ipc_server_del(Ecore_Ipc_Server *svr); | 297 | EAPI void *ecore_ipc_server_del(Ecore_Ipc_Server *svr); |
298 | EAPI void *ecore_ipc_server_data_get(Ecore_Ipc_Server *svr); | 298 | EAPI void *ecore_ipc_server_data_get(Ecore_Ipc_Server *svr); |
299 | EAPI int ecore_ipc_server_connected_get(Ecore_Ipc_Server *svr); | 299 | EAPI int ecore_ipc_server_connected_get(Ecore_Ipc_Server *svr); |
300 | EAPI Ecore_List *ecore_ipc_server_clients_get(Ecore_Ipc_Server *svr); | 300 | EAPI Eina_List *ecore_ipc_server_clients_get(Ecore_Ipc_Server *svr); |
301 | /* FIXME: this needs to become an ipc message */ | 301 | /* FIXME: this needs to become an ipc message */ |
302 | EAPI int ecore_ipc_server_send(Ecore_Ipc_Server *svr, int major, int minor, int ref, int ref_to, int response, const void *data, int size); | 302 | EAPI int ecore_ipc_server_send(Ecore_Ipc_Server *svr, int major, int minor, int ref, int ref_to, int response, const void *data, int size); |
303 | EAPI void ecore_ipc_server_client_limit_set(Ecore_Ipc_Server *svr, int client_limit, char reject_excess_clients); | 303 | EAPI void ecore_ipc_server_client_limit_set(Ecore_Ipc_Server *svr, int client_limit, char reject_excess_clients); |
diff --git a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c index 6bfc04bbbc..e69866aa51 100644 --- a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c +++ b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c | |||
@@ -241,7 +241,7 @@ EAPI int ECORE_IPC_EVENT_CLIENT_DATA = 0; | |||
241 | EAPI int ECORE_IPC_EVENT_SERVER_DATA = 0; | 241 | EAPI int ECORE_IPC_EVENT_SERVER_DATA = 0; |
242 | 242 | ||
243 | static int init_count = 0; | 243 | static int init_count = 0; |
244 | static Ecore_Ipc_Server *servers = NULL; | 244 | static Eina_List *servers = NULL; |
245 | static Ecore_Event_Handler *handler[6]; | 245 | static Ecore_Event_Handler *handler[6]; |
246 | 246 | ||
247 | /** | 247 | /** |
@@ -300,7 +300,7 @@ ecore_ipc_shutdown(void) | |||
300 | 300 | ||
301 | if (--init_count != 0) return init_count; | 301 | if (--init_count != 0) return init_count; |
302 | 302 | ||
303 | while (servers) ecore_ipc_server_del(servers); | 303 | while (servers) ecore_ipc_server_del(eina_list_data_get(servers)); |
304 | 304 | ||
305 | for (i = 0; i < 6; i++) | 305 | for (i = 0; i < 6; i++) |
306 | ecore_event_handler_del(handler[i]); | 306 | ecore_event_handler_del(handler[i]); |
@@ -364,9 +364,7 @@ ecore_ipc_server_add(Ecore_Ipc_Type compl_type, const char *name, int port, cons | |||
364 | } | 364 | } |
365 | svr->max_buf_size = 32 * 1024; | 365 | svr->max_buf_size = 32 * 1024; |
366 | svr->data = (void *)data; | 366 | svr->data = (void *)data; |
367 | svr->client_list = ecore_list_new(); | 367 | servers = eina_list_append(servers, svr); |
368 | ecore_list_init(svr->client_list); | ||
369 | servers = _ecore_list2_append(servers, svr); | ||
370 | ECORE_MAGIC_SET(svr, ECORE_MAGIC_IPC_SERVER); | 368 | ECORE_MAGIC_SET(svr, ECORE_MAGIC_IPC_SERVER); |
371 | return svr; | 369 | return svr; |
372 | } | 370 | } |
@@ -422,7 +420,7 @@ ecore_ipc_server_connect(Ecore_Ipc_Type compl_type, char *name, int port, const | |||
422 | } | 420 | } |
423 | svr->max_buf_size = -1; | 421 | svr->max_buf_size = -1; |
424 | svr->data = (void *)data; | 422 | svr->data = (void *)data; |
425 | servers = _ecore_list2_append(servers, svr); | 423 | servers = eina_list_append(servers, svr); |
426 | ECORE_MAGIC_SET(svr, ECORE_MAGIC_IPC_SERVER); | 424 | ECORE_MAGIC_SET(svr, ECORE_MAGIC_IPC_SERVER); |
427 | return svr; | 425 | return svr; |
428 | } | 426 | } |
@@ -444,17 +442,21 @@ ecore_ipc_server_del(Ecore_Ipc_Server *svr) | |||
444 | "ecore_ipc_server_del"); | 442 | "ecore_ipc_server_del"); |
445 | return NULL; | 443 | return NULL; |
446 | } | 444 | } |
445 | if (svr->delete_me) return NULL; | ||
446 | |||
447 | data = svr->data; | 447 | data = svr->data; |
448 | svr->data = NULL; | 448 | svr->data = NULL; |
449 | svr->delete_me = 1; | 449 | svr->delete_me = 1; |
450 | if (svr->event_count == 0) | 450 | if (svr->event_count == 0) |
451 | { | 451 | { |
452 | while (svr->clients) | 452 | Ecore_Ipc_Client *cl; |
453 | ecore_ipc_client_del((Ecore_Ipc_Client *)svr->clients); | 453 | |
454 | EINA_LIST_FREE(svr->clients, cl) | ||
455 | ecore_ipc_client_del(cl); | ||
454 | ecore_con_server_del(svr->server); | 456 | ecore_con_server_del(svr->server); |
455 | servers = _ecore_list2_remove(servers, svr); | 457 | servers = eina_list_remove(servers, svr); |
458 | |||
456 | if (svr->buf) free(svr->buf); | 459 | if (svr->buf) free(svr->buf); |
457 | if (svr->client_list) ecore_list_destroy(svr->client_list); | ||
458 | ECORE_MAGIC_SET(svr, ECORE_MAGIC_NONE); | 460 | ECORE_MAGIC_SET(svr, ECORE_MAGIC_NONE); |
459 | free(svr); | 461 | free(svr); |
460 | } | 462 | } |
@@ -500,10 +502,10 @@ ecore_ipc_server_connected_get(Ecore_Ipc_Server *svr) | |||
500 | /** | 502 | /** |
501 | * Retrieves the list of clients for this server. | 503 | * Retrieves the list of clients for this server. |
502 | * @param svr The given IPC server. | 504 | * @param svr The given IPC server. |
503 | * @return An Ecore_List with the clients. | 505 | * @return An Eina_List with the clients. |
504 | * @ingroup Ecore_IPC_Server_Group | 506 | * @ingroup Ecore_IPC_Server_Group |
505 | */ | 507 | */ |
506 | EAPI Ecore_List * | 508 | EAPI Eina_List * |
507 | ecore_ipc_server_clients_get(Ecore_Ipc_Server *svr) | 509 | ecore_ipc_server_clients_get(Ecore_Ipc_Server *svr) |
508 | { | 510 | { |
509 | if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER)) | 511 | if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER)) |
@@ -1000,7 +1002,7 @@ _ecore_ipc_event_client_add(void *data __UNUSED__, int ev_type __UNUSED__, void | |||
1000 | Ecore_Con_Event_Client_Add *e; | 1002 | Ecore_Con_Event_Client_Add *e; |
1001 | 1003 | ||
1002 | e = ev; | 1004 | e = ev; |
1003 | if (!_ecore_list2_find(servers, ecore_con_server_data_get(ecore_con_client_server_get(e->client)))) return 1; | 1005 | if (!eina_list_data_find(servers, ecore_con_server_data_get(ecore_con_client_server_get(e->client)))) return 1; |
1004 | /* handling code here */ | 1006 | /* handling code here */ |
1005 | { | 1007 | { |
1006 | Ecore_Ipc_Client *cl; | 1008 | Ecore_Ipc_Client *cl; |
@@ -1014,7 +1016,7 @@ _ecore_ipc_event_client_add(void *data __UNUSED__, int ev_type __UNUSED__, void | |||
1014 | cl->max_buf_size = 32 * 1024; | 1016 | cl->max_buf_size = 32 * 1024; |
1015 | ecore_con_client_data_set(cl->client, (void *)cl); | 1017 | ecore_con_client_data_set(cl->client, (void *)cl); |
1016 | svr->clients = _ecore_list2_append(svr->clients, cl); | 1018 | svr->clients = _ecore_list2_append(svr->clients, cl); |
1017 | ecore_list_append(svr->client_list, cl); | 1019 | svr->client_list = eina_list_append(svr->client_list, cl); |
1018 | if (!cl->delete_me) | 1020 | if (!cl->delete_me) |
1019 | { | 1021 | { |
1020 | Ecore_Ipc_Event_Client_Add *e2; | 1022 | Ecore_Ipc_Event_Client_Add *e2; |
@@ -1038,7 +1040,7 @@ _ecore_ipc_event_client_del(void *data __UNUSED__, int ev_type __UNUSED__, void | |||
1038 | Ecore_Con_Event_Client_Del *e; | 1040 | Ecore_Con_Event_Client_Del *e; |
1039 | 1041 | ||
1040 | e = ev; | 1042 | e = ev; |
1041 | if (!_ecore_list2_find(servers, ecore_con_server_data_get(ecore_con_client_server_get(e->client)))) return 1; | 1043 | if (!eina_list_data_find(servers, ecore_con_server_data_get(ecore_con_client_server_get(e->client)))) return 1; |
1042 | /* handling code here */ | 1044 | /* handling code here */ |
1043 | { | 1045 | { |
1044 | Ecore_Ipc_Client *cl; | 1046 | Ecore_Ipc_Client *cl; |
@@ -1049,9 +1051,7 @@ _ecore_ipc_event_client_del(void *data __UNUSED__, int ev_type __UNUSED__, void | |||
1049 | Ecore_Ipc_Server *svr; | 1051 | Ecore_Ipc_Server *svr; |
1050 | 1052 | ||
1051 | svr = ecore_con_server_data_get(ecore_con_client_server_get(e->client)); | 1053 | svr = ecore_con_server_data_get(ecore_con_client_server_get(e->client)); |
1052 | ecore_list_goto(svr->client_list, cl); | 1054 | svr->client_list = eina_list_remove(svr->client_list, cl); |
1053 | ecore_list_remove(svr->client_list); | ||
1054 | ecore_list_first_goto(svr->client_list); | ||
1055 | if (!cl->delete_me) | 1055 | if (!cl->delete_me) |
1056 | { | 1056 | { |
1057 | e2 = calloc(1, sizeof(Ecore_Ipc_Event_Client_Del)); | 1057 | e2 = calloc(1, sizeof(Ecore_Ipc_Event_Client_Del)); |
@@ -1074,7 +1074,7 @@ _ecore_ipc_event_server_add(void *data __UNUSED__, int ev_type __UNUSED__, void | |||
1074 | Ecore_Con_Event_Server_Add *e; | 1074 | Ecore_Con_Event_Server_Add *e; |
1075 | 1075 | ||
1076 | e = ev; | 1076 | e = ev; |
1077 | if (!_ecore_list2_find(servers, ecore_con_server_data_get(e->server))) return 1; | 1077 | if (!eina_list_data_find(servers, ecore_con_server_data_get(e->server))) return 1; |
1078 | /* handling code here */ | 1078 | /* handling code here */ |
1079 | { | 1079 | { |
1080 | Ecore_Ipc_Server *svr; | 1080 | Ecore_Ipc_Server *svr; |
@@ -1103,7 +1103,7 @@ _ecore_ipc_event_server_del(void *data __UNUSED__, int ev_type __UNUSED__, void | |||
1103 | Ecore_Con_Event_Server_Del *e; | 1103 | Ecore_Con_Event_Server_Del *e; |
1104 | 1104 | ||
1105 | e = ev; | 1105 | e = ev; |
1106 | if (!_ecore_list2_find(servers, ecore_con_server_data_get(e->server))) return 1; | 1106 | if (!eina_list_data_find(servers, ecore_con_server_data_get(e->server))) return 1; |
1107 | /* handling code here */ | 1107 | /* handling code here */ |
1108 | { | 1108 | { |
1109 | Ecore_Ipc_Server *svr; | 1109 | Ecore_Ipc_Server *svr; |
@@ -1173,7 +1173,7 @@ _ecore_ipc_event_client_data(void *data __UNUSED__, int ev_type __UNUSED__, void | |||
1173 | Ecore_Con_Event_Client_Data *e; | 1173 | Ecore_Con_Event_Client_Data *e; |
1174 | 1174 | ||
1175 | e = ev; | 1175 | e = ev; |
1176 | if (!_ecore_list2_find(servers, ecore_con_server_data_get(ecore_con_client_server_get(e->client)))) return 1; | 1176 | if (!eina_list_data_find(servers, ecore_con_server_data_get(ecore_con_client_server_get(e->client)))) return 1; |
1177 | /* handling code here */ | 1177 | /* handling code here */ |
1178 | { | 1178 | { |
1179 | Ecore_Ipc_Client *cl; | 1179 | Ecore_Ipc_Client *cl; |
@@ -1365,7 +1365,7 @@ _ecore_ipc_event_server_data(void *data __UNUSED__, int ev_type __UNUSED__, void | |||
1365 | Ecore_Con_Event_Server_Data *e; | 1365 | Ecore_Con_Event_Server_Data *e; |
1366 | 1366 | ||
1367 | e = ev; | 1367 | e = ev; |
1368 | if (!_ecore_list2_find(servers, ecore_con_server_data_get(e->server))) return 1; | 1368 | if (!eina_list_data_find(servers, ecore_con_server_data_get(e->server))) return 1; |
1369 | /* handling code here */ | 1369 | /* handling code here */ |
1370 | { | 1370 | { |
1371 | Ecore_Ipc_Server *svr; | 1371 | Ecore_Ipc_Server *svr; |
diff --git a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h index f8813a8999..9595975018 100644 --- a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h +++ b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h | |||
@@ -39,7 +39,6 @@ __attribute__ ((packed)); | |||
39 | 39 | ||
40 | struct _Ecore_Ipc_Client | 40 | struct _Ecore_Ipc_Client |
41 | { | 41 | { |
42 | Ecore_List __list_data; | ||
43 | ECORE_MAGIC; | 42 | ECORE_MAGIC; |
44 | Ecore_Con_Client *client; | 43 | Ecore_Con_Client *client; |
45 | void *data; | 44 | void *data; |
@@ -57,11 +56,10 @@ struct _Ecore_Ipc_Client | |||
57 | 56 | ||
58 | struct _Ecore_Ipc_Server | 57 | struct _Ecore_Ipc_Server |
59 | { | 58 | { |
60 | Ecore_List __list_data; | ||
61 | ECORE_MAGIC; | 59 | ECORE_MAGIC; |
62 | Ecore_Con_Server *server; | 60 | Ecore_Con_Server *server; |
63 | Ecore_Ipc_Client *clients; | 61 | Eina_List *clients; |
64 | Ecore_List *client_list; | 62 | Eina_List *client_list; |
65 | void *data; | 63 | void *data; |
66 | unsigned char *buf; | 64 | unsigned char *buf; |
67 | int buf_size; | 65 | int buf_size; |
diff --git a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_reply.c b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_reply.c index f27f3b0860..13402b66e5 100644 --- a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_reply.c +++ b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_reply.c | |||
@@ -19,7 +19,7 @@ | |||
19 | * but its code is commented. | 19 | * but its code is commented. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | static Ecore_List *_ecore_xcb_cookies = NULL; | 22 | static Eina_List *_ecore_xcb_cookies = NULL; |
23 | static void *_ecore_xcb_reply = NULL; | 23 | static void *_ecore_xcb_reply = NULL; |
24 | 24 | ||
25 | typedef struct _Ecore_Xcb_Data Ecore_Xcb_Data; | 25 | typedef struct _Ecore_Xcb_Data Ecore_Xcb_Data; |
@@ -33,35 +33,22 @@ struct _Ecore_Xcb_Data | |||
33 | int | 33 | int |
34 | _ecore_x_reply_init () | 34 | _ecore_x_reply_init () |
35 | { | 35 | { |
36 | _ecore_xcb_cookies = ecore_list_new(); | ||
37 | if (!_ecore_xcb_cookies) | ||
38 | return 0; | ||
39 | |||
40 | if (!ecore_list_init(_ecore_xcb_cookies)) | ||
41 | { | ||
42 | ecore_list_destroy(_ecore_xcb_cookies); | ||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | if (!ecore_list_free_cb_set(_ecore_xcb_cookies, ECORE_FREE_CB(free))) | ||
47 | { | ||
48 | ecore_list_destroy(_ecore_xcb_cookies); | ||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | return 1; | 36 | return 1; |
53 | } | 37 | } |
54 | 38 | ||
55 | void | 39 | void |
56 | _ecore_x_reply_shutdown () | 40 | _ecore_x_reply_shutdown () |
57 | { | 41 | { |
42 | Ecore_Xcb_Data *data; | ||
43 | |||
58 | if (_ecore_xcb_reply) | 44 | if (_ecore_xcb_reply) |
59 | free(_ecore_xcb_reply); | 45 | free(_ecore_xcb_reply); |
60 | 46 | ||
61 | if (!_ecore_xcb_cookies) | 47 | if (!_ecore_xcb_cookies) |
62 | return; | 48 | return; |
63 | 49 | ||
64 | ecore_list_destroy(_ecore_xcb_cookies); | 50 | EINA_LIST_FREE(_ecore_xcb_cookies, data) |
51 | free(data); | ||
65 | } | 52 | } |
66 | 53 | ||
67 | void | 54 | void |
@@ -78,7 +65,8 @@ _ecore_xcb_cookie_cache (unsigned int cookie) | |||
78 | 65 | ||
79 | data->cookie = cookie; | 66 | data->cookie = cookie; |
80 | 67 | ||
81 | if (!ecore_list_append(_ecore_xcb_cookies, data)) | 68 | _ecore_xcb_cookies = eina_list_append(_ecore_xcb_cookies, data); |
69 | if (!eina_list_data_find(_ecore_xcb_cookies, data)) | ||
82 | { | 70 | { |
83 | free(data); | 71 | free(data); |
84 | return; | 72 | return; |
@@ -94,16 +82,14 @@ _ecore_xcb_cookie_get (void) | |||
94 | if (!_ecore_xcb_cookies) | 82 | if (!_ecore_xcb_cookies) |
95 | return 0; | 83 | return 0; |
96 | 84 | ||
97 | data = ecore_list_first_remove(_ecore_xcb_cookies); | 85 | data = eina_list_data_get(_ecore_xcb_cookies); |
98 | if (data) | 86 | if (!data) return 0; |
99 | { | 87 | |
88 | _ecore_xcb_cookies = eina_list_remove_list(_ecore_xcb_cookies, _ecore_xcb_cookies); | ||
100 | cookie = data->cookie; | 89 | cookie = data->cookie; |
101 | free(data); | 90 | free(data); |
102 | 91 | ||
103 | return cookie; | 92 | return cookie; |
104 | } | ||
105 | |||
106 | return 0; | ||
107 | } | 93 | } |
108 | 94 | ||
109 | void | 95 | void |