* estickies,
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 25 Feb 2009 11:03:47 +0000 (11:03 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 25 Feb 2009 11:03:47 +0000 (11:03 +0000)
* 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.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/efreet@39200 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

22 files changed:
src/bin/ef_cache.c
src/bin/ef_data_dirs.c
src/bin/ef_desktop.c
src/bin/ef_icon_theme.c
src/bin/ef_menu.c
src/bin/efreet_spec_test.c
src/bin/main.c
src/lib/Efreet_Trash.h
src/lib/efreet_base.c
src/lib/efreet_base.h
src/lib/efreet_desktop.c
src/lib/efreet_desktop.h
src/lib/efreet_icon.c
src/lib/efreet_icon.h
src/lib/efreet_ini.c
src/lib/efreet_menu.c
src/lib/efreet_menu.h
src/lib/efreet_mime.c
src/lib/efreet_private.h
src/lib/efreet_trash.c
src/lib/efreet_utils.c
src/lib/efreet_utils.h

index 45ffd80..73fd0df 100644 (file)
@@ -5,7 +5,8 @@
 static int
 timer(void *data __UNUSED__)
 {
-    Ecore_List *list;
+    Eina_List *list;
+    Eina_List *l;
     Efreet_Desktop *desktop;
     double start;
 
@@ -22,12 +23,12 @@ timer(void *data __UNUSED__)
     list = efreet_util_desktop_mime_list("application/ogg");
     if (list)
     {
-        ecore_list_first_goto(list);
-        while ((desktop = ecore_list_next(list)))
+       EINA_LIST_FOREACH(list, l, desktop)
         {
             printf("application/ogg: %s\n", desktop->name);
         }
-        ecore_list_destroy(list);
+        while (list)
+               list = eina_list_remove_list(list, list);
     }
 
     return 0;
index 291273d..02e3ae3 100644 (file)
@@ -153,7 +153,7 @@ ef_cb_efreet_cache_home(void)
 int
 ef_cb_efreet_data_dirs(void)
 {
-    Ecore_List *tmp;
+    Eina_List *tmp, *l;
     int ret = 1, i;
     char dirs[128], *val;
     char *vals[] = {"/var/tmp/a", "/tmp/b", "/usr/local/share", "/etc", NULL};
@@ -172,8 +172,7 @@ ef_cb_efreet_data_dirs(void)
 
     i = 0;
     tmp = efreet_data_dirs_get();
-    ecore_list_first_goto(tmp);
-    while ((val = ecore_list_next(tmp)))
+    EINA_LIST_FOREACH(tmp, l, val)
     {
         if (vals[i] == NULL)
         {
@@ -199,14 +198,13 @@ ef_cb_efreet_data_dirs(void)
 
     i = 0;
     tmp = efreet_data_dirs_get();
-    if (ecore_list_count(tmp) != 2)
+    if (eina_list_count(tmp) != 2)
     {
         printf("efreet_data_dirs_get() nodes is differnet from expected default\n");
         ret = 0;
     }
 
-    ecore_list_first_goto(tmp);
-    while ((val = ecore_list_next(tmp)))
+    EINA_LIST_FOREACH(tmp, l, val)
     {
         if (def_vals[i] == NULL)
         {
@@ -231,7 +229,7 @@ ef_cb_efreet_data_dirs(void)
 int
 ef_cb_efreet_config_dirs(void)
 {
-    Ecore_List *tmp;
+    Eina_List *tmp, *l;
     int ret = 1, i;
     char dirs[128], *val;
     char *vals[] = {"/var/tmp/a", "/tmp/b", "/usr/local/share", "/etc", NULL};
@@ -251,8 +249,7 @@ ef_cb_efreet_config_dirs(void)
 
     i = 0;
     tmp = efreet_config_dirs_get();
-    ecore_list_first_goto(tmp);
-    while ((val = ecore_list_next(tmp)))
+    EINA_LIST_FOREACH(tmp, l, val)
     {
         if (vals[i] == NULL)
         {
@@ -278,8 +275,7 @@ ef_cb_efreet_config_dirs(void)
 
     i = 0;
     tmp = efreet_config_dirs_get();
-    ecore_list_first_goto(tmp);
-    while ((val = ecore_list_next(tmp)))
+    EINA_LIST_FOREACH(tmp, l, val)
     {
         if (def_vals[i] == NULL)
         {
index af7cfad..7713cce 100644 (file)
@@ -14,6 +14,7 @@ int
 ef_cb_desktop_parse(void)
 {
     Efreet_Desktop *desktop;
+    Eina_List *l;
     int ret = 1;
 
     desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/test/test.desktop");
@@ -48,8 +49,7 @@ ef_cb_desktop_parse(void)
         const char *cat;
         int num_categories = 2, i = 0;
 
-        ecore_list_first_goto(desktop->categories);
-        while ((cat = ecore_list_next(desktop->categories)))
+       EINA_LIST_FOREACH(desktop->categories, l, cat)
         {
             if (i >= num_categories)
             {
@@ -141,10 +141,9 @@ ef_cb_desktop_save(void)
     desktop->type = EFREET_DESKTOP_TYPE_APPLICATION;
     desktop->generic_name = strdup("Test Application");
     desktop->exec = strdup("efreet_test");
-    desktop->categories = ecore_list_new();
-    ecore_list_free_cb_set(desktop->categories, ECORE_FREE_CB(free));
-    ecore_list_append(desktop->categories, strdup("Test"));
-    ecore_list_append(desktop->categories, strdup("Enlightenment"));
+    desktop->categories = NULL;
+    desktop->categories = eina_list_append(desktop->categories, strdup("Test"));
+    desktop->categories = eina_list_append(desktop->categories, strdup("Enlightenment"));
     printf("save test: %d\n", efreet_desktop_save(desktop));
     unlink("/tmp/test.desktop");
     efreet_desktop_free(desktop);
@@ -154,7 +153,7 @@ ef_cb_desktop_save(void)
 
 typedef struct
 {
-  Ecore_List *expected;
+  Eina_List *expected;
   int error;
   char type;
 } Test_Info;
@@ -163,7 +162,7 @@ int
 ef_cb_desktop_command_get(void)
 {
     Efreet_Desktop *desktop;
-    Ecore_List *files, *expected;
+    Eina_List *files, *expected;
     char olddir[PATH_MAX];
     Test_Info *info;
     int ret;
@@ -177,14 +176,15 @@ ef_cb_desktop_command_get(void)
     desktop->name = strdup("App Name");
     desktop->icon = strdup("icon.png");
 
-    files = ecore_list_new();
-    ecore_list_append(files, "/tmp/absolute_path");
-    ecore_list_append(files, "relative_path");
-    ecore_list_append(files, "file:///tmp/absolute_uri");
-    ecore_list_append(files, "file:relative_uri");
+    files = NULL;
+    files = eina_list_append(files, "/tmp/absolute_path");
+    files = eina_list_append(files, "relative_path");
+    files = eina_list_append(files, "file:///tmp/absolute_uri");
+    files = eina_list_append(files, "file:relative_uri");
 
     info = NEW(Test_Info, 1);
-    expected = ecore_list_new();
+    expected = NULL;
+    // FIXME: info->expected needs to be update.
     info->expected = expected;
     info->error = 0;
 
@@ -192,129 +192,131 @@ ef_cb_desktop_command_get(void)
     info->type = 'f';
     IF_FREE(desktop->exec);
     desktop->exec = strdup("app %f");
-    ecore_list_append(expected, "app '/tmp/absolute_path'");
-    ecore_list_append(expected, "app '/relative_path'");
-    ecore_list_append(expected, "app '/tmp/absolute_uri'");
-    ecore_list_append(expected, "app '/relative_uri'");
+    expected = eina_list_append(expected, "app '/tmp/absolute_path'");
+    expected = eina_list_append(expected, "app '/relative_path'");
+    expected = eina_list_append(expected, "app '/tmp/absolute_uri'");
+    expected = eina_list_append(expected, "app '/relative_uri'");
 
-    ecore_list_first_goto(expected);
     efreet_desktop_command_get(desktop, files, _cb_command, info);
-    ecore_list_clear(expected);
+    while (expected)
+           expected = eina_list_remove_list(expected, expected);
 
     /* test single uri */
     info->type = 'u';
     IF_FREE(desktop->exec);
     desktop->exec = strdup("app %u");
-    ecore_list_append(expected, "app 'file:///tmp/absolute_path'");
-    ecore_list_append(expected, "app 'file:///relative_path'");
-    ecore_list_append(expected, "app 'file:///tmp/absolute_uri'");
-    ecore_list_append(expected, "app 'file:///relative_uri'");
+    expected = eina_list_append(expected, "app 'file:///tmp/absolute_path'");
+    expected = eina_list_append(expected, "app 'file:///relative_path'");
+    expected = eina_list_append(expected, "app 'file:///tmp/absolute_uri'");
+    expected = eina_list_append(expected, "app 'file:///relative_uri'");
 
-    ecore_list_first_goto(expected);
     efreet_desktop_command_get(desktop, files, _cb_command, info);
-    ecore_list_clear(expected);
+    while (expected)
+           expected = eina_list_remove_list(expected, expected);
 
     /* test single dir */
     info->type = 'd';
     IF_FREE(desktop->exec);
     desktop->exec = strdup("app %d");
-    ecore_list_append(expected, "app '/tmp'");
-    ecore_list_append(expected, "app '/'");
-    ecore_list_append(expected, "app '/tmp'");
-    ecore_list_append(expected, "app '/'");
+    expected = eina_list_append(expected, "app '/tmp'");
+    expected = eina_list_append(expected, "app '/'");
+    expected = eina_list_append(expected, "app '/tmp'");
+    expected = eina_list_append(expected, "app '/'");
 
-    ecore_list_first_goto(expected);
     efreet_desktop_command_get(desktop, files, _cb_command, info);
-    ecore_list_clear(expected);
+    while (expected)
+           expected = eina_list_remove_list(expected, expected);
 
 
     /* test single names */
     info->type = 'n';
     IF_FREE(desktop->exec);
     desktop->exec = strdup("app %n");
-    ecore_list_append(expected, "app 'absolute_path'");
-    ecore_list_append(expected, "app 'relative_path'");
-    ecore_list_append(expected, "app 'absolute_uri'");
-    ecore_list_append(expected, "app 'relative_uri'");
+    expected = eina_list_append(expected, "app 'absolute_path'");
+    expected = eina_list_append(expected, "app 'relative_path'");
+    expected = eina_list_append(expected, "app 'absolute_uri'");
+    expected = eina_list_append(expected, "app 'relative_uri'");
 
-    ecore_list_first_goto(expected);
     efreet_desktop_command_get(desktop, files, _cb_command, info);
-    ecore_list_clear(expected);
+    while (expected)
+           expected = eina_list_remove_list(expected, expected);
 
     /* test multiple fullpaths */
     info->type = 'F';
     IF_FREE(desktop->exec);
     desktop->exec = strdup("app %F");
-    ecore_list_append(expected, "app '/tmp/absolute_path' '/relative_path' '/tmp/absolute_uri' '/relative_uri'");
+    expected = eina_list_append(expected, "app '/tmp/absolute_path' '/relative_path' '/tmp/absolute_uri' '/relative_uri'");
 
-    ecore_list_first_goto(expected);
     efreet_desktop_command_get(desktop, files, _cb_command, info);
-    ecore_list_clear(expected);
+    while (expected)
+           expected = eina_list_remove_list(expected, expected);
 
     /* test multiple URIs */
     info->type = 'U';
     IF_FREE(desktop->exec);
     desktop->exec = strdup("app %U");
-    ecore_list_append(expected, "app 'file:///tmp/absolute_path' 'file:///relative_path' 'file:///tmp/absolute_uri' 'file:///relative_uri'");
+    expected = eina_list_append(expected, "app 'file:///tmp/absolute_path' 'file:///relative_path' 'file:///tmp/absolute_uri' 'file:///relative_uri'");
 
-    ecore_list_first_goto(expected);
     efreet_desktop_command_get(desktop, files, _cb_command, info);
-    ecore_list_clear(expected);
+    while (expected)
+           expected = eina_list_remove_list(expected, expected);
 
     /* test multiple dirs */
     info->type = 'D';
     IF_FREE(desktop->exec);
     desktop->exec = strdup("app %D");
-    ecore_list_append(expected, "app '/tmp' '/' '/tmp' '/'");
+    expected = eina_list_append(expected, "app '/tmp' '/' '/tmp' '/'");
 
-    ecore_list_first_goto(expected);
     efreet_desktop_command_get(desktop, files, _cb_command, info);
-    ecore_list_clear(expected);
+    while (expected)
+           expected = eina_list_remove_list(expected, expected);
 
     /* test multiple names */
     info->type = 'N';
     IF_FREE(desktop->exec);
     desktop->exec = strdup("app %N");
-    ecore_list_append(expected, "app 'absolute_path' 'relative_path' 'absolute_uri' 'relative_uri'");
+    expected = eina_list_append(expected, "app 'absolute_path' 'relative_path' 'absolute_uri' 'relative_uri'");
 
-    ecore_list_first_goto(expected);
     efreet_desktop_command_get(desktop, files, _cb_command, info);
-    ecore_list_clear(expected);
+    while (expected)
+           expected = eina_list_remove_list(expected, expected);
 
     /* test icon appending */
     info->type = 'i';
     IF_FREE(desktop->exec);
     desktop->exec = strdup("app %i");
-    ecore_list_append(expected, "app --icon 'icon.png'");
+    expected = eina_list_append(expected, "app --icon 'icon.png'");
 
-    ecore_list_first_goto(expected);
     efreet_desktop_command_get(desktop, NULL, _cb_command, info);
-    ecore_list_clear(expected);
+    while (expected)
+           expected = eina_list_remove_list(expected, expected);
 
     /* test app name */
     info->type = 'c';
     IF_FREE(desktop->exec);
     desktop->exec = strdup("app %c");
-    ecore_list_append(expected, "app 'App Name'");
+    expected = eina_list_append(expected, "app 'App Name'");
 
-    ecore_list_first_goto(expected);
     efreet_desktop_command_get(desktop, NULL, _cb_command, info);
-    ecore_list_clear(expected);
+    while (expected)
+           expected = eina_list_remove_list(expected, expected);
 
     /* test desktop path */
     info->type = 'k';
     IF_FREE(desktop->exec);
     desktop->exec = strdup("app %k");
-    ecore_list_append(expected, "app 'test.desktop'");
+    expected = eina_list_append(expected, "app 'test.desktop'");
 
-    ecore_list_first_goto(expected);
     efreet_desktop_command_get(desktop, NULL, _cb_command, info);
-    ecore_list_clear(expected);
+    while (expected)
+           expected = eina_list_remove_list(expected, expected);
 
     /* clean up */
     efreet_desktop_free(desktop);
-    ecore_list_destroy(files);
-    ecore_list_destroy(expected);
+    while (files)
+           files = eina_list_remove_list(files, expected);
+    while (expected)
+           expected = eina_list_remove_list(expected, expected);
 
     ret = info->error > 0 ? 0 : 1;
     free(info);
@@ -331,7 +333,8 @@ _cb_command(void *data, Efreet_Desktop *desktop __UNUSED__,
   Test_Info *info = data;
   char *expected;
 
-  expected = ecore_list_next(info->expected);
+  expected = eina_list_data_get(info->expected);
+  info->expected = eina_list_demote_list(info->expected, info->expected);
   if (!expected)
   {
     printf("  ERROR: (%%%c) got \"%s\", expected nothing\n", info->type, exec);
index 56dcaf8..369a4b8 100644 (file)
@@ -15,7 +15,7 @@
 static Eina_Bool _hash_keys(Eina_Hash *hash, const char *key, void *list);
 static void ef_icon_theme_themes_find(const char *search_dir,
                                         Eina_Hash *themes);
-static void ef_icons_find(Efreet_Icon_Theme *theme, Ecore_List *themes,
+static void ef_icons_find(Efreet_Icon_Theme *theme, Eina_List *themes,
                                                     Eina_Hash *icons);
 static void ef_read_dir(const char *dir, Eina_Hash *icons);
 
@@ -56,7 +56,9 @@ ef_cb_efreet_icon_theme(void)
 static Eina_Bool
 _hash_keys(Eina_Hash *hash, const char *key, void *list)
 {
-  ecore_list_append(list, key);
+  Eina_List **l = list;
+
+  *l = eina_list_append(*l, key);
   return EINA_TRUE;
 }
 
@@ -64,11 +66,12 @@ int
 ef_cb_efreet_icon_theme_list(void)
 {
     int ret = 1;
-    Ecore_List *themes;
+    Eina_List *themes;
+    Eina_List *icon_dirs;
+    Eina_List *l;
     Eina_Hash *dirs;
     Eina_Iterator *it;
     Efreet_Icon_Theme *theme;
-    Ecore_List *icon_dirs;
     const char *dir;
     char buf[PATH_MAX];
     void *value;
@@ -76,10 +79,9 @@ ef_cb_efreet_icon_theme_list(void)
     dirs = eina_hash_string_superfast_new(free);
 
     icon_dirs = efreet_data_dirs_get();
-    ecore_list_first_goto(icon_dirs);
 
     ef_icon_theme_themes_find(efreet_icon_user_dir_get(), dirs);
-    while ((dir = ecore_list_next(icon_dirs)))
+    EINA_LIST_FOREACH(icon_dirs, l, dir)
     {
         snprintf(buf, sizeof(buf), "%s/icons", dir);
         ef_icon_theme_themes_find(buf, dirs);
@@ -87,8 +89,7 @@ ef_cb_efreet_icon_theme_list(void)
     ef_icon_theme_themes_find("/usr/share/pixmaps", dirs);
 
     themes = efreet_icon_theme_list_get();
-    ecore_list_first_goto(themes);
-    while ((theme = ecore_list_next(themes)))
+    EINA_LIST_FOREACH(themes, l, theme)
     {
         if ((eina_hash_find(dirs, theme->name.internal)))
            eina_hash_del(dirs, theme->name.internal, NULL);
@@ -99,26 +100,31 @@ ef_cb_efreet_icon_theme_list(void)
             ret = 0;
         }
     }
-    ecore_list_destroy(themes);
+    while (themes)
+      {
+        themes = eina_list_remove_list(themes, themes);
+      }
 
-    themes = ecore_list_new();
+    themes = NULL;
     it = eina_hash_iterator_key_new(dirs);
-    eina_iterator_foreach(it, EINA_EACH(_hash_keys), themes);
+    eina_iterator_foreach(it, EINA_EACH(_hash_keys), &themes);
     eina_iterator_free(it);
 
-    if (ecore_list_count(themes) > 0)
+    if (eina_list_count(themes) > 0)
     {
         char *dir;
 
         printf("efreet_icon_theme_list_get() missed: ");
-        ecore_list_first_goto(themes);
-        while ((dir = ecore_list_next(themes)))
+       EINA_LIST_FOREACH(themes, l, dir)
             printf("%s ", dir);
         printf("\n");
 
         ret = 0;
     }
-    ecore_list_destroy(themes);
+    while (themes)
+      {
+        themes = eina_list_remove_list(themes, themes);
+      }
     eina_hash_free(dirs);
 
     return ret;
@@ -127,7 +133,7 @@ ef_cb_efreet_icon_theme_list(void)
 static void
 ef_icon_theme_themes_find(const char *search_dir, Eina_Hash *themes)
 {
-    Ecore_List *dirs;
+    Eina_List *dirs;
     char *dir;
 
     if (!search_dir || !themes) return;
@@ -135,10 +141,11 @@ ef_icon_theme_themes_find(const char *search_dir, Eina_Hash *themes)
     dirs = ecore_file_ls(search_dir);
     if (!dirs) return;
 
-    while ((dir = ecore_list_first_remove(dirs)))
+    while ((dir = eina_list_data_get(dirs)))
     {
         char p[PATH_MAX];
 
+       dirs = eina_list_remove_list(dirs, dirs);
         /* if we've already added the theme we're done */
         if (eina_hash_find(themes, dir))
         {
@@ -170,7 +177,6 @@ ef_icon_theme_themes_find(const char *search_dir, Eina_Hash *themes)
         }
         free(dir);
     }
-    ecore_list_destroy(dirs);
 }
 
 const char *icons[] =
@@ -440,11 +446,11 @@ ef_cb_efreet_icon_match(void)
     int i, ret = 1;
     Eina_Hash *icon_hash;
     Efreet_Icon_Theme *theme;
-    Ecore_List *themes;
+    Eina_List *themes;
+    Eina_List *l;
 
     themes = efreet_icon_theme_list_get();
-    ecore_list_first_goto(themes);
-    while ((theme = ecore_list_next(themes)))
+    EINA_LIST_FOREACH(themes, l, theme)
     {
         if (!strcmp(theme->name.internal, THEME))
             break;
@@ -453,14 +459,16 @@ ef_cb_efreet_icon_match(void)
     if (!theme)
     {
         printf("Theme not installed, SKIPPED.\n");
-        ecore_list_destroy(themes);
+       while (themes)
+          themes = eina_list_remove_list(themes, themes);
         return 1;
     }
 
     icon_hash = eina_hash_string_superfast_new(free);
 
     ef_icons_find(theme, themes, icon_hash);
-    ecore_list_destroy(themes);
+    while (themes)
+       themes = eina_list_remove_list(themes, themes);
 
     double start = ecore_time_get();
     for (i = 0; icons[i] != NULL; i++)
@@ -527,67 +535,33 @@ ef_cb_efreet_icon_match(void)
 }
 
 static void
-ef_icons_find(Efreet_Icon_Theme *theme, Ecore_List *themes, Eina_Hash *icons)
+ef_icons_find(Efreet_Icon_Theme *theme, Eina_List *themes, Eina_Hash *icons)
 {
+    Eina_List *l, *ll;
     char path[PATH_MAX];
+    const char *theme_path;
 
     if (!theme || !icons) return;
 
-    if (theme->paths.count == 1)
+    EINA_LIST_FOREACH(theme->paths, l, theme_path)
     {
         Efreet_Icon_Theme_Directory *dir;
 
-        ecore_list_first_goto(theme->directories);
-        while ((dir = ecore_list_next(theme->directories)))
-        {
-            if (theme->paths.count > 1)
-            {
-                Ecore_List *list;
-                char *tmp;
-
-                list = theme->paths.path;
-                ecore_list_first_goto(list);
-                while ((tmp = ecore_list_next(list)))
-                {
-                    snprintf(path, sizeof(path), "%s/%s/", tmp, dir->name);
-                    ef_read_dir(path, icons);
-                }
-            }
-            else if (theme->paths.count == 1)
-            {
-                snprintf(path, sizeof(path), "%s/%s/", (char *)theme->paths.path, dir->name);
-                ef_read_dir(path, icons);
-            }
-        }
-    }
-    else if (theme->paths.count > 1)
-    {
-        const char *theme_path;
-
-        ecore_list_first_goto(theme->paths.path);
-        while ((theme_path = ecore_list_next(theme->paths.path)))
-        {
-            Efreet_Icon_Theme_Directory *dir;
-
-            ecore_list_first_goto(theme->directories);
-            while ((dir = ecore_list_next(theme->directories)))
+        EINA_LIST_FOREACH(theme->directories, ll, dir)
             {
                 snprintf(path, sizeof(path), "%s/%s/", theme_path, dir->name);
                 ef_read_dir(path, icons);
             }
         }
-    }
 
     if (theme->inherits)
     {
         Efreet_Icon_Theme *parent_theme;
         char *parent;
 
-        ecore_list_first_goto(theme->inherits);
-        while ((parent = ecore_list_next(theme->inherits)))
+       EINA_LIST_FOREACH(theme->inherits, l, parent)
         {
-            ecore_list_first_goto(themes);
-            while ((parent_theme = ecore_list_next(themes)))
+           EINA_LIST_FOREACH(themes, ll, parent_theme)
             {
                 if (!strcmp(parent_theme->name.internal, parent))
                     ef_icons_find(parent_theme, themes, icons);
@@ -598,8 +572,7 @@ ef_icons_find(Efreet_Icon_Theme *theme, Ecore_List *themes, Eina_Hash *icons)
     {
         Efreet_Icon_Theme *parent_theme;
 
-        ecore_list_first_goto(themes);
-        while ((parent_theme = ecore_list_next(themes)))
+       EINA_LIST_FOREACH(themes, l, parent_theme)
         {
             if (!strcmp(parent_theme->name.internal, "hicolor"))
                 ef_icons_find(parent_theme, themes, icons);
@@ -612,7 +585,7 @@ ef_icons_find(Efreet_Icon_Theme *theme, Ecore_List *themes, Eina_Hash *icons)
 static void
 ef_read_dir(const char *dir, Eina_Hash *icons)
 {
-    Ecore_List *files;
+    Eina_List *files;
     char *file;
 
     if (!dir || !icons) return;
@@ -620,10 +593,11 @@ ef_read_dir(const char *dir, Eina_Hash *icons)
     files = ecore_file_ls(dir);
     if (!files) return;
 
-    while ((file = ecore_list_first_remove(files)))
+    while ((file = eina_list_data_get(files)))
     {
         char *p;
 
+       files = eina_list_remove_list(files, files);
         p = strrchr(file, '.');
         if (!p)
         {
@@ -640,5 +614,4 @@ ef_read_dir(const char *dir, Eina_Hash *icons)
 
         FREE(file);
     }
-    ecore_list_destroy(files);
 }
index 9894b4f..e15a93d 100644 (file)
@@ -8,20 +8,20 @@
 static void
 ef_menu_desktop_exec(Efreet_Menu *menu)
 {
+    Eina_List *l;
+
     if (menu->entries)
     {
         Efreet_Desktop *desktop;
 
-        ecore_list_first_goto(menu->entries);
-        while ((desktop = ecore_list_next(menu->entries)))
+        EINA_LIST_FOREACH(menu->entries, l, desktop)
             efreet_desktop_exec(desktop, NULL);
     }
     if (menu->sub_menus)
     {
         Efreet_Menu *sub_menu;
 
-        ecore_list_first_goto(menu->sub_menus);
-        while ((sub_menu = ecore_list_next(menu->sub_menus)))
+        EINA_LIST_FOREACH(menu->sub_menus, l, sub_menu)
             ef_menu_desktop_exec(sub_menu);
     }
 }
@@ -113,8 +113,7 @@ ef_cb_menu_edit(void)
     efreet_menu_dump(menu, "");
     printf("\n");
 #endif
-    ecore_list_first_goto(menu->entries);
-    entry = ecore_list_current(menu->entries);
+    entry = eina_list_data_get(menu->entries);
     if (desktop != entry->desktop)
     {
         efreet_menu_free(menu);
@@ -127,8 +126,7 @@ ef_cb_menu_edit(void)
     efreet_menu_dump(menu, "");
     printf("\n");
 #endif
-    ecore_list_index_goto(menu->entries, 2);
-    entry = ecore_list_current(menu->entries);
+    entry = eina_list_nth(menu->entries, 2);
     if (desktop != entry->desktop)
     {
         efreet_menu_free(menu);
@@ -141,8 +139,7 @@ ef_cb_menu_edit(void)
     efreet_menu_dump(menu, "");
     printf("\n");
 #endif
-    ecore_list_last_goto(menu->entries);
-    entry = ecore_list_current(menu->entries);
+    entry = eina_list_data_get(eina_list_last(menu->entries));
     if (desktop != entry->desktop)
     {
         efreet_menu_free(menu);
index a5ef2a6..ed93ea5 100644 (file)
@@ -35,11 +35,11 @@ static void
 dump(Efreet_Menu *menu, const char *path)
 {
     Efreet_Menu *entry;
+    Eina_List *l;
 
     if (!menu || !menu->entries) return;
 
-    ecore_list_first_goto(menu->entries);
-    while ((entry = ecore_list_next(menu->entries)))
+    EINA_LIST_FOREACH(menu->entries, l, entry)
     {
         if (entry->type == EFREET_MENU_ENTRY_DESKTOP)
         {
index 105a057..b515f8c 100644 (file)
@@ -77,34 +77,34 @@ static Efreet_Test tests[] = {
 };
 
 extern char **environ;
-static Ecore_List *environment = NULL;
+static Eina_List *environment = NULL;
 
 void
 environment_store(void)
 {
+    char *env;
     char **e;
 
-    if (environment)
-        ecore_list_clear(environment);
-    else
+    while (environment)
     {
-        environment = ecore_list_new();
-        ecore_list_free_cb_set(environment, ECORE_FREE_CB(free));
+        env = eina_list_data_get(environment);
+        free(env);
+        environment = eina_list_remove_list(environment, environment);
     }
 
     for (e = environ; *e; e++)
-        ecore_list_append(environment, strdup(*e));
+        environment = eina_list_append(environment, strdup(*e));
 }
 
 void
 environment_restore(void)
 {
+    Eina_List *l;
     char *e;
     if (!environment) return;
 
     *environ = NULL;
-    ecore_list_first_goto(environment);
-    while ((e = ecore_list_next(environment)))
+    EINA_LIST_FOREACH(environment, l, e)
         putenv(e);
 }
 
@@ -112,13 +112,12 @@ int
 main(int argc, char ** argv)
 {
     int i, passed = 0, num_tests = 0;
-    Ecore_List *run = NULL;
+    Eina_List *run = NULL;
     double total;
 
     total = ecore_time_get();
     if (argc > 1)
     {
-        run = ecore_list_new();
         for (i = 1; i < argc; i++)
         {
             if ((!strcmp(argv[i], "-h")) ||
@@ -130,7 +129,7 @@ main(int argc, char ** argv)
                 }
                 return 1;
             }
-            ecore_list_append(run, argv[i]);
+            run = eina_list_append(run, argv[i]);
         }
     }
 
@@ -141,7 +140,7 @@ main(int argc, char ** argv)
         double start;
 
         /* we've been given specific tests and it isn't in the list */
-        if (run && !ecore_list_find(run, ECORE_COMPARE_CB(strcasecmp),
+        if (run && !eina_list_search_unsorted(run, ECORE_COMPARE_CB(strcasecmp),
                                                         tests[i].name))
             continue;
 
@@ -166,10 +165,15 @@ main(int argc, char ** argv)
     }
 
     printf("\n-----------------\n");
-    if (environment) ecore_list_destroy(environment);
+    while (environment)
+    {
+        free(eina_list_data_get(environment));
+        environment = eina_list_remove_list(environment, environment);
+    }
     printf("Passed %d of %d tests.\n", passed, num_tests);
 
-    if (run) ecore_list_destroy(run);
+    while (run)
+        run = eina_list_remove_list(run, run);
 
     printf("Total run: %.3f seconds\n", ecore_time_get() - total);
     return 0;
index febf70d..897f646 100644 (file)
@@ -41,7 +41,7 @@ EAPI void        efreet_trash_shutdown(void);
 
 EAPI const char *efreet_trash_dir_get(void);
 EAPI int         efreet_trash_delete_uri(Efreet_Uri *uri, int force_delete);
-EAPI Ecore_List *efreet_trash_ls(void);
+EAPI Eina_List  *efreet_trash_ls(void);
 EAPI int         efreet_trash_is_empty(void);
 EAPI int         efreet_trash_empty_trash(void);
 
index 3be459e..f4738e1 100644 (file)
@@ -6,11 +6,11 @@ static const char *efreet_home_dir = NULL;
 static const char *xdg_data_home = NULL;
 static const char *xdg_config_home = NULL;
 static const char *xdg_cache_home = NULL;
-static Ecore_List *xdg_data_dirs = NULL;
-static Ecore_List *xdg_config_dirs = NULL;
+static Eina_List  *xdg_data_dirs = NULL;
+static Eina_List  *xdg_config_dirs = NULL;
 
 static const char *efreet_dir_get(const char *key, const char *fallback);
-static Ecore_List *efreet_dirs_get(const char *key,
+static Eina_List  *efreet_dirs_get(const char *key,
                                         const char *fallback);
 
 /**
@@ -77,15 +77,15 @@ efreet_data_home_get(void)
 }
 
 /**
- * @return Returns the Ecore_List of preference ordered extra data directories
- * @brief Returns the Ecore_List of prefernece oredred extra data
+ * @return Returns the Eina_List of preference ordered extra data directories
+ * @brief Returns the Eina_List of prefernece oredred extra data
  * directories
  *
  * @note The returned list is static inside Efreet. If you add/remove from the
  * list then the next call to efreet_data_dirs_get() will return your
  * modified values. DO NOT free this list.
  */
-EAPI Ecore_List *
+EAPI Eina_List *
 efreet_data_dirs_get(void)
 {
     if (xdg_data_dirs) return xdg_data_dirs;
@@ -107,15 +107,15 @@ efreet_config_home_get(void)
 }
 
 /**
- * @return Returns the Ecore_List of preference ordered extra config directories
- * @brief Returns the Ecore_List of prefernece oredred extra config
+ * @return Returns the Eina_List of preference ordered extra config directories
+ * @brief Returns the Eina_List of prefernece oredred extra config
  * directories
  *
  * @note The returned list is static inside Efreet. If you add/remove from the
  * list then the next call to efreet_config_dirs_get() will return your
  * modified values. DO NOT free this list.
  */
-EAPI Ecore_List *
+EAPI Eina_List *
 efreet_config_dirs_get(void)
 {
     if (xdg_config_dirs) return xdg_config_dirs;
@@ -177,18 +177,16 @@ efreet_dir_get(const char *key, const char *fallback)
  * @brief Creates a list of directories as given in the environment key @a
  * key or from the fallbacks in @a fallback
  */
-static Ecore_List *
+static Eina_List *
 efreet_dirs_get(const char *key, const char *fallback)
 {
-    Ecore_List *dirs;
+    Eina_List *dirs = NULL;
     const char *path;
     char *tmp, *s, *p;
 
     path = getenv(key);
     if (!path || (path[0] == '\0')) path = fallback;
 
-    dirs = ecore_list_new();
-    ecore_list_free_cb_set(dirs, ECORE_FREE_CB(eina_stringshare_del));
     if (!path) return dirs;
 
     tmp = strdup(path);
@@ -197,14 +195,14 @@ efreet_dirs_get(const char *key, const char *fallback)
     while (p)
     {
         *p = '\0';
-        if (!ecore_list_find(dirs, ECORE_COMPARE_CB(strcmp), s))
-            ecore_list_append(dirs, (void *)eina_stringshare_add(s));
+        if (!eina_list_search_unsorted(dirs, (Eina_Compare_Cb)strcmp, s))
+            dirs = eina_list_append(dirs, (void *)eina_stringshare_add(s));
 
         s = ++p;
         p = strchr(s, ':');
     }
-    if (!ecore_list_find(dirs, ECORE_COMPARE_CB(strcmp), s))
-      ecore_list_append(dirs, (void *)eina_stringshare_add(s));
+    if (!eina_list_search_unsorted(dirs, ECORE_COMPARE_CB(strcmp), s))
+      dirs = eina_list_append(dirs, (void *)eina_stringshare_add(s));
     FREE(tmp);
 
     return dirs;
index 021c89b..d6b9f24 100644 (file)
 #include <Ecore_Data.h>
 
 EAPI const char *efreet_data_home_get(void);
-EAPI Ecore_List *efreet_data_dirs_get(void);
+EAPI Eina_List *efreet_data_dirs_get(void);
 
 EAPI const char *efreet_config_home_get(void);
-EAPI Ecore_List *efreet_config_dirs_get(void);
+EAPI Eina_List *efreet_config_dirs_get(void);
 
 EAPI const char *efreet_cache_home_get(void);
 
index b0f057e..5db998a 100644 (file)
@@ -18,7 +18,7 @@ static Eina_Hash *efreet_desktop_cache = NULL;
 /**
  * A list of the desktop types available
  */
-static Ecore_List *efreet_desktop_types = NULL;
+static Eina_List *efreet_desktop_types = NULL;
 
 /**
  * A unique id for each tmp file created while building a command
@@ -74,7 +74,7 @@ static char *efreet_string_append(char *dest, int *size,
                                     int *len, const char *src);
 static char *efreet_string_append_char(char *dest, int *size,
                                         int *len, char c);
-static Ecore_List *efreet_desktop_command_build(Efreet_Desktop_Command *command);
+static Eina_List *efreet_desktop_command_build(Efreet_Desktop_Command *command);
 static void efreet_desktop_command_free(Efreet_Desktop_Command *command);
 static char *efreet_desktop_command_append_quoted(char *dest, int *size,
                                                     int *len, char *src);
@@ -106,7 +106,7 @@ static void *efreet_desktop_exec_cb(void *data, Efreet_Desktop *desktop,
 
 static void efreet_desktop_type_info_free(Efreet_Desktop_Type_Info *info);
 static int efreet_desktop_command_flags_get(Efreet_Desktop *desktop);
-static void *efreet_desktop_command_execs_process(Efreet_Desktop_Command *command, Ecore_List *execs);
+static void *efreet_desktop_command_execs_process(Efreet_Desktop_Command *command, Eina_List *execs);
 
 /**
  * @internal
@@ -121,10 +121,7 @@ efreet_desktop_init(void)
     if (!ecore_file_init()) return --init;
 
     efreet_desktop_cache = eina_hash_string_superfast_new(NULL);
-
-    efreet_desktop_types = ecore_list_new();
-    ecore_list_free_cb_set(efreet_desktop_types,
-                            ECORE_FREE_CB(efreet_desktop_type_info_free));
+    efreet_desktop_types = NULL;
 
     EFREET_DESKTOP_TYPE_APPLICATION = efreet_desktop_type_add("Application",
                                         efreet_desktop_application_fields_parse,
@@ -147,13 +144,21 @@ efreet_desktop_init(void)
 int
 efreet_desktop_shutdown(void)
 {
+    Efreet_Desktop_Type_Info *info;
+
     if (--init) return init;
     ecore_file_shutdown();
     eina_stringshare_shutdown();
 
     IF_RELEASE(desktop_environment);
     IF_FREE_HASH(efreet_desktop_cache);
-    IF_FREE_LIST(efreet_desktop_types);
+    while (efreet_desktop_types)
+    {
+        info = eina_list_data_get(efreet_desktop_types);
+        efreet_desktop_type_info_free(info);
+        efreet_desktop_types = eina_list_remove_list(efreet_desktop_types,
+                                                     efreet_desktop_types);
+    }
 
     return init;
 }
@@ -353,6 +358,8 @@ efreet_desktop_read(Efreet_Desktop *desktop)
 static void
 efreet_desktop_clear(Efreet_Desktop *desktop)
 {
+    char *data;
+
     IF_FREE(desktop->name);
     IF_FREE(desktop->generic_name);
     IF_FREE(desktop->comment);
@@ -366,15 +373,25 @@ efreet_desktop_clear(Efreet_Desktop *desktop)
 
     IF_FREE_LIST(desktop->only_show_in);
     IF_FREE_LIST(desktop->not_show_in);
-    IF_FREE_LIST(desktop->categories);
-    IF_FREE_LIST(desktop->mime_types);
+    while (desktop->categories)
+    {
+        data = eina_list_data_get(desktop->categories);
+        eina_stringshare_del(data);
+        desktop->categories = eina_list_remove_list(desktop->categories, desktop->categories);
+    }
+    while (desktop->mime_types)
+    {
+        data = eina_list_data_get(desktop->mime_types);
+        eina_stringshare_del(data);
+        desktop->mime_types = eina_list_remove_list(desktop->mime_types, desktop->mime_types);
+    }
 
     IF_FREE_HASH(desktop->x);
 
     if (desktop->type_data)
     {
         Efreet_Desktop_Type_Info *info;
-        info = ecore_list_index_goto(efreet_desktop_types, desktop->type);
+        info = eina_list_nth(efreet_desktop_types, desktop->type);
         if (info->free_func)
             info->free_func(desktop->type_data);
     }
@@ -397,7 +414,7 @@ efreet_desktop_save(Efreet_Desktop *desktop)
     efreet_ini_section_add(ini, "Desktop Entry");
     efreet_ini_section_set(ini, "Desktop Entry");
 
-    info = ecore_list_index_goto(efreet_desktop_types, desktop->type);
+    info = eina_list_nth(efreet_desktop_types, desktop->type);
     if (info)
     {
         efreet_ini_string_set(ini, "Type", info->type);
@@ -494,15 +511,24 @@ efreet_desktop_free(Efreet_Desktop *desktop)
 
     IF_FREE_LIST(desktop->only_show_in);
     IF_FREE_LIST(desktop->not_show_in);
-    IF_FREE_LIST(desktop->categories);
-    IF_FREE_LIST(desktop->mime_types);
+
+    while (desktop->categories)
+    {
+        eina_stringshare_del(eina_list_data_get(desktop->categories));
+        desktop->categories = eina_list_remove_list(desktop->categories, desktop->categories);
+    }
+    while (desktop->mime_types)
+    {
+        eina_stringshare_del(eina_list_data_get(desktop->mime_types));
+        desktop->mime_types = eina_list_remove_list(desktop->mime_types, desktop->mime_types);
+    }
 
     IF_FREE_HASH(desktop->x);
 
     if (desktop->type_data)
     {
         Efreet_Desktop_Type_Info *info;
-        info = ecore_list_index_goto(efreet_desktop_types, desktop->type);
+        info = eina_list_nth(efreet_desktop_types, desktop->type);
         if (info->free_func)
             info->free_func(desktop->type_data);
     }
@@ -518,7 +544,7 @@ efreet_desktop_free(Efreet_Desktop *desktop)
  * @brief Parses the @a desktop exec line and returns an Ecore_Exe.
  */
 EAPI void
-efreet_desktop_exec(Efreet_Desktop *desktop, Ecore_List *files, void *data)
+efreet_desktop_exec(Efreet_Desktop *desktop, Eina_List *files, void *data)
 {
     efreet_desktop_command_get(desktop, files, efreet_desktop_exec_cb, data);
 }
@@ -564,7 +590,7 @@ EAPI unsigned int
 efreet_desktop_category_count_get(Efreet_Desktop *desktop)
 {
     if (!desktop || !desktop->categories) return 0;
-    return ecore_list_count(desktop->categories);
+    return eina_list_count(desktop->categories);
 }
 
 /**
@@ -577,17 +603,10 @@ efreet_desktop_category_add(Efreet_Desktop *desktop, const char *category)
 {
     if (!desktop) return;
 
-    if (!desktop->categories)
-    {
-        desktop->categories = ecore_list_new();
-        ecore_list_free_cb_set(desktop->categories,
-                                ECORE_FREE_CB(eina_stringshare_del));
-    }
-    else
-        if (ecore_list_find(desktop->categories,
-                                ECORE_COMPARE_CB(strcmp), category)) return;
+    if (eina_list_search_unsorted(desktop->categories,
+                                  (Eina_Compare_Cb)strcmp, category)) return;
 
-    ecore_list_append(desktop->categories,
+    desktop->categories = eina_list_append(desktop->categories,
                         (void *)eina_stringshare_add(category));
 }
 
@@ -600,17 +619,20 @@ efreet_desktop_category_add(Efreet_Desktop *desktop, const char *category)
 EAPI int
 efreet_desktop_category_del(Efreet_Desktop *desktop, const char *category)
 {
-    int found = 0;
+    char *found = NULL;
+
     if (!desktop || !desktop->categories) return 0;
 
-    if (ecore_list_find(desktop->categories,
-                            ECORE_COMPARE_CB(strcmp), category))
+    if ((found = eina_list_search_unsorted(desktop->categories,
+                                           (Eina_Compare_Cb)strcmp, category)))
     {
-        found = 1;
-        ecore_list_remove(desktop->categories);
+        eina_stringshare_del(found);
+        desktop->categories = eina_list_remove(desktop->categories, found);
+
+        return 1;
     }
 
-    return found;
+    return 0;
 }
 
 /**
@@ -632,7 +654,7 @@ efreet_desktop_type_add(const char *type, Efreet_Desktop_Type_Parse_Cb parse_fun
     info = NEW(Efreet_Desktop_Type_Info, 1);
     if (!info) return 0;
 
-    id = ecore_list_count(efreet_desktop_types);
+    id = eina_list_count(efreet_desktop_types);
 
     info->id = id;
     info->type = strdup(type);
@@ -640,7 +662,7 @@ efreet_desktop_type_add(const char *type, Efreet_Desktop_Type_Parse_Cb parse_fun
     info->save_func = save_func;
     info->free_func = free_func;
 
-    ecore_list_append(efreet_desktop_types, info);
+    efreet_desktop_types = eina_list_append(efreet_desktop_types, info);
 
     return id;
 }
@@ -657,7 +679,7 @@ EAPI int
 efreet_desktop_type_alias(int from_type, const char *alias)
 {
     Efreet_Desktop_Type_Info *info;
-    info = ecore_list_index_goto(efreet_desktop_types, from_type);
+    info = eina_list_nth(efreet_desktop_types, from_type);
     if (!info) return -1;
 
     return efreet_desktop_type_add(alias, info->parse_func, info->save_func, info->free_func);
@@ -696,11 +718,11 @@ static Efreet_Desktop_Type_Info *
 efreet_desktop_type_parse(const char *type_str)
 {
     Efreet_Desktop_Type_Info *info;
+    Eina_List *l;
 
     if (!type_str) return NULL;
 
-    ecore_list_first_goto(efreet_desktop_types);
-    while ((info = ecore_list_next(efreet_desktop_types)))
+    EINA_LIST_FOREACH(efreet_desktop_types, l, info)
     {
         if (!strcmp(info->type, type_str))
             return info;
@@ -711,23 +733,18 @@ efreet_desktop_type_parse(const char *type_str)
 
 /**
  * @param string: the raw string list
- * @return an Ecore_List of ecore string's
+ * @return an Eina_List of ecore string's
  * @brief Parse ';' separate list of strings according to the desktop spec
  */
-EAPI Ecore_List *
+EAPI Eina_List *
 efreet_desktop_string_list_parse(const char *string)
 {
-    Ecore_List *list;
+    Eina_List *list = NULL;
     char *tmp;
     char *s, *p;
 
     if (!string) return NULL;
 
-    list = ecore_list_new();
-    if (!list) return NULL;
-
-    ecore_list_free_cb_set(list, ECORE_FREE_CB(eina_stringshare_del));
-
     tmp = strdup(string);
     s = tmp;
 
@@ -735,7 +752,7 @@ efreet_desktop_string_list_parse(const char *string)
     {
         if (p > tmp && *(p-1) == '\\') continue;
         *p = '\0';
-        ecore_list_append(list, (void *)eina_stringshare_add(s));
+        list = eina_list_append(list, (void *)eina_stringshare_add(s));
         s = p + 1;
     }
     /* If this is true, the .desktop file does not follow the standard */
@@ -745,7 +762,7 @@ efreet_desktop_string_list_parse(const char *string)
         printf("[Efreet]: Found a string list without ';' "
                 "at the end: %s\n", string);
 #endif
-        ecore_list_append(list, (void *)eina_stringshare_add(s));
+        list = eina_list_append(list, (void *)eina_stringshare_add(s));
     }
 
     free(tmp);
@@ -754,25 +771,25 @@ efreet_desktop_string_list_parse(const char *string)
 }
 
 /**
- * @param list: Ecore_List with strings
+ * @param list: Eina_List with strings
  * @return a raw string list
  * @brief Create a ';' separate list of strings according to the desktop spec
  */
 EAPI char *
-efreet_desktop_string_list_join(Ecore_List *list)
+efreet_desktop_string_list_join(Eina_List *list)
 {
+    Eina_List *l;
     const char *tmp;
     char *string;
     size_t size, pos, len;
 
-    if (ecore_list_empty_is(list)) return strdup("");
+    if (!list) return strdup("");
 
     size = 1024;
     string = malloc(size);
     pos = 0;
 
-    ecore_list_first_goto(list);
-    while ((tmp = ecore_list_next(list)))
+    EINA_LIST_FOREACH(list, l, tmp)
     {
         len = strlen(tmp);
         /* +1 for ';' */
@@ -1041,54 +1058,35 @@ efreet_desktop_x_fields_save(const Eina_Hash *hash, const void *key, void *value
 static int
 efreet_desktop_environment_check(Efreet_Ini *ini)
 {
-    Ecore_List *list;
-    const char *val;
+    Eina_List *list, *l;
+    int found = 0;
+    char *val;
+
+    if (!desktop_environment)
+      return 1;
 
     list = efreet_desktop_string_list_parse(efreet_ini_string_get(ini, "OnlyShowIn"));
     if (list)
     {
-        int found = 0;
-
-        if (desktop_environment)
-        {
-            ecore_list_first_goto(list);
-            while ((val = ecore_list_next(list)))
+       EINA_LIST_FREE(list, val)
             {
                 if (!strcmp(val, desktop_environment))
-                {
                     found = 1;
-                    break;
-                }
-            }
+           eina_stringshare_del(val);
         }
 
-        ecore_list_destroy(list);
         return found;
     }
 
-    if (desktop_environment)
-    {
-        int found = 0;
-
         list = efreet_desktop_string_list_parse(efreet_ini_string_get(ini, "NotShowIn"));
-        if (list)
-        {
-            ecore_list_first_goto(list);
-            while ((val = ecore_list_next(list)))
+    EINA_LIST_FREE(list, val)
             {
                 if (!strcmp(val, desktop_environment))
-                {
                     found = 1;
-                    break;
-                }
-            }
-            ecore_list_destroy(list);
+        eina_stringshare_del(val);
         }
 
         return !found;
-    }
-
-    return 1;
 }
 
 
@@ -1102,7 +1100,7 @@ efreet_desktop_environment_check(Efreet_Ini *ini)
  * @brief Get a command to use to execute a desktop entry.
  */
 EAPI void *
-efreet_desktop_command_get(Efreet_Desktop *desktop, Ecore_List *files,
+efreet_desktop_command_get(Efreet_Desktop *desktop, Eina_List *files,
                             Efreet_Desktop_Command_Cb func, void *data)
 {
     return efreet_desktop_command_progress_get(desktop, files, func, NULL, data);
@@ -1116,30 +1114,25 @@ efreet_desktop_command_get(Efreet_Desktop *desktop, Ecore_List *files,
  *
  * The returned list and each of its elements must be freed.
  */
-EAPI Ecore_List *
-efreet_desktop_command_local_get(Efreet_Desktop *desktop, Ecore_List *files)
+EAPI Eina_List *
+efreet_desktop_command_local_get(Efreet_Desktop *desktop, Eina_List *files)
 {
     Efreet_Desktop_Command *command;
     char *file;
-    Ecore_List *execs;
+    Eina_List *execs, *l;
 
     if (!desktop || !desktop->exec) return NULL;
 
     command = NEW(Efreet_Desktop_Command, 1);
     if (!command) return 0;
 
-    command->files = ecore_list_new();
     command->desktop = desktop;
 
-    ecore_list_free_cb_set(command->files,
-                            ECORE_FREE_CB(efreet_desktop_command_file_free));
-
     command->flags = efreet_desktop_command_flags_get(desktop);
     /* get the required info for each file passed in */
     if (files)
     {
-        ecore_list_first_goto(files);
-        while ((file = ecore_list_next(files)))
+        EINA_LIST_FOREACH(files, l, file)
         {
             Efreet_Desktop_Command_File *dcf;
 
@@ -1150,7 +1143,7 @@ efreet_desktop_command_local_get(Efreet_Desktop *desktop, Ecore_List *files)
                 efreet_desktop_command_file_free(dcf);
                 continue;
             }
-            ecore_list_append(command->files, dcf);
+            command->files = eina_list_append(command->files, dcf);
         }
     }
 
@@ -1173,13 +1166,15 @@ efreet_desktop_command_local_get(Efreet_Desktop *desktop, Ecore_List *files)
  * updates for downloading of remote URI's passed in.
  */
 EAPI void *
-efreet_desktop_command_progress_get(Efreet_Desktop *desktop, Ecore_List *files,
+efreet_desktop_command_progress_get(Efreet_Desktop *desktop, Eina_List *files,
                                     Efreet_Desktop_Command_Cb cb_command,
                                     Efreet_Desktop_Progress_Cb cb_progress,
                                     void *data)
 {
     Efreet_Desktop_Command *command;
+    Eina_List *l;
     char *file;
+    char *exec;
     void *ret = NULL;
 
     if (!desktop || !cb_command || !desktop->exec) return NULL;
@@ -1190,34 +1185,34 @@ efreet_desktop_command_progress_get(Efreet_Desktop *desktop, Ecore_List *files,
     command->cb_command = cb_command;
     command->cb_progress = cb_progress;
     command->data = data;
-    command->files = ecore_list_new();
     command->desktop = desktop;
 
-    ecore_list_free_cb_set(command->files,
-                            ECORE_FREE_CB(efreet_desktop_command_file_free));
-
     command->flags = efreet_desktop_command_flags_get(desktop);
     /* get the required info for each file passed in */
     if (files)
     {
-        ecore_list_first_goto(files);
-        while ((file = ecore_list_next(files)))
+        EINA_LIST_FOREACH(files, l, file)
         {
             Efreet_Desktop_Command_File *dcf;
 
             dcf = efreet_desktop_command_file_process(command, file);
             if (!dcf) continue;
-            ecore_list_append(command->files, dcf);
+            command->files = eina_list_append(command->files, dcf);
             command->num_pending += dcf->pending;
         }
     }
 
     if (command->num_pending == 0)
     {
-        Ecore_List *execs;
+        Eina_List *execs;
         execs = efreet_desktop_command_build(command);
         ret = efreet_desktop_command_execs_process(command, execs);
-        ecore_list_destroy(execs);
+        while (execs)
+        {
+            exec = eina_list_data_get(execs);
+            free(exec);
+            execs = eina_list_remove_list(execs, execs);
+        }
         efreet_desktop_command_free(command);
     }
 
@@ -1289,15 +1284,15 @@ efreet_desktop_command_flags_get(Efreet_Desktop *desktop)
  * @param execs
  */
 static void *
-efreet_desktop_command_execs_process(Efreet_Desktop_Command *command, Ecore_List *execs)
+efreet_desktop_command_execs_process(Efreet_Desktop_Command *command, Eina_List *execs)
 {
+    Eina_List *l;
     char *exec;
     int num;
     void *ret = NULL;
    
-    num = ecore_list_count(execs);
-    ecore_list_first_goto(execs);
-    while ((exec = ecore_list_next(execs)))
+    num = eina_list_count(execs);
+    EINA_LIST_FOREACH(execs, l, exec)
     {
         ret = command->cb_command(command->data, command->desktop, exec, --num);
     }
@@ -1313,31 +1308,26 @@ efreet_desktop_command_execs_process(Efreet_Desktop_Command *command, Ecore_List
  * @param command: the command to build
  * @return a list of executable strings
  */
-static Ecore_List *
+static Eina_List *
 efreet_desktop_command_build(Efreet_Desktop_Command *command)
 {
     Efreet_Desktop_Command_File *file = NULL;
-    int first = 1;
-    Ecore_List *execs;
+    Eina_List *execs = NULL;
+    Eina_List *l;
     char *exec;
 
-    execs = ecore_list_new();
-
-    ecore_list_first_goto(command->files);
 
     /* if the Exec field appends multiple, that will run the list to the end,
      * causing this loop to only run once. otherwise, this loop will generate a
      * command for each file in the list. if the list is empty, this
      * will run once, removing any file field codes */
-    while ((file = ecore_list_next(command->files)) || first)
+    EINA_LIST_FOREACH(command->files, l, file)
     {
         const char *p;
         int len = 0;
         int size = PATH_MAX;
         int file_added = 0;
 
-        first = 0;
-
         exec = malloc(size);
         p = command->desktop->exec;
         len = 0;
@@ -1437,7 +1427,7 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
 #endif
         exec[len++] = '\0';
 
-        ecore_list_append(execs, exec);
+        execs = eina_list_append(execs, exec);
 
         /* If no file was added, then the Exec field doesn't contain any file
          * fields (fFuUdDnN). We only want to run the app once in this case. */
@@ -1450,9 +1440,17 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
 static void
 efreet_desktop_command_free(Efreet_Desktop_Command *command)
 {
+    Efreet_Desktop_Command_File *dcf;
+
     if (!command) return;
 
-    IF_FREE_LIST(command->files);
+    while (command->files)
+    {
+        dcf = eina_list_data_get(command->files);
+        efreet_desktop_command_file_free(dcf);
+        command->files = eina_list_remove_list(command->files,
+                                               command->files);
+    }
     FREE(command);
 }
 
@@ -1490,12 +1488,12 @@ efreet_desktop_command_append_multiple(char *dest, int *size, int *len,
                                         char type)
 {
     Efreet_Desktop_Command_File *file;
+    Eina_List *l;
     int first = 1;
 
     if (!command->files) return dest;
 
-    ecore_list_first_goto(command->files);
-    while ((file = ecore_list_next(command->files)))
+    EINA_LIST_FOREACH(command->files, l, file)
     {
         if (first)
             first = 0;
@@ -1759,6 +1757,8 @@ efreet_desktop_cb_download_complete(void *data, const char *file __UNUSED__,
                                                         int status __UNUSED__)
 {
     Efreet_Desktop_Command_File *f;
+    char *exec;
+
     f = data;
 
     /* XXX check status... error handling, etc */
@@ -1767,11 +1767,16 @@ efreet_desktop_cb_download_complete(void *data, const char *file __UNUSED__,
 
     if (f->command->num_pending <= 0)
     {
-        Ecore_List *execs;
+        Eina_List *execs;
         execs = efreet_desktop_command_build(f->command);
         /* TODO: Need to handle the return value from efreet_desktop_command_execs_process */
         efreet_desktop_command_execs_process(f->command, execs);
-        ecore_list_destroy(execs);
+        while (execs)
+        {
+            exec = eina_list_data_get(execs);
+            free(exec);
+            execs = eina_list_remove_list(execs, execs);
+        }
         efreet_desktop_command_free(f->command);
     }
 }
index a830ede..f301463 100644 (file)
@@ -75,12 +75,12 @@ struct _Efreet_Desktop
                                 the given string as it's WM class or WM name */
     char *url;              /**< URL to access if type is EFREET_TYPE_LINK */
 
-    Ecore_List *only_show_in;   /**< list of environments that should
+    Eina_List  *only_show_in;   /**< list of environments that should
                                                     display the icon */
-    Ecore_List *not_show_in;    /**< list of environments that shoudn't
+    Eina_List  *not_show_in;    /**< list of environments that shoudn't
                                                     display the icon */
-    Ecore_List *categories;     /**< Categories in which item should be shown */
-    Ecore_List *mime_types;     /**< The mime types supppored by this app */
+    Eina_List  *categories;     /**< Categories in which item should be shown */
+    Eina_List  *mime_types;     /**< The mime types supppored by this app */
 
     unsigned char no_display:1;        /**< Don't display this application in menus */
     unsigned char hidden:1;            /**< User delete the item */
@@ -103,21 +103,21 @@ EAPI int               efreet_desktop_save_as(Efreet_Desktop *desktop,
                                                 const char *file);
 
 EAPI void              efreet_desktop_exec(Efreet_Desktop *desktop,
-                                      Ecore_List *files, void *data);
+                                           Eina_List *files, void *data);
 
 EAPI void              efreet_desktop_environment_set(const char *environment);
 EAPI const char       *efreet_desktop_environment_get(void);
 EAPI void             *efreet_desktop_command_progress_get(Efreet_Desktop *desktop,
-                                         Ecore_List *files,
+                                         Eina_List *files,
                                          Efreet_Desktop_Command_Cb cb_command,
                                          Efreet_Desktop_Progress_Cb cb_prog,
                                          void *data);
 EAPI void              *efreet_desktop_command_get(Efreet_Desktop *desktop,
-                                         Ecore_List *files,
+                                         Eina_List *files,
                                          Efreet_Desktop_Command_Cb func,
                                          void *data);
-EAPI Ecore_List *      efreet_desktop_command_local_get(Efreet_Desktop *desktop,
-                                         Ecore_List *files);
+EAPI Eina_List *      efreet_desktop_command_local_get(Efreet_Desktop *desktop,
+                                         Eina_List *files);
 
 EAPI unsigned int      efreet_desktop_category_count_get(Efreet_Desktop *desktop);
 EAPI void              efreet_desktop_category_add(Efreet_Desktop *desktop,
@@ -133,8 +133,8 @@ EAPI int               efreet_desktop_type_alias (int from_type,
                                              const char *alias);
 EAPI void             *efreet_desktop_type_data_get(Efreet_Desktop *desktop);
 
-EAPI Ecore_List       *efreet_desktop_string_list_parse(const char *string);
-EAPI char             *efreet_desktop_string_list_join(Ecore_List *list);
+EAPI Eina_List        *efreet_desktop_string_list_parse(const char *string);
+EAPI char             *efreet_desktop_string_list_join(Eina_List *list);
 
 EAPI void              efreet_desktop_cache_flush(void);
 
index 5b95662..aead8b5 100644 (file)
@@ -5,8 +5,8 @@
 static char *efreet_icon_deprecated_user_dir = NULL;
 static char *efreet_icon_user_dir = NULL;
 static Eina_Hash *efreet_icon_themes = NULL;
-static Ecore_List *efreet_icon_extensions = NULL;
-static Ecore_List *efreet_extra_icon_dirs = NULL;
+static Eina_List *efreet_icon_extensions = NULL;
+static Eina_List *efreet_extra_icon_dirs = NULL;
 static Eina_Hash *efreet_icon_cache = NULL;
 
 static int efreet_icon_init_count = 0;
@@ -27,12 +27,12 @@ static char *efreet_icon_find_fallback(Efreet_Icon_Theme *theme,
                                        const char *icon,
                                        unsigned int size);
 static char *efreet_icon_list_find_fallback(Efreet_Icon_Theme *theme,
-                                            Ecore_List *icons,
+                                            Eina_List *icons,
                                             unsigned int size);
 static char *efreet_icon_find_helper(Efreet_Icon_Theme *theme,
                                      const char *icon, unsigned int size);
 static char *efreet_icon_list_find_helper(Efreet_Icon_Theme *theme,
-                                          Ecore_List *icons, unsigned int size);
+                                          Eina_List *icons, unsigned int size);
 static char *efreet_icon_lookup_icon(Efreet_Icon_Theme *theme,
                                      const char *icon_name, unsigned int size);
 static char *efreet_icon_fallback_icon(const char *icon_name);
@@ -74,11 +74,20 @@ static int efreet_icon_theme_cache_check_dir(Efreet_Icon_Theme *theme,
                                                         const char *dir);
 
 static int efreet_icon_cache_find(Efreet_Icon_Cache *value, const char *key);
-static void efreet_icon_cache_flush(Ecore_List *list);
+static void efreet_icon_cache_flush(Eina_List *list);
 static void efreet_icon_cache_free(Efreet_Icon_Cache *value);
 static char *efreet_icon_cache_check(Efreet_Icon_Theme *theme, const char *icon, unsigned int size);
 static void efreet_icon_cache_add(Efreet_Icon_Theme *theme, const char *icon, unsigned int size, const char *value);
 
+static void
+_efreet_icon_cache_list_destroy(Eina_List *list)
+{
+   Efreet_Icon_Cache *cache;
+
+   EINA_LIST_FREE(list, cache)
+     efreet_icon_cache_free(cache);
+}
+
 /**
  * @internal
  * @return Returns 1 on success or 0 on failure
@@ -102,16 +111,13 @@ efreet_icon_init(void)
         }
 
         /* setup the default extension list */
-        efreet_icon_extensions = ecore_list_new();
-        ecore_list_free_cb_set(efreet_icon_extensions, free);
-
         for (i = 0; default_exts[i] != NULL; i++)
-            ecore_list_append(efreet_icon_extensions, strdup(default_exts[i]));
+            efreet_icon_extensions = eina_list_append(efreet_icon_extensions, strdup(default_exts[i]));
 
         efreet_icon_themes = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_icon_theme_free));
-        efreet_extra_icon_dirs = ecore_list_new();
 
-        efreet_icon_cache = eina_hash_pointer_new(EINA_FREE_CB(ecore_list_destroy));
+        efreet_extra_icon_dirs = NULL;
+        efreet_icon_cache = eina_hash_pointer_new(EINA_FREE_CB(_efreet_icon_cache_list_destroy));
     }
 
     return 1;
@@ -185,7 +191,7 @@ efreet_icon_user_dir_get(void)
 EAPI void
 efreet_icon_extension_add(const char *ext)
 {
-    ecore_list_prepend(efreet_icon_extensions, strdup(ext));
+    efreet_icon_extensions  = eina_list_prepend(efreet_icon_extensions, strdup(ext));
 }
 
 /**
@@ -196,7 +202,7 @@ efreet_icon_extension_add(const char *ext)
  * from first to last directory in this list. the strings in the list should
  * be created with eina_stringshare_add().
  */
-EAPI Ecore_List *
+EAPI Eina_List *
 efreet_icon_extra_list_get(void)
 {
     return efreet_extra_icon_dirs;
@@ -205,7 +211,7 @@ efreet_icon_extra_list_get(void)
 static Eina_Bool
 _hash_keys(Eina_Hash *hash, const void *key, void *list)
 {
-  ecore_list_append(list, key);
+  *(Eina_List**)list = eina_list_append(*(Eina_List**)list, key);
   return EINA_TRUE;
 }
 /**
@@ -214,10 +220,11 @@ _hash_keys(Eina_Hash *hash, const void *key, void *list)
  * @brief Retrieves all of the non-hidden icon themes available on the system.
  * The returned list must be freed. Do not free the list data.
  */
-EAPI Ecore_List *
+EAPI Eina_List *
 efreet_icon_theme_list_get(void)
 {
-    Ecore_List *list, *theme_list;
+    Eina_List *list = NULL;
+    Eina_List *theme_list = NULL;
     char *dir;
     Eina_Iterator *it;
 
@@ -226,13 +233,11 @@ efreet_icon_theme_list_get(void)
     efreet_icon_theme_dir_validity_check();
 
     /* create the list for the user */
-    list = ecore_list_new();
-    theme_list = ecore_list_new();
     it = eina_hash_iterator_key_new(efreet_icon_themes);
-    eina_iterator_foreach(it, EINA_EACH(_hash_keys), theme_list);
+    eina_iterator_foreach(it, EINA_EACH(_hash_keys), &theme_list);
     eina_iterator_free(it);
-    ecore_list_first_goto(theme_list);
-    while ((dir = ecore_list_next(theme_list)))
+
+    EINA_LIST_FREE(theme_list, dir)
     {
         Efreet_Icon_Theme *theme;
 
@@ -242,9 +247,8 @@ efreet_icon_theme_list_get(void)
         if (!theme->name.name) continue;
 #endif
 
-        ecore_list_append(list, theme);
+        list = eina_list_append(list, theme);
     }
-    ecore_list_destroy(theme_list);
 
     return list;
 }
@@ -282,6 +286,7 @@ efreet_icon_theme_find(const char *theme_name)
 static char *
 efreet_icon_remove_extension(const char *icon)
 {
+    Eina_List *l;
     char *tmp = NULL, *ext = NULL;
 
     tmp = strdup(icon);
@@ -289,8 +294,7 @@ efreet_icon_remove_extension(const char *icon)
     if (ext)
     {
         const char *ext2;
-        ecore_list_first_goto(efreet_icon_extensions);
-        while ((ext2 = ecore_list_next(efreet_icon_extensions)))
+        EINA_LIST_FOREACH(efreet_icon_extensions, l, ext2)
         {
             if (!strcmp(ext, ext2))
             {
@@ -386,28 +390,31 @@ efreet_icon_path_find(const char *theme_name, const char *icon, unsigned int siz
  * back. This is useful when searching for mimetype icons.
  */
 EAPI char *
-efreet_icon_list_find(const char *theme_name, Ecore_List *icons,
+efreet_icon_list_find(const char *theme_name, Eina_List *icons,
                                                             unsigned int size)
 {
+    Eina_List *l;
     const char *icon = NULL;
     char *value = NULL;
+    char *data;
     Efreet_Icon_Theme *theme;
 
     theme = efreet_icon_find_theme_check(theme_name);
 
-    ecore_list_first_goto(icons);
 #ifdef SLOPPY_SPEC
     {
-        Ecore_List *tmps = NULL;
+        Eina_List *tmps = NULL;
 
-        tmps = ecore_list_new();
-        ecore_list_free_cb_set(tmps, free);
-        ecore_list_first_goto(icons);
-        while ((icon = ecore_list_next(icons)))
-            ecore_list_append(tmps, efreet_icon_remove_extension(icon));
+        EINA_LIST_FOREACH(icons, l, icon)
+            tmps = eina_list_append(tmps, efreet_icon_remove_extension(icon));
 
         value = efreet_icon_list_find_helper(theme, tmps, size);
-        ecore_list_destroy(tmps);
+        while (tmps)
+        {
+            data = eina_list_data_get(tmps);
+            free(data);
+            tmps = eina_list_remove_list(tmps, tmps);
+        }
     }
 #else
     value = efreet_icon_list_find_helper(theme, icons, size);
@@ -418,8 +425,7 @@ efreet_icon_list_find(const char *theme_name, Ecore_List *icons,
      */
     if (!value || (value == NON_EXISTING))
     {
-        ecore_list_first_goto(icons);
-        while ((icon = ecore_list_next(icons)))
+        EINA_LIST_FOREACH(icons, l, icon)
         {
             value = efreet_icon_fallback_icon(icon);
             if (value && (value != NON_EXISTING))
@@ -470,13 +476,13 @@ static char *
 efreet_icon_find_fallback(Efreet_Icon_Theme *theme,
                           const char *icon, unsigned int size)
 {
+    Eina_List *l;
     char *parent = NULL;
     char *value = NULL;
 
     if (theme->inherits)
     {
-        ecore_list_first_goto(theme->inherits);
-        while ((parent = ecore_list_next(theme->inherits)))
+        EINA_LIST_FOREACH(theme->inherits, l, parent)
         {
             Efreet_Icon_Theme *parent_theme;
 
@@ -547,15 +553,15 @@ efreet_icon_find_helper(Efreet_Icon_Theme *theme,
  */
 static char *
 efreet_icon_list_find_fallback(Efreet_Icon_Theme *theme,
-                               Ecore_List *icons, unsigned int size)
+                               Eina_List *icons, unsigned int size)
 {
+    Eina_List *l;
     char *parent = NULL;
     char *value = NULL;
 
     if (theme->inherits)
     {
-        ecore_list_first_goto(theme->inherits);
-        while ((parent = ecore_list_next(theme->inherits)))
+        EINA_LIST_FOREACH(theme->inherits, l, parent)
         {
             Efreet_Icon_Theme *parent_theme;
 
@@ -595,8 +601,9 @@ efreet_icon_list_find_fallback(Efreet_Icon_Theme *theme,
  */
 static char *
 efreet_icon_list_find_helper(Efreet_Icon_Theme *theme,
-                             Ecore_List *icons, unsigned int size)
+                             Eina_List *icons, unsigned int size)
 {
+    Eina_List *l;
     char *value = NULL;
     const char *icon = NULL;
     static int recurse = 0;
@@ -610,8 +617,7 @@ efreet_icon_list_find_helper(Efreet_Icon_Theme *theme,
     if (recurse > 256) return NULL;
     recurse++;
 
-    ecore_list_first_goto(icons);
-    while ((icon = ecore_list_next(icons)))
+    EINA_LIST_FOREACH(icons, l, icon)
     {
         value = efreet_icon_lookup_icon(theme, icon, size);
         if (value && (value != NON_EXISTING))
@@ -639,19 +645,19 @@ static char *
 efreet_icon_lookup_icon(Efreet_Icon_Theme *theme, const char *icon_name,
                                                     unsigned int size)
 {
+    Eina_List *l;
     char *icon = NULL, *tmp = NULL;
     Efreet_Icon_Theme_Directory *dir;
     int minimal_size = INT_MAX;
 
-    if (!theme || (theme->paths.count == 0) || !icon_name || !size)
+    if (!theme || (theme->paths == NULL) || !icon_name || !size)
         return NULL;
 
     icon = efreet_icon_cache_check(theme, icon_name, size);
     if (icon) return icon;
 
     /* search for allowed size == requested size */
-    ecore_list_first_goto(theme->directories);
-    while ((dir = ecore_list_next(theme->directories)))
+    EINA_LIST_FOREACH(theme->directories, l, dir)
     {
         if (!efreet_icon_directory_size_match(dir, size)) continue;
         icon = efreet_icon_lookup_directory(theme, dir,
@@ -664,8 +670,7 @@ efreet_icon_lookup_icon(Efreet_Icon_Theme *theme, const char *icon_name,
     }
 
     /* search for any icon that matches */
-    ecore_list_first_goto(theme->directories);
-    while ((dir = ecore_list_next(theme->directories)))
+    EINA_LIST_FOREACH(theme->directories, l, dir)
     {
         int distance;
 
@@ -701,21 +706,15 @@ efreet_icon_lookup_directory(Efreet_Icon_Theme *theme,
                              Efreet_Icon_Theme_Directory *dir,
                              const char *icon_name)
 {
-    if (theme->paths.count == 1)
-        return efreet_icon_lookup_directory_helper(dir, theme->paths.path, icon_name);
-
-    else
-    {
+   Eina_List *l;
         char *icon;
         const char *path;
 
-        ecore_list_first_goto(theme->paths.path);
-        while ((path = ecore_list_next(theme->paths.path)))
+   EINA_LIST_FOREACH(theme->paths, l, path)
         {
             icon = efreet_icon_lookup_directory_helper(dir, path, icon_name);
             if (icon) return icon;
         }
-    }
 
     return NULL;
 }
@@ -802,12 +801,11 @@ efreet_icon_fallback_icon(const char *icon_name)
         icon = efreet_icon_fallback_dir_scan(efreet_icon_user_dir_get(), icon_name);
     if (!icon)
     {
-        Ecore_List *xdg_dirs;
+        Eina_List *xdg_dirs, *l;
         const char *dir;
         char path[PATH_MAX];
 
-        ecore_list_first_goto(efreet_extra_icon_dirs);
-        while ((dir = ecore_list_next(efreet_extra_icon_dirs)))
+        EINA_LIST_FOREACH(efreet_extra_icon_dirs, l, dir)
         {
             icon = efreet_icon_fallback_dir_scan(dir, icon_name);
             if (icon)
@@ -818,8 +816,8 @@ efreet_icon_fallback_icon(const char *icon_name)
         }
 
         xdg_dirs = efreet_data_dirs_get();
-        ecore_list_first_goto(xdg_dirs);
-        while ((dir = ecore_list_next(xdg_dirs)))
+
+        EINA_LIST_FOREACH(xdg_dirs, l, dir)
         {
             snprintf(path, PATH_MAX, "%s/icons", dir);
             icon = efreet_icon_fallback_dir_scan(path, icon_name);
@@ -848,6 +846,7 @@ efreet_icon_fallback_icon(const char *icon_name)
 static char *
 efreet_icon_fallback_dir_scan(const char *dir, const char *icon_name)
 {
+    Eina_List *l;
     char *icon = NULL;
     char path[PATH_MAX], *ext;
     const char *icon_path[] = { dir, "/", icon_name, NULL };
@@ -856,8 +855,7 @@ efreet_icon_fallback_dir_scan(const char *dir, const char *icon_name)
     if (!dir || !icon_name) return NULL;
 
     size = efreet_array_cat(path, sizeof(path), icon_path);
-    ecore_list_first_goto(efreet_icon_extensions);
-    while ((ext = ecore_list_next(efreet_icon_extensions)))
+    EINA_LIST_FOREACH(efreet_icon_extensions, l, ext)
     {
         ecore_strlcpy(path + size, ext, sizeof(path) - size);
 
@@ -899,6 +897,7 @@ static char *
 efreet_icon_lookup_directory_helper(Efreet_Icon_Theme_Directory *dir,
                                     const char *path, const char *icon_name)
 {
+    Eina_List *l;
     char *icon = NULL;
     char file_path[PATH_MAX];
     const char *ext, *path_strs[] = { path, "/", dir->name, "/", icon_name, NULL };
@@ -906,8 +905,7 @@ efreet_icon_lookup_directory_helper(Efreet_Icon_Theme_Directory *dir,
 
     len = efreet_array_cat(file_path, sizeof(file_path), path_strs);
 
-    ecore_list_first_goto(efreet_icon_extensions);
-    while ((ext = ecore_list_next(efreet_icon_extensions)))
+    EINA_LIST_FOREACH(efreet_icon_extensions, l, ext)
     {
         ecore_strlcpy(file_path + len, ext, sizeof(file_path) - len);
 
@@ -1062,10 +1060,6 @@ efreet_icon_populate(Efreet_Icon *icon, const char *file)
     {
         char *t, *s, *p;
 
-        icon->attach_points = ecore_list_new();
-        ecore_list_free_cb_set(icon->attach_points,
-                            ECORE_FREE_CB(efreet_icon_point_free));
-
         t = strdup(tmp);
         s = t;
         p = t;
@@ -1087,7 +1081,8 @@ efreet_icon_populate(Efreet_Icon *icon, const char *file)
             if (p) *p = '\0';
 
             point->y = atoi(s);
-            ecore_list_append(icon->attach_points, point);
+
+            icon->attach_points = eina_list_append(icon->attach_points, point);
 
             if (p) s = ++p;
             else s = NULL;
@@ -1130,11 +1125,7 @@ efreet_icon_theme_free(Efreet_Icon_Theme *theme)
     IF_FREE(theme->comment);
     IF_FREE(theme->example_icon);
 
-    if (theme->paths.count == 1)
-        IF_FREE(theme->paths.path);
-    else
-        IF_FREE_LIST(theme->paths.path);
-
+    IF_FREE_LIST(theme->paths);
     IF_FREE_LIST(theme->inherits);
     IF_FREE_LIST(theme->directories);
 
@@ -1154,24 +1145,7 @@ efreet_icon_theme_path_add(Efreet_Icon_Theme *theme, const char *path)
 {
     if (!theme || !path) return;
 
-    if (theme->paths.count == 0)
-        theme->paths.path = strdup(path);
-
-    else if (theme->paths.count > 1)
-        ecore_list_append(theme->paths.path, strdup(path));
-
-    else
-    {
-        char *old;
-
-        old = theme->paths.path;
-        theme->paths.path = ecore_list_new();
-        ecore_list_free_cb_set(theme->paths.path, free);
-
-        ecore_list_append(theme->paths.path, old);
-        ecore_list_append(theme->paths.path, strdup(path));
-    }
-    theme->paths.count++;
+    theme->paths = eina_list_append(theme->paths, strdup(path));
 }
 
 /**
@@ -1187,6 +1161,7 @@ efreet_icon_theme_path_add(Efreet_Icon_Theme *theme, const char *path)
 static void
 efreet_icon_theme_cache_check(Efreet_Icon_Theme *theme)
 {
+    Eina_List *l;
     double new_check;
 
     new_check = ecore_time_get();
@@ -1197,15 +1172,11 @@ efreet_icon_theme_cache_check(Efreet_Icon_Theme *theme)
     if (theme->fake)
         efreet_icon_theme_dir_scan_all(theme->name.internal);
 
-    else if (theme->paths.count == 1)
-        efreet_icon_theme_cache_check_dir(theme, theme->paths.path);
-
-    else if (theme->paths.count > 1)
+    else
     {
         char *path;
 
-        ecore_list_first_goto(theme->paths.path);
-        while ((path = ecore_list_next(theme->paths.path)))
+        EINA_LIST_FOREACH(theme->paths, l, path)
         {
             if (!efreet_icon_theme_cache_check_dir(theme, path))
                 break;
@@ -1248,15 +1219,14 @@ efreet_icon_theme_cache_check_dir(Efreet_Icon_Theme *theme, const char *dir)
 static void
 efreet_icon_theme_dir_scan_all(const char *theme_name)
 {
-    Ecore_List *xdg_dirs;
+    Eina_List *xdg_dirs, *l;
     char path[PATH_MAX], *dir;
 
     efreet_icon_theme_dir_scan(efreet_icon_deprecated_user_dir_get(), theme_name);
     efreet_icon_theme_dir_scan(efreet_icon_user_dir_get(), theme_name);
 
     xdg_dirs = efreet_data_dirs_get();
-    ecore_list_first_goto(xdg_dirs);
-    while ((dir = ecore_list_next(xdg_dirs)))
+    EINA_LIST_FOREACH(xdg_dirs, l, dir)
     {
         snprintf(path, sizeof(path), "%s/icons", dir);
         efreet_icon_theme_dir_scan(path, theme_name);
@@ -1384,9 +1354,6 @@ efreet_icon_theme_index_read(Efreet_Icon_Theme *theme, const char *path)
     {
         char *t, *s, *p;
 
-        theme->inherits = ecore_list_new();
-        ecore_list_free_cb_set(theme->inherits, free);
-
         t = strdup(tmp);
         s = t;
         p = strchr(s, ',');
@@ -1395,11 +1362,11 @@ efreet_icon_theme_index_read(Efreet_Icon_Theme *theme, const char *path)
         {
             *p = '\0';
 
-            ecore_list_append(theme->inherits, strdup(s));
+            theme->inherits = eina_list_append(theme->inherits, strdup(s));
             s = ++p;
             p = strchr(s, ',');
         }
-        ecore_list_append(theme->inherits, strdup(s));
+        theme->inherits = eina_list_append(theme->inherits, strdup(s));
 
         FREE(t);
     }
@@ -1411,10 +1378,6 @@ efreet_icon_theme_index_read(Efreet_Icon_Theme *theme, const char *path)
     {
         char *t, *s, *p;
 
-        theme->directories = ecore_list_new();
-        ecore_list_free_cb_set(theme->directories,
-                            ECORE_FREE_CB(efreet_icon_theme_directory_free));
-
         t = strdup(tmp);
         s = t;
         p = s;
@@ -1425,7 +1388,7 @@ efreet_icon_theme_index_read(Efreet_Icon_Theme *theme, const char *path)
 
             if (p) *p = '\0';
 
-            ecore_list_append(theme->directories,
+            theme->directories = eina_list_append(theme->directories,
                             efreet_icon_theme_directory_new(ini, s));
 
             if (p) s = ++p;
@@ -1449,16 +1412,16 @@ efreet_icon_theme_index_read(Efreet_Icon_Theme *theme, const char *path)
 static void
 efreet_icon_theme_dir_validity_check(void)
 {
-    Ecore_List *keys;
+    Eina_List *keys, *l;
     const char *name;
     Eina_Iterator *it;
 
-    keys = ecore_list_new();
+    keys = NULL;
     it = eina_hash_iterator_key_new(efreet_icon_themes);
-    eina_iterator_foreach(it, EINA_EACH(_hash_keys), keys);
+    eina_iterator_foreach(it, EINA_EACH(_hash_keys), &keys);
     eina_iterator_free(it);
-    ecore_list_first_goto(keys);
-    while ((name = ecore_list_next(keys)))
+
+    EINA_LIST_FOREACH(keys, l, name)
     {
         Efreet_Icon_Theme *theme;
 
@@ -1466,7 +1429,8 @@ efreet_icon_theme_dir_validity_check(void)
         if (theme && !theme->valid && !theme->fake)
             eina_hash_del(efreet_icon_themes, name, theme);
     }
-    ecore_list_destroy(keys);
+    while (keys)
+        keys = eina_list_remove_list(keys, keys);
 }
 
 /**
@@ -1561,18 +1525,21 @@ efreet_icon_cache_find(Efreet_Icon_Cache *value, const char *key)
 }
 
 static void
-efreet_icon_cache_flush(Ecore_List *list)
+efreet_icon_cache_flush(Eina_List *list)
 {
     /* TODO:
      * * Dynamic cache size
      * * Maybe add references to cache, so that we sort on how often a value is used
      */
-    while (ecore_list_count(list) > 100)
+    while (eina_list_count(list) > 100)
     {
         Efreet_Icon_Cache *cache;
+       Eina_List *last;
 
-        cache = ecore_list_last_remove(list);
+       last = eina_list_last(list);
+        cache = eina_list_data_get(last);
         efreet_icon_cache_free(cache);
+        list = eina_list_remove_list(list, last);
     }
 }
 
@@ -1589,36 +1556,30 @@ efreet_icon_cache_free(Efreet_Icon_Cache *value)
 static char *
 efreet_icon_cache_check(Efreet_Icon_Theme *theme, const char *icon, unsigned int size)
 {
-    Ecore_List *list;
+    Eina_List *list;
     Efreet_Icon_Cache *cache;
     char key[4096];
     struct stat st;
 
     list = eina_hash_find(efreet_icon_cache, &theme);
-    if (!list)
-    {
-        list = ecore_list_new();
-        ecore_list_free_cb_set(list, ECORE_FREE_CB(efreet_icon_cache_free));
-        eina_hash_add(efreet_icon_cache, &theme, list);
-        return NULL;
-    }
+    if (!list) return NULL;
 
     snprintf(key, sizeof(key), "%s %d", icon, size);
-    cache = ecore_list_find(list, ECORE_COMPARE_CB(efreet_icon_cache_find), key);
+    cache = eina_list_search_unsorted(list, (Eina_Compare_Cb)efreet_icon_cache_find, key);
     if (cache)
     {
-        ecore_list_remove(list);
         if (!cache->path)
         {
-            ecore_list_prepend(list, cache);
+            list = eina_list_promote_list(list, eina_list_data_find_list(list, cache));
             return NON_EXISTING;
         }
         else if (!stat(cache->path, &st) && st.st_mtime == cache->lasttime)
         {
-            ecore_list_prepend(list, cache);
+            list = eina_list_promote_list(list, eina_list_data_find_list(list, cache));
             return strdup(cache->path);
         }
         efreet_icon_cache_free(cache);
+       list = eina_list_remove(list, cache);
     }
     return NULL;
 }
@@ -1626,18 +1587,12 @@ efreet_icon_cache_check(Efreet_Icon_Theme *theme, const char *icon, unsigned int
 static void
 efreet_icon_cache_add(Efreet_Icon_Theme *theme, const char *icon, unsigned int size, const char *value)
 {
-    Ecore_List *list;
+    Eina_List *list, *l;
     Efreet_Icon_Cache *cache;
     char key[4096];
     struct stat st;
 
     list = eina_hash_find(efreet_icon_cache, &theme);
-    if (!list)
-    {
-        list = ecore_list_new();
-        ecore_list_free_cb_set(list, ECORE_FREE_CB(efreet_icon_cache_free));
-        eina_hash_add(efreet_icon_cache, &theme, list);
-    }
 
     snprintf(key, sizeof(key), "%s %d", icon, size);
     cache = NEW(Efreet_Icon_Cache, 1);
@@ -1649,6 +1604,12 @@ efreet_icon_cache_add(Efreet_Icon_Theme *theme, const char *icon, unsigned int s
     }
     else
         cache->lasttime = ecore_time_get();
-    ecore_list_prepend(list, cache);
+
+    l = list;
+    list = eina_list_prepend(list, cache);
+
+    if (!l) eina_hash_add(efreet_icon_cache, &theme, list);
+    else eina_hash_modify(efreet_icon_cache, &theme, list);
+
     efreet_icon_cache_flush(list);
 }
index 118307e..76d5272 100644 (file)
@@ -66,17 +66,11 @@ struct Efreet_Icon_Theme
     char *example_icon;   /**< Icon to use as an example of the theme */
 
     /* An icon theme can have multiple directories that store it's icons. We
-     * need to be able to find a search each one. If count is 1 then path
-     * will be a char * pointing to the directory. If count > 1 then path
-     * will be an Ecore_List of char *'s pointing to the directories */
-    struct
-    {
-        void *path;       /**< The paths */
-        int count;        /**< The number of path's */
-    } paths;              /**< The paths to this theme */
+     * need to be able to find a search each one. */
 
-    Ecore_List *inherits;       /**< Icon themes we inherit from */
-    Ecore_List *directories;    /**< List of subdirectories for this theme */
+    Eina_List *paths;          /**< The paths */
+    Eina_List *inherits;       /**< Icon themes we inherit from */
+    Eina_List *directories;    /**< List of subdirectories for this theme */
 
     double last_cache_check;    /**< Last time the cache was checked */
 
@@ -135,7 +129,7 @@ struct Efreet_Icon
     } embedded_text_rectangle;  /**< Rectangle where text can
                                         be displayed on the icon */
 
-    Ecore_List *attach_points; /**< List of points to be used as anchor
+    Eina_List *attach_points; /**< List of points to be used as anchor
                                         points for emblems/overlays */
 
     unsigned int ref_count;    /**< References to this icon */
@@ -161,14 +155,14 @@ struct Efreet_Icon_Point
 EAPI const char        *efreet_icon_user_dir_get(void);
 EAPI void               efreet_icon_extension_add(const char *ext);
 
-EAPI Ecore_List        *efreet_icon_extra_list_get(void);
-EAPI Ecore_List        *efreet_icon_theme_list_get(void);
+EAPI Eina_List         *efreet_icon_extra_list_get(void);
+EAPI Eina_List         *efreet_icon_theme_list_get(void);
 EAPI Efreet_Icon_Theme *efreet_icon_theme_find(const char *theme_name);
 EAPI Efreet_Icon       *efreet_icon_find(const char *theme_name,
                                             const char *icon,
                                             unsigned int size);
 EAPI char              *efreet_icon_list_find(const char *theme_name,
-                                                Ecore_List *icons,
+                                                Eina_List *icons,
                                                 unsigned int size);
 EAPI char              *efreet_icon_path_find(const char *theme_name,
                                                 const char *icon,
index da1cb96..15e8f24 100644 (file)
@@ -141,7 +141,6 @@ efreet_ini_parse(const char *file)
 
             if (line_start[header_length] == ']')
             {
-                Eina_Hash *old;
                 const char *header;
 
                 header = alloca(header_length * sizeof(unsigned char));
@@ -180,7 +179,6 @@ efreet_ini_parse(const char *file)
         if (sep < line_length)
         {
             const char *key, *value;
-            char *old;
             int key_end, value_start, value_end;
 
             /* trim whitespace from end of key */
index 69508e2..3ec7d46 100644 (file)
@@ -45,22 +45,22 @@ struct Efreet_Menu_Internal
 
     Efreet_Menu_Move *current_move; /**< The current move */
 
-    Ecore_List *app_dirs;           /**< .desktop application directories */
+    Eina_List *app_dirs;           /**< .desktop application directories */
 
-    Ecore_List *app_pool;           /**< application pool */
-    Ecore_List *applications;       /**< applications in this menu */
+    Eina_List *app_pool;           /**< application pool */
+    Eina_List *applications;       /**< applications in this menu */
 
     Ecore_DList *directory_dirs;    /**< .directory file directories */
     Eina_Hash *directory_cache;    /**< .directory dirs */
 
-    Ecore_List *moves;              /**< List of moves to be handled by the menu */
-    Ecore_List *filters;            /**< Include and Exclude filters */
+    Eina_List *moves;              /**< List of moves to be handled by the menu */
+    Eina_List *filters;            /**< Include and Exclude filters */
 
     Efreet_Menu_Internal *parent;   /**< Our parent menu */
-    Ecore_List *sub_menus;          /**< Our sub menus */
+    Eina_List *sub_menus;          /**< Our sub menus */
 
-    Ecore_List *layout;             /**< This menus layout */
-    Ecore_List *default_layout;     /**< Default layout */
+    Eina_List *layout;             /**< This menus layout */
+    Eina_List *default_layout;     /**< Default layout */
     char show_empty;    /**< Whether to show empty menus */
     char in_line;       /**< Whether this meny can be inlined */
     char inline_limit;  /**< Number of elements which triggers inline */
@@ -130,10 +130,10 @@ typedef struct Efreet_Menu_Filter_Op Efreet_Menu_Filter_Op;
 struct Efreet_Menu_Filter_Op
 {
     Efreet_Menu_Filter_Op_Type type; /**< The type of operation */
-    Ecore_List *categories;          /**< The categories this op applies too */
-    Ecore_List *filenames;           /**< The filenames this op applies too */
+    Eina_List *categories;          /**< The categories this op applies too */
+    Eina_List *filenames;           /**< The filenames this op applies too */
 
-    Ecore_List *filters;             /**< Child filters */
+    Eina_List *filters;             /**< Child filters */
 
     unsigned char all:1;             /**< Applies to all .desktop files */
 };
@@ -208,7 +208,7 @@ struct Efreet_Menu_Desktop
 };
 
 static char *efreet_menu_prefix = NULL; /**< The $XDG_MENU_PREFIX env var */
-Ecore_List *efreet_menu_kde_legacy_dirs = NULL; /**< The directories to use for KDELegacy entries */
+Eina_List *efreet_menu_kde_legacy_dirs = NULL; /**< The directories to use for KDELegacy entries */
 static const char *efreet_tag_menu = NULL;
 static char *efreet_menu_file = NULL; /**< A menu file set explicityl as default */
 
@@ -248,7 +248,7 @@ static Efreet_Desktop *efreet_menu_directory_get(Efreet_Menu_Internal *internal,
                                                     const char *path);
 static void efreet_menu_process_filters(Efreet_Menu_Internal *internal,
                                             unsigned int only_unallocated);
-static void efreet_menu_process_app_pool(Ecore_List *pool, Ecore_List *applications,
+static Eina_List * efreet_menu_process_app_pool(Eina_List *pool, Eina_List *applications,
                                         Eina_Hash *matches,
                                         Efreet_Menu_Filter *filter,
                                         unsigned int only_unallocated);
@@ -507,10 +507,6 @@ efreet_menu_kde_legacy_init(void)
     f = popen("kde-config --path apps", "r");
     if (!f) return 0;
 
-    efreet_menu_kde_legacy_dirs = ecore_list_new();
-    ecore_list_free_cb_set(efreet_menu_kde_legacy_dirs,
-                            ECORE_FREE_CB(eina_stringshare_del));
-
     /* XXX if the return from kde-config is a line longer than PATH_MAX,
      * this won't be correct (increase buffer and get the rest...) */
     if (!fgets(buf, PATH_MAX, f))
@@ -524,14 +520,14 @@ efreet_menu_kde_legacy_init(void)
     while (p)
     {
         *p = '\0';
-        ecore_list_append(efreet_menu_kde_legacy_dirs,
+        efreet_menu_kde_legacy_dirs = eina_list_append(efreet_menu_kde_legacy_dirs,
                             (void *)eina_stringshare_add(s));
         s = p + 1;
         p = strchr(s, ':');
     }
 
     if (*s)
-        ecore_list_append(efreet_menu_kde_legacy_dirs,
+        efreet_menu_kde_legacy_dirs = eina_list_append(efreet_menu_kde_legacy_dirs,
                             (void *)eina_stringshare_add(s));
 
     pclose(f);
@@ -604,7 +600,7 @@ efreet_menu_get(void)
 {
     char menu[PATH_MAX];
     const char *dir;
-    Ecore_List *config_dirs;
+    Eina_List *config_dirs, *l;
 
     /* check the users config directory first */
     snprintf(menu, sizeof(menu), "%s/menus/%sapplications.menu",
@@ -620,8 +616,7 @@ efreet_menu_get(void)
 
     /* fallback to the XDG_CONFIG_DIRS */
     config_dirs = efreet_config_dirs_get();
-    ecore_list_first_goto(config_dirs);
-    while ((dir = ecore_list_next(config_dirs)))
+    EINA_LIST_FOREACH(config_dirs, l, dir)
     {
         snprintf(menu, sizeof(menu), "%s/menus/%sapplications.menu",
                                     dir, efreet_menu_prefix_get());
@@ -644,7 +639,7 @@ efreet_menu_parse(const char *path)
     Efreet_Xml *xml;
     Efreet_Menu_Internal *internal = NULL;
     Efreet_Menu *entry = NULL;
-    Ecore_List *search_dirs;
+    Eina_List *search_dirs;
 
     xml = efreet_xml_new(path);
     if (!xml) return NULL;
@@ -737,6 +732,8 @@ efreet_menu_save(Efreet_Menu *menu, const char *path)
 static int
 efreet_menu_save_menu(Efreet_Menu *menu, FILE *f, int indent)
 {
+    Eina_List *l;
+
     efreet_menu_save_indent(f, indent);
     fprintf(f, "<Menu>\n");
     if (menu->name)
@@ -767,8 +764,7 @@ efreet_menu_save_menu(Efreet_Menu *menu, FILE *f, int indent)
 
         efreet_menu_save_indent(f, indent + 1);
         fprintf(f, "<Layout>\n");
-        ecore_list_first_goto(menu->entries);
-        while ((entry = ecore_list_next(menu->entries)))
+        EINA_LIST_FOREACH(menu->entries, l, entry)
         {
             if (entry->type == EFREET_MENU_ENTRY_MENU)
             {
@@ -795,8 +791,7 @@ efreet_menu_save_menu(Efreet_Menu *menu, FILE *f, int indent)
         {
             efreet_menu_save_indent(f, indent + 1);
             fprintf(f, "<Include>\n");
-            ecore_list_first_goto(menu->entries);
-            while ((entry = ecore_list_next(menu->entries)))
+            EINA_LIST_FOREACH(menu->entries, l, entry)
             {
                 if (entry->type == EFREET_MENU_ENTRY_DESKTOP)
                 {
@@ -810,8 +805,7 @@ efreet_menu_save_menu(Efreet_Menu *menu, FILE *f, int indent)
 
         if (has_menu)
         {
-            ecore_list_first_goto(menu->entries);
-            while ((entry = ecore_list_next(menu->entries)))
+            EINA_LIST_FOREACH(menu->entries, l, entry)
             {
                 if (entry->type == EFREET_MENU_ENTRY_MENU)
                     efreet_menu_save_menu(entry, f, indent + 1);
@@ -859,18 +853,12 @@ efreet_menu_desktop_insert(Efreet_Menu *menu, Efreet_Desktop *desktop, int pos)
     efreet_desktop_ref(desktop);
     entry->desktop = desktop;
 
-    if (!menu->entries)
-    {
-        menu->entries = ecore_list_new();
-        ecore_list_free_cb_set(menu->entries, ECORE_FREE_CB(efreet_menu_free));
-    }
-
-    if (pos < 0 || pos >= ecore_list_count(menu->entries))
-        ecore_list_append(menu->entries, entry);
+    if (pos < 0 || pos >= eina_list_count(menu->entries))
+        menu->entries = eina_list_append(menu->entries, entry);
     else
     {
-        ecore_list_index_goto(menu->entries, pos);
-        ecore_list_insert(menu->entries, entry);
+        menu->entries = eina_list_append_relative(menu->entries, entry,
+                                                  eina_list_nth(menu->entries, pos));
     }
     return 1;
 }
@@ -889,12 +877,12 @@ efreet_menu_desktop_remove(Efreet_Menu *menu, Efreet_Desktop *desktop)
 
     if (!desktop || !menu) return 0;
 
-    entry = ecore_list_find(menu->entries,
-                            ECORE_COMPARE_CB(efreet_menu_cb_entry_compare_desktop),
+    entry = eina_list_search_unsorted(menu->entries,
+                                      (Eina_Compare_Cb)efreet_menu_cb_entry_compare_desktop,
                             desktop);
     if (entry)
     {
-        ecore_list_remove(menu->entries);
+        menu->entries = eina_list_remove(menu->entries, entry);
         efreet_menu_free(entry);
         return 1;
     }
@@ -911,6 +899,8 @@ efreet_menu_desktop_remove(Efreet_Menu *menu, Efreet_Desktop *desktop)
 EAPI void
 efreet_menu_dump(Efreet_Menu *menu, const char *indent)
 {
+    Eina_List *l;
+
     printf("%s%s: ", indent, menu->name);
     printf("%s\n", (menu->icon ? menu->icon : "No icon"));
 
@@ -926,8 +916,7 @@ efreet_menu_dump(Efreet_Menu *menu, const char *indent)
         new_indent = malloc(sizeof(char *) * len);
         snprintf(new_indent, len, "%s  ", indent);
 
-        ecore_list_first_goto(menu->entries);
-        while ((entry = ecore_list_next(menu->entries)))
+        EINA_LIST_FOREACH(menu->entries, l, entry)
         {
             if (entry->type == EFREET_MENU_ENTRY_SEPARATOR)
                 printf("%s|---\n", new_indent);
@@ -951,25 +940,22 @@ efreet_menu_dump(Efreet_Menu *menu, const char *indent)
  * @brief Creates the list of directories based on the user
  * dir, system dirs and given suffix.
  */
-Ecore_List *
-efreet_default_dirs_get(const char *user_dir, Ecore_List *system_dirs,
+Eina_List *
+efreet_default_dirs_get(const char *user_dir, Eina_List *system_dirs,
                                                     const char *suffix)
 {
     const char *xdg_dir;
     char dir[PATH_MAX];
-    Ecore_List *list;
-
-    list = ecore_list_new();
-    ecore_list_free_cb_set(list, ECORE_FREE_CB(free));
+    Eina_List *list = NULL;
+    Eina_List *l;
 
     snprintf(dir, sizeof(dir), "%s/%s", user_dir, suffix);
-    ecore_list_append(list, strdup(dir));
+    list = eina_list_append(list, strdup(dir));
 
-    ecore_list_first_goto(system_dirs);
-    while ((xdg_dir = ecore_list_next(system_dirs)))
+    EINA_LIST_FOREACH(system_dirs, l, xdg_dir)
     {
         snprintf(dir, sizeof(dir), "%s/%s", xdg_dir, suffix);
-        ecore_list_append(list, strdup(dir));
+        list = eina_list_append(list, strdup(dir));
     }
 
     return list;
@@ -1109,15 +1095,16 @@ efreet_menu_handle_sub_menu(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
 
     /* if this menu already exists we just take this one and stick it on the
      * start of the existing one */
-    if ((match = ecore_list_find(parent->sub_menus,
-                ECORE_COMPARE_CB(efreet_menu_cb_menu_compare), internal)))
+    if ((match = eina_list_search_unsorted(parent->sub_menus,
+                                           (Eina_Compare_Cb)efreet_menu_cb_menu_compare,
+                                           internal)))
     {
 
         efreet_menu_concatenate(match, internal);
         efreet_menu_internal_free(internal);
     }
     else
-        ecore_list_prepend(parent->sub_menus, internal);
+        parent->sub_menus = eina_list_prepend(parent->sub_menus, internal);
 
     return 1;
 }
@@ -1142,8 +1129,9 @@ efreet_menu_handle_app_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
     if (!path) return 0;
 
     /* we've already got this guy in our list we can skip it */
-    if (ecore_list_find(parent->app_dirs,
-            ECORE_COMPARE_CB(efreet_menu_cb_app_dirs_compare), path))
+    if (eina_list_search_unsorted(parent->app_dirs,
+                                  (Eina_Compare_Cb)efreet_menu_cb_app_dirs_compare,
+                                  path))
     {
         FREE(path);
         return 1;
@@ -1152,7 +1140,7 @@ efreet_menu_handle_app_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
     app_dir = efreet_menu_app_dir_new();
     app_dir->path = path;
 
-    ecore_list_prepend(parent->app_dirs, app_dir);
+    parent->app_dirs = eina_list_prepend(parent->app_dirs, app_dir);
 
     return 1;
 }
@@ -1167,7 +1155,8 @@ efreet_menu_handle_app_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
 static int
 efreet_menu_handle_default_app_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xml __UNUSED__)
 {
-    Ecore_List *dirs, *prepend;
+    Eina_List *prepend = NULL;
+    Eina_List *dirs;
     char *dir;
 
     if (!parent) return 0;
@@ -1175,24 +1164,23 @@ efreet_menu_handle_default_app_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xm
     efreet_menu_create_app_dirs_list(parent);
     dirs = efreet_default_dirs_get(efreet_data_home_get(), efreet_data_dirs_get(),
                                                                     "applications");
-    prepend = ecore_list_new();
-    ecore_list_first_goto(dirs);
-    while ((dir = ecore_list_next(dirs)))
+    EINA_LIST_FREE(dirs, dir)
     {
         Efreet_Menu_App_Dir *app_dir;
 
-        if (ecore_list_find(parent->app_dirs,
-                    ECORE_COMPARE_CB(efreet_menu_cb_app_dirs_compare), dir))
+        if (eina_list_search_unsorted(parent->app_dirs,
+                                      (Eina_Compare_Cb)efreet_menu_cb_app_dirs_compare,
+                                      dir))
             continue;
 
         app_dir = efreet_menu_app_dir_new();
         app_dir->path = strdup(dir);
 
-        ecore_list_append(prepend, app_dir);
+        prepend = eina_list_append(prepend, app_dir);
+
+       free(dir);
     }
-    ecore_list_destroy(dirs);
-    ecore_list_prepend_list(parent->app_dirs, prepend);
-    ecore_list_destroy(prepend);
+    parent->app_dirs = eina_list_merge(prepend, parent->app_dirs);
 
     return 1;
 }
@@ -1237,7 +1225,7 @@ efreet_menu_handle_directory_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
 static int
 efreet_menu_handle_default_directory_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xml __UNUSED__)
 {
-    Ecore_List *dirs;
+    Eina_List *dirs, *l;
     char *dir;
 
     if (!parent) return 0;
@@ -1245,8 +1233,7 @@ efreet_menu_handle_default_directory_dirs(Efreet_Menu_Internal *parent, Efreet_X
     efreet_menu_create_directory_dirs_list(parent);
     dirs = efreet_default_dirs_get(efreet_data_home_get(), efreet_data_dirs_get(),
                                                             "desktop-directories");
-    ecore_list_first_goto(dirs);
-    while ((dir = ecore_list_next(dirs)))
+    EINA_LIST_FOREACH(dirs, l, dir)
     {
         if (ecore_list_find(parent->directory_dirs, ECORE_COMPARE_CB(strcmp), dir))
             continue;
@@ -1254,7 +1241,11 @@ efreet_menu_handle_default_directory_dirs(Efreet_Menu_Internal *parent, Efreet_X
         ecore_dlist_prepend(parent->directory_dirs, strdup(dir));
     }
 
-    ecore_list_destroy(dirs);
+    while (dirs)
+    {
+        free(eina_list_data_get(dirs));
+        dirs = eina_list_remove_list(dirs, dirs);
+    }
 
     return 1;
 }
@@ -1429,13 +1420,7 @@ efreet_menu_handle_filename(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml)
 {
     if (!op || !xml) return 0;
 
-    if (!op->filenames)
-    {
-        op->filenames = ecore_list_new();
-        ecore_list_free_cb_set(op->filenames, free);
-    }
-
-    ecore_list_append(op->filenames, strdup(xml->text));
+    op->filenames = eina_list_append(op->filenames, strdup(xml->text));
 
     return 1;
 }
@@ -1452,13 +1437,8 @@ efreet_menu_handle_category(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml)
 {
     if (!op || !xml) return 0;
 
-    if (!op->categories)
-    {
-        op->categories = ecore_list_new();
-        ecore_list_free_cb_set(op->categories, free);
-    }
 
-    ecore_list_append(op->categories, strdup(xml->text));
+    op->categories = eina_list_append(op->categories, strdup(xml->text));
 
     return 1;
 }
@@ -1538,6 +1518,7 @@ efreet_menu_handle_not(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml)
 static int
 efreet_menu_handle_merge_file(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
 {
+    Eina_List *l;
     char *path = NULL;
     const char *attr = NULL;
     int is_path = 1;
@@ -1558,7 +1539,7 @@ efreet_menu_handle_merge_file(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
      * dir after ours (if we're in a config dir) */
     else
     {
-        Ecore_List *search_dirs;
+        Eina_List *search_dirs;
         const char *dir, *p;
         int len = 0;
 
@@ -1578,12 +1559,11 @@ efreet_menu_handle_merge_file(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
          * be left at the next pointer so we can start looking for the menu
          * from that point */
 
-        ecore_list_first_goto(search_dirs);
         dir = efreet_config_home_get();
         len = strlen(dir);
         if (strncmp(dir, parent->file.path, len))
         {
-            while ((dir = ecore_list_next(search_dirs)))
+            EINA_LIST_FOREACH(search_dirs, l, dir)
             {
                 if (!strncmp(dir, parent->file.path, len))
                     break;
@@ -1603,7 +1583,7 @@ efreet_menu_handle_merge_file(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
 
         /* whatever dirs are left in the search dir we need to look for the
          * menu with the same relative filename */
-        while ((dir = ecore_list_next(search_dirs)))
+        EINA_LIST_FOREACH(search_dirs, l, dir)
         {
             char file[PATH_MAX];
 
@@ -1762,7 +1742,7 @@ efreet_menu_merge_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml, const char
 static int
 efreet_menu_handle_default_merge_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
 {
-    Ecore_List *dirs;
+    Eina_List *dirs;
     char path[PATH_MAX], *p;
     const char *prefix;
 
@@ -1790,13 +1770,13 @@ efreet_menu_handle_default_merge_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *
 
     dirs = efreet_default_dirs_get(efreet_config_home_get(),
                                     efreet_config_dirs_get(), path);
-    ecore_list_first_goto(dirs);
-    while ((p = ecore_list_first_remove(dirs)))
+
+    while ((p = eina_list_data_get(dirs)))
     {
+        dirs = eina_list_remove_list(dirs, dirs);
         efreet_menu_merge_dir(parent, xml, p);
         FREE(p);
     }
-    ecore_list_destroy(dirs);
 
     return 1;
 }
@@ -1867,7 +1847,7 @@ efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
     if (prefix && !strchr(prefix, '/')) app_dir->prefix = strdup(prefix);
 
     efreet_menu_create_app_dirs_list(legacy_internal);
-    ecore_list_append(legacy_internal->app_dirs, app_dir);
+    legacy_internal->app_dirs = eina_list_append(legacy_internal->app_dirs, app_dir);
 #ifndef STRICT_SPEC
     if (root)
     {
@@ -1876,7 +1856,7 @@ efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
         app_dir->path = strdup(path);
         app_dir->legacy = 1;
         if (prefix && !strchr(prefix, '/')) app_dir->prefix = strdup(prefix);
-        ecore_list_append(root->app_dirs, app_dir);
+        root->app_dirs = eina_list_append(root->app_dirs, app_dir);
     }
 #endif
 
@@ -1890,11 +1870,9 @@ efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
     filter->type = EFREET_MENU_FILTER_INCLUDE;
 
     filter->op->type = EFREET_MENU_FILTER_OP_OR;
-    filter->op->filenames = ecore_list_new();
-    ecore_list_free_cb_set(filter->op->filenames, free);
 
     efreet_menu_create_filter_list(legacy_internal);
-    ecore_list_append(legacy_internal->filters, filter);
+    legacy_internal->filters = eina_list_append(legacy_internal->filters, filter);
 
     path_len = strlen(path);
     files = opendir(path);
@@ -1926,7 +1904,7 @@ efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
             }
 
             efreet_menu_create_sub_menu_list(legacy_internal);
-            ecore_list_prepend(legacy_internal->sub_menus, ret);
+            legacy_internal->sub_menus = eina_list_prepend(legacy_internal->sub_menus, ret);
 
             continue;
         }
@@ -1960,10 +1938,10 @@ efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
         if (prefix)
         {
             snprintf(buf, PATH_MAX, "%s%s", prefix, file->d_name);
-            ecore_list_append(filter->op->filenames, strdup(buf));
+            filter->op->filenames = eina_list_append(filter->op->filenames, strdup(buf));
         }
         else
-            ecore_list_append(filter->op->filenames, strdup(file->d_name));
+            filter->op->filenames = eina_list_append(filter->op->filenames, strdup(file->d_name));
 
         count++;
         efreet_desktop_free(desktop);
@@ -1984,6 +1962,7 @@ efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
 static int
 efreet_menu_handle_kde_legacy_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xml __UNUSED__)
 {
+    Eina_List *l;
     const char *dir;
 
     if (!parent) return 0;
@@ -1992,8 +1971,7 @@ efreet_menu_handle_kde_legacy_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xml
 
     /* XXX if one _helper() call succeeds, we return success. should this be flipped?
      * (return fail if on of them failed) */
-    ecore_list_first_goto(efreet_menu_kde_legacy_dirs);
-    while ((dir = ecore_list_next(efreet_menu_kde_legacy_dirs)))
+    EINA_LIST_FOREACH(efreet_menu_kde_legacy_dirs, l, dir)
     {
         Efreet_Menu_Internal *kde;
 
@@ -2073,16 +2051,21 @@ efreet_menu_handle_old(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
     /* If we already moved this menu, remove the old move */
     /* XXX This seems wrong, but it makes efreet pass the fdo tests */
 #ifndef STRICT_SPEC
-    move = ecore_list_find(parent->moves,
-            ECORE_COMPARE_CB(efreet_menu_cb_move_compare), xml->text);
-    if (move) ecore_list_remove_destroy(parent->moves);
+    move = eina_list_search_unsorted(parent->moves,
+                                     (Eina_Compare_Cb)efreet_menu_cb_move_compare,
+                                     xml->text);
+    if (move)
+    {
+        efreet_menu_move_free(move);
+        parent->moves = eina_list_remove(parent->moves, move);
+    }
 #endif
 
     move = efreet_menu_move_new();
     move->old_name = strdup(xml->text);
 
     parent->current_move = move;
-    ecore_list_append(parent->moves, move);
+    parent->moves = eina_list_append(parent->moves, move);
 
     return 1;
 }
@@ -2243,8 +2226,8 @@ efreet_menu_handle_layout_menuname(Efreet_Menu_Internal *parent, Efreet_Xml *xml
     val = efreet_xml_attribute_get(xml, "inline_alias");
     if (val) layout->inline_alias = !strcmp(val, "true");
 
-    if (def) ecore_list_append(parent->default_layout, layout);
-    else ecore_list_append(parent->layout, layout);
+    if (def) parent->default_layout = eina_list_append(parent->default_layout, layout);
+    else parent->layout = eina_list_append(parent->layout, layout);
 
     return 1;
 }
@@ -2267,8 +2250,8 @@ efreet_menu_handle_layout_filename(Efreet_Menu_Internal *parent, Efreet_Xml *xml
     layout->type = EFREET_MENU_LAYOUT_FILENAME;
     layout->name = strdup(xml->text);
 
-    if (def) ecore_list_append(parent->default_layout, layout);
-    else ecore_list_append(parent->layout, layout);
+    if (def) parent->default_layout = eina_list_append(parent->default_layout, layout);
+    else parent->layout = eina_list_append(parent->layout, layout);
 
     return 1;
 }
@@ -2283,9 +2266,9 @@ efreet_menu_handle_layout_separator(Efreet_Menu_Internal *parent, Efreet_Xml *xm
     layout = efreet_menu_layout_new();
     layout->type = EFREET_MENU_LAYOUT_SEPARATOR;
     if (def)
-        ecore_list_append(parent->default_layout, layout);
+        parent->default_layout = eina_list_append(parent->default_layout, layout);
     else
-        ecore_list_append(parent->layout, layout);
+        parent->layout = eina_list_append(parent->layout, layout);
     return 1;
 }
 
@@ -2316,8 +2299,8 @@ efreet_menu_handle_layout_merge(Efreet_Menu_Internal *parent, Efreet_Xml *xml, i
     layout->type = EFREET_MENU_LAYOUT_MERGE;
     layout->name = strdup(attr);
 
-    if (def) ecore_list_append(parent->default_layout, layout);
-    else ecore_list_append(parent->layout, layout);
+    if (def) parent->default_layout = eina_list_append(parent->default_layout, layout);
+    else parent->layout = eina_list_append(parent->layout, layout);
 
     return 1;
 }
@@ -2349,7 +2332,7 @@ efreet_menu_handle_filter(Efreet_Menu_Internal *parent, Efreet_Xml *xml,
         return 0;
     }
 
-    ecore_list_prepend(parent->filters, filter);
+    parent->filters = eina_list_prepend(parent->filters, filter);
 
     return 1;
 }
@@ -2577,14 +2560,7 @@ efreet_menu_handle_filter_child_op(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml,
         return 0;
     }
 
-    if (!op->filters)
-    {
-        op->filters = ecore_list_new();
-        ecore_list_free_cb_set(op->filters,
-                    ECORE_FREE_CB(efreet_menu_filter_op_free));
-    }
-
-    ecore_list_append(op->filters, child_op);
+    op->filters = eina_list_append(op->filters, child_op);
 
     return 1;
 }
@@ -2600,6 +2576,8 @@ efreet_menu_handle_filter_child_op(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml,
 static int
 efreet_menu_process(Efreet_Menu_Internal *internal, unsigned int only_unallocated)
 {
+    Eina_List *l;
+
     /* a menu _MUST_ have a name */
     if (!internal->name.internal || (internal->name.internal[0] == '\0'))
         return 0;
@@ -2612,8 +2590,7 @@ efreet_menu_process(Efreet_Menu_Internal *internal, unsigned int only_unallocate
     {
         Efreet_Menu_Internal *sub_internal;
 
-        ecore_list_first_goto(internal->sub_menus);
-        while ((sub_internal = ecore_list_next(internal->sub_menus)))
+        EINA_LIST_FOREACH(internal->sub_menus, l, sub_internal)
         {
             sub_internal->parent = internal;
             efreet_menu_process(sub_internal, only_unallocated);
@@ -2629,6 +2606,8 @@ efreet_menu_process(Efreet_Menu_Internal *internal, unsigned int only_unallocate
 static int
 efreet_menu_process_dirs(Efreet_Menu_Internal *internal)
 {
+    Eina_List *l;
+
     /* Scan application directories for .desktop files */
     if (!efreet_menu_app_dirs_process(internal))
         return 0;
@@ -2641,8 +2620,7 @@ efreet_menu_process_dirs(Efreet_Menu_Internal *internal)
     {
         Efreet_Menu_Internal *sub_internal;
 
-        ecore_list_first_goto(internal->sub_menus);
-        while ((sub_internal = ecore_list_next(internal->sub_menus)))
+        EINA_LIST_FOREACH(internal->sub_menus, l, sub_internal)
         {
             sub_internal->parent = internal;
             efreet_menu_process_dirs(sub_internal);
@@ -2666,21 +2644,22 @@ static void
 efreet_menu_process_filters(Efreet_Menu_Internal *internal, unsigned int only_unallocated)
 {
     Efreet_Menu_Filter *filter;
+    Efreet_Menu_Desktop *md;
+    Eina_List *l, *ll;
+
     int included = 0;
 
     /* nothing to do if we're checking the other option */
     if (only_unallocated != internal->only_unallocated) return;
 
-    if (!internal->applications) internal->applications = ecore_list_new();
-    else ecore_list_clear(internal->applications);
+    while (internal->applications)
+        internal->applications = eina_list_remove_list(internal->applications,
+                                                       internal->applications);
 
     if (!internal->filters) return;
 
-    ecore_list_first_goto(internal->filters);
-    while ((filter = ecore_list_next(internal->filters)))
+    EINA_LIST_FOREACH(internal->filters, l, filter)
     {
-        Efreet_Menu_Desktop *md;
-
         /* skip excludes until we get an include */
         if (!included && (filter->type == EFREET_MENU_FILTER_EXCLUDE))
             continue;
@@ -2691,7 +2670,7 @@ efreet_menu_process_filters(Efreet_Menu_Internal *internal, unsigned int only_un
             Eina_Hash *matches;
 
             matches = eina_hash_string_superfast_new(NULL);
-            efreet_menu_process_app_pool(internal->app_pool, internal->applications,
+            internal->applications = efreet_menu_process_app_pool(internal->app_pool, internal->applications,
                                         matches, filter, internal->only_unallocated);
             if (internal->parent)
             {
@@ -2699,7 +2678,7 @@ efreet_menu_process_filters(Efreet_Menu_Internal *internal, unsigned int only_un
 
                 parent = internal->parent;
                 do {
-                    efreet_menu_process_app_pool(parent->app_pool,
+                    internal->applications = efreet_menu_process_app_pool(parent->app_pool,
                                                 internal->applications, matches, filter,
                                                 internal->only_unallocated);
                 } while ((parent = parent->parent));
@@ -2709,13 +2688,13 @@ efreet_menu_process_filters(Efreet_Menu_Internal *internal, unsigned int only_un
         else
         {
             /* check each item in our menu so far and see if it's excluded */
-            ecore_list_first_goto(internal->applications);
-            while ((md = ecore_list_current(internal->applications)))
+            l = internal->applications;
+            while ((md = eina_list_data_get(l)))
             {
+                ll = eina_list_next(l);
                 if (efreet_menu_filter_matches(filter->op, md))
-                    ecore_list_remove(internal->applications);
-                else
-                    ecore_list_next(internal->applications);
+                    internal->applications = eina_list_remove_list(internal->applications, l);
+                l = ll;
             }
         }
     }
@@ -2726,7 +2705,7 @@ efreet_menu_process_filters(Efreet_Menu_Internal *internal, unsigned int only_un
     {
         int count;
 
-        count = ecore_list_count(internal->applications);
+        count = eina_list_count(internal->applications);
         if (count)
         {
             Ecore_Sheap *sheap;
@@ -2734,21 +2713,20 @@ efreet_menu_process_filters(Efreet_Menu_Internal *internal, unsigned int only_un
 
             sheap = ecore_sheap_new(
                         ECORE_COMPARE_CB(efreet_menu_cb_md_compare), count);
-            while ((md = ecore_list_first_remove(internal->applications)))
+            while ((md = eina_list_data_get(internal->applications)))
+            {
+                internal->applications = eina_list_remove_list(internal->applications,
+                                                               internal->applications);
                 ecore_sheap_insert(sheap, md);
-
+            }
             while ((md = ecore_sheap_extract(sheap)))
             {
                 if (md->desktop->no_display) continue;
-                ecore_list_append(internal->applications, md);
+                internal->applications = eina_list_append(internal->applications, md);
             }
 
             ecore_sheap_destroy(sheap);
         }
-
-        /* Don't keep the list if it is empty */
-        if (ecore_list_empty_is(internal->applications))
-            IF_FREE_LIST(internal->applications);
     }
 }
 
@@ -2765,28 +2743,29 @@ efreet_menu_process_filters(Efreet_Menu_Internal *internal, unsigned int only_un
  * in @a matches. If @a only_unallocated is set we'll only only at the
  * .desktop files that haven't been previoulsy matched
  */
-static
-void efreet_menu_process_app_pool(Ecore_List *pool, Ecore_List *applications,
+static Eina_List *
+efreet_menu_process_app_pool(Eina_List *pool, Eina_List *applications,
                                  Eina_Hash *matches,
                                  Efreet_Menu_Filter *filter,
                                  unsigned int only_unallocated)
 {
     Efreet_Menu_Desktop *md;
+    Eina_List *l;
 
-    if (!pool) return;
+    if (!pool) return NULL;
 
-    ecore_list_first_goto(pool);
-    while ((md = ecore_list_next(pool)))
+    EINA_LIST_FOREACH(pool, l, md)
     {
         if (eina_hash_find(matches, md->id)) continue;
         if (only_unallocated && md->allocated) continue;
         if (efreet_menu_filter_matches(filter->op, md))
         {
-            ecore_list_append(applications, md);
+            applications = eina_list_append(applications, md);
             eina_hash_add(matches, (void *)md->id, md);
             md->allocated = 1;
         }
     }
+    return applications;
 }
 
 /**
@@ -2822,31 +2801,30 @@ static int
 efreet_menu_filter_or_matches(Efreet_Menu_Filter_Op *op, Efreet_Menu_Desktop *md)
 {
     Efreet_Menu_Filter_Op *child;
+    Eina_List *l;
     char *t;
 
     if (op->all) return 1;
 
     if (op->categories && md->desktop->categories)
     {
-        ecore_list_first_goto(op->categories);
-        while ((t = ecore_list_next(op->categories)))
+        EINA_LIST_FOREACH(op->categories, l, t)
         {
-            if (ecore_list_find(md->desktop->categories, ECORE_COMPARE_CB(strcmp), t))
+            if (eina_list_search_unsorted(md->desktop->categories,
+                                          (Eina_Compare_Cb)strcmp, t))
                 return 1;
         }
     }
 
     if (op->filenames)
     {
-        ecore_list_first_goto(op->filenames);
-        while ((t = ecore_list_next(op->filenames)))
+        EINA_LIST_FOREACH(op->filenames, l, t)
             if (!strcmp(t, md->id)) return 1;
     }
 
     if (op->filters)
     {
-        ecore_list_first_goto(op->filters);
-        while ((child = ecore_list_next(op->filters)))
+        EINA_LIST_FOREACH(op->filters, l, child)
         {
             if (efreet_menu_filter_matches(child, md))
                 return 1;
@@ -2867,25 +2845,25 @@ static int
 efreet_menu_filter_and_matches(Efreet_Menu_Filter_Op *op, Efreet_Menu_Desktop *md)
 {
     Efreet_Menu_Filter_Op *child;
+    Eina_List *l;
     char *t;
 
     if (op->categories)
     {
-        if ((ecore_list_count(op->categories) > 0) && !md->desktop->categories)
+        if ((eina_list_count(op->categories) > 0) && !md->desktop->categories)
             return 0;
 
-        ecore_list_first_goto(op->categories);
-        while ((t = ecore_list_next(op->categories)))
+        EINA_LIST_FOREACH(op->categories, l, t)
         {
-            if (!ecore_list_find(md->desktop->categories, ECORE_COMPARE_CB(strcmp), t))
+            if (!eina_list_search_unsorted(md->desktop->categories,
+                                           (Eina_Compare_Cb)strcmp, t))
                 return 0;
         }
     }
 
     if (op->filenames)
     {
-        ecore_list_first_goto(op->filenames);
-        while ((t = ecore_list_next(op->filenames)))
+        EINA_LIST_FOREACH(op->filenames, l, t)
         {
             if (strcmp(t, md->id)) return 0;
         }
@@ -2893,8 +2871,7 @@ efreet_menu_filter_and_matches(Efreet_Menu_Filter_Op *op, Efreet_Menu_Desktop *m
 
     if (op->filters)
     {
-        ecore_list_first_goto(op->filters);
-        while ((child = ecore_list_next(op->filters)))
+        EINA_LIST_FOREACH(op->filters, l, child)
         {
             if (!efreet_menu_filter_matches(child, md))
                 return 0;
@@ -2915,6 +2892,7 @@ static int
 efreet_menu_filter_not_matches(Efreet_Menu_Filter_Op *op, Efreet_Menu_Desktop *md)
 {
     Efreet_Menu_Filter_Op *child;
+    Eina_List *l;
     char *t;
 
     /* !all means no desktops match */
@@ -2922,21 +2900,20 @@ efreet_menu_filter_not_matches(Efreet_Menu_Filter_Op *op, Efreet_Menu_Desktop *m
 
     if (op->categories)
     {
-        if ((ecore_list_count(op->categories) > 0) && !md->desktop->categories)
+        if ((eina_list_count(op->categories) > 0) && !md->desktop->categories)
             return 1;
 
-        ecore_list_first_goto(op->categories);
-        while ((t = ecore_list_next(op->categories)))
+        EINA_LIST_FOREACH(op->categories, l, t) 
         {
-            if (ecore_list_find(md->desktop->categories, ECORE_COMPARE_CB(strcmp), t))
+            if (eina_list_search_unsorted(md->desktop->categories,
+                                          (Eina_Compare_Cb)strcmp, t))
                 return 0;
         }
     }
 
     if (op->filenames)
     {
-        ecore_list_first_goto(op->filenames);
-        while ((t = ecore_list_next(op->filenames)))
+        EINA_LIST_FOREACH(op->filenames, l, t)
         {
             if (!strcmp(t, md->id)) return 0;
         }
@@ -2944,8 +2921,7 @@ efreet_menu_filter_not_matches(Efreet_Menu_Filter_Op *op, Efreet_Menu_Desktop *m
 
     if (op->filters)
     {
-        ecore_list_first_goto(op->filters);
-        while ((child = ecore_list_next(op->filters)))
+        EINA_LIST_FOREACH(op->filters, l, child)
         {
             if (efreet_menu_filter_matches(child, md))
                 return 0;
@@ -2997,7 +2973,8 @@ efreet_menu_concatenate(Efreet_Menu_Internal *dest, Efreet_Menu_Internal *src)
     if (src->app_dirs)
     {
         efreet_menu_create_app_dirs_list(dest);
-        ecore_list_prepend_list(dest->app_dirs, src->app_dirs);
+        dest->app_dirs = eina_list_merge(src->app_dirs, dest->app_dirs);
+       src->app_dirs = NULL;
     }
 
     if (src->directory_dirs)
@@ -3009,32 +2986,36 @@ efreet_menu_concatenate(Efreet_Menu_Internal *dest, Efreet_Menu_Internal *src)
     if (src->moves)
     {
         efreet_menu_create_move_list(dest);
-        ecore_list_prepend_list(dest->moves, src->moves);
+        dest->moves = eina_list_merge(src->moves, dest->moves);
+       src->moves = NULL;
     }
 
     if (src->filters)
     {
         efreet_menu_create_filter_list(dest);
-        ecore_list_prepend_list(dest->filters, src->filters);
+        dest->filters = eina_list_merge(src->filters, dest->filters);
+       src->filters = NULL;
     }
 
     if (src->sub_menus)
     {
         efreet_menu_create_sub_menu_list(dest);
 
-        while ((submenu = ecore_list_last_remove(src->sub_menus)))
+        while ((submenu = eina_list_data_get(eina_list_last(src->sub_menus))))
         {
             Efreet_Menu_Internal *match;
 
+            src->sub_menus = eina_list_remove(src->sub_menus, submenu);
             /* if this menu is in the list already we just add to that */
-            if ((match = ecore_list_find(dest->sub_menus,
-                        ECORE_COMPARE_CB(efreet_menu_cb_menu_compare), submenu)))
+            if ((match = eina_list_search_unsorted(dest->sub_menus,
+                                                   (Eina_Compare_Cb)efreet_menu_cb_menu_compare,
+                                                   submenu)))
             {
                 efreet_menu_concatenate(match, submenu);
                 efreet_menu_internal_free(submenu);
             }
             else
-                ecore_list_prepend(dest->sub_menus, submenu);
+                dest->sub_menus = eina_list_prepend(dest->sub_menus, submenu);
         }
     }
 }
@@ -3050,20 +3031,19 @@ efreet_menu_resolve_moves(Efreet_Menu_Internal *internal)
 {
     Efreet_Menu_Internal *child;
     Efreet_Menu_Move *move;
+    Eina_List *l;
 
     /* child moves are handled before parent moves */
     if (internal->sub_menus)
     {
-        ecore_list_first_goto(internal->sub_menus);
-        while ((child = ecore_list_next(internal->sub_menus)))
+        EINA_LIST_FOREACH(internal->sub_menus, l, child)
             efreet_menu_resolve_moves(child);
     }
 
     /* nothing to do if this menu has no moves */
     if (!internal->moves) return;
 
-    ecore_list_first_goto(internal->moves);
-    while ((move = ecore_list_next(internal->moves)))
+    EINA_LIST_FOREACH(internal->moves, l, move)
     {
         Efreet_Menu_Internal *origin, *dest, *parent;
 
@@ -3072,7 +3052,7 @@ efreet_menu_resolve_moves(Efreet_Menu_Internal *internal)
         if (!origin) continue;
 
         /* remove the origin menu from the parent */
-        ecore_list_remove(parent->sub_menus);
+        parent->sub_menus = eina_list_remove(parent->sub_menus, origin);
 
         /* if the destination path doesn't exist we just rename the origin
          * menu and append to the parents list of children */
@@ -3096,7 +3076,7 @@ efreet_menu_resolve_moves(Efreet_Menu_Internal *internal)
                 ancestor->name.internal = eina_stringshare_add(tmp);
 
                 efreet_menu_create_sub_menu_list(parent);
-                ecore_list_append(parent->sub_menus, ancestor);
+                parent->sub_menus = eina_list_append(parent->sub_menus, ancestor);
 
                 parent = ancestor;
                 tmp = ++path;
@@ -3107,7 +3087,7 @@ efreet_menu_resolve_moves(Efreet_Menu_Internal *internal)
             origin->name.internal = eina_stringshare_add(tmp);
 
             efreet_menu_create_sub_menu_list(parent);
-            ecore_list_append(parent->sub_menus, origin);
+            parent->sub_menus = eina_list_append(parent->sub_menus, origin);
 
             FREE(t);
         }
@@ -3144,14 +3124,14 @@ efreet_menu_by_name_find(Efreet_Menu_Internal *internal, const char *name, Efree
     {
         *part = '\0';
 
-        if (!ecore_list_find(internal->sub_menus,
-                    ECORE_COMPARE_CB(efreet_menu_cb_compare_names), ptr))
+        if (!(internal = eina_list_search_unsorted(internal->sub_menus,
+                                                   (Eina_Compare_Cb)efreet_menu_cb_compare_names,
+                                                   ptr)))
         {
             FREE(tmp);
             return NULL;
         }
 
-        internal = ecore_list_current(internal->sub_menus);
         ptr = ++part;
         part = strchr(ptr, '/');
     }
@@ -3159,15 +3139,16 @@ efreet_menu_by_name_find(Efreet_Menu_Internal *internal, const char *name, Efree
     if (parent) *parent = internal;
 
     /* find the menu in the parent list */
-    if (!ecore_list_find(internal->sub_menus,
-                ECORE_COMPARE_CB(efreet_menu_cb_compare_names), ptr))
+    if (!(internal = eina_list_search_unsorted(internal->sub_menus,
+                                               (Eina_Compare_Cb)efreet_menu_cb_compare_names,
+                                               ptr)))
     {
         FREE(tmp);
         return NULL;
     }
 
     FREE(tmp);
-    return ecore_list_current(internal->sub_menus);
+    return internal;
 }
 
 static void
@@ -3270,9 +3251,7 @@ efreet_menu_create_sub_menu_list(Efreet_Menu_Internal *internal)
 {
     if (!internal || internal->sub_menus) return;
 
-    internal->sub_menus = ecore_list_new();
-    ecore_list_free_cb_set(internal->sub_menus,
-                        ECORE_FREE_CB(efreet_menu_internal_free));
+    internal->sub_menus = NULL;
 }
 
 static void
@@ -3280,9 +3259,7 @@ efreet_menu_create_app_dirs_list(Efreet_Menu_Internal *internal)
 {
     if (!internal || internal->app_dirs) return;
 
-    internal->app_dirs = ecore_list_new();
-    ecore_list_free_cb_set(internal->app_dirs,
-                        ECORE_FREE_CB(efreet_menu_app_dir_free));
+    internal->app_dirs = NULL;
 }
 
 static void
@@ -3291,7 +3268,6 @@ efreet_menu_create_directory_dirs_list(Efreet_Menu_Internal *internal)
     if (!internal || internal->directory_dirs) return;
 
     internal->directory_dirs = ecore_dlist_new();
-    ecore_list_free_cb_set(internal->directory_dirs, ECORE_FREE_CB(free));
 }
 
 static void
@@ -3299,8 +3275,7 @@ efreet_menu_create_move_list(Efreet_Menu_Internal *internal)
 {
     if (!internal || internal->moves) return;
 
-    internal->moves = ecore_list_new();
-    ecore_list_free_cb_set(internal->moves, ECORE_FREE_CB(efreet_menu_move_free));
+    internal->moves = NULL;
 }
 
 static void
@@ -3308,9 +3283,7 @@ efreet_menu_create_filter_list(Efreet_Menu_Internal *internal)
 {
     if (!internal || internal->filters) return;
 
-    internal->filters = ecore_list_new();
-    ecore_list_free_cb_set(internal->filters,
-                        ECORE_FREE_CB(efreet_menu_filter_free));
+    internal->filters = NULL;
 }
 
 static void
@@ -3318,9 +3291,7 @@ efreet_menu_create_layout_list(Efreet_Menu_Internal *internal)
 {
     if (!internal || internal->layout) return;
 
-    internal->layout = ecore_list_new();
-    ecore_list_free_cb_set(internal->layout,
-                        ECORE_FREE_CB(efreet_menu_layout_free));
+    internal->layout = NULL;
 }
 
 static void
@@ -3328,9 +3299,7 @@ efreet_menu_create_default_layout_list(Efreet_Menu_Internal *internal)
 {
     if (!internal || internal->default_layout) return;
 
-    internal->default_layout = ecore_list_new();
-    ecore_list_free_cb_set(internal->default_layout,
-                        ECORE_FREE_CB(efreet_menu_layout_free));
+    internal->default_layout = NULL;
 }
 
 static void
@@ -3339,7 +3308,6 @@ efreet_menu_create_directories_list(Efreet_Menu_Internal *internal)
     if (!internal || internal->directories) return;
 
     internal->directories = ecore_dlist_new();
-    ecore_list_free_cb_set(internal->directories, free);
 }
 
 static char *
@@ -3378,22 +3346,15 @@ static int
 efreet_menu_app_dirs_process(Efreet_Menu_Internal *internal)
 {
     Efreet_Menu_App_Dir *app_dir;
+    Efreet_Menu_Desktop *md;
+    Eina_List *l;
 
-    if (internal->app_pool)
-    {
-        ecore_list_destroy(internal->app_pool);
-        internal->app_pool = NULL;
-    }
-
-    if (internal->app_dirs)
-    {
-        internal->app_pool = ecore_list_new();
-        ecore_list_free_cb_set(internal->app_pool, ECORE_FREE_CB(efreet_menu_desktop_free));
+    EINA_LIST_FREE(internal->app_pool, md)
+      efreet_menu_desktop_free(md);
 
-        ecore_list_first_goto(internal->app_dirs);
-        while ((app_dir = ecore_list_next(internal->app_dirs)))
+    EINA_LIST_FOREACH(internal->app_dirs, l, app_dir)
             efreet_menu_app_dir_scan(internal, app_dir->path, app_dir->prefix, app_dir->legacy);
-    }
+
     return 1;
 }
 
@@ -3437,13 +3398,15 @@ efreet_menu_app_dir_scan(Efreet_Menu_Internal *internal, const char *path, const
                 continue;
             }
             /* Don't add two files with the same id in the app pool */
-            if (ecore_list_find(internal->app_pool,
-                    ECORE_COMPARE_CB(efreet_menu_cb_md_compare_ids), buf2)) continue;
+            if (eina_list_search_unsorted(internal->app_pool,
+                                          (Eina_Compare_Cb)efreet_menu_cb_md_compare_ids,
+                                          buf2))
+                continue;
 
             menu_desktop = efreet_menu_desktop_new();
             menu_desktop->desktop = desktop;
             menu_desktop->id = eina_stringshare_add(buf2);
-            ecore_list_prepend(internal->app_pool, menu_desktop);
+            internal->app_pool = eina_list_prepend(internal->app_pool, menu_desktop);
         }
     }
     closedir(files);
@@ -3601,7 +3564,8 @@ static Efreet_Menu *
 efreet_menu_layout_menu(Efreet_Menu_Internal *internal)
 {
     Efreet_Menu *entry;
-    Ecore_List *layout = NULL;
+    Eina_List *layout = NULL;
+    Eina_List *l;
 
     if (internal->parent)
     {
@@ -3638,14 +3602,14 @@ efreet_menu_layout_menu(Efreet_Menu_Internal *internal)
         efreet_desktop_ref(internal->directory);
         entry->desktop = internal->directory;
     }
-    entry->entries = ecore_list_new();
-    ecore_list_free_cb_set(entry->entries, ECORE_FREE_CB(efreet_menu_free));
+    entry->entries = NULL;
 
 #if 1 //STRICT_SPEC
     if (internal->sub_menus)
     {
-        ecore_list_sort(internal->sub_menus,
-                        ECORE_COMPARE_CB(efreet_menu_cb_menu_compare), ECORE_SORT_MIN);
+        internal->sub_menus = eina_list_sort(internal->sub_menus,
+                                             0,
+                                             (Eina_Compare_Cb)efreet_menu_cb_menu_compare);
     }
 #endif
 
@@ -3653,8 +3617,7 @@ efreet_menu_layout_menu(Efreet_Menu_Internal *internal)
     {
         Efreet_Menu_Layout *lay;
 
-        ecore_list_first_goto(layout);
-        while ((lay = ecore_list_next(layout)))
+        EINA_LIST_FOREACH(layout, l, lay)
             efreet_menu_layout_entries_get(entry, internal, lay);
     }
     else
@@ -3664,8 +3627,7 @@ efreet_menu_layout_menu(Efreet_Menu_Internal *internal)
         {
             Efreet_Menu_Internal *sub;
 
-            ecore_list_first_goto(internal->sub_menus);
-            while ((sub = ecore_list_next(internal->sub_menus)))
+            EINA_LIST_FOREACH(internal->sub_menus, l, sub)
             {
                 Efreet_Menu *sub_entry;
                 if ((sub->directory && sub->directory->no_display) || sub->deleted) continue;
@@ -3676,7 +3638,7 @@ efreet_menu_layout_menu(Efreet_Menu_Internal *internal)
                     efreet_menu_free(sub_entry);
                     continue;
                 }
-                ecore_list_append(entry->entries, sub_entry);
+                entry->entries = eina_list_append(entry->entries, sub_entry);
             }
         }
 
@@ -3684,18 +3646,16 @@ efreet_menu_layout_menu(Efreet_Menu_Internal *internal)
         {
             Efreet_Menu_Desktop *md;
 
-            ecore_list_first_goto(internal->applications);
-            while ((md = ecore_list_next(internal->applications)))
+            EINA_LIST_FOREACH(internal->applications, l, md)
             {
                 Efreet_Menu *sub_entry;
                 sub_entry = efreet_menu_layout_desktop(md);
-                ecore_list_append(entry->entries, sub_entry);
+                entry->entries = eina_list_append(entry->entries, sub_entry);
             }
         }
     }
 
     /* Don't keep this list around if it is empty */
-    if (ecore_list_empty_is(entry->entries)) IF_FREE_LIST(entry->entries);
 
     return entry;
 }
@@ -3745,8 +3705,8 @@ efreet_menu_layout_entries_get(Efreet_Menu *entry, Efreet_Menu_Internal *interna
         if (layout->inline_alias == -1) inline_alias = internal->inline_alias;
         else inline_alias = layout->inline_alias;
 
-        sub = ecore_list_find(internal->sub_menus,
-                ECORE_COMPARE_CB(efreet_menu_cb_compare_names), layout->name);
+        sub = eina_list_search_unsorted(internal->sub_menus,
+                                        (Eina_Compare_Cb)efreet_menu_cb_compare_names, layout->name);
         if (sub)
         {
             if (!(sub->directory && sub->directory->no_display) && !sub->deleted)
@@ -3756,26 +3716,27 @@ efreet_menu_layout_entries_get(Efreet_Menu *entry, Efreet_Menu_Internal *interna
                     efreet_menu_free(sub_entry);
                 else if (in_line &&
                         ((inline_limit == 0) ||
-                         (!sub_entry->entries || (ecore_list_count(sub_entry->entries) <= inline_limit))))
+                         (!sub_entry->entries || (eina_list_count(sub_entry->entries) <= inline_limit))))
                 {
                     /* Inline */
                     if (!sub_entry->entries)
                     {
                         /* Can't inline an empty submenu */
-                        ecore_list_append(entry->entries, sub_entry);
+                        entry->entries = eina_list_append(entry->entries, sub_entry);
                     }
-                    else if (inline_alias && (ecore_list_count(sub_entry->entries) == 1))
+                    else if (inline_alias && (eina_list_count(sub_entry->entries) == 1))
                     {
                         Efreet_Menu *tmp;
 
-                        tmp = ecore_list_first_remove(sub_entry->entries);
+                        tmp = eina_list_data_get(sub_entry->entries);
+                        sub_entry->entries = eina_list_remove_list(sub_entry->entries, sub_entry->entries);
                         IF_RELEASE(tmp->name);
                         tmp->name = sub_entry->name;
                         sub_entry->name = NULL;
                         IF_RELEASE(tmp->icon);
                         tmp->icon = sub_entry->icon;
                         sub_entry->icon = NULL;
-                        ecore_list_append(entry->entries, tmp);
+                        entry->entries = eina_list_append(entry->entries, tmp);
                         efreet_menu_free(sub_entry);
                     }
                     else
@@ -3790,34 +3751,34 @@ efreet_menu_layout_entries_get(Efreet_Menu *entry, Efreet_Menu_Internal *interna
                             sub_entry->name = NULL;
                             tmp->icon = sub_entry->icon;
                             sub_entry->icon = NULL;
-                            ecore_list_append(entry->entries, tmp);
+                            entry->entries = eina_list_append(entry->entries, tmp);
+                        }
+                        while ((tmp = eina_list_data_get(sub_entry->entries)))
+                        {
+                            sub_entry->entries = eina_list_remove_list(sub_entry->entries, sub_entry->entries);
+                            entry->entries = eina_list_append(entry->entries, tmp);
                         }
-                        ecore_list_first_goto(sub_entry->entries);
-                        while ((tmp = ecore_list_first_remove(sub_entry->entries)))
-                            ecore_list_append(entry->entries, tmp);
                         efreet_menu_free(sub_entry);
                     }
                 }
                 else
-                    ecore_list_append(entry->entries, sub_entry);
+                    entry->entries = eina_list_append(entry->entries, sub_entry);
             }
-            ecore_list_remove(internal->sub_menus);
+            internal->sub_menus = eina_list_remove(internal->sub_menus, sub);
             efreet_menu_internal_free(sub);
         }
-        if (ecore_list_empty_is(internal->sub_menus)) IF_FREE_LIST(internal->sub_menus);
     }
     else if (internal->applications && layout->type == EFREET_MENU_LAYOUT_FILENAME)
     {
         Efreet_Menu_Desktop *md;
-        md = ecore_list_find(internal->applications,
-                ECORE_COMPARE_CB(efreet_menu_cb_md_compare_ids), layout->name);
+        md = eina_list_search_unsorted(internal->applications,
+                                       (Eina_Compare_Cb)efreet_menu_cb_md_compare_ids, layout->name);
         if (md)
         {
             sub_entry = efreet_menu_layout_desktop(md);
-            ecore_list_append(entry->entries, sub_entry);
-            ecore_list_remove(internal->applications);
+            entry->entries = eina_list_append(entry->entries, sub_entry);
+            internal->applications = eina_list_remove(internal->applications, md);
         }
-        if (ecore_list_empty_is(internal->applications)) IF_FREE_LIST(internal->applications);
     }
     else if (layout->type == EFREET_MENU_LAYOUT_MERGE)
     {
@@ -3825,15 +3786,17 @@ efreet_menu_layout_entries_get(Efreet_Menu *entry, Efreet_Menu_Internal *interna
         {
             Efreet_Menu_Desktop *md;
 
-            ecore_list_first_goto(internal->applications);
-            while ((md = ecore_list_first_remove(internal->applications)))
+            while ((md = eina_list_data_get(internal->applications)))
             {
-                sub_entry = ecore_list_find(entry->entries,
-                        ECORE_COMPARE_CB(efreet_menu_cb_entry_compare_desktop), md->desktop);
+                internal->applications = eina_list_remove_list(internal->applications,
+                                                               internal->applications);
+                sub_entry = eina_list_search_unsorted(entry->entries,
+                                                      (Eina_Compare_Cb)efreet_menu_cb_entry_compare_desktop,
+                                                      md->desktop);
                 if (!sub_entry)
                 {
                     sub_entry = efreet_menu_layout_desktop(md);
-                    ecore_list_append(entry->entries, sub_entry);
+                    entry->entries = eina_list_append(entry->entries, sub_entry);
                 }
             }
             IF_FREE_LIST(internal->applications);
@@ -3842,16 +3805,17 @@ efreet_menu_layout_entries_get(Efreet_Menu *entry, Efreet_Menu_Internal *interna
         {
             Efreet_Menu_Internal *sub;
 
-            ecore_list_first_goto(internal->sub_menus);
-            while ((sub = ecore_list_first_remove(internal->sub_menus)))
+            while ((sub = eina_list_data_get(internal->sub_menus)))
             {
+                internal->sub_menus = eina_list_remove_list(internal->sub_menus, internal->sub_menus);
                 if ((sub->directory && sub->directory->no_display) || sub->deleted)
                 {
                     efreet_menu_internal_free(sub);
                     continue;
                 }
-                sub_entry = ecore_list_find(entry->entries,
-                        ECORE_COMPARE_CB(efreet_menu_cb_entry_compare_menu), sub);
+                sub_entry = eina_list_search_unsorted(entry->entries,
+                                                      (Eina_Compare_Cb)efreet_menu_cb_entry_compare_menu,
+                                                      sub);
                 if (!sub_entry)
                 {
                     sub_entry = efreet_menu_layout_menu(sub);
@@ -3859,19 +3823,20 @@ efreet_menu_layout_entries_get(Efreet_Menu *entry, Efreet_Menu_Internal *interna
                         efreet_menu_free(sub_entry);
                     else if (internal->in_line &&
                             ((internal->inline_limit == 0) ||
-                             (!sub_entry->entries || (ecore_list_count(sub_entry->entries) <= internal->inline_limit))))
+                             (!sub_entry->entries || (eina_list_count(sub_entry->entries) <= internal->inline_limit))))
                     {
                         /* Inline */
                         if (!sub_entry->entries)
                         {
                             /* Can't inline an empty submenu */
-                            ecore_list_append(entry->entries, sub_entry);
+                            entry->entries = eina_list_append(entry->entries, sub_entry);
                         }
-                        else if (internal->inline_alias && (ecore_list_count(sub_entry->entries) == 1))
+                        else if (internal->inline_alias && (eina_list_count(sub_entry->entries) == 1))
                         {
                             Efreet_Menu *tmp;
 
-                            tmp = ecore_list_first_remove(sub_entry->entries);
+                            tmp = eina_list_data_get(sub_entry->entries);
+                            sub_entry->entries = eina_list_remove_list(sub_entry->entries, sub_entry->entries);
                             eina_stringshare_del(tmp->name);
                             tmp->name = sub_entry->name;
                             sub_entry->name = NULL;
@@ -3881,7 +3846,7 @@ efreet_menu_layout_entries_get(Efreet_Menu *entry, Efreet_Menu_Internal *interna
                                 tmp->icon = sub_entry->icon;
                                 sub_entry->icon = NULL;
                             }
-                            ecore_list_append(entry->entries, tmp);
+                            entry->entries = eina_list_append(entry->entries, tmp);
                             efreet_menu_free(sub_entry);
                         }
                         else
@@ -3896,16 +3861,19 @@ efreet_menu_layout_entries_get(Efreet_Menu *entry, Efreet_Menu_Internal *interna
                                 sub_entry->name = NULL;
                                 if (sub_entry->icon) tmp->icon = sub_entry->icon;
                                 sub_entry->icon = NULL;
-                                ecore_list_append(entry->entries, tmp);
+                                entry->entries = eina_list_append(entry->entries, tmp);
+                            }
+                            while ((tmp = eina_list_data_get(sub_entry->entries)))
+                            {
+                                sub_entry->entries = eina_list_remove_list(sub_entry->entries,
+                                                                           sub_entry->entries);
+                                entry->entries = eina_list_append(entry->entries, tmp);
                             }
-                            ecore_list_first_goto(sub_entry->entries);
-                            while ((tmp = ecore_list_first_remove(sub_entry->entries)))
-                                ecore_list_append(entry->entries, tmp);
                             efreet_menu_free(sub_entry);
                         }
                     }
                     else
-                        ecore_list_append(entry->entries, sub_entry);
+                        entry->entries = eina_list_append(entry->entries, sub_entry);
                 }
                 efreet_menu_internal_free(sub);
             }
@@ -3927,7 +3895,7 @@ efreet_menu_layout_entries_get(Efreet_Menu *entry, Efreet_Menu_Internal *interna
     {
         sub_entry = efreet_menu_entry_new();
         sub_entry->type = EFREET_MENU_ENTRY_SEPARATOR;
-        ecore_list_append(entry->entries, sub_entry);
+        entry->entries = eina_list_append(entry->entries, sub_entry);
     }
 }
 
@@ -3955,11 +3923,11 @@ static int
 efreet_menu_layout_is_empty(Efreet_Menu *entry)
 {
     Efreet_Menu *sub_entry;
+    Eina_List *l;
 
     if (!entry->entries) return 1;
 
-    ecore_list_first_goto(entry->entries);
-    while ((sub_entry = ecore_list_next(entry->entries)))
+    EINA_LIST_FOREACH(entry->entries, l, sub_entry)
     {
         if (sub_entry->type == EFREET_MENU_ENTRY_MENU) return 0;
         if (sub_entry->type == EFREET_MENU_ENTRY_DESKTOP) return 0;
index e953787..a6643d3 100644 (file)
@@ -46,7 +46,7 @@ struct Efreet_Menu
     const char *icon; /**< Icon for this entry */
 
     Efreet_Desktop *desktop;   /**< The desktop we refer too */
-    Ecore_List     *entries;   /**< The menu items */
+    Eina_List      *entries;   /**< The menu items */
 };
 
 EAPI int              efreet_menu_kde_legacy_init(void);
index 10291ff..415b171 100644 (file)
@@ -7,8 +7,8 @@
 #include <sys/types.h>
 #include <sys/time.h>
 
-static Ecore_List *globs = NULL;     /* contains Efreet_Mime_Glob structs */
-static Ecore_List *magics = NULL;    /* contains Efreet_Mime_Magic structs */
+static Eina_List *globs = NULL;     /* contains Efreet_Mime_Glob structs */
+static Eina_List *magics = NULL;    /* contains Efreet_Mime_Magic structs */
 static Eina_Hash *wild = NULL;      /* contains *.ext and mime.types globs*/
 static Eina_Hash *monitors = NULL;  /* contains file monitors */
 
@@ -50,7 +50,7 @@ struct Efreet_Mime_Magic
 {
     unsigned int priority;
     const char *mime;
-    Ecore_List *entries;
+    Eina_List *entries;
 };
 
 /**
@@ -175,7 +175,8 @@ EAPI char *
 efreet_mime_type_icon_get(const char *mime, const char *theme, unsigned int size)
 {
     char *icon = NULL;
-    Ecore_List *icons  = NULL;
+    char *data;
+    Eina_List *icons  = NULL;
     const char *env = NULL;
     char *p = NULL, *pp = NULL, *ppp = NULL;
     char buf[PATH_MAX];
@@ -183,9 +184,6 @@ efreet_mime_type_icon_get(const char *mime, const char *theme, unsigned int size
     if (!mime || !theme || !size)
         return NULL;
 
-    icons = ecore_list_new();
-    ecore_list_free_cb_set(icons, free);
-
     /* Standard icon name */
     p = strdup(mime);
     pp = p;
@@ -194,21 +192,21 @@ efreet_mime_type_icon_get(const char *mime, const char *theme, unsigned int size
         if (*pp == '/') *pp = '-';
         pp++;
     }
-    ecore_list_append(icons, p);
+    icons = eina_list_append(icons, p);
 
     /* Environment Based icon names */
     if ((env = efreet_desktop_environment_get()))
     {
         snprintf(buf, sizeof(buf), "%s-mime-%s", env, p);
-        ecore_list_append(icons, strdup(buf));
+        icons = eina_list_append(icons, strdup(buf));
 
         snprintf(buf, sizeof(buf), "%s-%s", env, p);
-        ecore_list_append(icons, strdup(buf));
+        icons = eina_list_append(icons, strdup(buf));
     }
 
     /* Mime prefixed icon names */
     snprintf(buf, sizeof(buf), "mime-%s", p);
-    ecore_list_append(icons, strdup(buf));
+    icons = eina_list_append(icons, strdup(buf));
 
     /* Generic icons */
     pp = strdup(p);
@@ -217,16 +215,21 @@ efreet_mime_type_icon_get(const char *mime, const char *theme, unsigned int size
         *ppp = '\0';
 
         snprintf(buf, sizeof(buf), "%s-generic", pp);
-        ecore_list_append(icons, strdup(buf));
+        icons = eina_list_append(icons, strdup(buf));
 
         snprintf(buf, sizeof(buf), "%s", pp);
-        ecore_list_append(icons, strdup(buf));
+        icons = eina_list_append(icons, strdup(buf));
     }
     FREE(pp);
 
     /* Search for icons using list */
     icon = efreet_icon_list_find(theme, icons, size);
-    ecore_list_destroy(icons);
+    while (icons)
+    {
+        data = eina_list_data_get(icons);
+        free(data);
+        icons = eina_list_remove_list(icons, icons);
+    }
 
     return icon;
 }
@@ -250,6 +253,7 @@ efreet_mime_magic_type_get(const char *file)
 EAPI const char *
 efreet_mime_globs_type_get(const char *file)
 {
+    Eina_List *l;
     Efreet_Mime_Glob *g;
     char *sl, *p;
     const char *s;
@@ -272,8 +276,7 @@ efreet_mime_globs_type_get(const char *file)
     }
 
     /* Fallback to the other globs if not found */
-    ecore_list_first_goto(globs);
-    while ((g = ecore_list_next(globs)))
+    EINA_LIST_FOREACH(globs, l, g)
     {
         if (efreet_mime_glob_match(file, g->glob))
             return g->mime;
@@ -282,8 +285,7 @@ efreet_mime_globs_type_get(const char *file)
     ext = alloca(strlen(file) + 1);
     for (s = file, p = ext; *s; s++, p++) *p = tolower(*s);
     *p = 0;
-    ecore_list_first_goto(globs);
-    while ((g = ecore_list_next(globs)))
+    EINA_LIST_FOREACH(globs, l, g)
     {
         if (efreet_mime_glob_case_match(ext, g->glob))
             return g->mime;
@@ -358,17 +360,19 @@ efreet_mime_monitor_add(const char *file)
  * Also reads the /etc/mime.types file.
  */
 static void
-efreet_mime_load_globs(Ecore_List *datadirs, const char *datahome)
+efreet_mime_load_globs(Eina_List *datadirs, const char *datahome)
 {
+    Eina_List *l;
     char buf[4096];
     const char *datadir = NULL;
 
     IF_FREE_HASH(wild);
     wild = eina_hash_string_superfast_new(EINA_FREE_CB(eina_stringshare_del));
-    IF_FREE_LIST(globs);
-    globs = ecore_list_new();
-    ecore_list_free_cb_set(globs, efreet_mime_glob_free);
-
+    while (globs)
+    {
+        efreet_mime_glob_free(eina_list_data_get(globs));
+        globs = eina_list_remove_list(globs, globs);
+    }
 
     /*
      * This is here for legacy reasons.  It is mentioned briefly
@@ -379,13 +383,13 @@ efreet_mime_load_globs(Ecore_List *datadirs, const char *datahome)
     efreet_mime_mime_types_load("/etc/mime.types");
 
     datadir = datahome;
-    ecore_list_first_goto(datadirs);
-    while (datadir)
-    {
         snprintf(buf, sizeof(buf), "%s/mime/globs", datadir);
         efreet_mime_shared_mimeinfo_globs_load(buf);
 
-        datadir = ecore_list_next(datadirs);
+    EINA_LIST_FOREACH(datadirs, l, datadir)
+    {
+        snprintf(buf, sizeof(buf), "%s/mime/globs", datadir);
+        efreet_mime_shared_mimeinfo_globs_load(buf);
     }
 }
 
@@ -397,23 +401,26 @@ efreet_mime_load_globs(Ecore_List *datadirs, const char *datahome)
  * @brief Read all magic files in XDG data/home dirs.
  */
 static void
-efreet_mime_load_magics(Ecore_List *datadirs, const char *datahome)
+efreet_mime_load_magics(Eina_List *datadirs, const char *datahome)
 {
+    Eina_List *l;
     char buf[4096];
     const char *datadir = NULL;
 
-    IF_FREE_LIST(magics);
-    magics = ecore_list_new();
-    ecore_list_free_cb_set(magics, efreet_mime_magic_free);
+    while (magics)
+    {
+        efreet_mime_magic_free(eina_list_data_get(magics));
+        magics = eina_list_remove_list(magics, magics);
+    }
 
     datadir = datahome;
-    ecore_list_first_goto(datadirs);
-    while (datadir)
-    {
         snprintf(buf, sizeof(buf), "%s/mime/magic", datadir);
         efreet_mime_shared_mimeinfo_magic_load(buf);
 
-        datadir = ecore_list_next(datadirs);
+    EINA_LIST_FOREACH(datadirs, l, datadir)
+    {
+        snprintf(buf, sizeof(buf), "%s/mime/magic", datadir);
+        efreet_mime_shared_mimeinfo_magic_load(buf);
     }
 }
 
@@ -435,7 +442,7 @@ efreet_mime_cb_update_file(void *data __UNUSED__,
                     Ecore_File_Event event __UNUSED__,
                     const char *path)
 {
-    Ecore_List *datadirs = NULL;
+    Eina_List *datadirs = NULL;
     const char *datahome = NULL;
 
     if (!(datahome = efreet_data_home_get()))
@@ -460,7 +467,8 @@ efreet_mime_cb_update_file(void *data __UNUSED__,
 static int
 efreet_mime_init_files(void)
 {
-    Ecore_List *datadirs = NULL;
+    Eina_List *l;
+    Eina_List *datadirs = NULL;
     char buf[PATH_MAX];
     const char *datahome, *datadir = NULL;
 
@@ -475,13 +483,13 @@ efreet_mime_init_files(void)
      * We watch the directories so we can watch for new files
      */
     datadir = datahome;
-    ecore_list_first_goto(datadirs);
-    while (datadir)
-    {
         snprintf(buf, PATH_MAX, "%s/mime", datadir);
         efreet_mime_monitor_add(buf);
 
-        datadir = ecore_list_next(datadirs);
+    EINA_LIST_FOREACH(datadirs, l, datadir)
+    {
+        snprintf(buf, PATH_MAX, "%s/mime", datadir);
+        efreet_mime_monitor_add(buf);
     }
     efreet_mime_monitor_add("/etc/mime.types");
 
@@ -622,19 +630,14 @@ efreet_mime_glob_remove(const char *glob)
 {
     Efreet_Mime_Glob *mime = NULL;
 
-    mime = ecore_list_first_goto(globs);
-    while ((mime = ecore_list_current(globs)))
-    {
-        if (!strcmp(glob, mime->glob))
+    if ((mime = eina_list_search_unsorted(globs, (Eina_Compare_Cb)strcmp, glob)))
         {
-            ecore_list_remove(globs);
+        globs = eina_list_remove(globs, mime);
             IF_RELEASE(mime->glob);
             IF_RELEASE(mime->mime);
             FREE(mime);
             return 1;
         }
-        ecore_list_next(globs);
-    }
 
     return 0;
 }
@@ -763,7 +766,7 @@ efreet_mime_shared_mimeinfo_globs_load(const char *file)
                 else
                 {
                     efreet_mime_glob_remove(ext);
-                    ecore_list_append(globs, mime);
+                    globs = eina_list_append(globs, mime);
                 }
             }
         }
@@ -882,10 +885,7 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
             char *val, buf[512];
 
             mime = NEW(Efreet_Mime_Magic, 1);
-            mime->entries = ecore_list_new();
-            ecore_list_free_cb_set(mime->entries,
-                                  efreet_mime_magic_entry_free);
-            ecore_list_append(magics, mime);
+            magics = eina_list_append(magics, mime);
 
             val = ++ptr;
             while ((*val != ':')) val++;
@@ -926,7 +926,7 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
                 entry->value = NULL;
                 ptr++;
 
-                ecore_list_append(mime->entries, entry);
+                mime->entries = eina_list_append(mime->entries, entry);
            }
 
             switch(*ptr)
@@ -1050,6 +1050,7 @@ efreet_mime_magic_check_priority(const char *file,
 {
     Efreet_Mime_Magic *m = NULL;
     Efreet_Mime_Magic_Entry *e = NULL;
+    Eina_List *l, *ll;
     FILE *f = NULL;
     unsigned int i = 0, offset = 0,level = 0, match = 0, bytes_read = 0;
     const char *last_mime = NULL;
@@ -1058,7 +1059,7 @@ efreet_mime_magic_check_priority(const char *file,
     f = fopen(file, "rb");
     if (!f) return NULL;
 
-    if (!(m = ecore_list_first_goto(magics)))
+    if (!magics)
     {
         fclose(f);
         return NULL;
@@ -1070,7 +1071,7 @@ efreet_mime_magic_check_priority(const char *file,
         return NULL;
     }
 
-    while ((m = ecore_list_next(magics)))
+    EINA_LIST_FOREACH(magics, l, m)
     {
         if ((start != 0) && (m->priority > start))
             continue;
@@ -1078,8 +1079,7 @@ efreet_mime_magic_check_priority(const char *file,
         if (m->priority < end)
             break;
 
-        ecore_list_first_goto(m->entries);
-        while ((e = ecore_list_next(m->entries)))
+        EINA_LIST_FOREACH(m->entries, ll, e)
         {
             if ((level < e->indent) && !match)
                 continue;
@@ -1157,9 +1157,15 @@ static void
 efreet_mime_magic_free(void *data)
 {
     Efreet_Mime_Magic *m = data;
+    Efreet_Mime_Magic_Entry *entry = NULL;
 
     IF_RELEASE(m->mime);
-    IF_FREE_LIST(m->entries);
+    while (m->entries)
+    {
+        entry = eina_list_data_get(m->entries);
+        efreet_mime_magic_entry_free(entry);
+        m->entries = eina_list_remove_list(m->entries, m->entries);
+    }
     IF_FREE(m);
 }
 
index 38d81da..8bcdde9 100644 (file)
  * If x is a valid pointer destroy x and set to NULL
  */
 #define IF_FREE_LIST(x) do { \
-    if (x) { \
-        Ecore_List *__tmp; __tmp = (x); (x) = NULL; ecore_list_destroy(__tmp); \
-    } \
-    (x) = NULL; \
+     x = eina_list_free(x);                    \
 } while (0)
 
 /**
@@ -146,7 +143,7 @@ struct Efreet_Desktop_Command
   Efreet_Desktop_Progress_Cb cb_progress;
   void *data;
 
-  Ecore_List *files; /**< list of Efreet_Desktop_Command_File */
+  Eina_List *files; /**< list of Efreet_Desktop_Command_File */
 };
 
 /**
@@ -178,8 +175,8 @@ void efreet_icon_shutdown(void);
 
 int efreet_menu_init(void);
 void efreet_menu_shutdown(void);
-Ecore_List *efreet_default_dirs_get(const char *user_dir,
-                                    Ecore_List *system_dirs,
+Eina_List *efreet_default_dirs_get(const char *user_dir,
+                                    Eina_List *system_dirs,
                                     const char *suffix);
 
 int efreet_ini_init(void);
index 60f83df..3fd279f 100644 (file)
@@ -178,12 +178,12 @@ efreet_trash_empty_trash(void)
  * when you don't need anymore)
  * @brief List all the files and directory currently inside the trash.
  */
-EAPI Ecore_List*
+EAPI Eina_List*
 efreet_trash_ls(void)
 {
     char *infofile;
     char buf[PATH_MAX];
-    Ecore_List *files;
+    Eina_List *files, *l;
 
     // NOTE THIS FUNCTION NOW IS NOT COMPLETE AS I DON'T NEED IT
     // TODO read the name from the infofile instead of the filename
@@ -191,7 +191,7 @@ efreet_trash_ls(void)
     snprintf(buf, PATH_MAX, "%s/files", efreet_trash_dir_get());
     files = ecore_file_ls(buf);
 
-    while ((infofile = ecore_list_next(files)))
+    EINA_LIST_FOREACH(files, l, infofile)
         printf("FILE: %s\n", infofile);
 
     return files;
index de56146..92d33f1 100644 (file)
@@ -11,7 +11,7 @@ typedef struct Efreet_Util_Desktop      Efreet_Util_Desktop;
 
 struct Efreet_Cache_Fill
 {
-    Ecore_List            *dirs;
+    Eina_List *dirs;
     Efreet_Cache_Fill_Dir *current;
     DIR  *files;
 };
@@ -32,7 +32,7 @@ struct Efreet_Cache_Search
 
 struct Efreet_Cache_Search_List
 {
-    Ecore_List *list;
+    Eina_List *list;
     const char *what;
 };
 
@@ -74,7 +74,7 @@ static void efreet_util_monitor(const char *path, const char *file_id, int prior
 static void efreet_util_monitor_cb(void *data, Ecore_File_Monitor *monitor,
                                     Ecore_File_Event event, const char *path);
 static void efreet_util_monitor_free(void *data);
-static void efreet_util_menus_find_helper(Ecore_List *menus, const char *config_dir);
+static void efreet_util_menus_find_helper(Eina_List *menus, const char *config_dir);
 
 static void efreet_util_desktops_by_category_add(Efreet_Desktop *desktop);
 static void efreet_util_desktops_by_category_remove(Efreet_Desktop *desktop);
@@ -89,7 +89,7 @@ static Eina_Hash *desktops_by_category = NULL;
 static Ecore_Idler       *idler = NULL;
 static Efreet_Cache_Fill *fill = NULL;
 
-static Ecore_List *monitors = NULL;
+static Eina_List *monitors = NULL;
 
 static int init = 0;
 
@@ -99,7 +99,7 @@ EAPI int EFREET_EVENT_DESKTOP_CHANGE = 0;
 EAPI int
 efreet_util_init(void)
 {
-    Ecore_List *dirs;
+    Eina_List *dirs;
 
     if (init++) return init;
 
@@ -109,14 +109,11 @@ efreet_util_init(void)
         EFREET_EVENT_DESKTOP_CHANGE = ecore_event_type_new();
     desktop_by_file_id = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_util_desktop_free));
     file_id_by_desktop_path = eina_hash_string_superfast_new(EINA_FREE_CB(eina_stringshare_del));
-    desktops_by_category = eina_hash_string_superfast_new(EINA_FREE_CB(ecore_list_destroy));
+    desktops_by_category = eina_hash_string_superfast_new(EINA_FREE_CB(eina_list_free));
 
-    monitors = ecore_list_new();
-    ecore_list_free_cb_set(monitors, efreet_util_monitor_free);
+    monitors = NULL;
 
     fill = NEW(Efreet_Cache_Fill, 1);
-    fill->dirs = ecore_list_new();
-    ecore_list_free_cb_set(fill->dirs, efreet_util_cache_dir_free);
     dirs = efreet_default_dirs_get(efreet_data_home_get(), efreet_data_dirs_get(),
                                                                     "applications");
     if (dirs)
@@ -125,14 +122,15 @@ efreet_util_init(void)
         char *path;
         int priority = 0;
 
-        while ((path = ecore_list_first_remove(dirs)))
+        while (dirs)
         {
+            path = eina_list_data_get(dirs);
             dir = NEW(Efreet_Cache_Fill_Dir, 1);
             dir->path = path;
             dir->priority = priority++;
-            ecore_list_append(fill->dirs, dir);
+            fill->dirs = eina_list_append(fill->dirs, dir);
+            dirs = eina_list_remove_list(dirs, dirs);
         }
-        ecore_list_destroy(dirs);
     }
     idler = ecore_idler_add(efreet_util_cache_fill, NULL);
     return init;
@@ -141,12 +139,21 @@ efreet_util_init(void)
 EAPI int
 efreet_util_shutdown(void)
 {
+    Efreet_Monitor *em;
+    Efreet_Cache_Fill_Dir *dir;
+
     if (--init) return init;
 
     if (idler)
     {
         ecore_idler_del(idler);
-        IF_FREE_LIST(fill->dirs);
+        while (fill->dirs)
+        {
+            dir = eina_list_data_get(fill->dirs);
+            efreet_util_cache_dir_free(dir);
+            fill->dirs = eina_list_remove_list(fill->dirs, fill->dirs);
+        }
+
         if (fill->current) efreet_util_cache_dir_free(fill->current);
         if (fill->files) closedir(fill->files);
         free(fill);
@@ -156,7 +163,12 @@ efreet_util_shutdown(void)
     IF_FREE_HASH(desktop_by_file_id);
     IF_FREE_HASH(file_id_by_desktop_path);
 
-    IF_FREE_LIST(monitors);
+    while (monitors)
+    {
+        em = eina_list_data_get(monitors);
+        efreet_util_monitor_free(em);
+        monitors = eina_list_remove_list(monitors, monitors);
+    }
 
     IF_FREE_HASH(desktops_by_category);
 
@@ -166,27 +178,29 @@ efreet_util_shutdown(void)
 static char *
 efreet_util_path_in_default(const char *section, const char *path)
 {
-    Ecore_List *dirs;
+    Eina_List *dirs, *l;
     char *ret = NULL;
     char *dir;
 
     dirs = efreet_default_dirs_get(efreet_data_home_get(), efreet_data_dirs_get(),
                                                                     section);
 
-    ecore_list_first_goto(dirs);
-    while ((dir = ecore_list_next(dirs)))
+    EINA_LIST_FREE(dirs, dir)
     {
         size_t len;
 
         len = strlen(dir);
         if (!strncmp(path, dir, strlen(dir)))
         {
-            ret = strdup(dir);
+            ret = dir;
             break;
         }
+       free(dir);
     }
 
-    ecore_list_destroy(dirs);
+    EINA_LIST_FREE(dirs, dir)
+      if (ret != dir) free(dir);
+
     return ret;
 }
 
@@ -232,13 +246,13 @@ efreet_util_path_to_file_id(const char *path)
     return file_id;
 }
 
-EAPI Ecore_List *
+EAPI Eina_List *
 efreet_util_desktop_mime_list(const char *mime)
 {
     Efreet_Cache_Search_List search;
     Eina_Iterator *it;
 
-    search.list = ecore_list_new();
+    search.list = NULL;
     search.what = eina_stringshare_add(mime);
 
     it = eina_hash_iterator_data_new(desktop_by_file_id);
@@ -247,7 +261,6 @@ efreet_util_desktop_mime_list(const char *mime)
 
     eina_stringshare_del(search.what);
 
-    if (ecore_list_empty_is(search.list)) IF_FREE_LIST(search.list);
     return search.list;
 }
 
@@ -268,7 +281,11 @@ efreet_util_desktop_wm_class_find(const char *wmname, const char *wmclass)
     eina_iterator_free(it);
     ud = search.result;
 
-    if (ud) return ud->desktop;
+    if (ud)
+      {
+        efreet_desktop_ref(ud->desktop);
+        return ud->desktop;
+      }
     return NULL;
 }
 
@@ -277,7 +294,7 @@ efreet_util_desktop_file_id_find(const char *file_id)
 {
     Efreet_Desktop *desktop = NULL;
     Efreet_Util_Desktop *ud = NULL;
-    Ecore_List *dirs;
+    Eina_List *dirs, *l;
     const char *dir;
     int priority = 0;
 
@@ -289,8 +306,7 @@ efreet_util_desktop_file_id_find(const char *file_id)
                                                                     "applications");
     if (!dirs) return NULL;
 
-    ecore_list_first_goto(dirs);
-    while ((dir = ecore_list_next(dirs)))
+    EINA_LIST_FOREACH(dirs, l, dir)
     {
         char *tmp, *p;
         char buf[PATH_MAX];
@@ -310,7 +326,11 @@ efreet_util_desktop_file_id_find(const char *file_id)
         if (desktop) break;
         priority++;
     }
-    ecore_list_destroy(dirs);
+    while (dirs)
+    {
+        free(eina_list_data_get(dirs));
+        dirs = eina_list_remove_list(dirs, dirs);
+    }
     if (desktop)
     {
         Efreet_Event_Desktop_Change *ev;
@@ -347,8 +367,10 @@ efreet_util_desktop_exec_find(const char *exec)
     eina_iterator_foreach(it, EINA_EACH(efreet_util_cache_search_exec), &search);
     eina_iterator_free(it);
 
-    if (search.result) return search.result->desktop;
-    return NULL;
+    if (!search.result) return NULL;
+
+    efreet_desktop_ref(search.result->desktop);
+    return search.result->desktop;
 }
 
 EAPI Efreet_Desktop *
@@ -366,8 +388,8 @@ efreet_util_desktop_name_find(const char *name)
     eina_iterator_foreach(it, EINA_EACH(efreet_util_cache_search_name), &search);
     eina_iterator_free(it);
 
-    if (search.result) return search.result->desktop;
-    return NULL;
+    efreet_desktop_ref(search.result->desktop);
+    return search.result->desktop;
 }
 
 EAPI Efreet_Desktop *
@@ -385,95 +407,99 @@ efreet_util_desktop_generic_name_find(const char *generic_name)
     eina_iterator_foreach(it, EINA_EACH(efreet_util_cache_search_generic_name), &search);
     eina_iterator_free(it);
 
-    if (search.result) return search.result->desktop;
-    return NULL;
+    efreet_desktop_ref(search.result->desktop);
+    return search.result->desktop;
 }
 
-EAPI Ecore_List *
+EAPI Eina_List *
 efreet_util_desktop_name_glob_list(const char *glob)
 {
     Efreet_Cache_Search_List search;
     Eina_Iterator *it;
 
-    search.list = ecore_list_new();
+    search.list = NULL;
     search.what = glob;
 
     it = eina_hash_iterator_data_new(desktop_by_file_id);
     eina_iterator_foreach(it, EINA_EACH(efreet_util_cache_search_name_glob), &search);
     eina_iterator_free(it);
 
-    if (ecore_list_empty_is(search.list)) IF_FREE_LIST(search.list);
     return search.list;
 }
 
-EAPI Ecore_List *
+EAPI Eina_List *
 efreet_util_desktop_exec_glob_list(const char *glob)
 {
     Efreet_Cache_Search_List search;
     Eina_Iterator *it;
 
-    search.list = ecore_list_new();
+    search.list = NULL;
     search.what = glob;
 
     it = eina_hash_iterator_data_new(desktop_by_file_id);
     eina_iterator_foreach(it, EINA_EACH(efreet_util_cache_search_exec_glob), &search);
     eina_iterator_free(it);
 
-    if (ecore_list_empty_is(search.list)) IF_FREE_LIST(search.list);
     return search.list;
 }
 
-EAPI Ecore_List *
+EAPI Eina_List *
 efreet_util_desktop_generic_name_glob_list(const char *glob)
 {
     Efreet_Cache_Search_List search;
     Eina_Iterator *it;
 
-    search.list = ecore_list_new();
+    search.list = NULL;
     search.what = glob;
 
     it = eina_hash_iterator_data_new(desktop_by_file_id);
     eina_iterator_foreach(it, EINA_EACH(efreet_util_cache_search_generic_name_glob), &search);
     eina_iterator_free(it);
 
-    if (ecore_list_empty_is(search.list)) IF_FREE_LIST(search.list);
     return search.list;
 }
 
-EAPI Ecore_List *
+EAPI Eina_List *
 efreet_util_desktop_comment_glob_list(const char *glob)
 {
     Efreet_Cache_Search_List search;
     Eina_Iterator *it;
 
-    search.list = ecore_list_new();
+    search.list = NULL;
     search.what = glob;
 
     it = eina_hash_iterator_data_new(desktop_by_file_id);
     eina_iterator_foreach(it, EINA_EACH(efreet_util_cache_search_comment_glob), &search);
     eina_iterator_free(it);
 
-    if (ecore_list_empty_is(search.list)) IF_FREE_LIST(search.list);
     return search.list;
 }
 
+static Eina_Bool
+_hash_keys(Eina_Hash *hash, const void *key, void *fdata)
+{
+    Eina_List **l = fdata;
+
+    *l = eina_list_append(*l, key);
+    return EINA_TRUE;
+}
+
 /**
  * Find all desktop categories
  * This list must be freed using ecore_list_destroy()
  *
- * @return an Ecore_List of category names (const char *)
+ * @return an Eina_List of category names (const char *)
  */
-EAPI Ecore_List *
+EAPI Eina_List *
 efreet_util_desktop_categories_list(void)
 {
     Eina_Iterator *it;
-    Ecore_List *list;
+    Eina_List *list = NULL;
 
-    list = ecore_list_new();
-    if (list)
-      {
        it = eina_hash_iterator_key_new(desktops_by_category);
-       eina_iterator_foreach(it, EINA_EACH(desktops_by_category), list);
+    if (it)
+    {
+        eina_iterator_foreach(it, EINA_EACH(_hash_keys), &list);
        eina_iterator_free(it);
       }
 
@@ -488,7 +514,7 @@ efreet_util_desktop_categories_list(void)
  * @param category the category name
  * @return a list of desktops
  */
-EAPI Ecore_List *
+EAPI Eina_List *
 efreet_util_desktop_category_list(const char *category)
 {
     return eina_hash_find(desktops_by_category, category);
@@ -505,6 +531,7 @@ dump(Eina_Hash *hash, const char *key, void *value, __UNUSED__ void *data)
 static int
 efreet_util_cache_fill(__UNUSED__ void *data)
 {
+    Efreet_Cache_Fill_Dir *dir;
     struct dirent *file = NULL;
     double start;
     char buf[PATH_MAX];
@@ -521,10 +548,17 @@ efreet_util_cache_fill(__UNUSED__ void *data)
     }
     if (!fill->current)
     {
-        fill->current = ecore_list_first_remove(fill->dirs);
+        fill->current = eina_list_data_get(fill->dirs);
+        fill->dirs = eina_list_remove_list(fill->dirs, fill->dirs);
         if (!fill->current)
         {
-            IF_FREE_LIST(fill->dirs);
+            while (fill->dirs)
+            {
+                dir = eina_list_data_get(fill->dirs);
+                efreet_util_cache_dir_free(dir);
+                fill->dirs = eina_list_remove_list(fill->dirs, fill->dirs);
+            }
+
             free(fill);
             idler = NULL;
             fill = NULL;
@@ -572,7 +606,7 @@ efreet_util_cache_fill(__UNUSED__ void *data)
                 dir->path = strdup(buf);
                 dir->file_id = strdup(file_id);
                 dir->priority = fill->current->priority;
-                ecore_list_append(fill->dirs, dir);
+                fill->dirs = eina_list_append(fill->dirs, dir);
             }
             else
                 efreet_util_cache_add(buf, file_id, fill->current->priority, 0);
@@ -781,21 +815,20 @@ efreet_util_cache_search_mime(__UNUSED__ const Eina_Hash *hash, void *value, voi
 {
     Efreet_Cache_Search_List *search;
     Efreet_Util_Desktop      *ud;
+    Eina_List                *l;
     const char               *mime;
 
     search = fdata;
     ud = value;
 
     if (!ud->desktop->mime_types) return EINA_FALSE;
-    ecore_list_first_goto(ud->desktop->mime_types);
-    while ((mime = ecore_list_next(ud->desktop->mime_types)))
-    {
+    EINA_LIST_FOREACH(ud->desktop->mime_types, l, mime)
         if (search->what == mime)
         {
-            ecore_list_append(search->list, ud->desktop);
+           efreet_desktop_ref(ud->desktop);
+            search->list = eina_list_append(search->list, ud->desktop);
             break;
         }
-    }
     return EINA_TRUE;
 }
 
@@ -808,6 +841,7 @@ efreet_util_cache_search_wm_class(__UNUSED__ const Eina_Hash *hash, void *value,
     ud = value;
     search = fdata;
 
+    if (!ud->desktop) return EINA_TRUE;
     if (!ud->desktop->startup_wm_class) return EINA_TRUE;
     if ((search->what2) && (!strcmp(ud->desktop->startup_wm_class, search->what2)))
       {
@@ -899,8 +933,12 @@ efreet_util_cache_search_name_glob(__UNUSED__ const Eina_Hash *hash, void *value
     search = fdata;
     ud = value;
 
+    if (!ud->desktop) return EINA_TRUE;
     if (efreet_util_glob_match(ud->desktop->name, search->what))
-        ecore_list_append(search->list, ud->desktop);
+      {
+        efreet_desktop_ref(ud->desktop);
+        search->list = eina_list_append(search->list, ud->desktop);
+      }
     return EINA_TRUE;
 }
 
@@ -916,12 +954,14 @@ efreet_util_cache_search_exec_glob(__UNUSED__ const Eina_Hash *hash, void *value
 
     if (!ud->desktop->exec) return EINA_FALSE;
     exec = ecore_file_app_exe_get(ud->desktop->exec);
-    if (exec)
-    {
+    if (!exec) return EINA_TRUE;
+
         if (efreet_util_glob_match(exec, search->what))
-            ecore_list_append(search->list, ud->desktop);
-        free(exec);
+      {
+        efreet_desktop_ref(ud->desktop);
+        search->list = eina_list_append(search->list, ud->desktop);
     }
+    free(exec);
     return EINA_TRUE;
 }
 
@@ -935,7 +975,10 @@ efreet_util_cache_search_generic_name_glob(__UNUSED__ const Eina_Hash *hash, voi
     ud = value;
 
     if (efreet_util_glob_match(ud->desktop->generic_name, search->what))
-        ecore_list_append(search->list, ud->desktop);
+      {
+        efreet_desktop_ref(ud->desktop);
+        search->list = eina_list_append(search->list, ud->desktop);
+      }
     return EINA_TRUE;
 }
 
@@ -949,7 +992,10 @@ efreet_util_cache_search_comment_glob(__UNUSED__ const Eina_Hash *hash, void *va
     ud = value;
 
     if (efreet_util_glob_match(ud->desktop->comment, search->what))
-        ecore_list_append(search->list, ud->desktop);
+      {
+        efreet_desktop_ref(ud->desktop);
+        search->list = eina_list_append(search->list, ud->desktop);
+      }
     return EINA_TRUE;
 }
 
@@ -977,7 +1023,7 @@ efreet_util_monitor(const char *path, const char *file_id, int priority)
     em->monitor = ecore_file_monitor_add(path, efreet_util_monitor_cb, em);
     if (file_id) em->file_id = strdup(file_id);
     em->priority = priority;
-    ecore_list_append(monitors, em);
+    monitors = eina_list_append(monitors, em);
 }
 
 static void
@@ -1007,15 +1053,13 @@ efreet_util_monitor_cb(void *data, Ecore_File_Monitor *monitor __UNUSED__,
                 if (!fill)
                 {
                     fill = NEW(Efreet_Cache_Fill, 1);
-                    fill->dirs = ecore_list_new();
-                    ecore_list_free_cb_set(fill->dirs, efreet_util_cache_dir_free);
                 }
 
                 dir = NEW(Efreet_Cache_Fill_Dir, 1);
                 dir->path = strdup(path);
                 dir->file_id = strdup(file_id);
                 dir->priority = em->priority;
-                ecore_list_append(fill->dirs, dir);
+                fill->dirs = eina_list_append(fill->dirs, dir);
 
                 if (!idler)
                     idler = ecore_idler_add(efreet_util_cache_fill, NULL);
@@ -1028,8 +1072,8 @@ efreet_util_monitor_cb(void *data, Ecore_File_Monitor *monitor __UNUSED__,
             /* Ignore, we should already have a monitor on any subdir */
             break;
         case ECORE_FILE_EVENT_DELETED_SELF:
-            if (ecore_list_goto(monitors, em))
-                ecore_list_remove(monitors);
+            if (eina_list_data_find(monitors, em))
+                eina_list_remove(monitors, em);
             efreet_util_monitor_free(em);
             break;
         case ECORE_FILE_EVENT_MODIFIED:
@@ -1053,27 +1097,24 @@ efreet_util_monitor_free(void *data)
  * Returns a list of .menu files found in the various config dirs.
  * @return An ecore list of menu file paths (const char *). This must be freed with ecore_list_destroy().
  */
-EAPI Ecore_List *
+EAPI Eina_List *
 efreet_util_menus_find(void)
 {
-    Ecore_List *menus, *dirs;
+    Eina_List *menus = NULL;
+    Eina_List *dirs, *l;
     const char *dir;
 
-    menus = ecore_list_new();
-    ecore_list_free_cb_set(menus, ECORE_FREE_CB(free));
-
     efreet_util_menus_find_helper(menus, efreet_config_home_get());
 
     dirs = efreet_config_dirs_get();
-    ecore_list_first_goto(dirs);
-    while ((dir = ecore_list_next(dirs)))
+    EINA_LIST_FOREACH(dirs, l, dir)
         efreet_util_menus_find_helper(menus, dir);
 
     return menus;
 }
 
 static void
-efreet_util_menus_find_helper(Ecore_List *menus, const char *config_dir)
+efreet_util_menus_find_helper(Eina_List *menus, const char *config_dir)
 {
     DIR *files = NULL;
     struct dirent *file = NULL;
@@ -1091,7 +1132,7 @@ efreet_util_menus_find_helper(Ecore_List *menus, const char *config_dir)
         snprintf(fbuf, PATH_MAX, "%s/%s", dbuf, file->d_name);
         if (ecore_file_is_dir(fbuf)) continue;
 
-        ecore_list_append(menus, strdup(fbuf));
+        menus = eina_list_append(menus, strdup(fbuf));
     }
     closedir(files);
 }
@@ -1099,42 +1140,40 @@ efreet_util_menus_find_helper(Ecore_List *menus, const char *config_dir)
 static void
 efreet_util_desktops_by_category_add(Efreet_Desktop *desktop)
 {
+    Eina_List *l;
     const char *category;
 
     if (!desktop->categories) return;
 
-    ecore_list_first_goto(desktop->categories);
-    while ((category = ecore_list_next(desktop->categories)))
+    EINA_LIST_FOREACH(desktop->categories, l, category)
     {
-        Ecore_List *list;
+        Eina_List *list;
         list = eina_hash_find(desktops_by_category, category);
-        if (!list)
-        {
-            list = ecore_list_new();
-            eina_hash_add(desktops_by_category, category, list);
-        }
-        if (!ecore_list_goto(list, desktop))
-            ecore_list_append(list, desktop);
+        if (!eina_list_data_find(list, desktop))
+            list = eina_list_append(list, desktop);
+        eina_hash_modify(desktops_by_category, category, list);
     }
 }
 
 static void
 efreet_util_desktops_by_category_remove(Efreet_Desktop *desktop)
 {
+    Eina_List *l;
     const char *category;
 
     if (!desktop->categories) return;
 
-    ecore_list_first_goto(desktop->categories);
-    while ((category = ecore_list_next(desktop->categories)))
+    EINA_LIST_FOREACH(desktop->categories, l, category)
     {
-        Ecore_List *list;
+        Eina_List *list;
         list = eina_hash_find(desktops_by_category, category);
         if (!list) continue;
-        if (ecore_list_goto(list, desktop))
-            ecore_list_remove(list);
-        if (ecore_list_empty_is(list))
+        if (eina_list_data_find(list, desktop))
+            list = eina_list_remove(list, desktop);
+        if (!list)
          eina_hash_del(desktops_by_category, category, list);
+        else
+            eina_hash_modify(desktops_by_category, category, list);
     }
 }
 
index 988e66f..eb21b5f 100644 (file)
@@ -25,7 +25,7 @@ EAPI int efreet_util_shutdown(void);
 
 EAPI const char *efreet_util_path_to_file_id(const char *path);
 
-EAPI Ecore_List *efreet_util_desktop_mime_list(const char *mime);
+EAPI Eina_List *efreet_util_desktop_mime_list(const char *mime);
 
 EAPI Efreet_Desktop *efreet_util_desktop_wm_class_find(const char *wmname, const char *wmclass);
 EAPI Efreet_Desktop *efreet_util_desktop_file_id_find(const char *file_id);
@@ -33,15 +33,15 @@ EAPI Efreet_Desktop *efreet_util_desktop_exec_find(const char *exec);
 EAPI Efreet_Desktop *efreet_util_desktop_name_find(const char *name);
 EAPI Efreet_Desktop *efreet_util_desktop_generic_name_find(const char *generic_name);
 
-EAPI Ecore_List *efreet_util_desktop_name_glob_list(const char *glob);
-EAPI Ecore_List *efreet_util_desktop_exec_glob_list(const char *glob);
-EAPI Ecore_List *efreet_util_desktop_generic_name_glob_list(const char *glob);
-EAPI Ecore_List *efreet_util_desktop_comment_glob_list(const char *glob);
+EAPI Eina_List *efreet_util_desktop_name_glob_list(const char *glob);
+EAPI Eina_List *efreet_util_desktop_exec_glob_list(const char *glob);
+EAPI Eina_List *efreet_util_desktop_generic_name_glob_list(const char *glob);
+EAPI Eina_List *efreet_util_desktop_comment_glob_list(const char *glob);
 
-EAPI Ecore_List *efreet_util_desktop_categories_list(void);
-EAPI Ecore_List *efreet_util_desktop_category_list(const char *category);
+EAPI Eina_List *efreet_util_desktop_categories_list(void);
+EAPI Eina_List *efreet_util_desktop_category_list(const char *category);
 
-EAPI Ecore_List *efreet_util_menus_find(void);
+EAPI Eina_List *efreet_util_menus_find(void);
 
 EAPI extern int EFREET_EVENT_DESKTOP_LIST_CHANGE;
 EAPI extern int EFREET_EVENT_DESKTOP_CHANGE;