From: Enlightenment C. <no...@cv...> - 2006-04-21 15:06:35
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/plugins/meta Log Message: Directory /cvs/e/e17/apps/evfs/src/plugins/meta added to the repository |
From: Enlightenment C. <no...@cv...> - 2006-04-21 15:11:03
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/plugins/meta Added Files: Makefile.am evfs_meta_audio.c Log Message: Ok, lotsa changes: * Abstracted out the plugin architecture. Two plugins types now: Filesystem, and metadata provider * Added audio tagger metadata provider (based on e_taggerd by CodeWarrior). Be warned - metadata provider file type is hardcoded to go to this plugin for now - more later, including libextract) * A few bug fixes, whatever ended up in this commit cycle |
From: Enlightenment C. <no...@cv...> - 2006-04-21 15:11:03
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/plugins/file Added Files: Makefile.am evfs_fs_bzip2.c evfs_fs_ftp.c evfs_fs_gzip.c evfs_fs_posix.c evfs_fs_samba.c evfs_fs_sftp.c evfs_fs_tar.c sftp.h Log Message: Ok, lotsa changes: * Abstracted out the plugin architecture. Two plugins types now: Filesystem, and metadata provider * Added audio tagger metadata provider (based on e_taggerd by CodeWarrior). Be warned - metadata provider file type is hardcoded to go to this plugin for now - more later, including libextract) * A few bug fixes, whatever ended up in this commit cycle |
From: Enlightenment C. <no...@cv...> - 2006-04-21 15:11:26
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs Modified Files: TODO configure.in Added Files: BUGS Log Message: Ok, lotsa changes: * Abstracted out the plugin architecture. Two plugins types now: Filesystem, and metadata provider * Added audio tagger metadata provider (based on e_taggerd by CodeWarrior). Be warned - metadata provider file type is hardcoded to go to this plugin for now - more later, including libextract) * A few bug fixes, whatever ended up in this commit cycle =================================================================== RCS file: /cvs/e/e17/apps/evfs/TODO,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- TODO 9 Apr 2006 09:02:43 -0000 1.7 +++ TODO 21 Apr 2006 15:10:16 -0000 1.8 @@ -1,11 +1,11 @@ TODO ---- - * Unique identifier per command, for easier tracking +[DONE] * Unique identifier per command, for easier tracking * Exception handling * File permissions checking [DONE] * Remove monitors for client when client disconnects - * evfs_fs_ssh (SSH filesystem plugin) +[DONE] * evfs_fs_ssh (SSH filesystem plugin) [DONE] * bzip2 [DONE] * gzip support [DONE] * ldap plugin =================================================================== RCS file: /cvs/e/e17/apps/evfs/configure.in,v retrieving revision 1.21 retrieving revision 1.22 diff -u -3 -r1.21 -r1.22 --- configure.in 15 Apr 2006 03:15:54 -0000 1.21 +++ configure.in 21 Apr 2006 15:10:16 -0000 1.22 @@ -174,6 +174,25 @@ AC_SUBST(eet_libs) +PROG="taglib-config"; +AC_PATH_PROG(TAGLIB_CONFIG, $PROG, "", $PATH) +msg_taglib="no" +if test -z "$TAGLIB_CONFIG" ; then + echo $PROG " is not in your \$PATH. Please ensure it is."; + echo "Read the manual page for your shell as to how to extend your path."; + AC_MSG_WARN(Cannot find $PROG) + taglib_libs="" + taglib_cflags="" +else + taglib_libs=`$TAGLIB_CONFIG --libs`" -ltag_c" + taglib_cflags=`$TAGLIB_CONFIG --cflags` + msg_taglib="yes" +fi + +AC_SUBST(taglib_libs) +AC_SUBST(taglib_cflags) +AM_CONDITIONAL(HAVE_TAGLIB, test $msg_taglib = yes) +AC_CHECK_HEADER(taglib/tag_c.h) @@ -261,6 +280,8 @@ src/bin/Makefile src/lib/Makefile src/plugins/Makefile +src/plugins/file/Makefile +src/plugins/meta/Makefile src/demo/Makefile src/include/Makefile src/common/Makefile |
From: Enlightenment C. <no...@cv...> - 2006-04-21 15:11:26
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/demo Modified Files: evfs_demo.c Log Message: Ok, lotsa changes: * Abstracted out the plugin architecture. Two plugins types now: Filesystem, and metadata provider * Added audio tagger metadata provider (based on e_taggerd by CodeWarrior). Be warned - metadata provider file type is hardcoded to go to this plugin for now - more later, including libextract) * A few bug fixes, whatever ended up in this commit cycle =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/demo/evfs_demo.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- evfs_demo.c 28 Mar 2006 07:42:33 -0000 1.25 +++ evfs_demo.c 21 Apr 2006 15:10:16 -0000 1.26 @@ -38,6 +38,18 @@ ref->file_type); } + } else if (data->type == EVFS_EV_METADATA) { + Ecore_List* keys; + char* key; + + printf("Received metadata:\n"); + + printf("Artist: '%s'\n", ecore_hash_get(data->meta->meta_hash, "artist")); + printf("Title: '%s'\n", ecore_hash_get(data->meta->meta_hash, "title")); + printf("Length: '%s'\n", ecore_hash_get(data->meta->meta_hash, "length")); + + + } /*if (mon_current == 2) { @@ -131,6 +143,8 @@ evfs_client_dir_list(con, dir_path->files[0]); } else if (!strcmp(cmd, "STAT")) { evfs_client_file_stat(con, dir_path->files[0]); + } else if (!strcmp(cmd, "META")) { + evfs_client_metadata_retrieve(con, dir_path->files[0]); } ecore_main_loop_begin(); evfs_disconnect(con); |
From: Enlightenment C. <no...@cv...> - 2006-04-21 15:11:27
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/common Modified Files: evfs_cleanup.c evfs_common.c evfs_event_helper.c evfs_io.c Log Message: Ok, lotsa changes: * Abstracted out the plugin architecture. Two plugins types now: Filesystem, and metadata provider * Added audio tagger metadata provider (based on e_taggerd by CodeWarrior). Be warned - metadata provider file type is hardcoded to go to this plugin for now - more later, including libextract) * A few bug fixes, whatever ended up in this commit cycle =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/common/evfs_cleanup.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- evfs_cleanup.c 8 Feb 2006 10:15:29 -0000 1.15 +++ evfs_cleanup.c 21 Apr 2006 15:10:16 -0000 1.16 @@ -128,6 +128,26 @@ } void +evfs_cleanup_metadata_event(evfs_event* event) +{ + evfs_meta_obj* obj; + Evas_List* l = event->meta->meta_list; + + for (; l ;) { + obj = l->data; + l = evas_list_remove(event->meta->meta_list, obj); + + free(obj->key); + free(obj->value); + free(obj); + } + evas_list_free(event->meta->meta_list); + free(event->meta); + + /*FIXME - id if client, free hash*/ +} + +void evfs_cleanup_event(evfs_event * event) { evfs_cleanup_command(&event->resp_command, EVFS_CLEANUP_PRESERVE_COMMAND); @@ -149,6 +169,8 @@ case EVFS_EV_OPERATION: evfs_cleanup_operation_event(event); break; + case EVFS_EV_METADATA: + evfs_cleanup_metadata_event(event); } free(event); =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/common/evfs_common.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- evfs_common.c 12 Mar 2006 05:27:33 -0000 1.3 +++ evfs_common.c 21 Apr 2006 15:10:16 -0000 1.4 @@ -1,5 +1,11 @@ #include "evfs.h" +evfs_plugin* +evfs_meta_plugin_get_for_type(evfs_server* server, char* mime) +{ + return ecore_hash_get(server->plugin_meta_hash, mime); +} + evfs_plugin * evfs_get_plugin_for_uri(evfs_server * server, char *uri_base) { =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/common/evfs_event_helper.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- evfs_event_helper.c 5 Apr 2006 02:22:48 -0000 1.25 +++ evfs_event_helper.c 21 Apr 2006 15:10:16 -0000 1.26 @@ -144,3 +144,18 @@ /*Destroy */ evfs_cleanup_event(event); } + +void +evfs_meta_data_event_create(evfs_client* client,evfs_command* command, Evas_List* ret_list) +{ + evfs_event *event = NEW(evfs_event); + + event->type = EVFS_EV_METADATA; + event->meta = calloc(1, sizeof(evfs_event_meta)); + event->meta->meta_list = ret_list; + + evfs_write_event(client, command, event); + + /*Destroy */ + evfs_cleanup_event(event); +} =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/common/evfs_io.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -3 -r1.52 -r1.53 --- evfs_io.c 5 Apr 2006 05:39:04 -0000 1.52 +++ evfs_io.c 21 Apr 2006 15:10:16 -0000 1.53 @@ -7,6 +7,9 @@ static Eet_Data_Descriptor *_evfs_progress_event_edd; static Eet_Data_Descriptor *_evfs_operation_edd; static Eet_Data_Descriptor *_evfs_filemonitor_edd; +static Eet_Data_Descriptor *_evfs_metalist_edd; +static Eet_Data_Descriptor *_evfs_metaobj_edd; + Eet_Data_Descriptor * evfs_io_filereference_edd_get() @@ -79,6 +82,45 @@ EET_DATA_DESCRIPTOR_ADD_BASIC(_evfs_progress_event_edd, evfs_event_progress, "type", type, EET_T_INT); + + /*Meta obj eet*/ + _evfs_metaobj_edd = eet_data_descriptor_new("evfs_meta_obj", + sizeof(evfs_meta_obj), + (void *(*)(void *))evas_list_next, + (void *(*)(void *, void *))evas_list_append, + (void *(*)(void *))evas_list_data, + (void *(*)(void *))evas_list_free, + (void (*) + (void *, + int (*)(void *, const char *, void *, void *), + void *))evas_hash_foreach, (void *(*)(void *, + const char + *, + void *)) + evas_hash_add, (void (*)(void *))evas_hash_free); + + EET_DATA_DESCRIPTOR_ADD_BASIC(_evfs_metaobj_edd, evfs_meta_obj, "key", key, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_evfs_metaobj_edd, evfs_meta_obj, "value", value, EET_T_STRING); + + /*Meta list eet*/ + _evfs_metalist_edd = eet_data_descriptor_new("evfs_metalist", + sizeof(evfs_event_meta), + (void *(*)(void *))evas_list_next, + (void *(*)(void *, void *))evas_list_append, + (void *(*)(void *))evas_list_data, + (void *(*)(void *))evas_list_free, + (void (*) + (void *, + int (*)(void *, const char *, void *, void *), + void *))evas_hash_foreach, (void *(*)(void *, + const char + *, + void *)) + evas_hash_add, (void (*)(void *))evas_hash_free); + + EET_DATA_DESCRIPTOR_ADD_LIST(_evfs_metalist_edd, evfs_event_meta, "evfs_event_meta", meta_list, + _evfs_metaobj_edd); + /*Evfs_operation eet */ _evfs_operation_edd = eet_data_descriptor_new("evfs_operation", sizeof(evfs_operation), @@ -248,6 +290,26 @@ event->data.size)); } +void evfs_write_meta_event(evfs_client * client, evfs_command * command, + evfs_event * event) +{ + int size_ret = 0; + char *data; + + data = + eet_data_descriptor_encode(_evfs_metalist_edd, event->meta, + &size_ret); + + evfs_write_ecore_ipc_client_message(client->client, + ecore_ipc_message_new(EVFS_EV_REPLY, + EVFS_EV_PART_METALIST, + client->id, 0, 0, + data, size_ret)); + + free(data); + +} + void evfs_write_progress_event(evfs_client * client, evfs_command * command, evfs_event * event) @@ -256,11 +318,6 @@ evfs_filereference *ref; char *data; - if (event->progress->type == EVFS_PROGRESS_TYPE_DONE) - { - printf("Sendign Done!\n"); - } - data = eet_data_descriptor_encode(_evfs_progress_event_edd, event->progress, &size_ret); @@ -347,6 +404,9 @@ case EVFS_EV_FILE_PROGRESS: evfs_write_progress_event(client, command, event); break; + case EVFS_EV_METADATA: + evfs_write_meta_event(client,command,event); + break; case EVFS_EV_FILE_OPEN: printf("Open event send\n"); @@ -420,6 +480,33 @@ } break; + + case EVFS_EV_PART_METALIST: + { + evfs_meta_obj* obj; + Evas_List* l; + + evfs_event_meta* meta = + eet_data_descriptor_decode(_evfs_metalist_edd, msg->data, + msg->len); + + /*Now we have to push this list to a hash..*/ + event->meta = meta; + event->meta->meta_hash = ecore_hash_new(ecore_str_hash, ecore_str_compare); + + for (l = event->meta->meta_list; l; ) { + obj = l->data; + l = evas_list_remove(event->meta->meta_list, l->data); + + ecore_hash_set(event->meta->meta_hash, obj->key, obj->value); + free(obj); + + } + evas_list_free(event->meta->meta_list); + + } + break; + case EVFS_EV_PART_DATA: { event->data.size = msg->len; @@ -558,6 +645,7 @@ case EVFS_CMD_FILE_OPEN: case EVFS_CMD_FILE_READ: case EVFS_CMD_DIRECTORY_CREATE: + case EVFS_CMD_METADATA_RETRIEVE: case EVFS_CMD_PING: evfs_write_file_command(conn, command); break; @@ -592,6 +680,7 @@ case EVFS_CMD_FILE_OPEN: case EVFS_CMD_FILE_READ: case EVFS_CMD_DIRECTORY_CREATE: + case EVFS_CMD_METADATA_RETRIEVE: case EVFS_CMD_PING: evfs_write_file_command_client(client, command); break; |
From: Enlightenment C. <no...@cv...> - 2006-04-21 15:11:27
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/lib Modified Files: evfs_commands.c Log Message: Ok, lotsa changes: * Abstracted out the plugin architecture. Two plugins types now: Filesystem, and metadata provider * Added audio tagger metadata provider (based on e_taggerd by CodeWarrior). Be warned - metadata provider file type is hardcoded to go to this plugin for now - more later, including libextract) * A few bug fixes, whatever ended up in this commit cycle =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/lib/evfs_commands.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- evfs_commands.c 5 Apr 2006 05:43:04 -0000 1.26 +++ evfs_commands.c 21 Apr 2006 15:10:16 -0000 1.27 @@ -231,3 +231,28 @@ return id; } + + +long +evfs_client_metadata_retrieve(evfs_connection * conn, evfs_filereference* file ) +{ + evfs_command *command = evfs_client_command_new(); + long id = command->client_identifier; + + command->type = EVFS_CMD_METADATA_RETRIEVE; + + command->file_command.num_files = 1; + command->file_command.files = malloc(sizeof(evfs_filereference *) * 1); + command->file_command.files[0] = file; + + + evfs_write_command(conn, command); + + free(command->file_command.files); + free(command); + + + return id; + +} + |
From: Enlightenment C. <no...@cv...> - 2006-04-21 15:11:29
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/include Modified Files: evfs.h evfs_command.h evfs_commands.h evfs_common.h evfs_event.h evfs_event_helper.h evfs_plugin.h evfs_server.h evfs_server_handle.h Log Message: Ok, lotsa changes: * Abstracted out the plugin architecture. Two plugins types now: Filesystem, and metadata provider * Added audio tagger metadata provider (based on e_taggerd by CodeWarrior). Be warned - metadata provider file type is hardcoded to go to this plugin for now - more later, including libextract) * A few bug fixes, whatever ended up in this commit cycle =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/include/evfs.h,v retrieving revision 1.45 retrieving revision 1.46 diff -u -3 -r1.45 -r1.46 --- evfs.h 11 Apr 2006 07:01:03 -0000 1.45 +++ evfs.h 21 Apr 2006 15:10:16 -0000 1.46 @@ -13,6 +13,8 @@ #include <Ecore_Ipc.h> #include <Ecore_File.h> +#include <Evas.h> + #include <stdlib.h> #include <string.h> =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/include/evfs_command.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- evfs_command.h 5 Apr 2006 05:39:05 -0000 1.8 +++ evfs_command.h 21 Apr 2006 15:10:16 -0000 1.9 @@ -19,7 +19,8 @@ EVFS_CMD_FILE_TEST = 11, EVFS_CMD_PING = 12, EVFS_CMD_OPERATION_RESPONSE = 13, - EVFS_CMD_DIRECTORY_CREATE = 14 + EVFS_CMD_DIRECTORY_CREATE = 14, + EVFS_CMD_METADATA_RETRIEVE = 15 } evfs_command_type; =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/include/evfs_commands.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- evfs_commands.h 5 Apr 2006 05:43:04 -0000 1.12 +++ evfs_commands.h 21 Apr 2006 15:10:16 -0000 1.13 @@ -18,4 +18,7 @@ long evfs_client_directory_create(evfs_connection * conn, evfs_filereference * file); +long +evfs_client_metadata_retrieve(evfs_connection * conn, evfs_filereference* file ); + #endif =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/include/evfs_common.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- evfs_common.h 12 Mar 2006 05:27:33 -0000 1.3 +++ evfs_common.h 21 Apr 2006 15:10:16 -0000 1.4 @@ -4,4 +4,7 @@ evfs_plugin *evfs_get_plugin_for_uri(evfs_server * server, char *uri_base); evfs_filereference* evfs_filereference_clone(evfs_filereference* source); +evfs_plugin* evfs_meta_plugin_get_for_type(evfs_server* server, char* mime); + + #endif =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/include/evfs_event.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- evfs_event.h 5 Apr 2006 05:39:05 -0000 1.12 +++ evfs_event.h 21 Apr 2006 15:10:16 -0000 1.13 @@ -14,6 +14,7 @@ EVFS_EV_FILE_READ = 7, EVFS_EV_PONG = 8, EVFS_EV_OPERATION = 9, + EVFS_EV_METADATA = 10, EVFS_EV_ERROR = 100, EVFS_EV_NOT_SUPPORTED = 101 @@ -34,17 +35,13 @@ EVFS_EV_PART_DATA = 6, EVFS_EV_PART_STAT_SIZE = 7, EVFS_EV_PART_FILE_REFERENCE = 8, - EVFS_EV_PART_FILE_REFERENCE_USERNAME = 9, - EVFS_EV_PART_FILE_REFERENCE_PASSWORD = 10, + EVFS_EV_PART_METALIST = 9, EVFS_EV_PART_PROGRESS = 11, EVFS_COMMAND_EXTRA = 12, EVFS_COMMAND_TYPE = 13, EVFS_FILE_REFERENCE = 14, - EVFS_FILE_REFERENCE_PASSWORD = 15, - EVFS_FILE_REFERENCE_USERNAME = 16, - EVFS_FILE_REFERENCE_FD = 17, EVFS_EV_PART_OPERATION = 18, EVFS_EV_PART_FILE_MONITOR = 19, @@ -77,6 +74,12 @@ } evfs_stat; +typedef struct evfs_meta_obj +{ + char* key; + char* value; +} evfs_meta_obj; + typedef struct evfs_event_id_notify evfs_event_id_notify; struct evfs_event_id_notify { @@ -128,6 +131,12 @@ char *bytes; } evfs_event_data; +typedef struct evfs_event_meta +{ + Evas_List* meta_list; + Ecore_Hash* meta_hash; +} evfs_event_meta; + /*typedef struct evfs_event_operation { evfs_operation* op; } evfs_event_operation;*/ @@ -144,6 +153,11 @@ evfs_event_stat stat; evfs_event_progress *progress; struct evfs_operation *op; + + /*This is just a hack until we separate out + * the different evfs_event types into a struct + * hierarchy */ + evfs_event_meta* meta; evfs_event_data data; } =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/include/evfs_event_helper.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- evfs_event_helper.h 12 Mar 2006 05:27:33 -0000 1.16 +++ evfs_event_helper.h 21 Apr 2006 15:10:16 -0000 1.17 @@ -23,4 +23,7 @@ void evfs_operation_event_create(evfs_client * client, evfs_command * command, evfs_operation * op, char* misc); +void +evfs_meta_data_event_create(evfs_client* client,evfs_command* command, Evas_List* ret_list); + #endif =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/include/evfs_plugin.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- evfs_plugin.h 3 Feb 2006 23:12:13 -0000 1.13 +++ evfs_plugin.h 21 Apr 2006 15:10:16 -0000 1.14 @@ -3,6 +3,11 @@ #include "evfs_client.h" +typedef struct evfs_plugin_functions_meta +{ + Evas_List* (*evfs_file_meta_retrieve)(evfs_client* client, evfs_command* command); +} evfs_plugin_functions_meta; + typedef struct evfs_plugin_functions { int (*evfs_client_disconnect) (evfs_client *); @@ -32,11 +37,31 @@ typedef struct evfs_plugin { - evfs_plugin_functions *functions; - void *dl_ref; - char *uri; } evfs_plugin; +#define EVFS_PLUGIN(plugin) ((evfs_plugin*)plugin) + +typedef struct evfs_plugin_file +{ + evfs_plugin base; + + char *uri; + evfs_plugin_functions *functions; + +} evfs_plugin_file; +#define EVFS_PLUGIN_FILE(plugin) ((evfs_plugin_file*)plugin) + +typedef struct evfs_plugin_meta +{ + evfs_plugin base; + + char *uri; + evfs_plugin_functions_meta *functions; + +} evfs_plugin_meta; +#define EVFS_PLUGIN_META(plugin) ((evfs_plugin_meta*)plugin) + + #endif =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/include/evfs_server.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- evfs_server.h 3 Feb 2006 23:12:13 -0000 1.3 +++ evfs_server.h 21 Apr 2006 15:10:16 -0000 1.4 @@ -16,6 +16,7 @@ { Ecore_Hash *client_hash; Ecore_Hash *plugin_uri_hash; + Ecore_Hash *plugin_meta_hash; Ecore_Ipc_Server *ipc_server; unsigned long clientCounter; =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/include/evfs_server_handle.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- evfs_server_handle.h 14 Mar 2006 13:06:23 -0000 1.16 +++ evfs_server_handle.h 21 Apr 2006 15:10:16 -0000 1.17 @@ -25,3 +25,5 @@ evfs_command * command); void evfs_handle_directory_create_command(evfs_client * client, evfs_command * command); + +void evfs_handle_metadata_command(evfs_client* client, evfs_command* command); |
From: Enlightenment C. <no...@cv...> - 2006-04-21 15:11:31
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/bin Modified Files: evfs_main.c evfs_operation_tasks.c evfs_server_handle.c Log Message: Ok, lotsa changes: * Abstracted out the plugin architecture. Two plugins types now: Filesystem, and metadata provider * Added audio tagger metadata provider (based on e_taggerd by CodeWarrior). Be warned - metadata provider file type is hardcoded to go to this plugin for now - more later, including libextract) * A few bug fixes, whatever ended up in this commit cycle =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/bin/evfs_main.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -3 -r1.42 -r1.43 --- evfs_main.c 15 Apr 2006 03:15:54 -0000 1.42 +++ evfs_main.c 21 Apr 2006 15:10:16 -0000 1.43 @@ -111,7 +111,7 @@ while ((key = ecore_list_remove_first(keys))) { plugin = ecore_hash_get(server->plugin_uri_hash, key); - (*plugin->functions->evfs_client_disconnect) (client); + (*EVFS_PLUGIN_FILE(plugin)->functions->evfs_client_disconnect) (client); } ecore_list_destroy(keys); @@ -212,6 +212,10 @@ case EVFS_CMD_OPERATION_RESPONSE: evfs_handle_operation_command(client, command); break; + + case EVFS_CMD_METADATA_RETRIEVE: + evfs_handle_metadata_command(client,command); + break; default: printf("Warning - unhandled command %d\n", command->type); break; @@ -221,26 +225,26 @@ } evfs_plugin * -evfs_load_plugin(char *filename) +evfs_load_plugin_file(char *filename) { - evfs_plugin *plugin = NEW(evfs_plugin); + evfs_plugin_file *plugin = NEW(evfs_plugin_file); char *(*evfs_plugin_uri_get) (); evfs_plugin_functions *(*evfs_plugin_init) (); printf("Loading plugin: %s\n", filename); - plugin->dl_ref = dlopen(filename, RTLD_LAZY); + EVFS_PLUGIN(plugin)->dl_ref = dlopen(filename, RTLD_LAZY); - if (plugin->dl_ref) + if (EVFS_PLUGIN(plugin)->dl_ref) { - evfs_plugin_uri_get = dlsym(plugin->dl_ref, "evfs_plugin_uri_get"); + evfs_plugin_uri_get = dlsym(EVFS_PLUGIN(plugin)->dl_ref, "evfs_plugin_uri_get"); if (evfs_plugin_uri_get) { plugin->uri = (*evfs_plugin_uri_get) (); printf("The plugin at '%s' handles '%s'\n", filename, plugin->uri); /*Execute the init function, if it's there.. */ - evfs_plugin_init = dlsym(plugin->dl_ref, "evfs_plugin_init"); + evfs_plugin_init = dlsym(EVFS_PLUGIN(plugin)->dl_ref, "evfs_plugin_init"); if (evfs_plugin_init) { plugin->functions = (*evfs_plugin_init) (); @@ -261,7 +265,63 @@ goto exit_error; } - return plugin; + return EVFS_PLUGIN(plugin); + + exit_error: + free(plugin); + return NULL; + +} + +evfs_plugin * +evfs_load_plugin_meta(char *filename) +{ + evfs_plugin_meta *plugin = NEW(evfs_plugin_file); + evfs_plugin_functions_meta *(*evfs_plugin_init) (); + Ecore_List* (*evfs_plugin_meta_types_get)(); + char* type; + Ecore_List* types; + + + printf("Loading plugin: %s\n", filename); + EVFS_PLUGIN(plugin)->dl_ref = dlopen(filename, RTLD_LAZY); + + if (EVFS_PLUGIN(plugin)->dl_ref) + { + /*Execute the init function, if it's there.. */ + evfs_plugin_init = dlsym(EVFS_PLUGIN(plugin)->dl_ref, "evfs_plugin_init"); + if (evfs_plugin_init) + { + plugin->functions = (*evfs_plugin_init) (); + + /*Load meta types*/ + evfs_plugin_meta_types_get = dlsym(EVFS_PLUGIN(plugin)->dl_ref, "evfs_plugin_meta_types_get"); + if (evfs_plugin_meta_types_get) { + + types = (*evfs_plugin_meta_types_get)(); + /*Register..*/ + while ( (type = ecore_list_remove_first(types))) { + ecore_hash_set(evfs_server_get()->plugin_meta_hash, type, plugin); + printf(" Registered meta plugin for '%s'...\n", type); + } + } else { + printf("Error - could not get type register function for meta plugin"); + } + } else { + printf + ("Error - plugin file does not contain init function - %s\n", + filename); + goto exit_error; + } + + } + else + { + printf("Error - plugin file invalid - %s\n", filename); + goto exit_error; + } + + return EVFS_PLUGIN(plugin); exit_error: free(plugin); @@ -269,6 +329,7 @@ } + void evfs_load_plugins() { @@ -283,14 +344,13 @@ { while ((de = readdir(dir))) { - if (!strncmp(de->d_name + strlen(de->d_name) - 3, ".so", 3)) { snprintf(plugin_path, 1024, "%s/%s", PACKAGE_PLUGIN_DIR "/plugins/file", de->d_name); - if ((plugin = evfs_load_plugin(plugin_path))) + if ((plugin = evfs_load_plugin_file(plugin_path))) { - ecore_hash_set(server->plugin_uri_hash, plugin->uri, + ecore_hash_set(server->plugin_uri_hash, EVFS_PLUGIN_FILE(plugin)->uri, plugin); } } @@ -304,6 +364,31 @@ } closedir(dir); + /*Load meta plugins*/ + printf("Reading plugins from: %s\n", PACKAGE_PLUGIN_DIR "/plugins/meta"); + dir = opendir(PACKAGE_PLUGIN_DIR "/plugins/meta"); + if (dir) + { + while ((de = readdir(dir))) + { + if (!strncmp(de->d_name + strlen(de->d_name) - 3, ".so", 3)) + { + snprintf(plugin_path, 1024, "%s/%s", + PACKAGE_PLUGIN_DIR "/plugins/meta", de->d_name); + if ((plugin = evfs_load_plugin_meta(plugin_path))) + { + } + } + } + } + else + { + fprintf(stderr, "EVFS: Could not location plugin directory '%s'\n", + PACKAGE_PLUGIN_DIR "/plugins/file"); + exit(1); + } + closedir(dir); + } int @@ -345,6 +430,7 @@ server->client_hash = ecore_hash_new(ecore_direct_hash, ecore_direct_compare); server->plugin_uri_hash = ecore_hash_new(ecore_str_hash, ecore_str_compare); + server->plugin_meta_hash = ecore_hash_new(ecore_str_hash, ecore_str_compare); server->clientCounter = 0; server->incoming_command_list = ecore_list_new(); =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/bin/evfs_operation_tasks.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- evfs_operation_tasks.c 9 Apr 2006 09:02:44 -0000 1.5 +++ evfs_operation_tasks.c 21 Apr 2006 15:10:16 -0000 1.6 @@ -44,13 +44,13 @@ if (copy->file_from->fd == 0 && copy->file_from->fd_p == NULL) { /*printf("Opening source file...\n");*/ - int fd =(*copy->file_from->plugin->functions->evfs_file_open) (op->client, copy->file_from); + int fd =(*EVFS_PLUGIN_FILE(copy->file_from->plugin)->functions->evfs_file_open) (op->client, copy->file_from); /*TODO: Error checking on file open fail*/ } if (copy->file_to->fd == 0 && copy->file_to->fd_p == NULL) { /*printf("Creating destination file..\n");*/ - (*copy->file_to->plugin->functions->evfs_file_create) (copy->file_to); + (*EVFS_PLUGIN_FILE(copy->file_to->plugin)->functions->evfs_file_create) (copy->file_to); } /*printf ("next_byte:size -> %lld:%lld\n", copy->next_byte, copy->source_stat.st_size); */ @@ -63,13 +63,13 @@ (copy->source_stat.st_size - copy->next_byte); - b_read = (*copy->file_from->plugin->functions->evfs_file_read) (op->client, + b_read = (*EVFS_PLUGIN_FILE(copy->file_from->plugin)->functions->evfs_file_read) (op->client, copy->file_from, bytes, read_write_bytes); if (b_read > 0) { - b_write = (*copy->file_to->plugin->functions->evfs_file_write) (copy->file_to, + b_write = (*EVFS_PLUGIN_FILE(copy->file_to->plugin)->functions->evfs_file_write) (copy->file_to, bytes, b_read); @@ -93,8 +93,8 @@ /*Check if it's time to end..*/ if (copy->next_byte == copy->source_stat.st_size) { - (*copy->file_from->plugin->functions->evfs_file_close) (copy->file_from); - (*copy->file_to->plugin->functions->evfs_file_close) (copy->file_to); + (*EVFS_PLUGIN_FILE(copy->file_from->plugin)->functions->evfs_file_close) (copy->file_from); + (*EVFS_PLUGIN_FILE(copy->file_to->plugin)->functions->evfs_file_close) (copy->file_to); EVFS_OPERATION_TASK(copy)->status = EVFS_OPERATION_TASK_STATUS_COMMITTED; } @@ -112,7 +112,7 @@ task->file->plugin_uri); - ret = (*task->file->plugin->functions->evfs_file_mkdir) (task->file); + ret = (*EVFS_PLUGIN_FILE(task->file->plugin)->functions->evfs_file_mkdir) (task->file); /*TODO - handle 'fail' state*/ EVFS_OPERATION_TASK(task)->status = EVFS_OPERATION_TASK_STATUS_COMMITTED; @@ -126,7 +126,7 @@ task->file->plugin = evfs_get_plugin_for_uri(evfs_server_get(), task->file->plugin_uri); - ret = (*task->file->plugin->functions->evfs_file_remove) (task->file->path); + ret = (*EVFS_PLUGIN_FILE(task->file->plugin)->functions->evfs_file_remove) (task->file->path); /*TODO - handle 'fail' state*/ EVFS_OPERATION_TASK(task)->status = EVFS_OPERATION_TASK_STATUS_COMMITTED; =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/bin/evfs_server_handle.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -3 -r1.51 -r1.52 --- evfs_server_handle.c 14 Mar 2006 13:06:22 -0000 1.51 +++ evfs_server_handle.c 21 Apr 2006 15:10:16 -0000 1.52 @@ -21,7 +21,7 @@ if (plugin) { printf("Opening file..\n"); - return (*plugin->functions->evfs_file_open) (client, uri); + return (*EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_open) (client, uri); } else { @@ -39,7 +39,7 @@ if (plugin) { printf("Closing file..\n"); - return (*plugin->functions->evfs_file_close) (uri); + return (*EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_close) (uri); } else { @@ -58,7 +58,7 @@ evfs_get_plugin_for_uri(client->server, uri->plugin_uri); if (plugin) { - return (*plugin->functions->evfs_file_read) (client, uri, bytes, size); + return (*EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_read) (client, uri, bytes, size); } else { @@ -90,7 +90,7 @@ printf ("Requesting a file monitor from this plugin for uri type '%s'\n", command->file_command.files[0]->plugin_uri); - (*plugin->functions->evfs_monitor_start) (client, command); + (*EVFS_PLUGIN_FILE(plugin)->functions->evfs_monitor_start) (client, command); } } @@ -148,7 +148,7 @@ op = evfs_operation_files_new(client, root_command); command->op = EVFS_OPERATION(op); } else { - op = root_command->op; + op = EVFS_OPERATION_FILES(root_command->op); } @@ -157,7 +157,7 @@ files[0]->plugin_uri); if (plugin) { - (*plugin->functions->evfs_file_lstat) (command, &file_stat, 0); + (*EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_lstat) (command, &file_stat, 0); /*If we're not a dir, simple remove command */ if (!S_ISDIR(file_stat.st_mode)) @@ -181,7 +181,7 @@ evfs_filereference *file = NULL; /*First, we need a directory list... */ - (*plugin->functions->evfs_dir_list) (client, command, + (*EVFS_PLUGIN_FILE(plugin)->functions->evfs_dir_list) (client, command, &directory_list); if (directory_list) { @@ -242,12 +242,12 @@ files[0]->plugin_uri); if (plugin) { - printf("Pointer here: %p\n", plugin->functions->evfs_file_rename); + printf("Pointer here: %p\n", EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_rename); - if (plugin->functions->evfs_file_rename) + if (EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_rename) { if (command->file_command.num_files == 2) - (*plugin->functions->evfs_file_rename) (client, command); + (*EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_rename) (client, command); else printf("ERR: Wrong number of files to rename\n"); } @@ -266,7 +266,7 @@ files[0]->plugin_uri); if (plugin) { - (*(plugin->functions->evfs_file_stat)) (command, &file_stat, 0); + (*(EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_stat)) (command, &file_stat, 0); evfs_stat_event_create(client, command, &file_stat); } @@ -284,8 +284,8 @@ files[0]->plugin_uri); if (plugin) { - printf("Pointer here: %p\n", plugin->functions->evfs_file_open); - (*(plugin->functions->evfs_file_open)) (client, + printf("Pointer here: %p\n", EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_open); + (*(EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_open)) (client, command->file_command.files[0]); fprintf(stderr, "Opened file, fd is: %d\n", @@ -312,9 +312,9 @@ files[0]->plugin_uri); if (plugin) { - //printf("Pointer here: %p\n", plugin->functions->evfs_file_read); + //printf("Pointer here: %p\n", EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_read); b_read = - (*(plugin->functions->evfs_file_read)) (client, + (*(EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_read)) (client, command->file_command. files[0], bytes, command->file_command.extra); @@ -338,7 +338,7 @@ { Ecore_List *directory_list = NULL; - (*plugin->functions->evfs_dir_list) (client, command, &directory_list); + (*EVFS_PLUGIN_FILE(plugin)->functions->evfs_dir_list) (client, command, &directory_list); if (directory_list) { @@ -373,7 +373,7 @@ command->file_command.files[0]->path); ret = - (*plugin->functions->evfs_file_mkdir) (command->file_command.files[0]); + (*EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_mkdir) (command->file_command.files[0]); printf("....ret was %d\n", ret); } } @@ -421,11 +421,11 @@ { /*Check for supported options */ - if (!(plugin->functions->evfs_file_lstat && - plugin->functions->evfs_file_open && - dst_plugin->functions->evfs_file_create && - plugin->functions->evfs_file_read && - dst_plugin->functions->evfs_file_write)) + if (!(EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_lstat && + EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_open && + EVFS_PLUGIN_FILE(dst_plugin)->functions->evfs_file_create && + EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_read && + EVFS_PLUGIN_FILE(dst_plugin)->functions->evfs_file_write)) { printf("ARGH! Copy Not supported!\n"); evfs_operation_destroy(EVFS_OPERATION(op)); @@ -433,9 +433,9 @@ } /*Get the source file size */ - (*plugin->functions->evfs_file_lstat) (command, &file_stat, 0); + (*EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_lstat) (command, &file_stat, 0); res = - (*dst_plugin->functions->evfs_file_lstat) (command, &dest_stat, 1); + (*EVFS_PLUGIN_FILE(dst_plugin)->functions->evfs_file_lstat) (command, &dest_stat, 1); if (!S_ISDIR(file_stat.st_mode)) { @@ -451,7 +451,7 @@ evfs_filereference_clone(command->file_command.files[1])); /*First, we need a directory list... */ - (*plugin->functions->evfs_dir_list) (client, command, + (*EVFS_PLUGIN_FILE(plugin)->functions->evfs_dir_list) (client, command, &directory_list); if (directory_list) { @@ -538,4 +538,21 @@ printf("*** Received operation response for op %ld -> %d\n", command->op->id, command->op->response); } +} + +void evfs_handle_metadata_command(evfs_client* client, evfs_command* command) +{ + char* type = "audio/x-mp3"; + evfs_plugin_meta* plugin; + Ecore_List* ret_list; + + plugin = EVFS_PLUGIN_META(evfs_meta_plugin_get_for_type(evfs_server_get(),type)); + if (plugin) { + ret_list = (*plugin->functions->evfs_file_meta_retrieve)(client,command); + + evfs_meta_data_event_create(client,command, ret_list); + } else { + printf("Could not find plugin to tag this type\n"); + } + } |
From: Enlightenment C. <no...@cv...> - 2006-04-21 15:11:37
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/plugins Modified Files: Makefile.am Removed Files: evfs_fs_bzip2.c evfs_fs_ftp.c evfs_fs_gzip.c evfs_fs_posix.c evfs_fs_samba.c evfs_fs_sftp.c evfs_fs_tar.c sftp.h Log Message: Ok, lotsa changes: * Abstracted out the plugin architecture. Two plugins types now: Filesystem, and metadata provider * Added audio tagger metadata provider (based on e_taggerd by CodeWarrior). Be warned - metadata provider file type is hardcoded to go to this plugin for now - more later, including libextract) * A few bug fixes, whatever ended up in this commit cycle =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/plugins/Makefile.am,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- Makefile.am 5 Feb 2006 11:49:26 -0000 1.16 +++ Makefile.am 21 Apr 2006 15:10:16 -0000 1.17 @@ -1,105 +1,3 @@ -## Process this file with automake to produce Makefile.in -AUTOMAKE_OPTIONS = 1.7 foreign - -LDFLAGS = -rdynamic -shared -INCLUDES = -I. -I$(top_srcdir) -I$(top_srcdir)/src/include - -pkgdir = $(libdir)/evfs/plugins/file - -POSIX_L = posix.la - -if HAVE_SAMBA -SAMBA_L = samba.la -else -SAMBA_L = -endif - -if HAVE_CURL -FTP_L = ftp.la -else -FTP_L = -endif - -SFTP_L = sftp.la - -TAR_L = tar.la - -BZIP2_L = bzip2.la - -GZIP_L = gzip.la - - -pkg_LTLIBRARIES = $(POSIX_L) $(SAMBA_L) $(TAR_L) $(BZIP2_L) $(FTP_L) $(GZIP_L) $(SFTP_L) - -posix_la_SOURCES = evfs_fs_posix.c \ - $(top_srcdir)/src/common/evfs_debug.c \ - $(top_srcdir)/src/common/evfs_event_helper.c \ - $(top_srcdir)/src/common/evfs_misc.c - - -tar_la_SOURCES = evfs_fs_tar.c \ - $(top_srcdir)/src/common/evfs_debug.c \ - $(top_srcdir)/src/common/evfs_event_helper.c \ - $(top_srcdir)/src/bin/evfs_server_handle.c \ - $(top_srcdir)/src/common/evfs_common.c - -sftp_la_SOURCES = evfs_fs_sftp.c \ - $(top_srcdir)/src/common/evfs_debug.c \ - $(top_srcdir)/src/common/evfs_event_helper.c \ - $(top_srcdir)/src/bin/evfs_server_handle.c \ - $(top_srcdir)/src/common/evfs_common.c - - -bzip2_la_SOURCES = evfs_fs_bzip2.c \ - $(top_srcdir)/src/common/evfs_debug.c \ - $(top_srcdir)/src/common/evfs_event_helper.c \ - $(top_srcdir)/src/bin/evfs_server_handle.c \ - $(top_srcdir)/src/common/evfs_common.c - -gzip_la_SOURCES = evfs_fs_gzip.c \ - $(top_srcdir)/src/common/evfs_debug.c \ - $(top_srcdir)/src/common/evfs_event_helper.c \ - $(top_srcdir)/src/bin/evfs_server_handle.c \ - $(top_srcdir)/src/common/evfs_common.c - - -samba_la_SOURCES = evfs_fs_samba.c \ - $(top_srcdir)/src/common/evfs_debug.c \ - $(top_srcdir)/src/common/evfs_event_helper.c \ - $(top_srcdir)/src/common/evfs_misc.c - -ftp_la_SOURCES = evfs_fs_ftp.c \ - $(top_srcdir)/src/common/evfs_debug.c \ - $(top_srcdir)/src/common/evfs_event_helper.c - - - -posix_la_CFLAGS = @ecore_cflags@ -posix_la_LDFLAGS = -module -avoid-version -posix_la_LIBADD = @ecore_libs@ -L$(top_builddir)/src/lib -levfs - -samba_la_CFLAGS = @ecore_cflags@ -samba_la_LDFLAGS = -module -avoid-version -lsmbclient -samba_la_LIBADD = @ecore_libs@ -L$(top_builddir)/src/lib -levfs - -tar_la_CFLAGS = @ecore_cflags@ -tar_la_LDFLAGS = -module -avoid-version -tar_la_LIBADD = @ecore_libs@ -L$(top_builddir)/src/lib -levfs - -bzip2_la_CFLAGS = @ecore_cflags@ -bzip2_la_LDFLAGS = -module -avoid-version -bzip2_la_LIBADD = @ecore_libs@ -L$(top_builddir)/src/lib -levfs @BZ2_LIBS@ - -gzip_la_CFLAGS = @ecore_cflags@ -gzip_la_LDFLAGS = -module -avoid-version -gzip_la_LIBADD = @ecore_libs@ -L$(top_builddir)/src/lib -levfs -lz - - -ftp_la_CFLAGS = @ecore_cflags@ @curl_cflags@ -ftp_la_LDFLAGS = -module -avoid-version -ftp_la_LIBADD = @ecore_libs@ -L$(top_builddir)/src/lib -levfs @curl_libs@ - -sftp_la_CFLAGS = @ecore_cflags@ -sftp_la_LDFLAGS = -module -avoid-version -sftp_la_LIBADD = @ecore_libs@ -L$(top_builddir)/src/lib -levfs +MAINTAINERCLEANFILES = Makefile.in +SUBDIRS = file meta |
From: Enlightenment C. <no...@cv...> - 2006-04-22 03:10:04
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/include Modified Files: evfs_io.h Log Message: * Bug fix to meta plugin init * Functions to identify whether we're a a server or client, for object cleanup purposes =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/include/evfs_io.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- evfs_io.h 3 Feb 2006 23:12:13 -0000 1.10 +++ evfs_io.h 22 Apr 2006 03:09:19 -0000 1.11 @@ -35,6 +35,9 @@ EVFS_COMMAND_END } EVFS_IO_PART_TYPE;*/ +int evfs_object_client_is_get(); +void evfs_object_server_is_set(); + Eet_Data_Descriptor *evfs_io_filereference_edd_get(); ecore_ipc_message *ecore_ipc_message_new(int major, int minor, int ref, @@ -57,5 +60,7 @@ void evfs_write_event(evfs_client * client, evfs_command * command, evfs_event * event); int evfs_read_event(evfs_event * event, ecore_ipc_message * msg); + + #endif |
From: Enlightenment C. <no...@cv...> - 2006-04-22 03:10:30
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/common Modified Files: evfs_io.c Log Message: * Bug fix to meta plugin init * Functions to identify whether we're a a server or client, for object cleanup purposes =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/common/evfs_io.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -3 -r1.53 -r1.54 --- evfs_io.c 21 Apr 2006 15:10:16 -0000 1.53 +++ evfs_io.c 22 Apr 2006 03:09:18 -0000 1.54 @@ -3,6 +3,7 @@ #include <Evas.h> static int io_init = 0; +static int _evfs_object_client_is = 1; static Eet_Data_Descriptor *_evfs_filereference_edd; static Eet_Data_Descriptor *_evfs_progress_event_edd; static Eet_Data_Descriptor *_evfs_operation_edd; @@ -10,6 +11,18 @@ static Eet_Data_Descriptor *_evfs_metalist_edd; static Eet_Data_Descriptor *_evfs_metaobj_edd; + +/*Functions so we know what to clean in various objects client/server side*/ +void evfs_object_server_is_set() +{ + _evfs_object_client_is = 0; +} + +int evfs_object_client_is_get() +{ + return _evfs_object_client_is; +} +/*-----------------------*/ Eet_Data_Descriptor * evfs_io_filereference_edd_get() |
From: Enlightenment C. <no...@cv...> - 2006-04-22 03:10:30
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/bin Modified Files: evfs_main.c Log Message: * Bug fix to meta plugin init * Functions to identify whether we're a a server or client, for object cleanup purposes =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/bin/evfs_main.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -3 -r1.43 -r1.44 --- evfs_main.c 21 Apr 2006 15:10:16 -0000 1.43 +++ evfs_main.c 22 Apr 2006 03:09:18 -0000 1.44 @@ -276,7 +276,7 @@ evfs_plugin * evfs_load_plugin_meta(char *filename) { - evfs_plugin_meta *plugin = NEW(evfs_plugin_file); + evfs_plugin_meta *plugin = NEW(evfs_plugin_meta); evfs_plugin_functions_meta *(*evfs_plugin_init) (); Ecore_List* (*evfs_plugin_meta_types_get)(); char* type; @@ -435,6 +435,9 @@ server->incoming_command_list = ecore_list_new(); ecore_idle_enterer_add(incoming_command_cb, NULL); + + /*Identify that we are a server*/ + evfs_object_server_is_set(); /*Add a timer, to make sure our event loop keeps going. Kinda hacky */ ecore_timer_add(0.01, ecore_timer_enterer, NULL); |
From: Enlightenment C. <no...@cv...> - 2006-04-22 03:17:42
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/common Modified Files: evfs_cleanup.c Log Message: * Do a few reaps if the object is a client =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/common/evfs_cleanup.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- evfs_cleanup.c 21 Apr 2006 15:10:16 -0000 1.16 +++ evfs_cleanup.c 22 Apr 2006 03:16:58 -0000 1.17 @@ -124,7 +124,10 @@ { /*We don't want to free the operation - the command owns this, * unless we're a client*/ - /*FIXME identify if we're the client, and free */ + if (evfs_object_client_is_get()) { + IF_FREE(event->op->misc_str); + free(event->op); + } } void @@ -142,9 +145,19 @@ free(obj); } evas_list_free(event->meta->meta_list); - free(event->meta); - /*FIXME - id if client, free hash*/ + if (evfs_object_client_is_get()) { + Ecore_List* keys; + char* key; + keys = ecore_hash_keys(event->meta->meta_hash); + while ( (key = ecore_list_remove_first(keys))) { + ecore_hash_remove(event->meta->meta_hash, key); + free(key); + } + ecore_hash_destroy(event->meta->meta_hash); + ecore_list_destroy(keys); + } + free(event->meta); } void |
From: Enlightenment C. <no...@cv...> - 2006-04-22 03:17:42
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/include Modified Files: evfs_misc.h Log Message: * Do a few reaps if the object is a client =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/include/evfs_misc.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- evfs_misc.h 5 Apr 2006 05:39:05 -0000 1.8 +++ evfs_misc.h 22 Apr 2006 03:16:58 -0000 1.9 @@ -1,6 +1,8 @@ #ifndef _EVFS_MISC_H_ #define _EVFS_MISC_H_ +#define IF_FREE(obj) if (obj) free(obj) + typedef struct evfs_command_client { evfs_client *client; |
From: Enlightenment C. <no...@cv...> - 2006-04-22 03:24:48
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/include Modified Files: evfs_misc.h Log Message: * Wrap IF_FREE in an ifdef, to prevent redef warnings =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/include/evfs_misc.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- evfs_misc.h 22 Apr 2006 03:16:58 -0000 1.9 +++ evfs_misc.h 22 Apr 2006 03:24:05 -0000 1.10 @@ -1,7 +1,9 @@ #ifndef _EVFS_MISC_H_ #define _EVFS_MISC_H_ -#define IF_FREE(obj) if (obj) free(obj) +#ifndef IF_FREE + #define IF_FREE(obj) if (obj) free(obj) +#endif typedef struct evfs_command_client { |
From: Enlightenment C. <no...@cv...> - 2006-04-22 06:51:37
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/bin Modified Files: evfs_main.c evfs_operation.c evfs_server_handle.c Log Message: * Misc bugfixes * Leak fix =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/bin/evfs_main.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -3 -r1.44 -r1.45 --- evfs_main.c 22 Apr 2006 03:09:18 -0000 1.44 +++ evfs_main.c 22 Apr 2006 06:50:25 -0000 1.45 @@ -392,18 +392,10 @@ } int -ecore_timer_enterer(__UNUSED__ void *data) -{ - evfs_operation_queue_run(); - - return 1; -} - -int incoming_command_cb(__UNUSED__ void *data) { int clean =0; - + evfs_command_client *com_cli = ecore_list_remove_first(server->incoming_command_list); @@ -418,6 +410,15 @@ } int +ecore_timer_enterer(__UNUSED__ void *data) +{ + incoming_command_cb(NULL); + evfs_operation_queue_run(); + + return 1; +} + +int main(int argc, char **argv) { /*Init the ipc server */ @@ -434,7 +435,7 @@ server->clientCounter = 0; server->incoming_command_list = ecore_list_new(); - ecore_idle_enterer_add(incoming_command_cb, NULL); + //ecore_idle_enterer_add(incoming_command_cb, NULL); /*Identify that we are a server*/ evfs_object_server_is_set(); @@ -471,6 +472,7 @@ ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DATA, ipc_client_data, NULL); } + ecore_main_loop_begin(); =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/bin/evfs_operation.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- evfs_operation.c 9 Apr 2006 09:02:43 -0000 1.12 +++ evfs_operation.c 22 Apr 2006 06:50:25 -0000 1.13 @@ -385,7 +385,7 @@ ecore_list_next(op->sub_task); } } else { - printf("Operation is in user wait state!\n"); + //printf("Operation is in user wait state!\n"); } } else { /*If task is null, operation is completed!*/ =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/bin/evfs_server_handle.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -3 -r1.52 -r1.53 --- evfs_server_handle.c 21 Apr 2006 15:10:16 -0000 1.52 +++ evfs_server_handle.c 22 Apr 2006 06:50:25 -0000 1.53 @@ -420,6 +420,7 @@ if (plugin && dst_plugin) { + /*Check for supported options */ if (!(EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_lstat && EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_open && @@ -432,11 +433,16 @@ return; } + + /*Get the source file size */ (*EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_lstat) (command, &file_stat, 0); + res = (*EVFS_PLUGIN_FILE(dst_plugin)->functions->evfs_file_lstat) (command, &dest_stat, 1); + + if (!S_ISDIR(file_stat.st_mode)) { evfs_operation_copy_task_add(EVFS_OPERATION(op), @@ -498,6 +504,9 @@ } + printf("4\n"); + + /*Only send '100%' event when we're back at the top, or we aren't recursive */ if (command == root_command) { /*evfs_file_progress_event_create(client, command, root_command, 100, |
From: Enlightenment C. <no...@cv...> - 2006-04-22 06:51:38
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/plugins/file Modified Files: evfs_fs_sftp.c Log Message: * Misc bugfixes * Leak fix =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/plugins/file/evfs_fs_sftp.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- evfs_fs_sftp.c 21 Apr 2006 15:10:17 -0000 1.1 +++ evfs_fs_sftp.c 22 Apr 2006 06:50:25 -0000 1.2 @@ -890,10 +890,8 @@ int rid; SftpGenericHandle* handle; + sftp_split_host_path(command->file_command.files[i]->path, &host, &path); - sftp_split_host_path(command->file_command.files[0]->path, &host, &path); - - if ( !(conn = sftp_get_connection_for_host(host))) { conn = sftp_connect(host); } |
From: Enlightenment C. <no...@cv...> - 2006-04-22 06:51:38
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/lib Modified Files: libevfs.c Log Message: * Misc bugfixes * Leak fix =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/lib/libevfs.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -3 -r1.37 -r1.38 --- libevfs.c 5 Apr 2006 05:39:05 -0000 1.37 +++ libevfs.c 22 Apr 2006 06:50:25 -0000 1.38 @@ -445,7 +445,7 @@ evfs_file_uri_path *path = NEW(evfs_file_uri_path); Ecore_DList *tokens; - //printf("Parsing URI '%s'\n", uri); + printf("Parsing URI '%s'\n", uri); /*for (i=0;i<strlen(uri);i++) { * printf("URI Input: '%s'\n", uri); |
From: Enlightenment C. <no...@cv...> - 2006-04-22 06:51:38
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/common Modified Files: evfs_io.c Log Message: * Misc bugfixes * Leak fix =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/common/evfs_io.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -3 -r1.54 -r1.55 --- evfs_io.c 22 Apr 2006 03:09:18 -0000 1.54 +++ evfs_io.c 22 Apr 2006 06:50:25 -0000 1.55 @@ -735,7 +735,6 @@ char* data; int size; evfs_filereference *ref = command->file_command.files[i]; - data = eet_data_descriptor_encode(_evfs_filereference_edd, ref, &size); @@ -837,7 +836,6 @@ eet_data_descriptor_decode(_evfs_filereference_edd, message->data, message->len); - if (command->file_command.num_files == 0) { |
From: Enlightenment C. <no...@cv...> - 2006-04-23 12:39:03
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/lib Modified Files: libevfs.c Log Message: * Fix invalid free =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/lib/libevfs.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -3 -r1.38 -r1.39 --- libevfs.c 22 Apr 2006 06:50:25 -0000 1.38 +++ libevfs.c 23 Apr 2006 12:38:15 -0000 1.39 @@ -445,7 +445,7 @@ evfs_file_uri_path *path = NEW(evfs_file_uri_path); Ecore_DList *tokens; - printf("Parsing URI '%s'\n", uri); + //printf("Parsing URI '%s'\n", uri); /*for (i=0;i<strlen(uri);i++) { * printf("URI Input: '%s'\n", uri); |
From: Enlightenment C. <no...@cv...> - 2006-04-23 12:39:31
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/bin Modified Files: evfs_operation_tasks.c Log Message: * Fix invalid free =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/bin/evfs_operation_tasks.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- evfs_operation_tasks.c 21 Apr 2006 15:10:16 -0000 1.6 +++ evfs_operation_tasks.c 23 Apr 2006 12:38:15 -0000 1.7 @@ -1,6 +1,6 @@ #include "evfs.h" -#define TASK_COPY_ITERATIONS 20 +#define TASK_COPY_ITERATIONS 1 int evfs_operation_tasks_file_copy_run(evfs_operation* op, evfs_operation_task_file_copy* copy) |
From: Enlightenment C. <no...@cv...> - 2006-04-23 12:39:31
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/common Modified Files: evfs_cleanup.c Log Message: * Fix invalid free =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/common/evfs_cleanup.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- evfs_cleanup.c 22 Apr 2006 03:16:58 -0000 1.17 +++ evfs_cleanup.c 23 Apr 2006 12:38:15 -0000 1.18 @@ -136,22 +136,14 @@ evfs_meta_obj* obj; Evas_List* l = event->meta->meta_list; - for (; l ;) { - obj = l->data; - l = evas_list_remove(event->meta->meta_list, obj); - - free(obj->key); - free(obj->value); - free(obj); - } - evas_list_free(event->meta->meta_list); - if (evfs_object_client_is_get()) { Ecore_List* keys; char* key; + char* value; keys = ecore_hash_keys(event->meta->meta_hash); while ( (key = ecore_list_remove_first(keys))) { - ecore_hash_remove(event->meta->meta_hash, key); + value = ecore_hash_remove(event->meta->meta_hash, key); + IF_FREE(value); free(key); } ecore_hash_destroy(event->meta->meta_hash); |
From: Enlightenment C. <no...@cv...> - 2006-04-23 13:35:20
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/common Modified Files: evfs_cleanup.c evfs_event_helper.c evfs_io.c Log Message: * Null check wrappers =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/common/evfs_cleanup.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- evfs_cleanup.c 23 Apr 2006 12:38:15 -0000 1.18 +++ evfs_cleanup.c 23 Apr 2006 13:34:36 -0000 1.19 @@ -136,14 +136,24 @@ evfs_meta_obj* obj; Evas_List* l = event->meta->meta_list; + if (!evfs_object_client_is_get()) { + for (; l ;) { + obj = l->data; + l = evas_list_remove(event->meta->meta_list, obj); + + free(obj->key); + free(obj->value); + free(obj); + } + evas_list_free(event->meta->meta_list); + } + if (evfs_object_client_is_get()) { Ecore_List* keys; char* key; - char* value; keys = ecore_hash_keys(event->meta->meta_hash); while ( (key = ecore_list_remove_first(keys))) { - value = ecore_hash_remove(event->meta->meta_hash, key); - IF_FREE(value); + ecore_hash_remove(event->meta->meta_hash, key); free(key); } ecore_hash_destroy(event->meta->meta_hash); =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/common/evfs_event_helper.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- evfs_event_helper.c 21 Apr 2006 15:10:16 -0000 1.26 +++ evfs_event_helper.c 23 Apr 2006 13:34:36 -0000 1.27 @@ -152,6 +152,8 @@ event->type = EVFS_EV_METADATA; event->meta = calloc(1, sizeof(evfs_event_meta)); + + printf("Ret list is: %p\n", ret_list); event->meta->meta_list = ret_list; evfs_write_event(client, command, event); =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/common/evfs_io.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -3 -r1.55 -r1.56 --- evfs_io.c 22 Apr 2006 06:50:25 -0000 1.55 +++ evfs_io.c 23 Apr 2006 13:34:36 -0000 1.56 @@ -505,18 +505,22 @@ /*Now we have to push this list to a hash..*/ event->meta = meta; - event->meta->meta_hash = ecore_hash_new(ecore_str_hash, ecore_str_compare); - - for (l = event->meta->meta_list; l; ) { - obj = l->data; - l = evas_list_remove(event->meta->meta_list, l->data); - - ecore_hash_set(event->meta->meta_hash, obj->key, obj->value); - free(obj); + if (event->meta) { + event->meta->meta_hash = ecore_hash_new(ecore_str_hash, ecore_str_compare); + for (l = event->meta->meta_list; l; ) { + obj = l->data; + l = evas_list_remove(event->meta->meta_list, l->data); + + ecore_hash_set(event->meta->meta_hash, obj->key, obj->value); + free(obj); + + } + evas_list_free(event->meta->meta_list); + } else { + printf("No meta data object!\n"); } - evas_list_free(event->meta->meta_list); - + } break; |
From: Enlightenment C. <no...@cv...> - 2006-04-23 13:35:20
|
Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs Dir : e17/apps/evfs/src/plugins/meta Modified Files: evfs_meta_audio.c Log Message: * Null check wrappers =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/plugins/meta/evfs_meta_audio.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- evfs_meta_audio.c 21 Apr 2006 15:10:17 -0000 1.1 +++ evfs_meta_audio.c 23 Apr 2006 13:34:36 -0000 1.2 @@ -75,14 +75,14 @@ Evas_List* ret_list = NULL; evfs_meta_obj* obj; - + taglib_file = taglib_file_new(command->file_command.files[0]->path); - if (!taglib_file) goto done; + if (!taglib_file) goto faildone; taglib_tag = taglib_file_tag(taglib_file); if (!taglib_tag) { taglib_file_free(taglib_file); - goto done; + goto faildone; } tmp = taglib_tag_artist(taglib_tag); @@ -92,6 +92,11 @@ obj->value = strdup(tmp); ret_list = evas_list_append(ret_list, obj); + } else { + obj = calloc(1,sizeof(evfs_meta_obj)); + obj->key = strdup("artist"); + obj->value = NULL; + ret_list = evas_list_append(ret_list, obj); } tmp = taglib_tag_title(taglib_tag); @@ -100,7 +105,11 @@ obj->key = strdup("title"); obj->value = strdup(tmp); ret_list = evas_list_append(ret_list, obj); - + } else { + obj = calloc(1,sizeof(evfs_meta_obj)); + obj->key = strdup("title"); + obj->value = NULL; + ret_list = evas_list_append(ret_list, obj); } taglib_props = taglib_file_audioproperties(taglib_file); @@ -112,9 +121,22 @@ obj->value = strdup(buf); ret_list = evas_list_append(ret_list, obj); + } else { + obj = calloc(1,sizeof(evfs_meta_obj)); + obj->key = strdup("length"); + obj->value = NULL; + ret_list = evas_list_append(ret_list, obj); } taglib_file_free(taglib_file); + + goto done; + + faildone: + obj = calloc(1,sizeof(evfs_meta_obj)); + obj->key = strdup("file"); + obj->value = strdup("invalid"); + ret_list = evas_list_append(ret_list, obj); done: return ret_list; |