englebass/Sebastian asked me to make these changes, so I figured I'd
post them here first to avoid yet another round of breakages. Attached
is a patch that removes stringshare_adds from ehal and reverts some
types back to native dbus types.
Won't have much time to tinker with them for the next few days, so talk
to englebass/Sebastian about these please.
Mike
Index: e_hal_manager.c
===================================================================
--- e_hal_manager.c (revision 48638)
+++ e_hal_manager.c (working copy)
@@ -33,8 +33,7 @@
char *dev = NULL;
dbus_message_iter_get_basic(&sub, &dev);
- if (dev)
- ret->strings = eina_list_append(ret->strings, eina_stringshare_add(dev));
+ if (dev) ret->strings = eina_list_append(ret->strings, dev);
dbus_message_iter_next(&sub);
}
@@ -45,11 +44,9 @@
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);
}
Index: e_hal_util.c
===================================================================
--- e_hal_util.c (revision 48638)
+++ e_hal_util.c (working copy)
@@ -34,7 +34,7 @@
return NULL;
}
-EAPI Eina_Bool
+EAPI char
e_hal_property_bool_get(E_Hal_Properties *properties, const char *key, int *err)
{
E_Hal_Property *prop;
@@ -60,7 +60,7 @@
return 0;
}
-EAPI uint64_t
+EAPI dbus_uint64_t
e_hal_property_uint64_get(E_Hal_Properties *properties, const char *key, int *err)
{
E_Hal_Property *prop;
Index: e_hal_device.c
===================================================================
--- e_hal_device.c (revision 48638)
+++ e_hal_device.c (working copy)
@@ -17,7 +17,6 @@
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)
@@ -31,8 +30,7 @@
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));
@@ -54,14 +52,6 @@
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);
}
@@ -85,7 +75,6 @@
{
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}"))
@@ -118,8 +107,7 @@
{
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;
@@ -147,8 +135,7 @@
{
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);
}
}
Index: e_hal_util.h
===================================================================
--- e_hal_util.h (revision 48638)
+++ e_hal_util.h (working copy)
@@ -7,7 +7,7 @@
const char *e_hal_property_string_get(E_Hal_Properties *properties, const char *key, int *err);
char e_hal_property_bool_get(E_Hal_Properties *properties, const char *key, int *err);
int e_hal_property_int_get(E_Hal_Properties *properties, const char *key, int *err);
-uint64_t e_hal_property_uint64_get(E_Hal_Properties *properties, const char *key, int *err);
+dbus_uint64_t e_hal_property_uint64_get(E_Hal_Properties *properties, const char *key, int *err);
double e_hal_property_double_get(E_Hal_Properties *properties, const char *key, int *err);
const Eina_List *e_hal_property_strlist_get(E_Hal_Properties *properties, const char *key, int *err);
Index: E_Hal.h
===================================================================
--- E_Hal.h (revision 48638)
+++ E_Hal.h (working copy)
@@ -42,7 +42,7 @@
struct E_Hal_Bool_Return
{
- Eina_Bool boolean;
+ char boolean;
};
struct E_Hal_UDI_Return
@@ -73,9 +73,9 @@
{
const char *s;
int i;
- Eina_Bool b;
+ dbus_bool_t b;
double d;
- uint64_t u64;
+ dbus_uint64_t u64;
Eina_List *strlist;
} val;
};
@@ -118,13 +118,13 @@
EAPI DBusPendingCall *e_hal_manager_find_device_by_capability(E_DBus_Connection *conn, const char *capability, E_DBus_Callback_Func cb_func, void *data);
/* utility functions */
- EAPI void e_hal_property_free(E_Hal_Property *prop);
- EAPI const char *e_hal_property_string_get(E_Hal_Properties *properties, const char *key, int *err);
- EAPI Eina_Bool e_hal_property_bool_get(E_Hal_Properties *properties, const char *key, int *err);
- EAPI int e_hal_property_int_get(E_Hal_Properties *properties, const char *key, int *err);
- EAPI uint64_t e_hal_property_uint64_get(E_Hal_Properties *properties, const char *key, int *err);
- EAPI double e_hal_property_double_get(E_Hal_Properties *properties, const char *key, int *err);
- EAPI const Eina_List *e_hal_property_strlist_get(E_Hal_Properties *properties, const char *key, int *err);
+ EAPI void e_hal_property_free(E_Hal_Property *prop);
+ EAPI const char *e_hal_property_string_get(E_Hal_Properties *properties, const char *key, int *err);
+ EAPI char e_hal_property_bool_get(E_Hal_Properties *properties, const char *key, int *err);
+ EAPI int e_hal_property_int_get(E_Hal_Properties *properties, const char *key, int *err);
+ EAPI dbus_uint64_t e_hal_property_uint64_get(E_Hal_Properties *properties, const char *key, int *err);
+ EAPI double e_hal_property_double_get(E_Hal_Properties *properties, const char *key, int *err);
+ EAPI const Eina_List *e_hal_property_strlist_get(E_Hal_Properties *properties, const char *key, int *err);
/* (un)mount */
EAPI DBusPendingCall *e_hal_device_volume_mount(E_DBus_Connection *conn, const char *udi, const char *mount_point, const char *fstype, Eina_List *options, E_DBus_Callback_Func cb_func, void *data);
------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel