Enlightenment CVS committal
Author : chaos
Project : e17
Module : proto
Dir : e17/proto/entropy/src
Modified Files:
entropy_file.c
Log Message:
* More consistent file sorting throughout
===================================================================
RCS file: /cvs/e/e17/proto/entropy/src/entropy_file.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- entropy_file.c 5 Apr 2006 02:10:54 -0000 1.11
+++ entropy_file.c 20 Apr 2006 06:32:02 -0000 1.12
@@ -46,48 +46,22 @@
}
}
-/*Ecore_List* entropy_generic_file_list_sort(Ecore_List* file_list) {
- Ecore_List* new_list = ecore_list_new();
- entropy_generic_file* file_ins;
- entropy_generic_file* file;
-
- ecore_list_goto_first(file_list);
- while ( (file_ins = ecore_list_remove_first(file_list)) ) {
- int ins = 0;
-
- ecore_list_goto_first(new_list);
- while ( (file = ecore_list_current(new_list)) ) {
- if (strcmp(file_ins->filename, file->filename) < 0) {
- ecore_list_insert(new_list, file_ins);
- ins = 1;
-
- goto out;
- }
-
- ecore_list_next(new_list);
- }
-
- if (!ins) {
- ecore_list_append(new_list, file_ins);
- }
-
-
-
-
- out: ;
-
- }
- ecore_list_destroy(file_list);
-
-
- return new_list;
-
-}*/
-
-
int entropy_generic_file_path_compare(entropy_generic_file* file1,
entropy_generic_file* file2) {
- return strcasecmp(file1->filename, file2->filename);
-
+ int val;
+
+ if (file1 && file2) {
+ val = strcasecmp(file1->filename, file2->filename);
+
+ if ( (!(file1->filetype == FILE_FOLDER)) && file2->filetype ==
FILE_FOLDER)
+ return 1;
+ else if ( (!(file2->filetype == FILE_FOLDER)) && file1->filetype ==
FILE_FOLDER)
+ return -1;
+ else
+ return val;
+ } else {
+ printf("Could not locate file!\n");
+ return 0;
+ }
}
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs