E_Hal_Device_Get_Property_Return *ret = NULL;
DBusMessageIter iter;
int type;
- char *tmp;
ret = calloc(1, sizeof(E_Hal_Device_Get_Property_Return));
if (!ret)
switch(type)
{
case DBUS_TYPE_STRING:
- dbus_message_iter_get_basic(&iter, &tmp);
- ret->val.s = eina_stringshare_add(tmp);
+ dbus_message_iter_get_basic(&iter, &(ret->val.s));
break;
case DBUS_TYPE_INT32:
dbus_message_iter_get_basic(&iter, &(ret->val.i));
E_Hal_Device_Get_Property_Return *ret = data;
if (!ret) return;
- if (ret->type == E_HAL_PROPERTY_TYPE_STRLIST)
- {
- const char *s;
- EINA_LIST_FREE(ret->val.strlist, s)
- eina_stringshare_del(s);
- }
- else if (ret->type == E_HAL_PROPERTY_TYPE_STRING)
- eina_stringshare_del(ret->val.s);
free(ret);
}
{
E_Hal_Device_Get_All_Properties_Return *ret = NULL;
DBusMessageIter iter, a_iter, s_iter, v_iter;
- const char *tmp;
/* a{sv} = array of string+variant */
if (!dbus_message_has_signature(msg, "a{sv}"))
{
case DBUS_TYPE_STRING:
prop->type = E_HAL_PROPERTY_TYPE_STRING;
- dbus_message_iter_get_basic(&v_iter, &tmp);
- prop->val.s = eina_stringshare_add(tmp);
+ dbus_message_iter_get_basic(&v_iter, &(prop->val.s));
break;
case DBUS_TYPE_INT32:
prop->type = E_HAL_PROPERTY_TYPE_INT;
{
char *str;
dbus_message_iter_get_basic(&list_iter, &str);
- tmp = eina_stringshare_add(str);
- prop->val.strlist = eina_list_append(prop->val.strlist, tmp);
+ prop->val.strlist = eina_list_append(prop->val.strlist, str);
dbus_message_iter_next(&list_iter);
}
}
dbus_message_iter_get_basic(&sub, &dev);
if (dev)
- ret->strings = eina_list_append(ret->strings, eina_stringshare_add(dev));
+ ret->strings = eina_list_append(ret->strings, dev);
dbus_message_iter_next(&sub);
}
free_string_list(void *data)
{
E_Hal_String_List_Return *ret = data;
- const char *x;
if (!ret) return;
- EINA_LIST_FREE(ret->strings, x)
- eina_stringshare_del(x);
+ eina_list_free(ret->strings);
free(ret);
}