* e_fm_shared.h: Proper fix with new API.

SVN revision: 42209
This commit is contained in:
Cedric BAIL 2009-09-03 14:48:46 +00:00
parent 907d84a94a
commit dff8cab47b
1 changed files with 8 additions and 37 deletions

View File

@ -117,38 +117,19 @@ _e_storage_free(E_Storage *s)
free(s);
}
static inline Eina_Hash *
eet_eina_hash_add_alloc(Eina_Hash *hash, const void *key, void *data)
{
if (!hash) hash = eina_hash_string_superfast_new(NULL);
if (!hash) return NULL;
eina_hash_add(hash, key, data);
return hash;
}
static Eet_Data_Descriptor *
_e_volume_edd_new(void)
{
Eet_Data_Descriptor *edd;
Eet_Data_Descriptor_Class eddc;
eddc.version = EET_DATA_DESCRIPTOR_CLASS_VERSION;
eddc.func.mem_alloc = NULL;
eddc.func.mem_free = NULL;
if (!eet_eina_stream_data_descriptor_class_set(&eddc, "e_volume", sizeof (E_Volume)))
return NULL;
eddc.func.str_alloc = (char *(*)(const char *)) strdup;
eddc.func.str_free = (void (*)(const char *)) free;
eddc.func.list_next = (void *(*)(void *)) eina_list_next;
eddc.func.list_append = (void *(*)(void *l, void *d)) eina_list_append;
eddc.func.list_data = (void *(*)(void *)) eina_list_data_get;
eddc.func.hash_foreach =
(void (*) (void *, int (*) (void *, const char *, void *, void *), void *))
eina_hash_foreach;
eddc.func.hash_add = (void* (*) (void *, const char *, void *)) eet_eina_hash_add_alloc;
eddc.func.hash_free = (void (*) (void *)) eina_hash_free;
eddc.name = "e_volume";
eddc.size = sizeof(E_Volume);
edd = eet_data_descriptor2_new(&eddc);
edd = eet_data_descriptor_stream_new(&eddc);
#define DAT(x, y, z) EET_DATA_DESCRIPTOR_ADD_BASIC(edd, E_Volume, x, y, z)
DAT("type", type, EET_T_INT);
DAT("udi", udi, EET_T_STRING);
@ -173,23 +154,13 @@ _e_storage_edd_new(void)
Eet_Data_Descriptor *edd;
Eet_Data_Descriptor_Class eddc;
eddc.version = EET_DATA_DESCRIPTOR_CLASS_VERSION;
eddc.func.mem_alloc = NULL;
eddc.func.mem_free = NULL;
if (!eet_eina_stream_data_descriptor_class_set(&eddc, "e_storage", sizeof (E_Storage)))
return NULL;
eddc.func.str_alloc = (char *(*)(const char *)) strdup;
eddc.func.str_free = (void (*)(const char *)) free;
eddc.func.list_next = (void *(*)(void *)) eina_list_next;
eddc.func.list_append = (void *(*)(void *l, void *d)) eina_list_append;
eddc.func.list_data = (void *(*)(void *)) eina_list_data_get;
eddc.func.hash_foreach =
(void (*) (void *, int (*) (void *, const char *, void *, void *), void *))
eina_hash_foreach;
eddc.func.hash_add = (void* (*) (void *, const char *, void *)) eet_eina_hash_add_alloc;
eddc.func.hash_free = (void (*) (Eina_Hash *)) eina_hash_free;
eddc.name = "e_storage";
eddc.size = sizeof(E_Storage);
edd = eet_data_descriptor2_new(&eddc);
edd = eet_data_descriptor_stream_new(&eddc);
#define DAT(x, y, z) EET_DATA_DESCRIPTOR_ADD_BASIC(edd, E_Storage, x, y, z)
DAT("type", type, EET_T_INT);
DAT("udi", udi, EET_T_STRING);