2011-12-02 Mike Blumenkrantz
* added eet_file_get to return the filename of an Eet_File
+ * Eet_File filenames are now stringshared
/**
* 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".
/**
* 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()
*
struct _Eet_File
{
- char *path;
+ const char *path;
Eina_File *readfp;
Eet_File_Header *header;
Eet_Dictionary *ed;
memset(ef, 0, sizeof(Eet_File));
/* free it */
+ eina_stringshare_del(ef->path);
free(ef);
return err;
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;