forked from enlightenment/efl
Updates. Reduce polling time on no events.
SVN revision: 13460
This commit is contained in:
parent
98fe13e6aa
commit
45d11bcebd
|
@ -38,8 +38,8 @@ EAPI int ecore_file_mkdir (const char *dir);
|
||||||
EAPI int ecore_file_mkpath (const char *path);
|
EAPI int ecore_file_mkpath (const char *path);
|
||||||
EAPI int ecore_file_cp (const char *src, const char *dst);
|
EAPI int ecore_file_cp (const char *src, const char *dst);
|
||||||
EAPI char *ecore_file_realpath (const char *file);
|
EAPI char *ecore_file_realpath (const char *file);
|
||||||
EAPI char *ecore_file_get_file (const char *path);
|
EAPI char *ecore_file_get_file (char *path);
|
||||||
EAPI char *ecore_file_get_dir (const char *path);
|
EAPI char *ecore_file_get_dir (char *path);
|
||||||
|
|
||||||
EAPI int ecore_file_can_exec (const char *file);
|
EAPI int ecore_file_can_exec (const char *file);
|
||||||
EAPI char *ecore_file_readlink (const char *link);
|
EAPI char *ecore_file_readlink (const char *link);
|
||||||
|
@ -62,6 +62,7 @@ typedef enum {
|
||||||
ECORE_FILE_EVENT_CHANGED
|
ECORE_FILE_EVENT_CHANGED
|
||||||
} Ecore_File_Event;
|
} Ecore_File_Event;
|
||||||
|
|
||||||
|
#if 0
|
||||||
struct _Ecore_File_Monitor {
|
struct _Ecore_File_Monitor {
|
||||||
void (*func) (void *data,
|
void (*func) (void *data,
|
||||||
Ecore_File_Monitor *ecore_file_monitor,
|
Ecore_File_Monitor *ecore_file_monitor,
|
||||||
|
@ -73,6 +74,7 @@ struct _Ecore_File_Monitor {
|
||||||
Ecore_File_Type type;
|
Ecore_File_Type type;
|
||||||
void *data;
|
void *data;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
struct _Ecore_File_Monitor_Event {
|
struct _Ecore_File_Monitor_Event {
|
||||||
|
@ -94,5 +96,6 @@ EAPI Ecore_File_Monitor *ecore_file_monitor_add(const char *path,
|
||||||
const char *path),
|
const char *path),
|
||||||
void *data);
|
void *data);
|
||||||
EAPI void ecore_file_monitor_del(Ecore_File_Monitor *ecore_file_monitor);
|
EAPI void ecore_file_monitor_del(Ecore_File_Monitor *ecore_file_monitor);
|
||||||
|
EAPI Ecore_File_Type ecore_file_monitor_type_get(Ecore_File_Monitor *ecore_file_monitor);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -16,6 +16,7 @@ include_HEADERS = Ecore_File.h
|
||||||
libecore_file_la_SOURCES = \
|
libecore_file_la_SOURCES = \
|
||||||
ecore_file.c \
|
ecore_file.c \
|
||||||
ecore_file_private.h \
|
ecore_file_private.h \
|
||||||
|
ecore_file_monitor.c \
|
||||||
ecore_file_monitor_fam.c \
|
ecore_file_monitor_fam.c \
|
||||||
ecore_file_monitor_inotify.c \
|
ecore_file_monitor_inotify.c \
|
||||||
ecore_file_monitor_dnotify.c \
|
ecore_file_monitor_dnotify.c \
|
||||||
|
@ -31,6 +32,7 @@ endif
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
ecore_file.c \
|
ecore_file.c \
|
||||||
ecore_file_private.h \
|
ecore_file_private.h \
|
||||||
|
ecore_file_monitor.c \
|
||||||
ecore_file_monitor_fam.c \
|
ecore_file_monitor_fam.c \
|
||||||
ecore_file_monitor_inotify.c \
|
ecore_file_monitor_inotify.c \
|
||||||
ecore_file_monitor_dnotify.c \
|
ecore_file_monitor_dnotify.c \
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
*/
|
*/
|
||||||
#include "ecore_file_private.h"
|
#include "ecore_file_private.h"
|
||||||
#include "Ecore_File.h"
|
|
||||||
|
|
||||||
/* externally accessible functions */
|
/* externally accessible functions */
|
||||||
int
|
int
|
||||||
|
@ -116,7 +115,7 @@ ecore_file_realpath(const char *file)
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
ecore_file_get_file(const char *path)
|
ecore_file_get_file(char *path)
|
||||||
{
|
{
|
||||||
char *result = NULL;
|
char *result = NULL;
|
||||||
|
|
||||||
|
@ -127,7 +126,7 @@ ecore_file_get_file(const char *path)
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
ecore_file_get_dir(const char *file)
|
ecore_file_get_dir(char *file)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
*/
|
*/
|
||||||
#include "ecore_file_private.h"
|
#include "ecore_file_private.h"
|
||||||
#include "Ecore_File.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO:
|
* TODO:
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
*/
|
*/
|
||||||
#include "ecore_file_private.h"
|
#include "ecore_file_private.h"
|
||||||
#include "Ecore_File.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO:
|
* TODO:
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
*/
|
*/
|
||||||
#include "ecore_file_private.h"
|
#include "ecore_file_private.h"
|
||||||
#include "Ecore_File.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO:
|
* TODO:
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
*/
|
*/
|
||||||
#include "ecore_file_private.h"
|
#include "ecore_file_private.h"
|
||||||
#include "Ecore_File.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_POLL
|
#ifdef HAVE_POLL
|
||||||
|
|
||||||
|
@ -14,19 +13,8 @@
|
||||||
* - Change poll time
|
* - Change poll time
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct _Ecore_File_Monitor_Poll Ecore_File_Monitor_Poll;
|
|
||||||
typedef struct _Ecore_File Ecore_File;
|
typedef struct _Ecore_File Ecore_File;
|
||||||
|
|
||||||
#define ECORE_FILE_MONITOR_POLL(x) ((Ecore_File_Monitor_Poll *)(x))
|
|
||||||
|
|
||||||
struct _Ecore_File_Monitor_Poll
|
|
||||||
{
|
|
||||||
Ecore_File_Monitor monitor;
|
|
||||||
int mtime;
|
|
||||||
Evas_List *files;
|
|
||||||
unsigned char deleted;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _Ecore_File
|
struct _Ecore_File
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
|
@ -34,6 +22,11 @@ struct _Ecore_File
|
||||||
Ecore_File_Type type;
|
Ecore_File_Type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define ECORE_FILE_INTERVAL_MIN 1.0
|
||||||
|
#define ECORE_FILE_INTERVAL_STEP 0.5
|
||||||
|
#define ECORE_FILE_INTERVAL_MAX 5.0
|
||||||
|
|
||||||
|
static double _interval = ECORE_FILE_INTERVAL_MIN;
|
||||||
static Ecore_Timer *_timer = NULL;
|
static Ecore_Timer *_timer = NULL;
|
||||||
static Evas_List *_monitors = NULL;
|
static Evas_List *_monitors = NULL;
|
||||||
static int _lock = 0;
|
static int _lock = 0;
|
||||||
|
@ -78,18 +71,18 @@ ecore_file_monitor_add(const char *path,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
Ecore_File_Monitor *em;
|
Ecore_File_Monitor *em;
|
||||||
Ecore_File_Monitor_Poll *emf;
|
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if (!path) return NULL;
|
if (!path) return NULL;
|
||||||
if (!func) return NULL;
|
if (!func) return NULL;
|
||||||
|
|
||||||
emf = calloc(1, sizeof(Ecore_File_Monitor_Poll));
|
em = calloc(1, sizeof(Ecore_File_Monitor));
|
||||||
em = ECORE_FILE_MONITOR(emf);
|
|
||||||
if (!em) return NULL;
|
if (!em) return NULL;
|
||||||
|
|
||||||
if (!_timer)
|
if (!_timer)
|
||||||
_timer = ecore_timer_add(1.0, _ecore_file_monitor_handler, NULL);
|
_timer = ecore_timer_add(_interval, _ecore_file_monitor_handler, NULL);
|
||||||
|
else
|
||||||
|
ecore_timer_interval_set(_timer, ECORE_FILE_INTERVAL_MIN);
|
||||||
|
|
||||||
em->path = strdup(path);
|
em->path = strdup(path);
|
||||||
len = strlen(em->path);
|
len = strlen(em->path);
|
||||||
|
@ -99,7 +92,7 @@ ecore_file_monitor_add(const char *path,
|
||||||
em->func = func;
|
em->func = func;
|
||||||
em->data = data;
|
em->data = data;
|
||||||
|
|
||||||
emf->mtime = ecore_file_mod_time(em->path);
|
em->mtime = ecore_file_mod_time(em->path);
|
||||||
if (ecore_file_exists(em->path))
|
if (ecore_file_exists(em->path))
|
||||||
{
|
{
|
||||||
em->type = ecore_file_is_dir(em->path) ?
|
em->type = ecore_file_is_dir(em->path) ?
|
||||||
|
@ -134,7 +127,7 @@ ecore_file_monitor_add(const char *path,
|
||||||
ECORE_FILE_TYPE_DIRECTORY :
|
ECORE_FILE_TYPE_DIRECTORY :
|
||||||
ECORE_FILE_TYPE_FILE;
|
ECORE_FILE_TYPE_FILE;
|
||||||
em->func(em->data, em, f->type, ECORE_FILE_EVENT_EXISTS, buf);
|
em->func(em->data, em, f->type, ECORE_FILE_EVENT_EXISTS, buf);
|
||||||
emf->files = evas_list_append(emf->files, f);
|
em->files = evas_list_append(em->files, f);
|
||||||
}
|
}
|
||||||
evas_list_free(files);
|
evas_list_free(files);
|
||||||
}
|
}
|
||||||
|
@ -153,25 +146,23 @@ ecore_file_monitor_add(const char *path,
|
||||||
void
|
void
|
||||||
ecore_file_monitor_del(Ecore_File_Monitor *em)
|
ecore_file_monitor_del(Ecore_File_Monitor *em)
|
||||||
{
|
{
|
||||||
Ecore_File_Monitor_Poll *emf;
|
|
||||||
Evas_List *l;
|
Evas_List *l;
|
||||||
|
|
||||||
emf = ECORE_FILE_MONITOR_POLL(em);
|
|
||||||
if (_lock)
|
if (_lock)
|
||||||
{
|
{
|
||||||
emf->deleted = 1;
|
em->deleted = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove files */
|
/* Remove files */
|
||||||
for (l = emf->files; l; l = l->next)
|
for (l = em->files; l; l = l->next)
|
||||||
{
|
{
|
||||||
Ecore_File *f;
|
Ecore_File *f;
|
||||||
f = l->data;
|
f = l->data;
|
||||||
free(f->name);
|
free(f->name);
|
||||||
free(f);
|
free(f);
|
||||||
}
|
}
|
||||||
evas_list_free(emf->files);
|
evas_list_free(em->files);
|
||||||
|
|
||||||
_monitors = evas_list_remove(_monitors, em);
|
_monitors = evas_list_remove(_monitors, em);
|
||||||
free(em->path);
|
free(em->path);
|
||||||
|
@ -182,6 +173,8 @@ ecore_file_monitor_del(Ecore_File_Monitor *em)
|
||||||
ecore_timer_del(_timer);
|
ecore_timer_del(_timer);
|
||||||
_timer = NULL;
|
_timer = NULL;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
ecore_timer_interval_set(_timer, ECORE_FILE_INTERVAL_MIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -189,6 +182,7 @@ _ecore_file_monitor_handler(void *data)
|
||||||
{
|
{
|
||||||
Evas_List *monitor;
|
Evas_List *monitor;
|
||||||
|
|
||||||
|
_interval += ECORE_FILE_INTERVAL_STEP;
|
||||||
_lock = 1;
|
_lock = 1;
|
||||||
for (monitor = _monitors; monitor;)
|
for (monitor = _monitors; monitor;)
|
||||||
{
|
{
|
||||||
|
@ -199,15 +193,17 @@ _ecore_file_monitor_handler(void *data)
|
||||||
_ecore_file_monitor_check(em);
|
_ecore_file_monitor_check(em);
|
||||||
}
|
}
|
||||||
_lock = 0;
|
_lock = 0;
|
||||||
|
if (_interval > ECORE_FILE_INTERVAL_MAX)
|
||||||
|
_interval = ECORE_FILE_INTERVAL_MAX;
|
||||||
|
ecore_timer_interval_set(_timer, _interval);
|
||||||
|
|
||||||
for (monitor = _monitors; monitor;)
|
for (monitor = _monitors; monitor;)
|
||||||
{
|
{
|
||||||
Ecore_File_Monitor *em;
|
Ecore_File_Monitor *em;
|
||||||
Ecore_File_Monitor_Poll *emf;
|
|
||||||
|
|
||||||
em = monitor->data;
|
em = monitor->data;
|
||||||
emf = ECORE_FILE_MONITOR_POLL(em);
|
|
||||||
monitor = monitor->next;
|
monitor = monitor->next;
|
||||||
if (emf->deleted)
|
if (em->deleted)
|
||||||
ecore_file_monitor_del(em);
|
ecore_file_monitor_del(em);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -216,30 +212,32 @@ _ecore_file_monitor_handler(void *data)
|
||||||
static void
|
static void
|
||||||
_ecore_file_monitor_check(Ecore_File_Monitor *em)
|
_ecore_file_monitor_check(Ecore_File_Monitor *em)
|
||||||
{
|
{
|
||||||
Ecore_File_Monitor_Poll *emf;
|
|
||||||
int mtime;
|
int mtime;
|
||||||
|
|
||||||
emf = ECORE_FILE_MONITOR_POLL(em);
|
|
||||||
mtime = ecore_file_mod_time(em->path);
|
mtime = ecore_file_mod_time(em->path);
|
||||||
switch (em->type)
|
switch (em->type)
|
||||||
{
|
{
|
||||||
case ECORE_FILE_TYPE_FILE:
|
case ECORE_FILE_TYPE_FILE:
|
||||||
if (mtime < emf->mtime)
|
if (mtime < em->mtime)
|
||||||
{
|
{
|
||||||
em->func(em->data, em, em->type, ECORE_FILE_EVENT_DELETED, em->path);
|
em->func(em->data, em, em->type, ECORE_FILE_EVENT_DELETED, em->path);
|
||||||
em->type = ECORE_FILE_TYPE_NONE;
|
em->type = ECORE_FILE_TYPE_NONE;
|
||||||
|
_interval = ECORE_FILE_INTERVAL_MIN;
|
||||||
|
}
|
||||||
|
else if (mtime > em->mtime)
|
||||||
|
{
|
||||||
|
em->func(em->data, em, em->type, ECORE_FILE_EVENT_CHANGED, em->path);
|
||||||
|
_interval = ECORE_FILE_INTERVAL_MIN;
|
||||||
}
|
}
|
||||||
else if (mtime > emf->mtime)
|
|
||||||
em->func(em->data, em, em->type, ECORE_FILE_EVENT_CHANGED, em->path);
|
|
||||||
break;
|
break;
|
||||||
case ECORE_FILE_TYPE_DIRECTORY:
|
case ECORE_FILE_TYPE_DIRECTORY:
|
||||||
if (mtime < emf->mtime)
|
if (mtime < em->mtime)
|
||||||
{
|
{
|
||||||
/* Deleted */
|
/* Deleted */
|
||||||
Evas_List *l;
|
Evas_List *l;
|
||||||
|
|
||||||
/* Notify all files deleted */
|
/* Notify all files deleted */
|
||||||
for (l = emf->files; l;)
|
for (l = em->files; l;)
|
||||||
{
|
{
|
||||||
Ecore_File *f;
|
Ecore_File *f;
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
|
@ -251,16 +249,17 @@ _ecore_file_monitor_check(Ecore_File_Monitor *em)
|
||||||
free(f->name);
|
free(f->name);
|
||||||
free(f);
|
free(f);
|
||||||
}
|
}
|
||||||
emf->files = evas_list_free(emf->files);
|
em->files = evas_list_free(em->files);
|
||||||
em->func(em->data, em, em->type, ECORE_FILE_EVENT_DELETED, em->path);
|
em->func(em->data, em, em->type, ECORE_FILE_EVENT_DELETED, em->path);
|
||||||
em->type = ECORE_FILE_TYPE_NONE;
|
em->type = ECORE_FILE_TYPE_NONE;
|
||||||
|
_interval = ECORE_FILE_INTERVAL_MIN;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Evas_List *l;
|
Evas_List *l;
|
||||||
|
|
||||||
/* Check for changed files */
|
/* Check for changed files */
|
||||||
for (l = emf->files; l;)
|
for (l = em->files; l;)
|
||||||
{
|
{
|
||||||
Ecore_File *f;
|
Ecore_File *f;
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
|
@ -273,17 +272,21 @@ _ecore_file_monitor_check(Ecore_File_Monitor *em)
|
||||||
if (mtime < f->mtime)
|
if (mtime < f->mtime)
|
||||||
{
|
{
|
||||||
em->func(em->data, em, f->type, ECORE_FILE_EVENT_DELETED, buf);
|
em->func(em->data, em, f->type, ECORE_FILE_EVENT_DELETED, buf);
|
||||||
emf->files = evas_list_remove(emf->files, f);
|
em->files = evas_list_remove(em->files, f);
|
||||||
free(f->name);
|
free(f->name);
|
||||||
free(f);
|
free(f);
|
||||||
|
_interval = ECORE_FILE_INTERVAL_MIN;
|
||||||
}
|
}
|
||||||
else if (mtime > f->mtime)
|
else if (mtime > f->mtime)
|
||||||
em->func(em->data, em, f->type, ECORE_FILE_EVENT_CHANGED, buf);
|
{
|
||||||
|
em->func(em->data, em, f->type, ECORE_FILE_EVENT_CHANGED, buf);
|
||||||
|
_interval = ECORE_FILE_INTERVAL_MIN;
|
||||||
|
}
|
||||||
f->mtime = mtime;
|
f->mtime = mtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for new files */
|
/* Check for new files */
|
||||||
if (emf->mtime < mtime)
|
if (em->mtime < mtime)
|
||||||
{
|
{
|
||||||
Evas_List *files;
|
Evas_List *files;
|
||||||
|
|
||||||
|
@ -316,14 +319,15 @@ _ecore_file_monitor_check(Ecore_File_Monitor *em)
|
||||||
ECORE_FILE_TYPE_DIRECTORY :
|
ECORE_FILE_TYPE_DIRECTORY :
|
||||||
ECORE_FILE_TYPE_FILE;
|
ECORE_FILE_TYPE_FILE;
|
||||||
em->func(em->data, em, f->type, ECORE_FILE_EVENT_CREATED, buf);
|
em->func(em->data, em, f->type, ECORE_FILE_EVENT_CREATED, buf);
|
||||||
emf->files = evas_list_append(emf->files, f);
|
em->files = evas_list_append(em->files, f);
|
||||||
}
|
}
|
||||||
em->func(em->data, em, em->type, ECORE_FILE_EVENT_CHANGED, em->path);
|
em->func(em->data, em, em->type, ECORE_FILE_EVENT_CHANGED, em->path);
|
||||||
|
_interval = ECORE_FILE_INTERVAL_MIN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ECORE_FILE_TYPE_NONE:
|
case ECORE_FILE_TYPE_NONE:
|
||||||
if (mtime > emf->mtime)
|
if (mtime > em->mtime)
|
||||||
{
|
{
|
||||||
/* Something has been created! */
|
/* Something has been created! */
|
||||||
em->type = ecore_file_is_dir(em->path) ?
|
em->type = ecore_file_is_dir(em->path) ?
|
||||||
|
@ -359,24 +363,23 @@ _ecore_file_monitor_check(Ecore_File_Monitor *em)
|
||||||
ECORE_FILE_TYPE_DIRECTORY :
|
ECORE_FILE_TYPE_DIRECTORY :
|
||||||
ECORE_FILE_TYPE_FILE;
|
ECORE_FILE_TYPE_FILE;
|
||||||
em->func(em->data, em, f->type, ECORE_FILE_EVENT_CREATED, buf);
|
em->func(em->data, em, f->type, ECORE_FILE_EVENT_CREATED, buf);
|
||||||
emf->files = evas_list_append(emf->files, f);
|
em->files = evas_list_append(em->files, f);
|
||||||
}
|
}
|
||||||
evas_list_free(files);
|
evas_list_free(files);
|
||||||
}
|
}
|
||||||
|
_interval = ECORE_FILE_INTERVAL_MIN;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
emf->mtime = mtime;
|
em->mtime = mtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_ecore_file_monitor_checking(Ecore_File_Monitor *em, char *name)
|
_ecore_file_monitor_checking(Ecore_File_Monitor *em, char *name)
|
||||||
{
|
{
|
||||||
Evas_List *l;
|
Evas_List *l;
|
||||||
Ecore_File_Monitor_Poll *emf;
|
|
||||||
|
|
||||||
emf = ECORE_FILE_MONITOR_POLL(em);
|
for (l = em->files; l; l = l->next)
|
||||||
for (l = emf->files; l; l = l->next)
|
|
||||||
{
|
{
|
||||||
Ecore_File *f;
|
Ecore_File *f;
|
||||||
|
|
||||||
|
|
|
@ -13,10 +13,29 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "Ecore.h"
|
#include "Ecore.h"
|
||||||
|
#include "Ecore_File.h"
|
||||||
|
|
||||||
int ecore_file_monitor_init(void);
|
int ecore_file_monitor_init(void);
|
||||||
int ecore_file_monitor_shutdown(void);
|
int ecore_file_monitor_shutdown(void);
|
||||||
|
|
||||||
|
struct _Ecore_File_Monitor
|
||||||
|
{
|
||||||
|
void (*func) (void *data,
|
||||||
|
Ecore_File_Monitor *ecore_file_monitor,
|
||||||
|
Ecore_File_Type type,
|
||||||
|
Ecore_File_Event event,
|
||||||
|
const char *path);
|
||||||
|
|
||||||
|
char *path;
|
||||||
|
Ecore_File_Type type;
|
||||||
|
void *data;
|
||||||
|
Evas_List *files;
|
||||||
|
#ifdef HAVE_POLL
|
||||||
|
int mtime;
|
||||||
|
unsigned char deleted;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#define HAVE_POLL
|
#define HAVE_POLL
|
||||||
#define HAVE_FAM
|
#define HAVE_FAM
|
||||||
|
|
Loading…
Reference in New Issue