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 
Added Files:
        evfscat.c 


Log Message:
* Added 'evfscat' - similar to unix cat.  Allows such cool things as 'evfscat 
smb://host/filename.mpg | mplayer -cache 8192 -' to play videos from a remote 
filesystem
* Client exposed versions of evfs_open/evfs_close/evfs_read etc
* Integer fd support and hash mappings for remoting of file references to client

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/bin/Makefile.am,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- Makefile.am 21 Nov 2005 11:25:58 -0000      1.11
+++ Makefile.am 6 Dec 2005 06:16:58 -0000       1.12
@@ -1,6 +1,6 @@
 AUTOMAKE_OPTIONS     = 1.7 foreign
 
-bin_PROGRAMS = evfs
+bin_PROGRAMS = evfs evfscat
 
 MAINTAINERCLEANFILES = Makefile.in Makefile
 
@@ -17,6 +17,11 @@
        $(top_srcdir)/src/common/evfs_common.c \
        evfs_server_handle.c
 
+evfscat_SOURCES = \
+       evfscat.c
+
 evfs_LDADD = -L$(top_builddir)/src/lib -levfs @ecore_libs@ @xml2_libs@ 
@eet_libs@
 
+evfscat_LDADD = -L$(top_builddir)/src/lib -levfs @ecore_libs@ @xml2_libs@ 
@eet_libs@
+
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/bin/evfs_main.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- evfs_main.c 9 Nov 2005 09:56:34 -0000       1.26
+++ evfs_main.c 6 Dec 2005 06:16:58 -0000       1.27
@@ -177,6 +177,12 @@
                case EVFS_CMD_LIST_DIR:
                        evfs_handle_dir_list_command(client,command);
                        break;
+               case EVFS_CMD_FILE_OPEN:
+                       evfs_handle_file_open_command(client,command);
+                       break;
+               case EVFS_CMD_FILE_READ:
+                       evfs_handle_file_read_command(client,command);
+                       break;
                case EVFS_CMD_FILE_COPY:
                        printf("File copy handler\n");
                        evfs_handle_file_copy(client,command);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/bin/evfs_server_handle.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- evfs_server_handle.c        20 Nov 2005 19:45:25 -0000      1.23
+++ evfs_server_handle.c        6 Dec 2005 06:16:58 -0000       1.24
@@ -139,6 +139,50 @@
 
 }
 
+void evfs_handle_file_open_command(evfs_client* client, evfs_command* command) 
{
+       
+       printf ("At file open handler\n");
+       printf("Looking for plugin for '%s'\n", 
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_open);
+               (*(plugin->functions->evfs_file_open))(client, 
command->file_command.files[0]);
+
+
+               fprintf(stderr, "Opened file, fd is: %d\n", 
command->file_command.files[0]->fd);
+               evfs_open_event_create(client, command);
+       }
+       printf("Handled event, client is %p\n", client);
+
+}
+
+
+void evfs_handle_file_read_command(evfs_client* client, evfs_command* command) 
{
+       char* bytes;
+       int b_read = 0;
+
+       
+       //printf ("At file read handler, fd is: %d\n", 
command->file_command.files[0]->fd);
+       //printf ("Reading %d bytes\n", command->file_command.extra);
+
+       bytes = malloc(sizeof(char)*command->file_command.extra);
+
+       //printf("Looking for plugin for '%s'\n", 
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_read);
+               b_read = (*(plugin->functions->evfs_file_read))(client, 
command->file_command.files[0], bytes, command->file_command.extra );
+
+               //printf("Bytes read: %d\n", b_read);
+
+
+               evfs_read_event_create(client, command, bytes, b_read);
+       }
+       //printf("Handled event, client is %p\n", client);
+
+}
+
+
 
 void evfs_handle_dir_list_command(evfs_client* client, evfs_command* command) {
 




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to