}
}
-static void
-dump_values(void *value, void *data)
+static Eina_Bool
+dump_values(const Eina_Hash *hash, const void *key, void *value, void *data)
{
- Ecore_Hash_Node *node;
-
- node = value;
- printf(" - name: %s - ", (char *)node->key);
- dump_variant(node->value);
+ printf(" - name: %s - ", (char *)key);
+ dump_variant(value);
printf("\n");
}
-static void
-dump_settings(void *value, void *data)
+static Eina_Bool
+dump_settings(const Eina_Hash *hash, const void *key, void *value, void *fdata)
{
- Ecore_Hash_Node *node;
-
- node = value;
- printf("name: %s\n", (char *)node->key);
+ printf("name: %s\n", (char *)key);
printf("values:\n");
- ecore_hash_for_each_node(node->value, dump_values, NULL);
+ eina_hash_foreach(value, dump_values, NULL);
printf("\n");
}
{
printf("Secrets:\n");
if (secrets)
- ecore_hash_for_each_node(secrets, dump_settings, NULL);
+ eina_hash_foreach(secrets, dump_settings, NULL);
return 1;
}
{
if (ecore_hash_get(settings, "802-11-wireless-security"))
e_nms_connection_secrets_get_secrets(data, "802-11-wireless-security", NULL, 0, cb_nms_connection_secrets, NULL);
- ecore_hash_for_each_node(settings, dump_settings, NULL);
+ eina_hash_foreach(settings, dump_settings, NULL);
}
return 1;
}
struct E_Hal_Properties
{
- Ecore_Hash *properties;
+ Eina_Hash *properties;
};
typedef struct E_Hal_Properties E_Hal_Device_Get_All_Properties_Return;
return NULL;
}
- ret->properties = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(ret->properties, ECORE_FREE_CB(eina_stringshare_del));
- ecore_hash_free_value_cb_set(ret->properties, ECORE_FREE_CB(e_hal_property_free));
-
+ ret->properties = eina_hash_string_small_new(EINA_FREE_CB(e_hal_property_free));
dbus_message_iter_init(msg, &iter);
dbus_message_iter_recurse(&iter, &a_iter);
printf("Error: unexpected property type (%s): %c\n", name, dbus_message_iter_get_arg_type(&v_iter));
break;
}
- ecore_hash_set(ret->properties, (void *)eina_stringshare_add(name), prop);
+ eina_hash_add(ret->properties, name, prop);
dbus_message_iter_next(&a_iter);
}
E_Hal_Device_Get_All_Properties_Return *ret = data;
if (!ret) return;
- ecore_hash_destroy(ret->properties);
+ eina_hash_free(ret->properties);
free(ret);
}
E_Hal_Property *prop;
if (err) *err = 0;
if (!properties->properties) return NULL;
- prop = ecore_hash_get(properties->properties, key);
+ prop = eina_hash_find(properties->properties, key);
if (prop) return strdup(prop->val.s);
if (err) *err = 1;
E_Hal_Property *prop;
if (err) *err = 0;
if (!properties->properties) return 0;
- prop = ecore_hash_get(properties->properties, key);
+ prop = eina_hash_find(properties->properties, key);
if (prop) return prop->val.b;
if (err) *err = 1;
E_Hal_Property *prop;
if (err) *err = 0;
if (!properties->properties) return 0;
- prop = ecore_hash_get(properties->properties, key);
+ prop = eina_hash_find(properties->properties, key);
if (prop) return prop->val.i;
if (err) *err = 1;
E_Hal_Property *prop;
if (err) *err = 0;
if (!properties->properties) return 0;
- prop = ecore_hash_get(properties->properties, key);
+ prop = eina_hash_find(properties->properties, key);
if (prop) return prop->val.u64;
if (err) *err = 1;
E_Hal_Property *prop;
if (err) *err = 0;
if (!properties->properties) return 0;
- prop = ecore_hash_get(properties->properties, key);
+ prop = eina_hash_find(properties->properties, key);
if (prop) return prop->val.d;
if (err) *err = 1;
E_Hal_Property *prop;
if (err) *err = 0;
if (!properties->properties) return NULL;
- prop = ecore_hash_get(properties->properties, key);
+ prop = eina_hash_find(properties->properties, key);
if (prop) return prop->val.strlist;
if (err) *err = 1;
/* TODO: e_nms_connection_update */
/* TODO: e_nms_connection_delete */
- EAPI int e_nms_connection_get_settings(E_NMS_Connection *conn, int (*cb_func)(void *data, Ecore_Hash *settings), void *data);
- EAPI int e_nms_connection_secrets_get_secrets(E_NMS_Connection *connection, const char *setting_name, Ecore_List *hints, int request_new, int (*cb_func)(void *data, Ecore_Hash *secrets), void *data);
+
+ EAPI int e_nms_connection_get_settings(E_NMS_Connection *conn, int (*cb_func)(void *data, Eina_Hash *settings), void *data);
+ EAPI int e_nms_connection_secrets_get_secrets(E_NMS_Connection *connection, const char *setting_name, Ecore_List *hints, int request_new, int (*cb_func)(void *data, Eina_Hash *secrets), void *data);
EAPI void e_nms_connection_callback_updated_set(E_NMS_Connection *connection, int (*cb_func)(E_NMS_Connection *conn, Ecore_Hash *settings));
/* TODO: e_nms_connection_callback_removed_set */
Ecore_Hash *
parse_settings(DBusMessage *msg)
{
- Ecore_Hash *settings;
+ Eina_Hash *settings;
DBusMessageIter iter, a_iter;
if (!dbus_message_has_signature(msg, "a{sa{sv}}")) return NULL;
dbus_message_iter_init(msg, &iter);
- settings = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(settings, free);
- ecore_hash_free_value_cb_set(settings, ECORE_FREE_CB(ecore_hash_destroy));
+ settings = eina_hash_string_small_new(EINA_FREE_CB(eina_hash_free));
dbus_message_iter_recurse(&iter, &a_iter);
while (dbus_message_iter_get_arg_type(&a_iter) != DBUS_TYPE_INVALID)
{
DBusMessageIter d_iter, a2_iter;
E_NM_Variant *prop;
const char *name;
- Ecore_Hash *value;
+ Eina_Hash *value;
dbus_message_iter_recurse(&a_iter, &d_iter);
if (!check_arg_type(&d_iter, 's')) goto error;
if (!check_arg_type(&d_iter, 'a')) goto error;
dbus_message_iter_recurse(&d_iter, &a2_iter);
- value = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(value, free);
- ecore_hash_free_value_cb_set(value, ECORE_FREE_CB(property_free));
- ecore_hash_set(settings, strdup(name), value);
+ value = eina_hash_string_small_new(EINA_FREE_CB(property_free));
+ eina_hash_add(settings, name, value);
while (dbus_message_iter_get_arg_type(&a2_iter) != DBUS_TYPE_INVALID)
{
dbus_message_iter_recurse(&a2_iter, &d_iter);
dbus_message_iter_next(&d_iter);
if (!check_arg_type(&d_iter, 'v')) goto error;
prop = property_variant(&d_iter, NULL, NULL);
- if (prop) ecore_hash_set(value, strdup(name), prop);
+ if (prop) eina_hash_add(value, name, prop);
dbus_message_iter_next(&a2_iter);
}
return settings;
error:
- ecore_hash_destroy(settings);
+ eina_hash_free(settings);
return NULL;
}
}
EAPI int
-e_nms_connection_get_settings(E_NMS_Connection *connection, int (*cb_func)(void *data, Ecore_Hash *settings), void *data)
+e_nms_connection_get_settings(E_NMS_Connection *connection, int (*cb_func)(void *data, Eina_Hash *settings), void *data)
{
DBusMessage *msg;
Reply_Data *d;
}
EAPI int
-e_nms_connection_secrets_get_secrets(E_NMS_Connection *connection, const char *setting_name, Ecore_List *hints, int request_new, int (*cb_func)(void *data, Ecore_Hash *secrets), void *data)
+e_nms_connection_secrets_get_secrets(E_NMS_Connection *connection, const char *setting_name, Ecore_List *hints, int request_new, int (*cb_func)(void *data, Eina_Hash *secrets), void *data)
{
DBusMessage *msg;
DBusMessageIter iter, a_iter;