Enlightenment CVS committal Author : lordchaos Project : e17 Module : apps/evfs
Dir : e17/apps/evfs/src/include Modified Files: Makefile.am evfs.h evfs_command.h evfs_common.h evfs_event.h evfs_event_helper.h evfs_misc.h evfs_operation.h Added Files: evfs_operation_tasks.h Log Message: * EVFS now has a workflow and eventing engine! This makes for a much cleaner, ecore_main_loop_iterate()-less system for the scheduling and processing of events in several chunks. At the moment, copy is the only major function to use this system, but recursive remove, and mkdir, are coming soon. The operation_response system is currently slightly broken as a result of this, but will be fixed soon. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/include/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- Makefile.am 18 Jan 2006 10:31:22 -0000 1.7 +++ Makefile.am 12 Mar 2006 05:27:33 -0000 1.8 @@ -17,6 +17,7 @@ evfs_server.h \ evfs_event.h \ evfs_vfolder.h \ - evfs_operation.h + evfs_operation.h \ + evfs_operation_tasks.h =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/include/evfs.h,v retrieving revision 1.43 retrieving revision 1.44 diff -u -3 -r1.43 -r1.44 --- evfs.h 2 Mar 2006 06:11:08 -0000 1.43 +++ evfs.h 12 Mar 2006 05:27:33 -0000 1.44 @@ -33,7 +33,6 @@ #define EVFS_FUNCTION_FILE_MOVE "evfs_file_move" #define EVFS_FUNCTION_FILE_STAT_GET "evfs_file_stat_get" -#include "evfs_operation.h" #include "evfs_plugin.h" typedef enum @@ -90,17 +89,20 @@ #include "evfs_event.h" #include "evfs_server.h" #include "evfs_misc.h" -#include "evfs_commands.h" #include "evfs_cleanup.h" #include "evfs_io.h" #include "evfs_new.h" -#include "evfs_event_helper.h" #include "evfs_server_handle.h" #include "evfs_common.h" #include "evfs_vfolder.h" +#include "evfs_operation.h" +#include "evfs_operation_tasks.h" +#include "evfs_commands.h" +#include "evfs_event_helper.h" void evfs_operation_user_dispatch(evfs_client * client, evfs_command * command, evfs_operation * op, char* misc); +evfs_server* evfs_server_get(); /** * ATTRIBUTE_UNUSED: =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/include/evfs_command.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- evfs_command.h 11 Mar 2006 07:11:16 -0000 1.6 +++ evfs_command.h 12 Mar 2006 05:27:33 -0000 1.7 @@ -36,7 +36,7 @@ { evfs_command_type type; evfs_command_file file_command; - evfs_operation *op; + struct evfs_operation *op; } evfs_command; =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/include/evfs_common.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- evfs_common.h 3 Feb 2006 23:12:13 -0000 1.2 +++ evfs_common.h 12 Mar 2006 05:27:33 -0000 1.3 @@ -1 +1,7 @@ +#ifndef __EVFS_COMMON_H_ +#define __EVFS_COMMON_H_ + evfs_plugin *evfs_get_plugin_for_uri(evfs_server * server, char *uri_base); +evfs_filereference* evfs_filereference_clone(evfs_filereference* source); + +#endif =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/include/evfs_event.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- evfs_event.h 4 Mar 2006 05:48:33 -0000 1.9 +++ evfs_event.h 12 Mar 2006 05:27:33 -0000 1.10 @@ -141,7 +141,7 @@ evfs_event_file_monitor file_monitor; evfs_event_stat stat; evfs_event_progress *progress; - evfs_operation *op; + struct evfs_operation *op; evfs_event_data data; } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/include/evfs_event_helper.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- evfs_event_helper.h 4 Mar 2006 05:48:33 -0000 1.15 +++ evfs_event_helper.h 12 Mar 2006 05:27:33 -0000 1.16 @@ -13,7 +13,8 @@ void evfs_list_dir_event_create(evfs_client * client, evfs_command * command, Ecore_List * files); void evfs_file_progress_event_create(evfs_client * client, - evfs_command * event_command, + evfs_filereference* prog_file1, + evfs_filereference* prog_file2, evfs_command * root_command, double progress, evfs_progress_type type); void evfs_open_event_create(evfs_client * client, evfs_command * command); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/include/evfs_misc.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- evfs_misc.h 5 Mar 2006 05:41:53 -0000 1.5 +++ evfs_misc.h 12 Mar 2006 05:27:33 -0000 1.6 @@ -33,7 +33,7 @@ evfs_connection *evfs_connect(void (*callback_func) (evfs_event *, void *), void *obj); evfs_file_uri_path *evfs_parse_uri(char *uri); -void evfs_handle_command(evfs_client * client, evfs_command * command); +int evfs_handle_command(evfs_client * client, evfs_command * command); void evfs_handle_monitor_start_command(evfs_client * client, evfs_command * command); unsigned long evfs_server_get_next_id(evfs_server * serve); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/include/evfs_operation.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- evfs_operation.h 2 Mar 2006 06:53:55 -0000 1.9 +++ evfs_operation.h 12 Mar 2006 05:27:33 -0000 1.10 @@ -11,7 +11,8 @@ EVFS_OPERATION_STATUS_USER_WAIT, EVFS_OPERATION_STATUS_ERROR, EVFS_OPERATION_STATUS_OVERRIDE, - EVFS_OPERATION_STATUS_NORMAL + EVFS_OPERATION_STATUS_NORMAL, + EVFS_OPERATION_STATUS_COMPLETED } evfs_operation_status; typedef enum evfs_operation_response @@ -28,20 +29,117 @@ EVFS_OPERATION_SUBSTATUS_FILE_OVERWRITE } evfs_operation_substatus; +typedef enum evfs_operation_type +{ + EVFS_OPERATION_TYPE_FILES=0, +} evfs_operation_type; + +typedef enum evfs_operation_task_type +{ + EVFS_OPERATION_TASK_TYPE_FILE_COPY, + EVFS_OPERATION_TASK_TYPE_FILE_REMOVE, + EVFS_OPERATION_TASK_TYPE_MKDIR +} evfs_operation_task_type; + +typedef enum evfs_operation_task_status +{ + EVFS_OPERATION_TASK_STATUS_PENDING, + EVFS_OPERATION_TASK_STATUS_EXEC, + EVFS_OPERATION_TASK_STATUS_COMMITTED +} evfs_operation_task_status; + + +#define EVFS_OPERATION(op) ((evfs_operation*) op) typedef struct evfs_operation evfs_operation; struct evfs_operation { + evfs_operation_type type; + evfs_client* client; + evfs_command* command; + int processed_tasks; + long id; /* A unique id for this op */ char* misc_str; evfs_operation_status status; evfs_operation_substatus substatus; evfs_operation_response response; + + Ecore_List* sub_task; /*The tasks that must be performed by this operation pre-completion*/ }; + + +#define EVFS_OPERATION_FILES(op) ((evfs_operation_files*) op) +struct evfs_operation_files { + evfs_operation op; + + uint64 total_bytes; + long total_files; + + uint64 progress_bytes; + long progress_files; +}; +typedef struct evfs_operation_files evfs_operation_files; + + + +#define EVFS_OPERATION_TASK(task) ((evfs_operation_task *) task) +struct evfs_operation_task { + evfs_operation_task_type type; + evfs_operation_task_status status; + + evfs_command* orig_exec_command; /*The command that led to the creation of + this op*/ +}; +typedef struct evfs_operation_task evfs_operation_task; + +#define EVFS_OPERATION_TASK_FILE_COPY(task) ((evfs_operation_task_file_copy *) task) +struct evfs_operation_task_file_copy { + evfs_operation_task task; + + struct stat source_stat; + struct stat dest_stat; + + evfs_filereference* file_from; + evfs_filereference* file_to; + + uint64 next_byte; + +}; +typedef struct evfs_operation_task_file_copy evfs_operation_task_file_copy; + +#define EVFS_OPERATION_TASK_FILE_REMOVE(task) ((evfs_operation_task_file_remove *) task) +struct evfs_operation_task_file_remove { + evfs_operation_task task; + + struct stat file_stat; + evfs_filereference* file; +}; +typedef struct evfs_operation_task_file_remove evfs_operation_task_file_remove; + + +#define EVFS_OPERATION_TASK_MKDIR(task) ((evfs_operation_task_mkdir *) task) +struct evfs_operation_task_mkdir { + evfs_operation_task task; + + evfs_filereference* file; +}; +typedef struct evfs_operation_task_mkdir evfs_operation_task_mkdir; + + + void evfs_operation_initialise(); -evfs_operation *evfs_operation_new(); +void evfs_operation_base_init(evfs_operation* op); +evfs_operation_files* evfs_operation_files_new(evfs_client* client, evfs_command* command); void evfs_operation_destroy(evfs_operation * op); evfs_operation *evfs_operation_get_by_id(long id); void evfs_operation_status_set(evfs_operation * op, int status); +void evfs_operation_copy_task_add(evfs_operation* op, evfs_filereference* file_from, + evfs_filereference* file_to, struct stat from_stat, struct stat to_stat); +void evfs_operation_mkdir_task_add(evfs_operation* op, evfs_filereference* dir); +void evfs_operation_tasks_print(evfs_operation* op); +void evfs_operation_queue_pending_add(evfs_operation* op); +void evfs_operation_queue_run(); +void evfs_operation_run_tasks(evfs_operation* op); #endif ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs