forked from enlightenment/efl
up eet to alpha status. see email to e-devel.
SVN revision: 34127
This commit is contained in:
parent
8e386e3f73
commit
42d262f5f3
|
@ -1,5 +1,15 @@
|
||||||
Eet @VERSION@
|
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
|
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
|
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
|
zip file) and allow fast random-access reading of the file later
|
||||||
|
@ -17,7 +27,7 @@ COMPILING AND INSTALLING:
|
||||||
|
|
||||||
./configure
|
./configure
|
||||||
make
|
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
|
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
|
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
|
not need to use sudo or root if you have your own ~/.rpmrc. see rpm documents
|
||||||
for more details)
|
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.
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# get rid of that stupid cache mechanism
|
# get rid of that stupid cache mechanism
|
||||||
rm -f config.cache
|
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_PREREQ(2.52)
|
||||||
AC_CONFIG_SRCDIR(configure.in)
|
AC_CONFIG_SRCDIR(configure.in)
|
||||||
AC_CANONICAL_BUILD
|
AC_CANONICAL_BUILD
|
||||||
|
|
|
@ -219,6 +219,7 @@ main(int argc, char **argv)
|
||||||
eet_init();
|
eet_init();
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
{
|
{
|
||||||
|
help:
|
||||||
printf("Usage:\n"
|
printf("Usage:\n"
|
||||||
" eet -l FILE.EET list all keys in FILE.EET\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"
|
" 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();
|
eet_shutdown();
|
||||||
return 0;
|
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]);
|
do_eet_list(argv[2]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,8 +225,29 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
EAPI Eet_Error eet_close(Eet_File *ef);
|
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);
|
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);
|
EAPI void *eet_read(Eet_File *ef, const char *name, int *size_ret);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
* Read a specified entry from an eet file and return data
|
* Read a specified entry from an eet file and return data
|
||||||
* @param ef A valid eet file handle opened for reading.
|
* @param ef A valid eet file handle opened for reading.
|
||||||
* @param name Name of the entry. eg: "/base/file_i_want".
|
* @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
|
* 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).
|
* member of the struct (it is suggested to use the struct member itself).
|
||||||
* The @p member parameter is the actual struct member itself (for
|
* 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,
|
* 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_FLOAT, EET_T_DOUBLE, EET_T_UCHAR, EET_T_USHORT, EET_T_UINT,
|
||||||
* EET_T_ULONG_LONG or EET_T_STRING.
|
* EET_T_ULONG_LONG or EET_T_STRING.
|
||||||
|
|
|
@ -301,13 +301,13 @@ eet_cache_del(Eet_File *ef, Eet_File ***cache, int *cache_num, int *cache_alloc)
|
||||||
*cache_alloc = new_cache_alloc;
|
*cache_alloc = new_cache_alloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* internal string match. bails out at first mismatch - not comparing all */
|
/* internal string match. null friendly, catches same ptr */
|
||||||
/* bytes in strings */
|
|
||||||
static int
|
static int
|
||||||
eet_string_match(const char *s1, const char *s2)
|
eet_string_match(const char *s1, const char *s2)
|
||||||
{
|
{
|
||||||
/* both null- no match */
|
/* both null- no match */
|
||||||
if ((!s1) || (!s2)) return 0;
|
if ((!s1) || (!s2)) return 0;
|
||||||
|
if (s1 == s2) return 1;
|
||||||
return (!strcmp(s1, s2));
|
return (!strcmp(s1, s2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -470,7 +470,7 @@ eet_flush2(Eet_File *ef)
|
||||||
|
|
||||||
return EET_ERROR_NONE;
|
return EET_ERROR_NONE;
|
||||||
|
|
||||||
write_error:
|
write_error:
|
||||||
switch (ferror(ef->fp))
|
switch (ferror(ef->fp))
|
||||||
{
|
{
|
||||||
case EFBIG: error = EET_ERROR_WRITE_ERROR_FILE_TOO_BIG; break;
|
case EFBIG: error = EET_ERROR_WRITE_ERROR_FILE_TOO_BIG; break;
|
||||||
|
@ -575,7 +575,7 @@ eet_flush(Eet_File *ef)
|
||||||
|
|
||||||
return EET_ERROR_NONE;
|
return EET_ERROR_NONE;
|
||||||
|
|
||||||
write_error:
|
write_error:
|
||||||
switch (ferror(ef->fp))
|
switch (ferror(ef->fp))
|
||||||
{
|
{
|
||||||
case EFBIG:
|
case EFBIG:
|
||||||
|
@ -629,19 +629,17 @@ eet_clearcache(void)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
We need to compute the list of eet file to close separately from the cache,
|
* 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.
|
* due to eet_close removing them from the cache after each call.
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < eet_writers_num; i++)
|
for (i = 0; i < eet_writers_num; i++)
|
||||||
{
|
{
|
||||||
if (eet_writers[i]->references <= 0)
|
if (eet_writers[i]->references <= 0) num++;
|
||||||
num++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < eet_readers_num; i++)
|
for (i = 0; i < eet_readers_num; i++)
|
||||||
{
|
{
|
||||||
if (eet_readers[i]->references <= 0)
|
if (eet_readers[i]->references <= 0) num++;
|
||||||
num++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num > 0)
|
if (num > 0)
|
||||||
|
@ -678,7 +676,7 @@ eet_clearcache(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: MMAP race condition in READ_WRITE_MODE */
|
/* FIXME: MMAP race condition in READ_WRITE_MODE */
|
||||||
static Eet_File*
|
static Eet_File *
|
||||||
eet_internal_read2(Eet_File *ef)
|
eet_internal_read2(Eet_File *ef)
|
||||||
{
|
{
|
||||||
const int *data = (const int*) ef->data;
|
const int *data = (const int*) ef->data;
|
||||||
|
@ -861,7 +859,7 @@ eet_internal_read2(Eet_File *ef)
|
||||||
return ef;
|
return ef;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eet_File*
|
static Eet_File *
|
||||||
eet_internal_read1(Eet_File *ef)
|
eet_internal_read1(Eet_File *ef)
|
||||||
{
|
{
|
||||||
const unsigned char *dyn_buf = NULL;
|
const unsigned char *dyn_buf = NULL;
|
||||||
|
@ -1023,29 +1021,29 @@ eet_internal_read1(Eet_File *ef)
|
||||||
return ef;
|
return ef;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eet_File*
|
static Eet_File *
|
||||||
eet_internal_read(Eet_File *ef)
|
eet_internal_read(Eet_File *ef)
|
||||||
{
|
{
|
||||||
const int *data = (const int*) ef->data;
|
const int *data = (const int*) ef->data;
|
||||||
|
|
||||||
if (eet_test_close((ef->data == (void *)-1) || (ef->data == NULL), ef))
|
if (eet_test_close((ef->data == (void *)-1) || (ef->data == NULL), ef))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (eet_test_close(ef->data_size < sizeof(int) * 3, ef))
|
if (eet_test_close(ef->data_size < sizeof(int) * 3, ef))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
switch (ntohl(*data))
|
switch (ntohl(*data))
|
||||||
{
|
{
|
||||||
case EET_MAGIC_FILE:
|
case EET_MAGIC_FILE:
|
||||||
return eet_internal_read1(ef);
|
return eet_internal_read1(ef);
|
||||||
case EET_MAGIC_FILE2:
|
case EET_MAGIC_FILE2:
|
||||||
return eet_internal_read2(ef);
|
return eet_internal_read2(ef);
|
||||||
default:
|
default:
|
||||||
ef->delete_me_now = 1;
|
ef->delete_me_now = 1;
|
||||||
eet_close(ef);
|
eet_close(ef);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1618,7 +1616,7 @@ eet_delete(Eet_File *ef, const char *name)
|
||||||
return exists_already;
|
return exists_already;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Eet_Dictionary*
|
EAPI Eet_Dictionary *
|
||||||
eet_dictionary_get(Eet_File *ef)
|
eet_dictionary_get(Eet_File *ef)
|
||||||
{
|
{
|
||||||
if (eet_check_pointer(ef)) return NULL;
|
if (eet_check_pointer(ef)) return NULL;
|
||||||
|
|
Loading…
Reference in New Issue