Enlightenment CVS committal

Author  : sebastid
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_file


Modified Files:
        Ecore_File.h ecore_file.c ecore_file_monitor_poll.c 


Log Message:
Update when func is called.

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_file/Ecore_File.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- Ecore_File.h        20 Feb 2005 12:17:07 -0000      1.1
+++ Ecore_File.h        21 Feb 2005 16:03:06 -0000      1.2
@@ -29,21 +29,21 @@
 #include <Evas.h>
 #include <time.h>
 
-EAPI int        ecore_file_init(void);
-EAPI int        ecore_file_shutdown(void);
-EAPI time_t     ecore_file_mod_time(char *file);
-EAPI int        ecore_file_exists(char *file);
-EAPI int        ecore_file_is_dir(char *file);
-EAPI int        ecore_file_mkdir(char *dir);
-EAPI int        ecore_file_mkpath(char *path);
-EAPI int        ecore_file_cp(char *src, char *dst);
-EAPI char      *ecore_file_realpath(char *file);
-EAPI char      *ecore_file_get_file(char *path);
-EAPI char      *ecore_file_get_dir(char *path);
-
-EAPI int        ecore_file_can_exec(char *file);
-EAPI char      *ecore_file_readlink(char *link);
-EAPI Evas_List *ecore_file_ls(char *dir);
+EAPI int        ecore_file_init     (void);
+EAPI int        ecore_file_shutdown (void);
+EAPI time_t     ecore_file_mod_time (const char *file);
+EAPI int        ecore_file_exists   (const char *file);
+EAPI int        ecore_file_is_dir   (const char *file);
+EAPI int        ecore_file_mkdir    (const char *dir);
+EAPI int        ecore_file_mkpath   (const char *path);
+EAPI int        ecore_file_cp       (const char *src, const char *dst);
+EAPI char      *ecore_file_realpath (const char *file);
+EAPI char      *ecore_file_get_file (const char *path);
+EAPI char      *ecore_file_get_dir  (const char *path);
+
+EAPI int        ecore_file_can_exec (const char *file);
+EAPI char      *ecore_file_readlink (const char *link);
+EAPI Evas_List *ecore_file_ls       (const char *dir);
 
 typedef struct _Ecore_File_Monitor       Ecore_File_Monitor;
 typedef struct _Ecore_File_Monitor_Event Ecore_File_Monitor_Event;
@@ -56,10 +56,10 @@
 
 typedef enum {
      ECORE_FILE_EVENT_NONE,
+     ECORE_FILE_EVENT_EXISTS,
      ECORE_FILE_EVENT_CREATED,
      ECORE_FILE_EVENT_DELETED,
-     ECORE_FILE_EVENT_CHANGED,
-     ECORE_FILE_EVENT_EXISTS
+     ECORE_FILE_EVENT_CHANGED
 } Ecore_File_Event;
 
 struct _Ecore_File_Monitor {
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_file/ecore_file.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ecore_file.c        20 Feb 2005 12:17:07 -0000      1.1
+++ ecore_file.c        21 Feb 2005 16:03:08 -0000      1.2
@@ -1,8 +1,8 @@
 /*
  * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
  */
-#include "Ecore_File.h"
 #include "ecore_file_private.h"
+#include "Ecore_File.h"
 
 /* externally accessible functions */
 int
@@ -22,7 +22,7 @@
 }
 
 time_t
-ecore_file_mod_time(char *file)
+ecore_file_mod_time(const char *file)
 {
    struct stat st;
 
@@ -31,7 +31,7 @@
 }
 
 int
-ecore_file_exists(char *file)
+ecore_file_exists(const char *file)
 {
    struct stat st;
 
@@ -40,7 +40,7 @@
 }
 
 int
