Don't use dlist

SVN revision: 14201
This commit is contained in:
sebastid 2005-04-14 13:35:50 +00:00 committed by sebastid
parent dda04c478c
commit 64f05a5a25
1 changed files with 9 additions and 9 deletions

View File

@ -188,11 +188,11 @@ ecore_file_ls(const char *dir)
{ {
DIR *dirp; DIR *dirp;
struct dirent *dp; struct dirent *dp;
Ecore_DList *list; Ecore_List *list;
dirp = opendir(dir); dirp = opendir(dir);
if (!dirp) return NULL; if (!dirp) return NULL;
list = ecore_dlist_new(); list = ecore_list_new();
while ((dp = readdir(dirp))) while ((dp = readdir(dirp)))
{ {
if ((strcmp(dp->d_name, ".")) && (strcmp(dp->d_name, ".."))) if ((strcmp(dp->d_name, ".")) && (strcmp(dp->d_name, "..")))
@ -200,27 +200,27 @@ ecore_file_ls(const char *dir)
char *file, *f; char *file, *f;
/* insertion sort */ /* insertion sort */
ecore_dlist_goto_first(list); ecore_list_goto_first(list);
while ((file = ecore_dlist_next(list))) while ((file = ecore_list_current(list)))
{ {
if (strcmp(file, dp->d_name) > 0) if (strcmp(file, dp->d_name) > 0)
{ {
ecore_dlist_previous(list);
f = strdup(dp->d_name); f = strdup(dp->d_name);
ecore_dlist_insert(list, f); ecore_list_insert(list, f);
break; break;
} }
ecore_list_next(list);
} }
/* nowhwre to go? just append it */ /* nowhwre to go? just append it */
if (!file) if (!file)
{ {
f = strdup(dp->d_name); f = strdup(dp->d_name);
ecore_dlist_append(list, f); ecore_list_append(list, f);
} }
} }
} }
closedir(dirp); closedir(dirp);
ecore_dlist_goto_first(list); ecore_list_goto_first(list);
return ECORE_LIST(list); return list;
} }