20 # define alloca __builtin_alloca
22 # define alloca __alloca
23 # elif defined _MSC_VER
25 # define alloca _alloca
26 # elif !defined HAVE_ALLOCA
30 void *alloca (size_t);
34 #include <sys/types.h>
37 # define NAMLEN(dirent) strlen ((dirent)->d_name)
39 # define dirent direct
40 # define NAMLEN(dirent) ((dirent)->d_namlen)
41 # ifdef HAVE_SYS_NDIR_H
42 # include <sys/ndir.h>
44 # ifdef HAVE_SYS_DIR_H
56 #include <sys/types.h>
65 #ifdef HAVE_FEATURES_H
66 # include <features.h>
81 #ifdef EFL_HAVE_POSIX_THREADS
85 #ifdef EFL_HAVE_WIN32_THREADS
86 # ifndef WIN32_LEAN_AND_MEAN
87 # define WIN32_LEAN_AND_MEAN
90 # undef WIN32_LEAN_AND_MEAN
102 typedef struct __stat64 _eio_stat_t;
103 #define _eio_stat(p, b) _stat64(p, b)
104 #define _eio_lstat(p, b) _stat64(p, b)
106 typedef struct stat _eio_stat_t;
107 #define _eio_stat(p, b) stat(p, b)
108 #define _eio_lstat(p, b) lstat(p, b)
111 /* Keeping 32 Eio_File_Progress alive should be enought */
112 #define EIO_PROGRESS_LIMIT 32
114 /* Huge TLB == 16M on most system */
115 #define EIO_PACKET_SIZE 65536
116 #define EIO_PACKET_COUNT 256
118 #define EIO_PACKED_TIME 0.003
120 extern int _eio_log_dom_global;
122 #ifdef EIO_DEFAULT_LOG_COLOR
123 # undef EIO_DEFAULT_LOG_COLOR
124 #endif /* ifdef EIO_DEFAULT_LOG_COLOR */
125 #define EIO_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
128 #endif /* ifdef ERR */
129 #define ERR(...) EINA_LOG_DOM_ERR(_eio_log_dom_global, __VA_ARGS__)
132 #endif /* ifdef DBG */
133 #define DBG(...) EINA_LOG_DOM_DBG(_eio_log_dom_global, __VA_ARGS__)
136 #endif /* ifdef INF */
137 #define INF(...) EINA_LOG_DOM_INFO(_eio_log_dom_global, __VA_ARGS__)
140 #endif /* ifdef WRN */
141 #define WRN(...) EINA_LOG_DOM_WARN(_eio_log_dom_global, __VA_ARGS__)
144 #endif /* ifdef CRIT */
145 #define CRIT(...) EINA_LOG_DOM_CRIT(_eio_log_dom_global, __VA_ARGS__)
147 typedef struct _Eio_Eet_Open Eio_Eet_Open;
148 typedef struct _Eio_Eet_Simple Eio_Eet_Simple;
149 typedef struct _Eio_Eet_Write Eio_Eet_Write;
150 typedef struct _Eio_Eet_Read Eio_Eet_Read;
151 typedef struct _Eio_Eet_Image_Write Eio_Eet_Image_Write;
152 typedef struct _Eio_File_Map Eio_File_Map;
153 typedef struct _Eio_File_Map_Rule Eio_File_Map_Rule;
154 typedef struct _Eio_File_Ls Eio_File_Ls;
155 typedef struct _Eio_File_Direct_Ls Eio_File_Direct_Ls;
156 typedef struct _Eio_File_Dir_Ls Eio_File_Dir_Ls;
157 typedef struct _Eio_File_Char_Ls Eio_File_Char_Ls;
158 typedef struct _Eio_File_Mkdir Eio_File_Mkdir;
159 typedef struct _Eio_File_Mkdir Eio_File_Chmod;
160 typedef struct _Eio_File_Unlink Eio_File_Unlink;
161 typedef struct _Eio_File_Stat Eio_File_Stat;
162 typedef struct _Eio_File_Progress Eio_File_Progress;
163 typedef struct _Eio_File_Move Eio_File_Move;
164 typedef struct _Eio_File_Chown Eio_File_Chown;
165 typedef struct _Eio_Monitor_Backend Eio_Monitor_Backend;
167 typedef struct _Eio_File_Xattr Eio_File_Xattr;
169 typedef struct _Eio_Dir_Copy Eio_Dir_Copy;
171 typedef struct _Eio_File_Direct_Info Eio_File_Direct_Info;
172 typedef struct _Eio_File_Char Eio_File_Char;
174 typedef struct _Eio_File_Associate Eio_File_Associate;
176 struct _Eio_File_Associate
180 Eina_Free_Cb free_cb;
183 struct _Eio_File_Direct_Info
185 Eina_File_Direct_Info info;
187 Eina_Hash *associated;
190 struct _Eio_File_Char
192 const char *filename;
194 Eina_Hash *associated;
199 Ecore_Thread *thread;
205 Eio_Error_Cb error_cb;
209 Eina_Hash *associated;
213 struct _Eio_Eet_Simple
218 Eio_Eet_Error_Cb error_cb;
222 struct _Eio_Eet_Write
227 Eet_Data_Descriptor *edd;
229 const char *cipher_key;
235 Eio_Done_Int_Cb done_cb;
243 Eet_Data_Descriptor *edd;
245 const char *cipher_key;
251 Eio_Done_ERead_Cb eread;
252 Eio_Done_Data_Cb data;
253 Eio_Done_Read_Cb read;
257 struct _Eio_Eet_Image_Write
263 const char *cipher_key;
274 Eio_Done_Int_Cb done_cb;
281 Eio_Eet_Open_Cb eet_cb;
282 const char *filename;
299 struct _Eio_File_Map_Rule
302 Eio_Filter_Map_Cb filter_cb;
305 Eina_File_Populate rule;
308 unsigned long int offset;
309 unsigned long int length;
317 const char *directory;
320 struct _Eio_File_Direct_Ls
324 Eio_Filter_Direct_Cb filter_cb;
325 Eio_Main_Direct_Cb main_cb;
331 struct _Eio_File_Dir_Ls
335 Eio_Filter_Dir_Cb filter_cb;
336 Eio_Main_Direct_Cb main_cb;
342 struct _Eio_File_Char_Ls
346 Eio_Filter_Cb filter_cb;
350 struct _Eio_File_Mkdir
358 struct _Eio_File_Unlink
365 struct _Eio_File_Stat
382 struct _Eio_File_Xattr
387 const char *attribute;
388 Eina_Xattr_Flags flags;
390 Eio_File_Xattr_Op op;
394 Eio_Done_Data_Cb done_cb;
400 Eio_Done_String_Cb done_cb;
405 Eio_Done_Double_Cb done_cb;
410 Eio_Done_Int_Cb done_cb;
419 struct _Eio_File_Progress
423 Eio_Progress_Cb progress_cb;
431 struct _Eio_File_Move
433 Eio_File_Progress progress;
440 Eio_File_Progress progress;
441 Eio_Filter_Direct_Cb filter_cb;
448 struct _Eio_File_Chown
459 Eio_Monitor_Backend *backend;
469 Eina_Bool fallback : 1;
470 Eina_Bool rename : 1;
471 Eina_Bool delete_me : 1;
474 /* Be aware that ecore_thread_run could call cancel_cb if something goes wrong. */
475 Eina_Bool eio_file_set(Eio_File *common,
477 Eio_Error_Cb error_cb,
479 Ecore_Thread_Cb job_cb,
480 Ecore_Thread_Cb end_cb,
481 Ecore_Thread_Cb cancel_cb);
483 /* Be aware that ecore_thread_run could call cancel_cb if something goes wrong. */
484 Eina_Bool eio_long_file_set(Eio_File *common,
486 Eio_Error_Cb error_cb,
488 Ecore_Thread_Cb heavy_cb,
489 Ecore_Thread_Notify_Cb notify_cb,
490 Ecore_Thread_Cb end_cb,
491 Ecore_Thread_Cb cancel_cb);
493 void eio_file_free(Eio_File *common);
494 void eio_async_free(Eio_File_Ls *async);
496 void eio_file_container_set(Eio_File *common, void *container);
498 void eio_file_error(Eio_File *common);
499 void eio_file_thread_error(Eio_File *common, Ecore_Thread *thread);
501 Eio_File_Direct_Info *eio_direct_info_malloc(void);
502 void eio_direct_info_free(Eio_File_Direct_Info *data);
504 Eio_File_Char *eio_char_malloc(void);
505 void eio_char_free(Eio_File_Char *data);
507 Eio_File_Associate *eio_associate_malloc(const void *data, Eina_Free_Cb free_cb);
508 void eio_associate_free(void *data);
510 Eio_Progress *eio_progress_malloc(void);
511 void eio_progress_free(Eio_Progress *progress);
513 void eio_progress_send(Ecore_Thread *thread, Eio_File_Progress *op,
514 long long current, long long max);
515 void eio_progress_cb(Eio_Progress *progress, Eio_File_Progress *op);
517 Eina_Bool eio_file_copy_do(Ecore_Thread *thread, Eio_File_Progress *copy);
519 void eio_monitor_init(void);
520 void eio_monitor_backend_init(void);
521 void eio_monitor_fallback_init(void);
523 void eio_monitor_shutdown(void);
524 void eio_monitor_backend_shutdown(void);
525 void eio_monitor_fallback_shutdown(void);
526 void eio_monitor_backend_add(Eio_Monitor *monitor);
527 void eio_monitor_fallback_add(Eio_Monitor *monitor);
529 void eio_monitor_backend_del(Eio_Monitor *monitor);
530 void eio_monitor_fallback_del(Eio_Monitor *monitor);
532 void _eio_monitor_send(Eio_Monitor *monitor, const char *filename, int event_code);
533 void _eio_monitor_rename(Eio_Monitor *monitor, const char *newpath);
535 void eio_async_end(void *data, Ecore_Thread *thread);
536 void eio_async_error(void *data, Ecore_Thread *thread);