static int
timer(void *data __UNUSED__)
{
- Ecore_List *list;
+ Eina_List *list;
+ Eina_List *l;
Efreet_Desktop *desktop;
double start;
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;
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};
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)
{
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)
{
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};
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)
{
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)
{
ef_cb_desktop_parse(void)
{
Efreet_Desktop *desktop;
+ Eina_List *l;
int ret = 1;
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/test/test.desktop");
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)
{
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);
typedef struct
{
- Ecore_List *expected;
+ Eina_List *expected;
int error;
char type;
} Test_Info;
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;
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;
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);
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);
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);
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;
}
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;
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);
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);
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;
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;
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))
{
}
free(dir);
}
- ecore_list_destroy(dirs);
}
const char *icons[] =
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;
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++)
}
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);
{
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);
static void
ef_read_dir(const char *dir, Eina_Hash *icons)
{
- Ecore_List *files;
+ Eina_List *files;
char *file;
if (!dir || !icons) return;
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)
{
FREE(file);
}
- ecore_list_destroy(files);
}
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);
}
}
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);
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);
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);
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)
{
};
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);
}
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")) ||
}
return 1;
}
- ecore_list_append(run, argv[i]);
+ run = eina_list_append(run, argv[i]);
}
}
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;
}
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;
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);
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);
/**
}
/**
- * @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;
}
/**
- * @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;
* @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);
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;
#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);
/**
* 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
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);
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
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,
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;
}
static void
efreet_desktop_clear(Efreet_Desktop *desktop)
{
+ char *data;
+
IF_FREE(desktop->name);
IF_FREE(desktop->generic_name);
IF_FREE(desktop->comment);
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);
}
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);
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);
}
* @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);
}
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);
}
/**
{
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));
}
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;
}
/**
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);
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;
}
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);
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;
/**
* @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;
{
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 */
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);
}
/**
- * @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 ';' */
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;
}
* @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);
*
* 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;
efreet_desktop_command_file_free(dcf);
continue;
}
- ecore_list_append(command->files, dcf);
+ command->files = eina_list_append(command->files, dcf);
}
}
* 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;
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);
}
* @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);
}
* @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;
#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. */
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);
}
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;
int status __UNUSED__)
{
Efreet_Desktop_Command_File *f;
+ char *exec;
+
f = data;
/* XXX check status... error handling, etc */
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);
}
}
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 */
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,
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);
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;
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);
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
}
/* 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;
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));
}
/**
* 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;
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;
}
/**
* @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;
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;
if (!theme->name.name) continue;
#endif
- ecore_list_append(list, theme);
+ list = eina_list_append(list, theme);
}
- ecore_list_destroy(theme_list);
return list;
}
static char *
efreet_icon_remove_extension(const char *icon)
{
+ Eina_List *l;
char *tmp = NULL, *ext = NULL;
tmp = strdup(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))
{
* 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);
*/
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))
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;
*/
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;
*/
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;
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))
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,
}
/* 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;
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;
}
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)
}
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);
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 };
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);
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 };
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);
{
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;
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;
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);
{
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));
}
/**
static void
efreet_icon_theme_cache_check(Efreet_Icon_Theme *theme)
{
+ Eina_List *l;
double new_check;
new_check = ecore_time_get();
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;
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);
{
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, ',');
{
*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);
}
{
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;
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;
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;
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);
}
/**
}
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);
}
}
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;
}
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);
}
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);
}
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 */
} 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 */
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,
if (line_start[header_length] == ']')
{
- Eina_Hash *old;
const char *header;
header = alloca(header_length * sizeof(unsigned char));
if (sep < line_length)
{
const char *key, *value;
- char *old;
int key_end, value_start, value_end;
/* trim whitespace from end of key */
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 */
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 */
};
};
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 */
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);
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))
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);
{
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",
/* 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());
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;
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)
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)
{
{
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)
{
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);
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;
}
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;
}
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"));
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);
* @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;
/* 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;
}
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;
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;
}
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;
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;
}
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;
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;
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;
}
{
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;
}
{
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;
}
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;
* 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;
* 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;
/* 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];
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;
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;
}
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)
{
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
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);
}
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;
}
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);
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;
/* 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;
/* 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;
}
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;
}
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;
}
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;
}
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;
}
return 0;
}
- ecore_list_prepend(parent->filters, filter);
+ parent->filters = eina_list_prepend(parent->filters, filter);
return 1;
}
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;
}
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;
{
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);
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;
{
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);
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;
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)
{
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));
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;
}
}
}
{
int count;
- count = ecore_list_count(internal->applications);
+ count = eina_list_count(internal->applications);
if (count)
{
Ecore_Sheap *sheap;
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);
}
}
* 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;
}
/**
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;
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;
}
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;
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 */
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;
}
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;
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)
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);
}
}
}
{
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;
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 */
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;
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);
}
{
*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, '/');
}
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
{
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
{
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
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
{
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
{
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
{
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
{
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
if (!internal || internal->directories) return;
internal->directories = ecore_dlist_new();
- ecore_list_free_cb_set(internal->directories, free);
}
static char *
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;
}
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);
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)
{
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
{
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
{
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;
efreet_menu_free(sub_entry);
continue;
}
- ecore_list_append(entry->entries, sub_entry);
+ entry->entries = eina_list_append(entry->entries, sub_entry);
}
}
{
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;
}
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)
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
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)
{
{
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);
{
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);
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;
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
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);
}
{
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);
}
}
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;
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);
#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 */
{
unsigned int priority;
const char *mime;
- Ecore_List *entries;
+ Eina_List *entries;
};
/**
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];
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;
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);
*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;
}
EAPI const char *
efreet_mime_globs_type_get(const char *file)
{
+ Eina_List *l;
Efreet_Mime_Glob *g;
char *sl, *p;
const char *s;
}
/* 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;
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;
* 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
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);
}
}
* @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);
}
}
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()))
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;
* 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");
{
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;
}
else
{
efreet_mime_glob_remove(ext);
- ecore_list_append(globs, mime);
+ globs = eina_list_append(globs, mime);
}
}
}
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++;
entry->value = NULL;
ptr++;
- ecore_list_append(mime->entries, entry);
+ mime->entries = eina_list_append(mime->entries, entry);
}
switch(*ptr)
{
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;
f = fopen(file, "rb");
if (!f) return NULL;
- if (!(m = ecore_list_first_goto(magics)))
+ if (!magics)
{
fclose(f);
return NULL;
return NULL;
}
- while ((m = ecore_list_next(magics)))
+ EINA_LIST_FOREACH(magics, l, m)
{
if ((start != 0) && (m->priority > start))
continue;
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;
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);
}
* 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)
/**
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 */
};
/**
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);
* 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
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;
struct Efreet_Cache_Fill
{
- Ecore_List *dirs;
+ Eina_List *dirs;
Efreet_Cache_Fill_Dir *current;
DIR *files;
};
struct Efreet_Cache_Search_List
{
- Ecore_List *list;
+ Eina_List *list;
const char *what;
};
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);
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;
EAPI int
efreet_util_init(void)
{
- Ecore_List *dirs;
+ Eina_List *dirs;
if (init++) return init;
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)
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;
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);
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);
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;
}
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);
eina_stringshare_del(search.what);
- if (ecore_list_empty_is(search.list)) IF_FREE_LIST(search.list);
return search.list;
}
eina_iterator_free(it);
ud = search.result;
- if (ud) return ud->desktop;
+ if (ud)
+ {
+ efreet_desktop_ref(ud->desktop);
+ return ud->desktop;
+ }
return NULL;
}
{
Efreet_Desktop *desktop = NULL;
Efreet_Util_Desktop *ud = NULL;
- Ecore_List *dirs;
+ Eina_List *dirs, *l;
const char *dir;
int priority = 0;
"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];
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;
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 *
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 *
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);
}
* @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);
static int
efreet_util_cache_fill(__UNUSED__ void *data)
{
+ Efreet_Cache_Fill_Dir *dir;
struct dirent *file = NULL;
double start;
char buf[PATH_MAX];
}
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;
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);
{
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;
}
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)))
{
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;
}
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;
}
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;
}
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;
}
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
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);
/* 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:
* 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;
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);
}
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);
}
}
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);
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;