diff --git a/legacy/eet/README.in b/legacy/eet/README.in index 6e1c17e439..3345a7143a 100644 --- a/legacy/eet/README.in +++ b/legacy/eet/README.in @@ -1,5 +1,15 @@ Eet @VERSION@ +****************************************************************************** +*** +*** THIS IS AN ALPHA RELEASE - PLEASE REPORT ANY PROBLEMS TO: +*** enlightenment-devel@lists.sourceforge.net +*** +*** We want to weed out any build, porting, compatability or functionality +*** bugs +*** +****************************************************************************** + Eet is a tiny library designed to write an arbitary set of chunks of data to a file and optionally compress each chunk (very much like a zip file) and allow fast random-access reading of the file later @@ -17,7 +27,7 @@ COMPILING AND INSTALLING: ./configure make -(as root unless youa re installing in your users directories): +(do this as root unless you are installing in your users directories): make install ------------------------------------------------------------------------------ @@ -30,14 +40,3 @@ RPM: To build rpm packages: You will find rpm packages in your system /usr/src/redhat/* dirs (note you may not need to use sudo or root if you have your own ~/.rpmrc. see rpm documents for more details) - -DEB: To build deb packages: - - tar zvf @PACKAGE@-@VERSION@.tar.gz - cd @PACKAGE@-@VERSION@ - dpkg-buildpackage -us -uc -rfakeroot - cd .. - rm -rf @PACKAGE@-@VERSION@ - -You will find all the debian source, binary etc. packages put in the directory -where you first untarred the source tarball. diff --git a/legacy/eet/configure.in b/legacy/eet/configure.in index f8b5aed5f6..e68e80a56a 100644 --- a/legacy/eet/configure.in +++ b/legacy/eet/configure.in @@ -1,7 +1,7 @@ # get rid of that stupid cache mechanism rm -f config.cache -AC_INIT(eet, 0.9.10.042, enlightenment-devel@lists.sourceforge.net) +AC_INIT(eet, 0.9.99900, enlightenment-devel@lists.sourceforge.net) AC_PREREQ(2.52) AC_CONFIG_SRCDIR(configure.in) AC_CANONICAL_BUILD diff --git a/legacy/eet/src/bin/eet_main.c b/legacy/eet/src/bin/eet_main.c index 8e01f5e542..b0ad7dd0b2 100644 --- a/legacy/eet/src/bin/eet_main.c +++ b/legacy/eet/src/bin/eet_main.c @@ -219,6 +219,7 @@ main(int argc, char **argv) eet_init(); if (argc < 2) { + help: printf("Usage:\n" " eet -l FILE.EET list all keys in FILE.EET\n" " eet -x FILE.EET KEY OUT-FILE extract data stored in KEY in FILE.EET and write to OUT-FILE\n" @@ -230,7 +231,11 @@ main(int argc, char **argv) eet_shutdown(); return 0; } - if ((!strcmp(argv[1], "-l")) && (argc > 2)) + if ((!strncmp(argv[1], "-h", 2))) + { + goto help; + } + else if ((!strcmp(argv[1], "-l")) && (argc > 2)) { do_eet_list(argv[2]); } diff --git a/legacy/eet/src/lib/Eet.h b/legacy/eet/src/lib/Eet.h index aebcbc514c..f2baf97973 100644 --- a/legacy/eet/src/lib/Eet.h +++ b/legacy/eet/src/lib/Eet.h @@ -225,8 +225,29 @@ extern "C" { */ 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 @@ extern "C" { 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 @@ extern "C" { * 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. diff --git a/legacy/eet/src/lib/eet_lib.c b/legacy/eet/src/lib/eet_lib.c index f3c4c9bd09..96d9cb7f79 100644 --- a/legacy/eet/src/lib/eet_lib.c +++ b/legacy/eet/src/lib/eet_lib.c @@ -301,13 +301,13 @@ eet_cache_del(Eet_File *ef, Eet_File ***cache, int *cache_num, int *cache_alloc) *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 @@ eet_flush2(Eet_File *ef) 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 @@ eet_flush(Eet_File *ef) return EET_ERROR_NONE; -write_error: + write_error: switch (ferror(ef->fp)) { case EFBIG: @@ -629,19 +629,17 @@ eet_clearcache(void) 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 @@ eet_clearcache(void) } /* 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 @@ eet_internal_read2(Eet_File *ef) return ef; } -static Eet_File* +static Eet_File * eet_internal_read1(Eet_File *ef) { const unsigned char *dyn_buf = NULL; @@ -1023,29 +1021,29 @@ eet_internal_read1(Eet_File *ef) 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 @@ eet_delete(Eet_File *ef, const char *name) return exists_already; } -EAPI Eet_Dictionary* +EAPI Eet_Dictionary * eet_dictionary_get(Eet_File *ef) { if (eet_check_pointer(ef)) return NULL;