-ecore_file_is_dir(char *file)
+ecore_file_is_dir(const char *file)
 {
    struct stat st;
 
@@ -52,14 +52,14 @@
 static mode_t default_mode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | 
S_IROTH | S_IXOTH;
 
 int
-ecore_file_mkdir(char *dir)
+ecore_file_mkdir(const char *dir)
 {
    if (mkdir(dir, default_mode) < 0) return 0;
    return 1;
 }
 
 int
-ecore_file_mkpath(char *path)
+ecore_file_mkpath(const char *path)
 {
    char ss[PATH_MAX];
    int  i, ii;
@@ -85,7 +85,7 @@
 }
 
 int
-ecore_file_cp(char *src, char *dst)
+ecore_file_cp(const char *src, const char *dst)
 {
    FILE               *f1, *f2;
    char                buf[16384];
@@ -106,7 +106,7 @@
 }
 
 char *
-ecore_file_realpath(char *file)
+ecore_file_realpath(const char *file)
 {
    char  buf[PATH_MAX];
    struct stat st;
@@ -116,7 +116,7 @@
 }
 
 char *
-ecore_file_get_file(char *path)
+ecore_file_get_file(const char *path)
 {
    char *result = NULL;
 
@@ -127,7 +127,7 @@
 }
 
 char *
-ecore_file_get_dir(char *file)
+ecore_file_get_dir(const char *file)
 {
    char               *p;
    char                buf[PATH_MAX];
@@ -143,7 +143,7 @@
 }
 
 int
-ecore_file_can_exec(char *file)
+ecore_file_can_exec(const char *file)
 {
    static int          have_uid = 0;
    static uid_t        uid = -1;
@@ -174,7 +174,7 @@
 }
 
 char *
-ecore_file_readlink(char *link)
+ecore_file_readlink(const char *link)
 {
    char                buf[PATH_MAX];
    int                 count;
@@ -185,7 +185,7 @@
 }
 
 Evas_List *
-ecore_file_ls(char *dir)
+ecore_file_ls(const char *dir)
 {
    DIR                *dirp;
    struct dirent      *dp;
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_file/ecore_file_monitor_poll.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ecore_file_monitor_poll.c   20 Feb 2005 12:33:59 -0000      1.2
+++ ecore_file_monitor_poll.c   21 Feb 2005 16:03:08 -0000      1.3
@@ -11,6 +11,7 @@
  * - Implement recursive as an option!
  * - Keep whole path or just name of file? (Memory or CPU...)
  * - Remove requests without files?
+ * - Change poll time
  */
 
 typedef struct _Ecore_File_Monitor_Poll Ecore_File_Monitor_Poll;
@@ -93,7 +94,7 @@
    em->path = strdup(path);
    len = strlen(em->path);
    if (em->path[len - 1] == '/')
-     em->path[len - 1] = '\0';
+     em->path[len - 1] = 0;
 
    em->func = func;
    em->data = data;
@@ -105,9 +106,7 @@
                   ECORE_FILE_TYPE_DIRECTORY :
                   ECORE_FILE_TYPE_FILE;
 
-#if 0
        em->func(em->data, em, em->type, ECORE_FILE_EVENT_EXISTS, em->path);
-#endif
        if (em->type == ECORE_FILE_TYPE_DIRECTORY)
          {
             /* Check for subdirs */
@@ -139,17 +138,11 @@
               }
             evas_list_free(files);
          }
-#if 0
-       else
-         em->func(em->data, em, em->type, ECORE_FILE_EVENT_EXISTS, em->path);
-#endif
      }
    else
      {
        em->type = ECORE_FILE_TYPE_NONE;
-#if 0
        em->func(em->data, em, em->type, ECORE_FILE_EVENT_DELETED, em->path);
-#endif
      }
 
    _monitors = evas_list_append(_monitors, em);
@@ -259,9 +252,7 @@
                   free(f);
                }
              emf->files = evas_list_free(emf->files);
-#if 0
              em->func(em->data, em, em->type, ECORE_FILE_EVENT_DELETED, 
em->path);
-#endif
              em->type = ECORE_FILE_TYPE_NONE;
           }
         else
@@ -297,9 +288,6 @@
                   Evas_List *files;
 
                   /* Files have been added or removed */
-#if 0
-                  em->func(em->data, em, em->type, ECORE_FILE_EVENT_CHANGED, 
em->path);
-#endif
                   files = ecore_file_ls(em->path);
                   for (l = files; l; l = l->next)
                     {
@@ -330,6 +318,7 @@
                        em->func(em->data, em, f->type, 
ECORE_FILE_EVENT_CREATED, buf);
                        emf->files = evas_list_append(emf->files, f);
                     }
+                  em->func(em->data, em, em->type, ECORE_FILE_EVENT_CHANGED, 
em->path);
                }
           }
         break;




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to