Enlightenment CVS committal

Author  : lordchaos
Project : e17
Module  : proto

Dir     : e17/proto/entropy/src


Modified Files:
        entropy_core.c 


Log Message:
* Incremental core reference cleanout

===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/entropy_core.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- entropy_core.c      21 Nov 2005 10:49:21 -0000      1.22
+++ entropy_core.c      21 Nov 2005 11:07:01 -0000      1.23
@@ -502,28 +502,32 @@
 }
 
 
-void entropy_core_selection_engine_init(entropy_core* core) {
-       core->selected_files = ecore_list_new();
+void entropy_core_selection_engine_init() {
+       core_core->selected_files = ecore_list_new();
 }
 
-void entropy_core_selected_file_add(entropy_core* core, entropy_generic_file* 
file) {
-       ecore_list_append(core->selected_files, file);
+void entropy_core_selected_file_add(entropy_generic_file* file) {
+       ecore_list_append(core_core->selected_files, file);
 
        /*We need this file to stay around, so add a reference*/
-       entropy_core_file_cache_add_reference(core, file->md5);
+       entropy_core_file_cache_add_reference(file->md5);
 
        /*Print the filename, for ref*/
        //printf("Retrieved file to clipboard: %s\n", file->filename);
 }
 
-Ecore_List* entropy_core_selected_files_get(entropy_core* core) {
-       return core->selected_files;
+Ecore_List* entropy_core_selected_files_get() {
+       return core_core->selected_files;
 }
 
 
-void entropy_core_selected_files_clear(entropy_core* core) {
-       ecore_list_destroy(core->selected_files);
-       core->selected_files = ecore_list_new();
+void entropy_core_selected_files_clear() {
+       entropy_generic_file* file;
+               
+       while ( (file = ecore_list_remove_first(core_core->selected_files))) {
+               entropy_core_file_cache_remove_reference(file->md5);
+       }
+       
 }
 
 
@@ -907,36 +911,36 @@
 }
 
 
-void entropy_core_file_cache_add(entropy_core* core, char* md5, 
entropy_file_listener* listener) {
+void entropy_core_file_cache_add(char* md5, entropy_file_listener* listener) {
 
-       LOCK(&core->file_cache_mutex);
+       LOCK(&core_core->file_cache_mutex);
        
-       if (!ecore_hash_get(core->file_interest_list, md5)) {
-               ecore_hash_set(core->file_interest_list, md5, listener);
+       if (!ecore_hash_get(core_core->file_interest_list, md5)) {
+               ecore_hash_set(core_core->file_interest_list, md5, listener);
        } else {
                printf("*** BAD: Called set-reference with file already 
cached!\n");
-               entropy_core_file_cache_add_reference(core, md5);
+               entropy_core_file_cache_add_reference(md5);
        }
        file_cache_size++;
        /*printf("File cache goes to %ld\n", file_cache_size);*/
-       UNLOCK(&core->file_cache_mutex);
+       UNLOCK(&core_core->file_cache_mutex);
        
 }
 
-void entropy_core_file_cache_add_reference(entropy_core* core, char* md5) {
-       LOCK(&core->file_cache_mutex);
-       entropy_file_listener* listener = 
ecore_hash_get(core->file_interest_list, md5);
+void entropy_core_file_cache_add_reference(char* md5) {
+       LOCK(&core_core->file_cache_mutex);
+       entropy_file_listener* listener = 
ecore_hash_get(core_core->file_interest_list, md5);
 
        if (listener) {
                listener->count++;
        }
-       UNLOCK(&core->file_cache_mutex);
+       UNLOCK(&core_core->file_cache_mutex);
 }
 
-void entropy_core_file_cache_remove_reference(entropy_core* core, char* md5) {
-       LOCK(&core->file_cache_mutex);
+void entropy_core_file_cache_remove_reference(char* md5) {
+       LOCK(&core_core->file_cache_mutex);
 
-       entropy_file_listener* listener = 
ecore_hash_get(core->file_interest_list, md5);
+       entropy_file_listener* listener = 
ecore_hash_get(core_core->file_interest_list, md5);
 
        if (listener) {
                listener->count--;
@@ -948,13 +952,13 @@
                        entropy_generic_file_destroy(listener->file);
                        free(listener);
 
-                       ecore_hash_remove(core->file_interest_list, md5);
+                       ecore_hash_remove(core_core->file_interest_list, md5);
 
                        file_cache_size--;
 
                } 
        }
-       UNLOCK(&core->file_cache_mutex);
+       UNLOCK(&core_core->file_cache_mutex);
 }
 
 entropy_file_listener* entropy_core_file_cache_retrieve(char* md5) {




-------------------------------------------------------
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. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to