forked from enlightenment/efl
* eina: remove dirent so apps don't rely on non portable code.
SVN revision: 54103
This commit is contained in:
parent
c45e906f7f
commit
eb4cd21f0c
|
@ -76,7 +76,6 @@ struct _Eina_File_Direct_Info
|
||||||
size_t name_length; /**< size of the filename/basename component */
|
size_t name_length; /**< size of the filename/basename component */
|
||||||
size_t name_start; /**< where the filename/basename component starts */
|
size_t name_start; /**< where the filename/basename component starts */
|
||||||
char path[PATH_MAX]; /**< the path */
|
char path[PATH_MAX]; /**< the path */
|
||||||
const struct dirent *dirent; /**< the dirent structure of the path - don't use this if you want compatibility */
|
|
||||||
Eina_File_Type type; /**< file type */
|
Eina_File_Type type; /**< file type */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -101,11 +101,11 @@ _eina_file_ls_iterator_next(Eina_File_Iterator *it, void **data)
|
||||||
((dp->d_name[1] == '\0') ||
|
((dp->d_name[1] == '\0') ||
|
||||||
((dp->d_name[1] == '.') && (dp->d_name[2] == '\0'))));
|
((dp->d_name[1] == '.') && (dp->d_name[2] == '\0'))));
|
||||||
|
|
||||||
#ifdef _DIRENT_HAVE_D_NAMLEN
|
#ifdef _DIRENT_HAVE_D_NAMLEN
|
||||||
length = dp->d_namlen;
|
length = dp->d_namlen;
|
||||||
#else
|
#else
|
||||||
length = strlen(dp->d_name);
|
length = strlen(dp->d_name);
|
||||||
#endif
|
#endif
|
||||||
name = alloca(length + 2 + it->length);
|
name = alloca(length + 2 + it->length);
|
||||||
|
|
||||||
memcpy(name, it->dir, it->length);
|
memcpy(name, it->dir, it->length);
|
||||||
|
@ -162,11 +162,11 @@ _eina_file_direct_ls_iterator_next(Eina_File_Direct_Iterator *it, void **data)
|
||||||
if (!dp)
|
if (!dp)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
|
||||||
#ifdef _DIRENT_HAVE_D_NAMLEN
|
#ifdef _DIRENT_HAVE_D_NAMLEN
|
||||||
length = dp->d_namlen;
|
length = dp->d_namlen;
|
||||||
#else
|
#else
|
||||||
length = strlen(dp->d_name);
|
length = strlen(dp->d_name);
|
||||||
#endif
|
#endif
|
||||||
if (it->info.name_start + length + 1 >= PATH_MAX)
|
if (it->info.name_start + length + 1 >= PATH_MAX)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ _eina_file_direct_ls_iterator_next(Eina_File_Direct_Iterator *it, void **data)
|
||||||
it->info.name_length = length;
|
it->info.name_length = length;
|
||||||
it->info.path_length = it->info.name_start + length;
|
it->info.path_length = it->info.name_start + length;
|
||||||
it->info.path[it->info.path_length] = '\0';
|
it->info.path[it->info.path_length] = '\0';
|
||||||
it->info.dirent = dp;
|
|
||||||
#ifdef _DIRENT_HAVE_D_TYPE
|
#ifdef _DIRENT_HAVE_D_TYPE
|
||||||
switch (dp->d_type)
|
switch (dp->d_type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -188,8 +188,6 @@ _eio_file_direct_heavy(Ecore_Thread *thread, void *data)
|
||||||
if (!send) continue;
|
if (!send) continue;
|
||||||
|
|
||||||
memcpy(send, info, sizeof (Eina_File_Direct_Info));
|
memcpy(send, info, sizeof (Eina_File_Direct_Info));
|
||||||
send->dirent = (struct dirent*)(send + 1);
|
|
||||||
memcpy((void*) send->dirent, info->dirent, sizeof (struct dirent));
|
|
||||||
|
|
||||||
ecore_thread_feedback(thread, send);
|
ecore_thread_feedback(thread, send);
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,7 +145,7 @@ eio_progress_send(Ecore_Thread *thread, Eio_File_Progress *op, off_t current, of
|
||||||
Eina_File_Direct_Info *
|
Eina_File_Direct_Info *
|
||||||
eio_direct_info_malloc(void)
|
eio_direct_info_malloc(void)
|
||||||
{
|
{
|
||||||
return _eio_pool_malloc(&direct_info, sizeof (Eina_File_Direct_Info) + sizeof (struct dirent));
|
return _eio_pool_malloc(&direct_info, sizeof (Eina_File_Direct_Info));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue