Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/eet

Dir     : e17/libs/eet/src/lib


Modified Files:
        Eet_private.h eet_data.c eet_dictionary.c eet_lib.c 


Log Message:


the rest of cedrics patchesfor fixing dictionaries and read_write

===================================================================
RCS file: /cvs/e/e17/libs/eet/src/lib/Eet_private.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- Eet_private.h       8 Mar 2008 07:28:12 -0000       1.22
+++ Eet_private.h       9 Mar 2008 16:16:40 -0000       1.23
@@ -61,22 +61,23 @@
   const char            *mmap;
   char                  *str;
 
-  struct
-  {
-    unsigned int         converted : 1;
-    unsigned int         is_float : 1;
-  } flags;
+  int                    hash;
+  int                    len;
+
+  int                    next;
+  int                    prev;
+
   union
   {
     float                f;
     double               d;
   } convert;
 
-  int                    hash;
-  int                    len;
-
-  int                    next;
-  int                    prev;
+  struct
+  {
+    unsigned int         converted : 1;
+    unsigned int         is_float : 1;
+  } flags;
 };
 struct _Eet_Dictionary
 {
===================================================================
RCS file: /cvs/e/e17/libs/eet/src/lib/eet_data.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -3 -r1.67 -r1.68
--- eet_data.c  8 Mar 2008 07:28:12 -0000       1.67
+++ eet_data.c  9 Mar 2008 16:16:40 -0000       1.68
@@ -981,10 +981,6 @@
      edd->func.str_alloc = eddc->func.str_alloc;
    if (eddc->func.str_free)
      edd->func.str_free = eddc->func.str_free;
-   if (eddc->func.str_direct_alloc)
-     edd->func.str_direct_alloc = eddc->func.str_direct_alloc;
-   if (eddc->func.str_direct_free)
-     edd->func.str_direct_free = eddc->func.str_direct_free;
    edd->func.list_next = eddc->func.list_next;
    edd->func.list_append = eddc->func.list_append;
    edd->func.list_data = eddc->func.list_data;
===================================================================
RCS file: /cvs/e/e17/libs/eet/src/lib/eet_dictionary.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- eet_dictionary.c    8 Mar 2008 07:28:12 -0000       1.3
+++ eet_dictionary.c    9 Mar 2008 16:16:40 -0000       1.4
@@ -20,9 +20,6 @@
    if (!new)
      return NULL;
 
-   new->count = 0;
-   new->total = 0;
-
    memset(new->hash, -1, sizeof (int) * 256);
 
    return new;
===================================================================
RCS file: /cvs/e/e17/libs/eet/src/lib/eet_lib.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -3 -r1.94 -r1.95
--- eet_lib.c   8 Mar 2008 07:28:12 -0000       1.94
+++ eet_lib.c   9 Mar 2008 16:16:40 -0000       1.95
@@ -29,6 +29,7 @@
 {
    char                 *path;
    FILE                 *fp;
+   FILE                        *readfp;
    Eet_File_Header      *header;
    const unsigned char  *data;
    Eet_Dictionary       *ed;
@@ -818,6 +819,7 @@
         if (eet_test_close(!ef->ed->all, ef)) return NULL;
 
         ef->ed->count = num_dictionary_entries;
+       ef->ed->total = num_dictionary_entries;
        ef->ed->start = start + bytes_dictionary_entries + 
bytes_directory_entries;
        ef->ed->end = ef->ed->start;
 
@@ -1092,6 +1094,7 @@
        if (ef)
          {
             eet_flush2(ef);
+            ef->references++;
             ef->delete_me_now = 1;
             eet_close(ef);
          }
@@ -1104,6 +1107,7 @@
        if (ef)
          {
             ef->delete_me_now = 1;
+            ef->references++;
             eet_close(ef);
          }
        ef = eet_cache_find((char *)file, eet_writers, eet_writers_num);
@@ -1159,6 +1163,7 @@
 
    /* fill some of the members */
    ef->fp = fp;
+   ef->readfp = NULL;
    ef->path = ((char *)ef) + sizeof(Eet_File);
    strcpy(ef->path, file);
    ef->magic = EET_MAGIC_FILE;
@@ -1193,35 +1198,7 @@
    /* we need to delete the original file in read-write mode and re-open for 
writing */
    if (ef->mode == EET_FILE_MODE_READ_WRITE)
      {
-       int i;
-
-       for (i = 0; i < ef->header->directory->size; i++)
-         {
-            Eet_File_Node      *efn;
-
-            for (efn = ef->header->directory->nodes[i]; efn; efn = efn->next)
-              {
-                 if (!efn->free_name)
-                   {
-                      efn->free_name = 1;
-                      efn->name = strdup(efn->name);
-                   }
-              }
-         }
-
-        if (ef->ed)
-          {
-             for (i = 0; i < ef->ed->count; ++i)
-              {
-                 if (ef->ed->all[i].mmap)
-                   {
-                      ef->ed->all[i].str = strdup(ef->ed->all[i].mmap);
-                      ef->ed->all[i].mmap = NULL;
-                   }
-              }
-          }
-
-       fclose(ef->fp);
+       ef->readfp = ef->fp;
        unlink(ef->path);
        ef->fp = fopen(ef->path, "wb");
      }
@@ -1311,8 +1288,8 @@
    eet_dictionary_free(ef->ed);
 
    if (ef->data) munmap((void*)ef->data, ef->data_size);
-
    if (ef->fp) fclose(ef->fp);
+   if (ef->readfp) fclose(ef->readfp);
 
    /* zero out ram for struct - caution tactic against stale memory use */
    memset(ef, 0, sizeof(Eet_File));



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to