Enlightenment CVS committal

Author  : lordchaos
Project : e17
Module  : apps/evfs

Dir     : e17/apps/evfs/src/plugins


Modified Files:
        Makefile.am evfs_fs_posix.c evfs_fs_samba.c 


Log Message:
* Cleanups
* Recursive file delete (be careful!)
* Sort results of directory lists

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/plugins/Makefile.am,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- Makefile.am 20 Nov 2005 01:27:24 -0000      1.14
+++ Makefile.am 27 Dec 2005 11:44:37 -0000      1.15
@@ -31,7 +31,8 @@
 
 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_event_helper.c \
+                       $(top_srcdir)/src/common/evfs_misc.c
                        
 
 tar_la_SOURCES = evfs_fs_tar.c \
@@ -55,7 +56,8 @@
 
 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_event_helper.c \
+                       $(top_srcdir)/src/common/evfs_misc.c
 
 ftp_la_SOURCES = evfs_fs_ftp.c \
                         $(top_srcdir)/src/common/evfs_debug.c \
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/plugins/evfs_fs_posix.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- evfs_fs_posix.c     11 Dec 2005 06:30:33 -0000      1.24
+++ evfs_fs_posix.c     27 Dec 2005 11:44:37 -0000      1.25
@@ -1,28 +1,28 @@
-/*
+       /*
 
-Copyright (C) 2000, 2001 Christian Kreibich <[EMAIL PROTECTED]>.
-Adopted for EVFS by Alex Taylor
+       Copyright (C) 2000, 2001 Christian Kreibich <[EMAIL PROTECTED]>.
+       Adopted for EVFS by Alex Taylor
 
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies of the Software and its documentation and acknowledgment shall be
-given in the documentation and software packages that this Software was
-used.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+       Permission is hereby granted, free of charge, to any person obtaining a 
copy
+       of this software and associated documentation files (the "Software"), to
+       deal in the Software without restriction, including without limitation 
the
+       rights to use, copy, modify, merge, publish, distribute, sublicense, 
and/or
+       sell copies of the Software, and to permit persons to whom the Software 
is
+       furnished to do so, subject to the following conditions:
+
+       The above copyright notice and this permission notice shall be included 
in
+       all copies of the Software and its documentation and acknowledgment 
shall be
+       given in the documentation and software packages that this Software was
+       used.
+
+       THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
OR
+       IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+       FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+       THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+       IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+       CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.
 
-*/
+       */
 #if HAVE_CONFIG_H
 # include <config.h>
 #endif
@@ -41,104 +41,104 @@
 #include <Ecore_File.h>
 
 
-/*Main file wrappers*/
-int evfs_file_remove(char* src);
-int evfs_file_rename(char* src, char* dst);
-
-int evfs_client_disconnect(evfs_client* client);
-int evfs_monitor_start(evfs_client* client, evfs_command* command);
-int evfs_monitor_stop(evfs_client* client, evfs_command* command);
-int evfs_file_open(evfs_client* client, evfs_filereference* file);
-int evfs_file_close(evfs_filereference* file);
-int evfs_file_stat(evfs_command* command, struct stat* file_stat);
-int evfs_file_seek(evfs_filereference* file, long offset, int whence);
-int evfs_file_read(evfs_client* client, evfs_filereference* file, char* bytes, 
long size);
-int evfs_file_write(evfs_filereference* file, char* bytes, long size);
-int evfs_file_create(evfs_filereference* file);
-int evfs_file_mkdir(evfs_filereference* file);
-void evfs_dir_list(evfs_client* client, evfs_command* command, Ecore_List** 
directory_list);
-
-
-/*Internal functions*/
-/* Real data-copying routine, handling holes etc. Returns outcome
-   upon return: 0 when successful, -1 when not.
-*/
-/*static int data_copy(char *src_path, struct stat *src_st, char *dst_path);
-static int file_copy(char *src_path, struct stat *src_st, char *dst_path);
-static int dir_copy(char *src_path, struct stat *src_st, char *dst_path);
-static int file_move(char *src_path, struct stat *src_st, char *dst_path);
-static int dir_move(char *src_path, char *dst_path);
-static int file_remove(char *path, struct stat *st);*/
+       /*Main file wrappers*/
+       int evfs_file_remove(char* src);
+       int evfs_file_rename(char* src, char* dst);
 
+       int evfs_client_disconnect(evfs_client* client);
+       int evfs_monitor_start(evfs_client* client, evfs_command* command);
+       int evfs_monitor_stop(evfs_client* client, evfs_command* command);
+       int evfs_file_open(evfs_client* client, evfs_filereference* file);
+       int evfs_file_close(evfs_filereference* file);
+       int evfs_file_stat(evfs_command* command, struct stat* file_stat);
+       int evfs_file_seek(evfs_filereference* file, long offset, int whence);
+       int evfs_file_read(evfs_client* client, evfs_filereference* file, char* 
bytes, long size);
+       int evfs_file_write(evfs_filereference* file, char* bytes, long size);
+       int evfs_file_create(evfs_filereference* file);
+       int evfs_file_mkdir(evfs_filereference* file);
+       void evfs_dir_list(evfs_client* client, evfs_command* command, 
Ecore_List** directory_list);
 
 
-/*Misc functions -----------------------------------------*/
-int    evfs_misc_remove(char *filename);
-void evfs_posix_monitor_remove(evfs_client* client, char* path);
+       /*Internal functions*/
+       /* Real data-copying routine, handling holes etc. Returns outcome
+          upon return: 0 when successful, -1 when not.
+       */
+       /*static int data_copy(char *src_path, struct stat *src_st, char 
*dst_path);
+       static int file_copy(char *src_path, struct stat *src_st, char 
*dst_path);
+       static int dir_copy(char *src_path, struct stat *src_st, char 
*dst_path);
+       static int file_move(char *src_path, struct stat *src_st, char 
*dst_path);
+       static int dir_move(char *src_path, char *dst_path);
+       static int file_remove(char *path, struct stat *st);*/
 
 
 
+       /*Misc functions -----------------------------------------*/
+       int    evfs_misc_remove(char *filename);
+       void evfs_posix_monitor_remove(evfs_client* client, char* path);
 
-Ecore_Hash* posix_monitor_hash;
 
-evfs_plugin_functions* evfs_plugin_init() {
-       printf("Initialising the posix plugin..\n");
-       evfs_plugin_functions* functions = calloc(1, 
sizeof(evfs_plugin_functions));
-       
-       posix_monitor_hash = ecore_hash_new(ecore_str_hash, ecore_str_compare);
 
-       functions->evfs_client_disconnect = &evfs_client_disconnect;
-       
-       functions->evfs_file_remove= &evfs_file_remove;
-       functions->evfs_monitor_start = &evfs_monitor_start;
-       functions->evfs_monitor_stop = &evfs_monitor_stop;
-       functions->evfs_file_stat = &evfs_file_stat;
-       functions->evfs_file_open = &evfs_file_open;
-       functions->evfs_file_close = &evfs_file_close;
-       functions->evfs_dir_list = &evfs_dir_list;
-       
-       
-       functions->evfs_file_seek = &evfs_file_seek;
-       functions->evfs_file_read = &evfs_file_read;
-       functions->evfs_file_write = &evfs_file_write;
-       functions->evfs_file_create = &evfs_file_create;
-       functions->evfs_file_mkdir = &evfs_file_mkdir;
-       return functions;
 
-       
-}
+       Ecore_Hash* posix_monitor_hash;
 
-char* evfs_plugin_uri_get() {
-       return "posix";
-}
+       evfs_plugin_functions* evfs_plugin_init() {
+               printf("Initialising the posix plugin..\n");
+               evfs_plugin_functions* functions = calloc(1, 
sizeof(evfs_plugin_functions));
+               
+               posix_monitor_hash = ecore_hash_new(ecore_str_hash, 
ecore_str_compare);
 
+               functions->evfs_client_disconnect = &evfs_client_disconnect;
+               
+               functions->evfs_file_remove= &evfs_file_remove;
+               functions->evfs_monitor_start = &evfs_monitor_start;
+               functions->evfs_monitor_stop = &evfs_monitor_stop;
+               functions->evfs_file_stat = &evfs_file_stat;
+               functions->evfs_file_open = &evfs_file_open;
+               functions->evfs_file_close = &evfs_file_close;
+               functions->evfs_dir_list = &evfs_dir_list;
+               
+               
+               functions->evfs_file_seek = &evfs_file_seek;
+               functions->evfs_file_read = &evfs_file_read;
+               functions->evfs_file_write = &evfs_file_write;
+               functions->evfs_file_create = &evfs_file_create;
+               functions->evfs_file_mkdir = &evfs_file_mkdir;
+               return functions;
 
-int
-evfs_client_disconnect(evfs_client* client) {
-       Ecore_List* mon_list;
-       Ecore_List* indiv_list;
-       evfs_file_monitor* mon;
-       char* key;
-       Ecore_List* watched_keys = ecore_list_new();
-       
-       printf ("Received disconnect for client at evfs_fs_posix.c for client 
%d\n", client->id);
-       printf ("Scanning monitors for client and removing...\n");
-       
-       mon_list = ecore_hash_keys(posix_monitor_hash);
-       if (mon_list) {
-               while ( (key = ecore_list_remove_first(mon_list))) {
-                       printf("Looking for clients for '%s'\n",key);
+               
+       }
+
+       char* evfs_plugin_uri_get() {
+               return "posix";
+       }
 
-                       indiv_list = ecore_hash_get(posix_monitor_hash, key);
-                       ecore_list_goto_first(indiv_list);
 
-                       while ( (mon = ecore_list_next(indiv_list))) {
-                               if (mon->client == client) {
-                                       ecore_list_append(watched_keys, key);
+       int
+       evfs_client_disconnect(evfs_client* client) {
+               Ecore_List* mon_list;
+               Ecore_List* indiv_list;
+               evfs_file_monitor* mon;
+               char* key;
+               Ecore_List* watched_keys = ecore_list_new();
+               
+               printf ("Received disconnect for client at evfs_fs_posix.c for 
client %d\n", client->id);
+               printf ("Scanning monitors for client and removing...\n");
+               
+               mon_list = ecore_hash_keys(posix_monitor_hash);
+               if (mon_list) {
+                       while ( (key = ecore_list_remove_first(mon_list))) {
+                               printf("Looking for clients for '%s'\n",key);
+
+                               indiv_list = ecore_hash_get(posix_monitor_hash, 
key);
+                               ecore_list_goto_first(indiv_list);
+
+                               while ( (mon = ecore_list_next(indiv_list))) {
+                                       if (mon->client == client) {
+                                               ecore_list_append(watched_keys, 
key);
+                                       } 
                                } 
-                       } 
-               }
-               ecore_list_destroy(mon_list);
+                       }
+                       ecore_list_destroy(mon_list);
        } else {
                printf("No directories/files monitored by any client\n");
        }
@@ -443,12 +443,13 @@
                        }
 
                        ref->path = strdup(full_name);
+                       ref->plugin_uri = strdup("posix");
                        ecore_list_append(files, ref);
                }
        }
        closedir(dir);
 
-       *directory_list = files;
+       *directory_list = evfs_file_list_sort(files);
 
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/plugins/evfs_fs_samba.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- evfs_fs_samba.c     6 Dec 2005 06:16:59 -0000       1.23
+++ evfs_fs_samba.c     27 Dec 2005 11:44:37 -0000      1.24
@@ -311,7 +311,7 @@
                smb_context->closedir(smb_context,dir);
 
                /*Set the return pointer..*/
-               *directory_list = files;
+               *directory_list = evfs_file_list_sort(files);
        } else {
                    printf("Could not open [%s] (%d:%s)\n",dir_path, errno, 
strerror(errno));
        }




-------------------------------------------------------
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