Enlightenment CVS committal Author : lordchaos Project : e17 Module : apps/evfs
Dir : e17/apps/evfs/src/bin Modified Files: evfs_main.c evfs_server_handle.c Log Message: Added file remove, implemented function pointers for callbacks on plugin init. TODO: Doc this before it gets too complicated =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/bin/evfs_main.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- evfs_main.c 18 Aug 2005 05:17:57 -0000 1.9 +++ evfs_main.c 19 Aug 2005 12:15:10 -0000 1.10 @@ -107,6 +107,7 @@ int ipc_client_data(void *data, int type, void *event) { + Ecore_Ipc_Event_Client_Data *e = (Ecore_Ipc_Event_Client_Data*) event; evfs_client* client; @@ -124,7 +125,8 @@ if (evfs_process_incoming_command(client->prog_command, msg)) { evfs_handle_command(client, client->prog_command); - client->prog_command = NULL; /*TODO - CLEANUP MEMORY HERE*/ + evfs_cleanup_command(client->prog_command); /*CLEANUP MEMORY HERE*/ + client->prog_command = NULL; } @@ -151,6 +153,10 @@ case EVFS_CMD_MOVE_FILE: printf("Move file stub\n"); break; + case EVFS_CMD_REMOVE_FILE: + printf("Remove file stub\n"); + evfs_handle_file_remove_command(client,command); + break; case EVFS_CMD_LIST_DIR: printf("List directory stub\n"); break; @@ -163,7 +169,7 @@ evfs_plugin* plugin = NEW(evfs_plugin); char* (*evfs_plugin_uri_get)(); - void (*evfs_plugin_init)(); + evfs_plugin_functions* (*evfs_plugin_init)(); printf("Loading plugin: %s\n", filename); plugin->dl_ref = dlopen(filename, RTLD_LAZY); @@ -177,7 +183,7 @@ /*Execute the init function, if it's there..*/ evfs_plugin_init = dlsym(plugin->dl_ref, "evfs_plugin_init"); if (evfs_plugin_init) { - (*evfs_plugin_init)(); + plugin->functions = (*evfs_plugin_init)(); } } else { printf("Error - plugin file does not contain uri identify function - %s\n", filename); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/bin/evfs_server_handle.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- evfs_server_handle.c 16 Aug 2005 09:00:19 -0000 1.2 +++ evfs_server_handle.c 19 Aug 2005 12:15:10 -0000 1.3 @@ -13,11 +13,7 @@ printf("No plugin able to monitor this uri type\n"); } else { printf("Requesting a file monitor from this plugin for uri type '%s'\n", command->file_command.files[0]->plugin_uri ); - - evfs_monitor_start = dlsym(plugin->dl_ref, EVFS_FUNCTION_MONITOR_START); - if (evfs_monitor_start) { - (*evfs_monitor_start)(client,command); - } + (*plugin->functions->evfs_monitor_start)(client,command); } } else { @@ -48,3 +44,13 @@ printf("No files to monitor!\n"); } } + +void evfs_handle_file_remove_command(evfs_client* client, evfs_command* command) { + printf("At remove handle\n"); + + evfs_plugin* plugin = evfs_get_plugin_for_uri(command->file_command.files[0]->plugin_uri); + if (plugin) { + printf("Pointer here: %p\n", plugin->functions->evfs_file_remove); + (*plugin->functions->evfs_file_remove)(command->file_command.files[0]->path); + } +} ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs