svn update: 48958 (latest:48959)
[framework/uifw/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 "Ecore.h"
17 #include "ecore_private.h"
18
19 #include "Ecore_File.h"
20
21 extern int _ecore_file_log_dom;
22
23 #ifdef ECORE_FILE_DEFAULT_LOG_COLOR
24 #undef ECORE_FILE_DEFAULT_LOG_COLOR
25 #endif
26 #define ECORE_FILE_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
27
28 #ifdef ERR
29 # undef ERR
30 #endif
31 #define ERR(...) EINA_LOG_DOM_ERR(_ecore_file_log_dom, __VA_ARGS__)
32
33 #ifdef DBG
34 # undef DBG
35 #endif
36 #define DBG(...) EINA_LOG_DOM_DBG(_ecore_file_log_dom, __VA_ARGS__)
37
38 #ifdef INF
39 # undef INF
40 #endif
41 #define INF(...) EINA_LOG_DOM_INFO(_ecore_file_log_dom, __VA_ARGS__)
42
43 #ifdef WRN
44 # undef WRN
45 #endif
46 #define WRN(...) EINA_LOG_DOM_WARN(_ecore_file_log_dom, __VA_ARGS__)
47
48 #ifdef CRIT
49 # undef CRIT
50 #endif
51 #define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_file_log_dom, __VA_ARGS__)
52
53 /* ecore_file_monitor */
54 int  ecore_file_monitor_init(void);
55 void ecore_file_monitor_shutdown(void);
56
57 #define ECORE_FILE_MONITOR(x) ((Ecore_File_Monitor *)(x))
58
59 typedef struct _Ecore_File Ecore_File;
60 struct _Ecore_File
61 {
62    EINA_INLIST;
63    char          *name;
64    int            mtime;
65    unsigned char  is_dir;
66 };
67
68 struct _Ecore_File_Monitor
69 {
70    EINA_INLIST;
71    void (*func) (void *data,
72                  Ecore_File_Monitor *ecore_file_monitor,
73                  Ecore_File_Event event,
74                  const char *path);
75
76    char               *path;
77    void               *data;
78    Ecore_File         *files;
79 };
80
81 #ifdef HAVE_INOTIFY
82 int                 ecore_file_monitor_inotify_init(void);
83 int                 ecore_file_monitor_inotify_shutdown(void);
84 Ecore_File_Monitor *ecore_file_monitor_inotify_add(const char *path,
85                                                         void (*func) (void *data,
86                                                                       Ecore_File_Monitor *ecore_file_monitor,
87                                                                       Ecore_File_Event event,
88                                                                       const char *path),
89                                                         void *data);
90 void                ecore_file_monitor_inotify_del(Ecore_File_Monitor *ecore_file_monitor);
91 #endif
92  
93 #ifdef HAVE_NOTIFY_WIN32
94 int                 ecore_file_monitor_win32_init(void);
95 int                 ecore_file_monitor_win32_shutdown(void);
96 Ecore_File_Monitor *ecore_file_monitor_win32_add(const char *path,
97                                                  void      (*func) (void               *data,
98                                                                     Ecore_File_Monitor *ecore_file_monitor,
99                                                                     Ecore_File_Event    event,
100                                                                     const char         *path),
101                                                  void       *data);
102 void                ecore_file_monitor_win32_del(Ecore_File_Monitor *ecore_file_monitor);
103 #endif
104
105 #ifdef HAVE_POLL
106 int                 ecore_file_monitor_poll_init(void);
107 int                 ecore_file_monitor_poll_shutdown(void);
108 Ecore_File_Monitor *ecore_file_monitor_poll_add(const char *path,
109                                                 void (*func) (void *data,
110                                                               Ecore_File_Monitor *ecore_file_monitor,
111                                                               Ecore_File_Event event,
112                                                               const char *path),
113                                                 void *data);
114 void                ecore_file_monitor_poll_del(Ecore_File_Monitor *ecore_file_monitor);
115
116 #endif
117
118 /* ecore_file_path */
119 void ecore_file_path_init(void);
120 void ecore_file_path_shutdown(void);
121
122 /* ecore_file_download */
123 int  ecore_file_download_init(void);
124 void ecore_file_download_shutdown(void);
125
126 #endif