forked from enlightenment/efl
Eio: fix shadow var warnings and make it compile on Windows. Needs more love though
SVN revision: 69809
This commit is contained in:
parent
dce9e934a2
commit
71f42dcebc
|
@ -83,12 +83,12 @@ _eio_file_recursiv_ls(Ecore_Thread *thread,
|
||||||
EINA_ITERATOR_FOREACH(it, info)
|
EINA_ITERATOR_FOREACH(it, info)
|
||||||
{
|
{
|
||||||
Eina_Bool filter = EINA_TRUE;
|
Eina_Bool filter = EINA_TRUE;
|
||||||
struct stat buffer;
|
_eio_stat_t buffer;
|
||||||
|
|
||||||
switch (info->type)
|
switch (info->type)
|
||||||
{
|
{
|
||||||
case EINA_FILE_DIR:
|
case EINA_FILE_DIR:
|
||||||
if (lstat(info->path, &buffer) != 0)
|
if (_eio_lstat(info->path, &buffer) != 0)
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
|
||||||
if (S_ISLNK(buffer.st_mode))
|
if (S_ISLNK(buffer.st_mode))
|
||||||
|
@ -683,16 +683,16 @@ _eio_dir_stat_find_forward(Eio_File_Dir_Ls *async,
|
||||||
|
|
||||||
if (filter)
|
if (filter)
|
||||||
{
|
{
|
||||||
Eio_File_Direct_Info *send;
|
Eio_File_Direct_Info *send_di;
|
||||||
|
|
||||||
send = eio_direct_info_malloc();
|
send_di = eio_direct_info_malloc();
|
||||||
if (!send) return EINA_FALSE;
|
if (!send_di) return EINA_FALSE;
|
||||||
|
|
||||||
memcpy(&send->info, info, sizeof (Eina_File_Direct_Info));
|
memcpy(&send_di->info, info, sizeof (Eina_File_Direct_Info));
|
||||||
send->associated = async->ls.common.worker.associated;
|
send_di->associated = async->ls.common.worker.associated;
|
||||||
async->ls.common.worker.associated = NULL;
|
async->ls.common.worker.associated = NULL;
|
||||||
|
|
||||||
async->pack = eina_list_append(async->pack, send);
|
async->pack = eina_list_append(async->pack, send_di);
|
||||||
}
|
}
|
||||||
else if (async->ls.common.worker.associated)
|
else if (async->ls.common.worker.associated)
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,16 +65,16 @@ _eio_file_heavy(void *data, Ecore_Thread *thread)
|
||||||
|
|
||||||
if (filter)
|
if (filter)
|
||||||
{
|
{
|
||||||
Eio_File_Char *send;
|
Eio_File_Char *send_fc;
|
||||||
|
|
||||||
send = eio_char_malloc();
|
send_fc = eio_char_malloc();
|
||||||
if (!send) goto on_error;
|
if (!send_fc) goto on_error;
|
||||||
|
|
||||||
send->filename = file;
|
send_fc->filename = file;
|
||||||
send->associated = async->ls.common.worker.associated;
|
send_fc->associated = async->ls.common.worker.associated;
|
||||||
async->ls.common.worker.associated = NULL;
|
async->ls.common.worker.associated = NULL;
|
||||||
|
|
||||||
pack = eina_list_append(pack, send);
|
pack = eina_list_append(pack, send_fc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -161,16 +161,16 @@ _eio_file_eina_ls_heavy(Ecore_Thread *thread, Eio_File_Direct_Ls *async, Eina_It
|
||||||
|
|
||||||
if (filter)
|
if (filter)
|
||||||
{
|
{
|
||||||
Eio_File_Direct_Info *send;
|
Eio_File_Direct_Info *send_di;
|
||||||
|
|
||||||
send = eio_direct_info_malloc();
|
send_di = eio_direct_info_malloc();
|
||||||
if (!send) continue;
|
if (!send_di) continue;
|
||||||
|
|
||||||
memcpy(&send->info, info, sizeof (Eina_File_Direct_Info));
|
memcpy(&send_di->info, info, sizeof (Eina_File_Direct_Info));
|
||||||
send->associated = async->ls.common.worker.associated;
|
send_di->associated = async->ls.common.worker.associated;
|
||||||
async->ls.common.worker.associated = NULL;
|
async->ls.common.worker.associated = NULL;
|
||||||
|
|
||||||
pack = eina_list_append(pack, send);
|
pack = eina_list_append(pack, send_di);
|
||||||
}
|
}
|
||||||
else if (async->ls.common.worker.associated)
|
else if (async->ls.common.worker.associated)
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,7 +74,7 @@ _eio_monitor_fallback_heavy_cb(void *data, Ecore_Thread *thread)
|
||||||
Eina_Iterator *it;
|
Eina_Iterator *it;
|
||||||
Eina_Stat *est;
|
Eina_Stat *est;
|
||||||
Eina_File_Direct_Info *info;
|
Eina_File_Direct_Info *info;
|
||||||
struct stat st;
|
_eio_stat_t st;
|
||||||
/* FIXME : copy ecore_file_monitor_poll here */
|
/* FIXME : copy ecore_file_monitor_poll here */
|
||||||
|
|
||||||
if (!backend->initialised)
|
if (!backend->initialised)
|
||||||
|
@ -85,7 +85,7 @@ _eio_monitor_fallback_heavy_cb(void *data, Ecore_Thread *thread)
|
||||||
if (!backend->parent)
|
if (!backend->parent)
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
if (stat(backend->parent->path, &st))
|
if (_eio_stat(backend->parent->path, &st))
|
||||||
{
|
{
|
||||||
if (backend->initialised && !backend->destroyed)
|
if (backend->initialised && !backend->destroyed)
|
||||||
{
|
{
|
||||||
|
@ -107,8 +107,13 @@ _eio_monitor_fallback_heavy_cb(void *data, Ecore_Thread *thread)
|
||||||
est->gid = st.st_gid;
|
est->gid = st.st_gid;
|
||||||
est->rdev = st.st_rdev;
|
est->rdev = st.st_rdev;
|
||||||
est->size = st.st_size;
|
est->size = st.st_size;
|
||||||
|
#ifdef _WIN32
|
||||||
|
est->blksize = 0;
|
||||||
|
est->blocks = 0;
|
||||||
|
#else
|
||||||
est->blksize = st.st_blksize;
|
est->blksize = st.st_blksize;
|
||||||
est->blocks = st.st_blocks;
|
est->blocks = st.st_blocks;
|
||||||
|
#endif
|
||||||
est->atime = st.st_atime;
|
est->atime = st.st_atime;
|
||||||
est->mtime = st.st_mtime;
|
est->mtime = st.st_mtime;
|
||||||
est->ctime = st.st_ctime;
|
est->ctime = st.st_ctime;
|
||||||
|
|
|
@ -64,10 +64,24 @@
|
||||||
# undef WIN32_LEAN_AND_MEAN
|
# undef WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_EVIL
|
||||||
|
# include <Evil.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <Ecore.h>
|
#include <Ecore.h>
|
||||||
|
|
||||||
#include "Eio.h"
|
#include "Eio.h"
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
typedef struct __stat64 _eio_stat_t;
|
||||||
|
#define _eio_stat(p, b) _stat64(p, b)
|
||||||
|
#define _eio_lstat(p, b) _stat64(p, b)
|
||||||
|
#else
|
||||||
|
typedef struct stat _eio_stat_t;
|
||||||
|
#define _eio_stat(p, b) stat(p, b)
|
||||||
|
#define _eio_lstat(p, b) lstat(p, b)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Keeping 32 Eio_File_Progress alive should be enought */
|
/* Keeping 32 Eio_File_Progress alive should be enought */
|
||||||
#define EIO_PROGRESS_LIMIT 32
|
#define EIO_PROGRESS_LIMIT 32
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ _eio_file_unlink_error(void *data, Ecore_Thread *thread __UNUSED__)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_eio_file_struct_2_eina(Eina_Stat *es, struct stat *st)
|
_eio_file_struct_2_eina(Eina_Stat *es, _eio_stat_t *st)
|
||||||
{
|
{
|
||||||
es->dev = st->st_dev;
|
es->dev = st->st_dev;
|
||||||
es->ino = st->st_ino;
|
es->ino = st->st_ino;
|
||||||
|
@ -112,8 +112,13 @@ _eio_file_struct_2_eina(Eina_Stat *es, struct stat *st)
|
||||||
es->gid = st->st_gid;
|
es->gid = st->st_gid;
|
||||||
es->rdev = st->st_rdev;
|
es->rdev = st->st_rdev;
|
||||||
es->size = st->st_size;
|
es->size = st->st_size;
|
||||||
|
#ifdef _WIN32
|
||||||
|
es->blksize = 0;
|
||||||
|
es->blocks = 0;
|
||||||
|
#else
|
||||||
es->blksize = st->st_blksize;
|
es->blksize = st->st_blksize;
|
||||||
es->blocks = st->st_blocks;
|
es->blocks = st->st_blocks;
|
||||||
|
#endif
|
||||||
es->atime = st->st_atime;
|
es->atime = st->st_atime;
|
||||||
es->mtime = st->st_mtime;
|
es->mtime = st->st_mtime;
|
||||||
es->ctime = st->st_ctime;
|
es->ctime = st->st_ctime;
|
||||||
|
@ -138,9 +143,9 @@ static void
|
||||||
_eio_file_stat(void *data, Ecore_Thread *thread)
|
_eio_file_stat(void *data, Ecore_Thread *thread)
|
||||||
{
|
{
|
||||||
Eio_File_Stat *s = data;
|
Eio_File_Stat *s = data;
|
||||||
struct stat buf;
|
_eio_stat_t buf;
|
||||||
|
|
||||||
if (stat(s->path, &buf) != 0)
|
if (_eio_stat(s->path, &buf) != 0)
|
||||||
eio_file_thread_error(&s->common, thread);
|
eio_file_thread_error(&s->common, thread);
|
||||||
|
|
||||||
_eio_file_struct_2_eina(&s->buffer, &buf);
|
_eio_file_struct_2_eina(&s->buffer, &buf);
|
||||||
|
@ -199,6 +204,13 @@ _eio_file_chmod(void *data, Ecore_Thread *thread)
|
||||||
static void
|
static void
|
||||||
_eio_file_chown(void *data, Ecore_Thread *thread)
|
_eio_file_chown(void *data, Ecore_Thread *thread)
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
/* FIXME:
|
||||||
|
* look at http://wwwthep.physik.uni-mainz.de/~frink/chown/readme.html
|
||||||
|
*/
|
||||||
|
(void)data;
|
||||||
|
(void)thread;
|
||||||
|
#else
|
||||||
Eio_File_Chown *own = data;
|
Eio_File_Chown *own = data;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
uid_t owner = -1;
|
uid_t owner = -1;
|
||||||
|
@ -251,6 +263,7 @@ _eio_file_chown(void *data, Ecore_Thread *thread)
|
||||||
on_error:
|
on_error:
|
||||||
ecore_thread_cancel(thread);
|
ecore_thread_cancel(thread);
|
||||||
return ;
|
return ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue