11606df7d024cd7ba33973170cfb142131826200
[profile/ivi/ecore.git] / src / lib / ecore_file / ecore_file_private.h
1 #ifndef ECORE_FILE_PRIVATE_H_
2 #define ECORE_FILE_PRIVATE_H_
3
4 #ifndef _FILE_OFFSET_BITS
5 # define _FILE_OFFSET_BITS  64
6 #endif
7
8 #ifdef __linux__
9 # include <features.h>
10 #endif
11
12 #ifdef HAVE_EVIL
13 # include <Evil.h>
14 #endif
15
16 #include <sys/types.h>
17 #include <sys/stat.h>
18 #include <dirent.h>
19
20 #include "Ecore.h"
21 #include "ecore_private.h"
22
23 #include "Ecore_File.h"
24
25 extern int _ecore_file_log_dom;
26
27 #ifdef ECORE_FILE_DEFAULT_LOG_COLOR
28 #undef ECORE_FILE_DEFAULT_LOG_COLOR
29 #endif
30 #define ECORE_FILE_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
31
32 #ifdef ERR
33 # undef ERR
34 #endif
35 #define ERR(...) EINA_LOG_DOM_ERR(_ecore_file_log_dom, __VA_ARGS__)
36
37 #ifdef DBG
38 # undef DBG
39 #endif
40 #define DBG(...) EINA_LOG_DOM_DBG(_ecore_file_log_dom, __VA_ARGS__)
41
42 #ifdef INF
43 # undef INF
44 #endif
45 #define INF(...) EINA_LOG_DOM_INFO(_ecore_file_log_dom, __VA_ARGS__)
46
47 #ifdef WRN
48 # undef WRN
49 #endif
50 #define WRN(...) EINA_LOG_DOM_WARN(_ecore_file_log_dom, __VA_ARGS__)
51
52 #ifdef CRIT
53 # undef CRIT
54 #endif
55 #define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_file_log_dom, __VA_ARGS__)
56
57 /* ecore_file_monitor */
58 int  ecore_file_monitor_init(void);
59 void ecore_file_monitor_shutdown(void);
60
61 #define ECORE_FILE_MONITOR(x) ((Ecore_File_Monitor *)(x))
62
63 typedef struct _Ecore_File Ecore_File;
64 struct _Ecore_File
65 {
66    EINA_INLIST;
67    char          *name;
68    int            mtime;
69    unsigned char  is_dir;
70 };
71
72 struct _Ecore_File_Monitor
73 {
74    EINA_INLIST;
75    void (*func) (void *data,
76                  Ecore_File_Monitor *ecore_file_monitor,
77                  Ecore_File_Event event,
78                  const char *path);
79
80    char               *path;
81    void               *data;
82    Ecore_File         *files;
83 };
84
85 #ifdef HAVE_INOTIFY
86 int                 ecore_file_monitor_inotify_init(void);
87 int                 ecore_file_monitor_inotify_shutdown(void);
88 Ecore_File_Monitor *ecore_file_monitor_inotify_add(const char *path,
89                                                         void (*func) (void *data,
90                                                                       Ecore_File_Monitor *ecore_file_monitor,
91                                                                       Ecore_File_Event event,
92                                                                       const char *path),
93                                                         void *data);
94 void                ecore_file_monitor_inotify_del(Ecore_File_Monitor *ecore_file_monitor);
95 #endif
96  
97 #ifdef HAVE_NOTIFY_WIN32
98 int                 ecore_file_monitor_win32_init(void);
99 int                 ecore_file_monitor_win32_shutdown(void);
100 Ecore_File_Monitor *ecore_file_monitor_win32_add(const char *path,
101                                                  void      (*func) (void               *data,
102                                                                     Ecore_File_Monitor *ecore_file_monitor,
103                                                                     Ecore_File_Event    event,
104                                                                     const char         *path),
105                                                  void       *data);
106 void                ecore_file_monitor_win32_del(Ecore_File_Monitor *ecore_file_monitor);
107 #endif
108
109 #ifdef HAVE_POLL
110 int                 ecore_file_monitor_poll_init(void);
111 int                 ecore_file_monitor_poll_shutdown(void);
112 Ecore_File_Monitor *ecore_file_monitor_poll_add(const char *path,
113                                                 void (*func) (void *data,
114                                                               Ecore_File_Monitor *ecore_file_monitor,
115                                                               Ecore_File_Event event,
116                                                               const char *path),
117                                                 void *data);
118 void                ecore_file_monitor_poll_del(Ecore_File_Monitor *ecore_file_monitor);
119
120 #endif
121
122 /* ecore_file_path */
123 void ecore_file_path_init(void);
124 void ecore_file_path_shutdown(void);
125
126 /* ecore_file_download */
127 int  ecore_file_download_init(void);
128 void ecore_file_download_shutdown(void);
129
130 #endif