Hi list,
just to annouce 1 fix and 1 doubt using eet library.

I am evaluating eet-1.0.0 and not the svn version because latest version
depends on eina (at this stage of my develop I do not need the
bleeding edge version but I would like to understand only if the Eet
library meets my project requirements).


Patch:
======
while evaluating Eet for a "hash-table(s) on disk" project,
I made two trivial fixes to eet_lib.c source file in eet-1.0.0 release
in order to allow my small test program to work in EET_FILE_MODE_WRITE
too.

I also checked the svn code and I am quite confident the patch should
be applied to the svn version.

Here is the patch:

ro...@tar.tecsiel.it 4261> diff -u eet_lib.c eet_lib.c.ORG
--- eet_lib.c   Mon Feb 16 11:45:00 2009
+++ eet_lib.c.ORG       Mon Feb 16 10:28:39 2009
@@ -1686,8 +1686,7 @@
    if (eet_check_pointer(ef) || eet_check_header(ef) ||
        (!glob) ||
        ((ef->mode != EET_FILE_MODE_READ) &&
-       (ef->mode != EET_FILE_MODE_WRITE) &&
-       (ef->mode != EET_FILE_MODE_READ_WRITE)))
+        (ef->mode != EET_FILE_MODE_READ_WRITE)))
      {
        if (count_ret)
          *count_ret = 0;
@@ -1751,8 +1750,7 @@
    /* check to see its' an eet file pointer */
    if (eet_check_pointer(ef) || eet_check_header(ef) ||
        ((ef->mode != EET_FILE_MODE_READ) &&
-       (ef->mode != EET_FILE_MODE_WRITE) &&
-       (ef->mode != EET_FILE_MODE_READ_WRITE)))
+        (ef->mode != EET_FILE_MODE_READ_WRITE)))
      return -1;
 
    /* loop through all entries */


Doubt:
======
Is the 'list' argument returned by eet_list() always NULL terminated?

That is how to say: is the following function usable on eet_list() return?

static void printkeys (char ** list) 
{ 
  char ** l = list; 
  while (l && * l) 
    printf ("%s\n", * l ++); 
} 
 

tnks for your support and your superb work

/rocco


ps.

  I wrote a simple test program which executes a random number
  of actions on an Eet file, made of a random number of eet_write()
  calls immediately followed  by a random of eet_delete() calls,
  with the number of eet_delete() < eet_write() just to have some data
  left on the disk after test execution.

  eg.
  ro...@tar.tecsiel.it 4282> ./rwxr--r-- -h
  Usage: rwxr--r-- [options]
     -h          show usage and exit
     -f filename define filename (default Italy.eet)
     -t number   define # of tests to run (default 1) (0 means unlimited)
     -n min      define min # of eet_write() per test (default 25)
     -x max      define max # of eet_write() per test (default 60)
     -N min      define min # of eet_delete() per test (default 3)
     -X max      define max # of eet_delete() per test (default 8)
     -w          enable show of written items
     -d          enable show of deleted items
     -c          enable show of cleaned items
     -z          enable file cleanup at the end of the execution
     -s          enable per test statistics
     -W          enable eet_xxx() warnings in the event of failure

  ro...@tar.tecsiel.it 4283> ./rwxr--r--
  Starting #1 test to write/delete items to/from file 'Italy.eet'

  Running test #1 of #1 - towrite #57 [40-120] - todelete #13 [10-15]
  Total items written #18 (of #57 issued)
  Total items deleted #13 (of #13 issued)
  Total items left    #5

  ro...@tar.tecsiel.it 4284> ls -la Italy.eet 
  -rw-rw-r--   1 rocco    carbone        328 Feb 16 13:03 Italy.eet


  my test program could be downloaded at:

  http://www.tecsiel.it/eet/test-eet.tar.gz

  just set the EETDIR= macro in the Makefile to suite the eet
  availability at your site

-- 
Rocco Carbone mail-to: <rocco /at/ ntop /dot/ org>
Pisa Italy

Life is in the details

In other words, you are welcome to use, share and improve me.
You are forbidden to forbid anyone else to use, share and
improve what I gave you.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to