forked from enlightenment/enlightenment
partly revert your stuff cedric... BAD frenchie! BAD! segv's for e17 all
round. members of E_Volume are strduped. rest of e's code still deals with it that way. e_hal from dbus also returns duped strings (thats why) SVN revision: 42204
This commit is contained in:
parent
fb4208b4a3
commit
bbdf974635
|
@ -117,16 +117,38 @@ _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;
|
||||
|
||||
if (!eet_eina_stream_data_descriptor_class_set(&eddc, "e_volume", sizeof (E_Volume)))
|
||||
return NULL;
|
||||
eddc.version = EET_DATA_DESCRIPTOR_CLASS_VERSION;
|
||||
eddc.func.mem_alloc = NULL;
|
||||
eddc.func.mem_free = 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_descriptor_stream_new(&eddc);
|
||||
edd = eet_data_descriptor2_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);
|
||||
|
@ -151,10 +173,23 @@ _e_storage_edd_new(void)
|
|||
Eet_Data_Descriptor *edd;
|
||||
Eet_Data_Descriptor_Class eddc;
|
||||
|
||||
if (!eet_eina_stream_data_descriptor_class_set(&eddc, "e_storage", sizeof (E_Storage)))
|
||||
return NULL;
|
||||
eddc.version = EET_DATA_DESCRIPTOR_CLASS_VERSION;
|
||||
eddc.func.mem_alloc = NULL;
|
||||
eddc.func.mem_free = 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_descriptor_stream_new(&eddc);
|
||||
edd = eet_data_descriptor2_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);
|
||||
|
|
Loading…
Reference in New Issue