Enlightenment CVS committal Author : lordchaos Project : e17 Module : proto
Dir : e17/proto/entropy/src Modified Files: entropy_file.c Log Message: * In the spirit of keepin' up with EFM, entropy now loads large directories in chunks =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/entropy_file.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- entropy_file.c 2 Nov 2005 11:52:30 -0000 1.4 +++ entropy_file.c 10 Nov 2005 11:38:05 -0000 1.5 @@ -30,7 +30,7 @@ print_allocation(); } -Ecore_List* entropy_generic_file_list_sort(Ecore_List* file_list) { +/*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; @@ -66,4 +66,39 @@ return new_list; +}*/ + + +int entropy_generic_file_path_compare(entropy_generic_file* file1, entropy_generic_file* file2) { + return strcasecmp(file1->filename, file2->filename); + } + + +Ecore_List* entropy_generic_file_list_sort(Ecore_List* file_list) { + + Ecore_Sheap *heap; + entropy_generic_file* f; + + /* + * Push the data into a heap. + */ + heap = ecore_sheap_new(ECORE_COMPARE_CB(entropy_generic_file_path_compare), ecore_list_nodes(file_list)); + while ((f = ecore_list_remove_first(file_list))) + { + ecore_sheap_insert(heap, f); + } + + /* + * Extract in sorted order. + */ + while ((f = ecore_sheap_extract(heap))) + { + ecore_list_append(file_list, f); + } + + ecore_list_goto_first(file_list); + ecore_sheap_destroy(heap); + + return file_list; + } ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs