Enlightenment CVS committal

Author  : lordchaos
Project : e17
Module  : apps/evfs

Dir     : e17/apps/evfs/src/bin


Modified Files:
        Makefile.am evfs_main.c evfs_server_handle.c 


Log Message:
* File refernces owned by the server now have a reference to the server object
* Nested URIs now work - i.e. tar over posix, tar over samba etc
* More complete/correct URI parser, also allows for nesting
* Miscellaneous cleanups


===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/bin/Makefile.am,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- Makefile.am 24 Oct 2005 09:13:12 -0000      1.6
+++ Makefile.am 26 Oct 2005 02:20:00 -0000      1.7
@@ -15,6 +15,7 @@
        $(top_srcdir)/src/common/evfs_new.c \
        $(top_srcdir)/src/common/evfs_io.c \
        $(top_srcdir)/src/common/evfs_event_helper.c \
+       $(top_srcdir)/src/common/evfs_common.c \
        evfs_server_handle.c
 
 evfs_LDADD = -L$(top_builddir)/src/lib -levfs @ecore_libs@ @xml2_libs@
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/bin/evfs_main.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- evfs_main.c 22 Oct 2005 09:09:55 -0000      1.20
+++ evfs_main.c 26 Oct 2005 02:20:00 -0000      1.21
@@ -52,10 +52,6 @@
        return ecore_hash_get(server->client_hash, client);
 }
 
-evfs_plugin* evfs_get_plugin_for_uri(char* uri_base) {
-       return ecore_hash_get(server->plugin_uri_hash, uri_base);
-}
-
 unsigned long evfs_server_get_next_id(evfs_server* serve) {
        serve->clientCounter++;
        printf("Allocated %ld\n", serve->clientCounter-1);
@@ -74,6 +70,7 @@
 
       client = NEW(evfs_client);
       client->client = e->client;
+      client->server = server;
       client->prog_command = NULL;
       client->id = evfs_server_get_next_id(server);
       ecore_hash_set(server->client_hash, client->client, client);
@@ -138,7 +135,7 @@
    }
 
    /*True == command finished*/
-   if (evfs_process_incoming_command(client->prog_command, msg)) {
+   if (evfs_process_incoming_command(server, client->prog_command, msg)) {
          evfs_handle_command(client, client->prog_command);
          
 
@@ -178,6 +175,7 @@
                        evfs_handle_file_stat_command(client,command);
                        break;
                case EVFS_CMD_LIST_DIR:
+                       printf("6. Assinged parent to '%s'\n", 
command->file_command.files[0]->parent->plugin_uri );
                        evfs_handle_dir_list_command(client,command);
                        printf("List directory stub\n");
                        break;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/bin/evfs_server_handle.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- evfs_server_handle.c        17 Oct 2005 10:57:30 -0000      1.9
+++ evfs_server_handle.c        26 Oct 2005 02:20:00 -0000      1.10
@@ -1,12 +1,45 @@
 #include <evfs.h>
 #include <dlfcn.h>
 
+
+/*---------------------------------------------------*/
+/*Move these functions somewhere*/
+
+void evfs_uri_open(evfs_server* server, evfs_filereference* uri) {
+       evfs_plugin* plugin = evfs_get_plugin_for_uri(server,uri->plugin_uri);
+       if (plugin) {
+               printf("Opening file..\n");
+               (*plugin->functions->evfs_file_open)(uri);              
+       } else {
+               printf("Could not get plugin for uri '%s' at evfs_uri_open\n", 
uri->plugin_uri);
+       }
+}
+
+int evfs_uri_read(evfs_filereference* uri, char* bytes, long size) {
+       evfs_plugin* plugin = 
evfs_get_plugin_for_uri(uri->server,uri->plugin_uri);
+       if (plugin) {
+               return (*plugin->functions->evfs_file_read)(uri,bytes,size);    
        
+       } else {
+               printf("Could not get plugin for uri '%s' at evfs_uri_open\n", 
uri->plugin_uri);
+               return -1;
+       }
+}
+
+/*---------------------------------------------------*/
+
+
+
+
+
+
+
+
 void evfs_handle_monitor_start_command(evfs_client* client, evfs_command* 
command) {
        /*First get the plugin responsible for this file*/
 
 
        if (command->file_command.num_files > 0) {
-               evfs_plugin* plugin = 
evfs_get_plugin_for_uri(command->file_command.files[0]->plugin_uri);
+               evfs_plugin* plugin = 
evfs_get_plugin_for_uri(client->server,command->file_command.files[0]->plugin_uri);
 
                if (!plugin) {
                        printf("No plugin able to monitor this uri type\n");
@@ -26,7 +59,7 @@
        void (*evfs_monitor_start)(evfs_client* client, evfs_command* command);
 
        if (command->file_command.num_files > 0) {
-               evfs_plugin* plugin = 
evfs_get_plugin_for_uri(command->file_command.files[0]->plugin_uri);
+               evfs_plugin* plugin = evfs_get_plugin_for_uri(client->server, 
command->file_command.files[0]->plugin_uri);
 
                if (!plugin) {
                        printf("No plugin able to monitor this uri type\n");
@@ -47,7 +80,7 @@
 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);
+       evfs_plugin* plugin = evfs_get_plugin_for_uri(client->server, 
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);
@@ -58,7 +91,7 @@
 void evfs_handle_file_rename_command(evfs_client* client, evfs_command* 
command) {
        printf("At rename handle\n");
 
-       evfs_plugin* plugin = 
evfs_get_plugin_for_uri(command->file_command.files[0]->plugin_uri);
+       evfs_plugin* plugin = evfs_get_plugin_for_uri(client->server, 
command->file_command.files[0]->plugin_uri);
        if (plugin) {
                printf("Pointer here: %p\n", 
plugin->functions->evfs_file_rename);
                (*plugin->functions->evfs_file_rename)(client,command);
@@ -70,7 +103,7 @@
        
        printf ("At file stat handler\n");
        printf("Looking for plugin for '%s'\n", 
command->file_command.files[0]->plugin_uri);
-       evfs_plugin* plugin = 
evfs_get_plugin_for_uri(command->file_command.files[0]->plugin_uri);
+       evfs_plugin* plugin = evfs_get_plugin_for_uri(client->server, 
command->file_command.files[0]->plugin_uri);
        if (plugin) {
                printf("Pointer here: %p\n", plugin->functions->evfs_file_stat);
                (*(plugin->functions->evfs_file_stat))(command, &file_stat);
@@ -85,10 +118,14 @@
 void evfs_handle_dir_list_command(evfs_client* client, evfs_command* command) {
        printf ("At dir list handler\n");
 
-       evfs_plugin* plugin = 
evfs_get_plugin_for_uri(command->file_command.files[0]->plugin_uri);
+       printf("1. Parent is '%s'\n", 
command->file_command.files[0]->parent->plugin_uri);
+       
+       evfs_plugin* plugin = evfs_get_plugin_for_uri(client->server, 
command->file_command.files[0]->plugin_uri);
        if (plugin) {
                printf("Pointer here: %p\n", plugin->functions->evfs_dir_list);
                (*plugin->functions->evfs_dir_list)(client,command);
+       } else {
+               printf("No plugin for '%s'\n", 
command->file_command.files[0]->plugin_uri);
        }
 
 }
@@ -113,8 +150,8 @@
        
        
 
-       plugin = 
evfs_get_plugin_for_uri(command->file_command.files[0]->plugin_uri);
-       dst_plugin = 
evfs_get_plugin_for_uri(command->file_command.files[1]->plugin_uri);
+       plugin = evfs_get_plugin_for_uri(client->server, 
command->file_command.files[0]->plugin_uri);
+       dst_plugin = evfs_get_plugin_for_uri(client->server, 
command->file_command.files[1]->plugin_uri);
        
        if (plugin && dst_plugin) {
                
(*dst_plugin->functions->evfs_file_create)(command->file_command.files[1]);
@@ -122,7 +159,7 @@
 
                /*Get the source file size*/
                (*plugin->functions->evfs_file_stat)(command, &file_stat);
-               printf("Source file size: %d bytes\n", file_stat.st_size);
+               printf("Source file size: %d bytes\n", (int)file_stat.st_size);
                
                
                count = 0;




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to