On Tue, Mar 4, 2008 at 6:38 PM, The Rasterman Carsten Haitzler
<[EMAIL PROTECTED]> wrote:
> On Mon, 3 Mar 2008 15:54:25 +0100 "Cedric BAIL" <[EMAIL PROTECTED]> babbled:
>  decompile isnt broken more than it was :) but still. got a test case for you:
>
>  eet -d sample.edj edje_file out.txt
>
>  this should work and produce a text file dump of the contents much like
>
>  blah "xxxx" {
>   blah "....
>   ...
>  }
>
>  in out.txt
>  :)

Ok, I found some more little bug linked with READ_WRITE_MODE. This
serie of patch fix most of what I found. Edje_editor should work now
and your test case also.

-- 
Cedric BAIL
From db05785668fa8673104eee2d1941e530ff35676f Mon Sep 17 00:00:00 2001
From: Cedric BAIL <[EMAIL PROTECTED]>
Date: Thu, 6 Mar 2008 13:51:55 +0100
Subject: [PATCH] Reorder structure with int on top.

---
 src/lib/Eet_private.h |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/lib/Eet_private.h b/src/lib/Eet_private.h
index c339aa8..b5372ed 100644
--- a/src/lib/Eet_private.h
+++ b/src/lib/Eet_private.h
@@ -59,22 +59,23 @@ struct _Eet_String
   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
 {
-- 
1.5.4.GIT

From 69d1fc425604e086fae8073bb3aa8e1ad3eb4819 Mon Sep 17 00:00:00 2001
From: Cedric BAIL <[EMAIL PROTECTED]>
Date: Thu, 6 Mar 2008 13:52:42 +0100
Subject: [PATCH] Fix error with wrong pointer allocation in case of old descriptor2_new.

---
 src/lib/eet_data.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/src/lib/eet_data.c b/src/lib/eet_data.c
index 09cbf06..b64b58a 100644
--- a/src/lib/eet_data.c
+++ b/src/lib/eet_data.c
@@ -938,10 +938,6 @@ eet_data_descriptor2_new(Eet_Data_Descriptor_Class *eddc)
      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;
-- 
1.5.4.GIT

From cff5f1e964dc0f249d3a04b60a644272487b5d1a Mon Sep 17 00:00:00 2001
From: Cedric BAIL <[EMAIL PROTECTED]>
Date: Thu, 6 Mar 2008 13:54:07 +0100
Subject: [PATCH] Don't initialise to zero already initialised structure.

---
 src/lib/eet_dictionary.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/src/lib/eet_dictionary.c b/src/lib/eet_dictionary.c
index 24b100f..2491f5b 100644
--- a/src/lib/eet_dictionary.c
+++ b/src/lib/eet_dictionary.c
@@ -12,9 +12,6 @@ eet_dictionary_add(void)
    if (!new)
      return NULL;
 
-   new->count = 0;
-   new->total = 0;
-
    memset(new->hash, -1, sizeof (int) * 256);
 
    return new;
-- 
1.5.4.GIT

From a90168a2d23278ea7350c89d50426d7e759223a9 Mon Sep 17 00:00:00 2001
From: Cedric BAIL <[EMAIL PROTECTED]>
Date: Thu, 6 Mar 2008 13:55:23 +0100
Subject: [PATCH] Fix dictionary load total size, READ_WRITE_MODE and correctly use reference counting.

---
 src/lib/eet_lib.c |   37 +++++++------------------------------
 1 files changed, 7 insertions(+), 30 deletions(-)

diff --git a/src/lib/eet_lib.c b/src/lib/eet_lib.c
index 6e74d10..536a70b 100644
--- a/src/lib/eet_lib.c
+++ b/src/lib/eet_lib.c
@@ -25,6 +25,7 @@ struct _Eet_File
 {
    char                 *path;
    FILE                 *fp;
+   FILE			*readfp;
    Eet_File_Header      *header;
    const unsigned char  *data;
    Eet_Dictionary       *ed;
@@ -814,6 +815,7 @@ eet_internal_read2(Eet_File *ef)
         if (eet_test_close(!ef->ed->all, ef)) return NULL;
 
         ef->ed->count = num_dictionary_entries;
+	ef->ed->total = num_dictionary_entries;
 
         for (j = 0; j < ef->ed->count; ++j)
           {
@@ -1083,6 +1085,7 @@ eet_open(const char *file, Eet_File_Mode mode)
 	if (ef)
 	  {
 	     eet_flush2(ef);
+	     ef->references++;
 	     ef->delete_me_now = 1;
 	     eet_close(ef);
 	  }
@@ -1095,6 +1098,7 @@ eet_open(const char *file, Eet_File_Mode mode)
 	if (ef)
 	  {
 	     ef->delete_me_now = 1;
+	     ef->references++;
 	     eet_close(ef);
 	  }
 	ef = eet_cache_find((char *)file, eet_writers, eet_writers_num);
@@ -1150,6 +1154,7 @@ eet_open(const char *file, Eet_File_Mode mode)
 
    /* 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;
@@ -1184,35 +1189,7 @@ eet_open(const char *file, Eet_File_Mode mode)
    /* 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");
      }
@@ -1302,8 +1279,8 @@ eet_close(Eet_File *ef)
    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));
-- 
1.5.4.GIT

-------------------------------------------------------------------------
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to