ef->path is now stringshared

SVN revision: 65813
This commit is contained in:
Mike Blumenkrantz 2011-12-02 14:07:34 +00:00
parent 3e0353f80b
commit fb3c8a5de8
3 changed files with 6 additions and 5 deletions

View File

@ -550,3 +550,4 @@
2011-12-02 Mike Blumenkrantz
* added eet_file_get to return the filename of an Eet_File
* Eet_File filenames are now stringshared

View File

@ -755,7 +755,7 @@ eet_delete(Eet_File *ef,
/**
* Alias a specific section to another one. Destination may exist or not,
* no check are done.
* no checks are done.
* @param ef A valid eet file handle opened for writing.
* @param name Name of the new entry. eg: "/base/file_i_want".
* @param destination Actual source of the aliased entry eg: "/base/the_real_stuff_i_want".
@ -777,7 +777,7 @@ eet_alias(Eet_File *ef,
/**
* Retrieve the filename of an Eet_File
* @param ef A valid eet file handle opened for writing.
* @return The file opened with eet_open(), or NULL on error
* @return The stringshared file string opened with eet_open(), or NULL on error
*
* @note This function will return NULL for files opened with eet_memopen_read()
*

View File

@ -88,7 +88,7 @@ typedef struct _Eet_File_Directory Eet_File_Directory;
struct _Eet_File
{
char *path;
const char *path;
Eina_File *readfp;
Eet_File_Header *header;
Eet_Dictionary *ed;
@ -1434,6 +1434,7 @@ eet_internal_close(Eet_File *ef,
memset(ef, 0, sizeof(Eet_File));
/* free it */
eina_stringshare_del(ef->path);
free(ef);
return err;
@ -1593,8 +1594,7 @@ open_error:
INIT_FILE(ef);
ef->key = NULL;
ef->readfp = fp;
ef->path = ((char *)ef) + sizeof(Eet_File);
memcpy(ef->path, file, file_len);
ef->path = eina_stringshare_add_length(file, file_len);
ef->magic = EET_MAGIC_FILE;
ef->references = 1;
ef->mode = mode;