Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/eet

Dir     : e17/libs/eet/src/lib


Modified Files:
        Eet.h eet_lib.c 


Log Message:


up eet to alpha status. see email to e-devel.

===================================================================
RCS file: /cvs/e/e17/libs/eet/src/lib/Eet.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -3 -r1.49 -r1.50
--- Eet.h       8 Mar 2008 07:28:12 -0000       1.49
+++ Eet.h       28 Mar 2008 14:37:29 -0000      1.50
@@ -225,8 +225,29 @@
     */
    EAPI Eet_Error eet_close(Eet_File *ef);
 
-   /* FIXME: Add some documentation */
-   EAPI Eet_Dictionary* eet_dictionary_get(Eet_File *ef);
+
+   /**
+    * Return a handle to the shared string dictionary of the Eet file
+    * @param ef A valid eet file handle.
+    * @return A handle to the dictionary of the file
+    * 
+    * This function returns a handle to the dictionary of an Eet file whose
+    * handle is @p ef, if a dictionary exists. NULL is returned otherwise or
+    * if the file handle is known to be invalid.
+    */
+   EAPI Eet_Dictionary *eet_dictionary_get(Eet_File *ef);
+   
+   /**
+    * Check if a given string comes from a given dictionary
+    * @param ed A valid dictionary handle
+    * @param string A valid 0 byte terminated C string
+    * @return 1 if it is in the dictionary, 0 otherwise
+    * 
+    * This checks the given dictionary to see if the given string is actually
+    * inside that dictionary (i.e. comes from it) and returns 1 if it does.
+    * If the dictionary handle is invlide, the string is NULL or the string is
+    * not in the dictionary, 0 is returned.
+    */
    EAPI int eet_dictionary_string_check(Eet_Dictionary *ed, const char 
*string);
 
    /**
@@ -249,7 +270,6 @@
    EAPI void *eet_read(Eet_File *ef, const char *name, int *size_ret);
 
    /**
-
     * Read a specified entry from an eet file and return data
     * @param ef A valid eet file handle opened for reading.
     * @param name Name of the entry. eg: "/base/file_i_want".
@@ -912,7 +932,7 @@
     * parameter defines a string that will be used to uniquely name that
     * member of the struct (it is suggested to use the struct member itself).
     * The @p member parameter is the actual struct member itself (for
-    * example: values), and @p type is the basic data type of the member which
+eet_dictionary_string_check    * example: values), and @p type is the basic 
data type of the member which
     * must be one of: EET_T_CHAR, EET_T_SHORT, EET_T_INT, EET_T_LONG_LONG,
     * EET_T_FLOAT, EET_T_DOUBLE, EET_T_UCHAR, EET_T_USHORT, EET_T_UINT,
     * EET_T_ULONG_LONG or EET_T_STRING.
===================================================================
RCS file: /cvs/e/e17/libs/eet/src/lib/eet_lib.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -3 -r1.95 -r1.96
--- eet_lib.c   9 Mar 2008 16:16:40 -0000       1.95
+++ eet_lib.c   28 Mar 2008 14:37:29 -0000      1.96
@@ -301,13 +301,13 @@
    *cache_alloc = new_cache_alloc;
 }
 
-/* internal string match. bails out at first mismatch - not comparing all */
-/* bytes in strings */
+/* internal string match. null friendly, catches same ptr */
 static int
 eet_string_match(const char *s1, const char *s2)
 {
    /* both null- no match */
    if ((!s1) || (!s2)) return 0;
+   if (s1 == s2) return 1;
    return (!strcmp(s1, s2));
 }
 
@@ -470,7 +470,7 @@
 
    return EET_ERROR_NONE;
 
- write_error:
+   write_error:
    switch (ferror(ef->fp))
      {
       case EFBIG: error = EET_ERROR_WRITE_ERROR_FILE_TOO_BIG; break;
@@ -575,7 +575,7 @@
 
    return EET_ERROR_NONE;
 
-write_error:
+   write_error:
    switch (ferror(ef->fp))
      {
       case EFBIG:
@@ -629,19 +629,17 @@
    int i;
 
    /*
-     We need to compute the list of eet file to close separately from the 
cache,
-     due to eet_close removing them from the cache after each call.
-   */
+    * We need to compute the list of eet file to close separately from the 
cache,
+    * due to eet_close removing them from the cache after each call.
+    */
    for (i = 0; i < eet_writers_num; i++)
      {
-       if (eet_writers[i]->references <= 0)
-         num++;
+       if (eet_writers[i]->references <= 0) num++;
      }
 
    for (i = 0; i < eet_readers_num; i++)
      {
-       if (eet_readers[i]->references <= 0)
-         num++;
+       if (eet_readers[i]->references <= 0) num++;
      }
 
    if (num > 0)
@@ -678,7 +676,7 @@
 }
 
 /* FIXME: MMAP race condition in READ_WRITE_MODE */
-static Eet_File*
+static Eet_File *
 eet_internal_read2(Eet_File *ef)
 {
    const int    *data = (const int*) ef->data;
@@ -861,7 +859,7 @@
    return ef;
 }
 
-static Eet_File*
+static Eet_File *
 eet_internal_read1(Eet_File *ef)
 {
    const unsigned char *dyn_buf = NULL;
@@ -1023,29 +1021,29 @@
    return ef;
 }
 
-static Eet_File*
+static Eet_File *
 eet_internal_read(Eet_File *ef)
 {
    const int    *data = (const int*) ef->data;
 
    if (eet_test_close((ef->data == (void *)-1) || (ef->data == NULL), ef))
      return NULL;
-
+   
    if (eet_test_close(ef->data_size < sizeof(int) * 3, ef))
      return NULL;
 
    switch (ntohl(*data))
      {
       case EET_MAGIC_FILE:
-         return eet_internal_read1(ef);
+       return eet_internal_read1(ef);
       case EET_MAGIC_FILE2:
-         return eet_internal_read2(ef);
+       return eet_internal_read2(ef);
       default:
-         ef->delete_me_now = 1;
-         eet_close(ef);
-         break;
+       ef->delete_me_now = 1;
+       eet_close(ef);
+       break;
      }
-
+   
    return NULL;
 }
 
@@ -1618,7 +1616,7 @@
    return exists_already;
 }
 
-EAPI Eet_Dictionary*
+EAPI Eet_Dictionary *
 eet_dictionary_get(Eet_File *ef)
 {
    if (eet_check_pointer(ef)) return NULL;



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to