#include <E_Nm.h>
-#include <Ecore_Data.h>
#include <unistd.h>
#include <string.h>
{
case 'a': {
E_NM_Variant *subvar;
+ Eina_List *l;
printf("a:");
- ecore_list_first_goto(var->a);
- while ((subvar = ecore_list_next(var->a)))
+ EINA_LIST_FOREACH(var->a, l, subvar)
{
dump_variant(subvar);
printf(";");
printf(" - name: %s - ", (char *)key);
dump_variant(value);
printf("\n");
+
+ return 1;
}
static Eina_Bool
printf("values:\n");
eina_hash_foreach(value, dump_values, NULL);
printf("\n");
+
+ return 1;
}
static int
-cb_nms_connection_secrets(void *data, Ecore_Hash *secrets)
+cb_nms_connection_secrets(void *data, Eina_Hash *secrets)
{
printf("Secrets:\n");
if (secrets)
}
static int
-cb_nms_connection_settings(void *data, Ecore_Hash *settings)
+cb_nms_connection_settings(void *data, Eina_Hash *settings)
{
printf("Settings:\n");
if (settings)
{
- if (ecore_hash_get(settings, "802-11-wireless-security"))
+ if (eina_hash_find(settings, "802-11-wireless-security"))
e_nms_connection_secrets_get_secrets(data, "802-11-wireless-security", NULL, 0, cb_nms_connection_secrets, NULL);
eina_hash_foreach(settings, dump_settings, NULL);
+ eina_hash_free(settings);
}
return 1;
}
static int
-cb_nms_connections(void *data, Ecore_List *list)
+cb_nms_connections(void *data, Eina_List *list)
{
E_NMS_Connection *conn;
+ Eina_List *l;
- if (list)
+ EINA_LIST_FOREACH(list, l, conn)
{
- ecore_list_first_goto(list);
- while ((conn = ecore_list_next(list)))
- {
- e_nms_connection_dump(conn);
- e_nms_connection_get_settings(conn, cb_nms_connection_settings, conn);
- }
- //ecore_list_destroy(list);
+ e_nms_connection_dump(conn);
+ e_nms_connection_get_settings(conn, cb_nms_connection_settings, conn);
}
//ecore_main_loop_quit();
//e_nms_list_connections(nms, cb_nms_connections, nms);
cb_active_connection(void *data, E_NM_Active_Connection *conn)
{
const char *device;
+ Eina_List *l;
+
e_nm_deactivate_connection(nm, conn);
- ecore_list_first_goto(conn->devices);
- while ((device = ecore_list_next(conn->devices)))
+ EINA_LIST_FOREACH(conn->devices, l, device)
e_nm_device_get(nm, device, cb_activate_connection, conn);
/*
e_nm_active_connection_dump(conn);
}
static int
-cb_access_points(void *data, Ecore_List *list)
+cb_access_points(void *data, Eina_List *list)
{
E_NM_Access_Point *ap;
+ Eina_List *l;
- if (list)
+ EINA_LIST_FREE(list, ap)
{
- ecore_list_first_goto(list);
- while ((ap = ecore_list_next(list)))
- {
- e_nm_access_point_dump(ap);
- }
- ecore_list_destroy(list);
+ e_nm_access_point_dump(ap);
+ e_nm_access_point_free(ap);
}
return 1;
}
static int
-cb_get_devices(void *data, Ecore_List *list)
+cb_get_devices(void *data, Eina_List *list)
{
E_NM_Device *device;
+ Eina_List *l;
- if (list)
+ EINA_LIST_FOREACH(list, l, device)
{
- ecore_list_first_goto(list);
- while ((device = ecore_list_next(list)))
+ e_nm_device_dump(device);
+ if (device->device_type == E_NM_DEVICE_TYPE_WIRELESS)
{
- e_nm_device_dump(device);
- if (device->device_type == E_NM_DEVICE_TYPE_WIRELESS)
- {
- /*
- e_nm_device_wireless_get_access_points(device, cb_access_points, NULL);
- e_nm_access_point_get(nm, device->wireless.active_access_point, cb_access_point, NULL);
- e_nm_ip4_config_get(nm, device->ip4_config, cb_ip4_config, NULL);
- */
- }
+ /*
+ e_nm_device_wireless_get_access_points(device, cb_access_points, NULL);
+ e_nm_access_point_get(nm, device->wireless.active_access_point, cb_access_point, NULL);
+ e_nm_ip4_config_get(nm, device->ip4_config, cb_ip4_config, NULL);
+ */
}
- //ecore_list_destroy(list);
}
//ecore_main_loop_quit();
return 1;
static int
cb_nms(void *data, E_NMS *reply)
{
- Ecore_Hash *settings, *values;
+ Eina_Hash *settings, *values;
E_NM_Variant variant;
const char ssid[] = { };
const char *bssids[] = { };
- 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));
/* connection */
- values = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(values, free);
- ecore_hash_free_value_cb_set(values, ECORE_FREE_CB(e_nm_variant_free));
- ecore_hash_set(settings, strdup("connection"), values);
+ values = eina_hash_string_small_new(EINA_FREE_CB(e_nm_variant_free));
+ eina_hash_add(settings, strdup("connection"), values);
memset(&variant, 0, sizeof(E_NM_Variant));
variant.type = 't';
variant.t = 1228201388;
- ecore_hash_set(values, strdup("timestamp"), memdup(&variant, sizeof(E_NM_Variant)));
+ eina_hash_add(values, strdup("timestamp"), memdup(&variant, sizeof(E_NM_Variant)));
memset(&variant, 0, sizeof(E_NM_Variant));
variant.type = 's';
variant.s = strdup("");
- ecore_hash_set(values, strdup("id"), memdup(&variant, sizeof(E_NM_Variant)));
+ eina_hash_add(values, strdup("id"), memdup(&variant, sizeof(E_NM_Variant)));
memset(&variant, 0, sizeof(E_NM_Variant));
variant.type = 's';
variant.s = strdup("");
- ecore_hash_set(values, strdup("uuid"), memdup(&variant, sizeof(E_NM_Variant)));
+ eina_hash_add(values, strdup("uuid"), memdup(&variant, sizeof(E_NM_Variant)));
memset(&variant, 0, sizeof(E_NM_Variant));
variant.type = 's';
variant.s = strdup("802-11-wireless");
- ecore_hash_set(values, strdup("type"), memdup(&variant, sizeof(E_NM_Variant)));
+ eina_hash_add(values, strdup("type"), memdup(&variant, sizeof(E_NM_Variant)));
memset(&variant, 0, sizeof(E_NM_Variant));
variant.type = 'b';
variant.b = 0;
- ecore_hash_set(values, strdup("autoconnect"), memdup(&variant, sizeof(E_NM_Variant)));
+ eina_hash_add(values, strdup("autoconnect"), memdup(&variant, sizeof(E_NM_Variant)));
/* 802-11-wireless */
- values = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(values, free);
- ecore_hash_free_value_cb_set(values, ECORE_FREE_CB(e_nm_variant_free));
- ecore_hash_set(settings, strdup("802-11-wireless"), values);
+ values = eina_hash_string_small_new(EINA_FREE_CB(e_nm_variant_free));
+ eina_hash_add(settings, strdup("802-11-wireless"), values);
memset(&variant, 0, sizeof(E_NM_Variant));
variant.type = 's';
variant.s = strdup("mode");
- ecore_hash_set(values, strdup("infrastructure"), memdup(&variant, sizeof(E_NM_Variant)));
- ecore_hash_set(values, strdup("ssid"), e_nm_variant_array_new('y', ssid, sizeof(ssid) / sizeof(ssid[0])));
- ecore_hash_set(values, strdup("seen-bssids"), e_nm_variant_array_new('s', bssids, sizeof(bssids) / sizeof(bssids[0])));
+ eina_hash_add(values, strdup("infrastructure"), memdup(&variant, sizeof(E_NM_Variant)));
+ eina_hash_add(values, strdup("ssid"), e_nm_variant_array_new('y', ssid, sizeof(ssid) / sizeof(ssid[0])));
+ eina_hash_add(values, strdup("seen-bssids"), e_nm_variant_array_new('s', bssids, sizeof(bssids) / sizeof(bssids[0])));
memset(&variant, 0, sizeof(E_NM_Variant));
variant.type = 's';
variant.s = strdup("802-11-wireless-security");
- ecore_hash_set(values, strdup("security"), memdup(&variant, sizeof(E_NM_Variant)));
+ eina_hash_add(values, strdup("security"), memdup(&variant, sizeof(E_NM_Variant)));
/* ipv4 */
- values = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(values, free);
- ecore_hash_free_value_cb_set(values, ECORE_FREE_CB(e_nm_variant_free));
- ecore_hash_set(settings, strdup("ipv4"), values);
+ values = eina_hash_string_small_new(EINA_FREE_CB(e_nm_variant_free));
+ eina_hash_add(settings, strdup("ipv4"), values);
memset(&variant, 0, sizeof(E_NM_Variant));
variant.type = 's';
variant.s = strdup("auto");
- ecore_hash_set(values, strdup("method"), memdup(&variant, sizeof(E_NM_Variant)));
+ eina_hash_add(values, strdup("method"), memdup(&variant, sizeof(E_NM_Variant)));
/* 802-11-wireless-security */
- values = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(values, free);
- ecore_hash_free_value_cb_set(values, ECORE_FREE_CB(e_nm_variant_free));
- ecore_hash_set(settings, strdup("802-11-wireless-security"), values);
+ values = eina_hash_string_small_new(EINA_FREE_CB(e_nm_variant_free));
+ eina_hash_add(settings, strdup("802-11-wireless-security"), values);
memset(&variant, 0, sizeof(E_NM_Variant));
variant.type = 's';
variant.s = strdup("none");
- ecore_hash_set(values, strdup("key-mgmt"), memdup(&variant, sizeof(E_NM_Variant)));
+ eina_hash_add(values, strdup("key-mgmt"), memdup(&variant, sizeof(E_NM_Variant)));
memset(&variant, 0, sizeof(E_NM_Variant));
variant.type = 's';
variant.s = strdup("open");
- ecore_hash_set(values, strdup("auth-alg"), memdup(&variant, sizeof(E_NM_Variant)));
+ eina_hash_add(values, strdup("auth-alg"), memdup(&variant, sizeof(E_NM_Variant)));
memset(&variant, 0, sizeof(E_NM_Variant));
variant.type = 's';
variant.s = strdup("");
- ecore_hash_set(values, strdup("wep-key0"), memdup(&variant, sizeof(E_NM_Variant)));
+ eina_hash_add(values, strdup("wep-key0"), memdup(&variant, sizeof(E_NM_Variant)));
nms = reply;
e_nms_dump(nms);
#ifndef E_DBUS_COLOR_DEFAULT
#define E_DBUS_COLOR_DEFAULT EINA_COLOR_CYAN
#endif
-extern int _e_dbus_log_dom;
+EAPI extern int _e_dbus_log_dom;
#define DBG(...) EINA_LOG_DOM_DBG(_e_dbus_log_dom, __VA_ARGS__)
#define INFO(...) EINA_LOG_DOM_INFO(_e_dbus_log_dom, __VA_ARGS__)
#define WARN(...) EINA_LOG_DOM_WARN(_e_dbus_log_dom, __VA_ARGS__)
#define E_NM_H
#include <E_DBus.h>
-#include <Ecore_Data.h>
+#include <Eina.h>
/*
* TODO:
{
int wireless_enabled; /* writeable*/
int wireless_hardware_enabled;
- Ecore_List *active_connections;
+ Eina_List *active_connections;
E_NM_State state;
};
E_NM_802_11_Ap_Flags flags;
E_NM_802_11_Ap_Sec wpa_flags;
E_NM_802_11_Ap_Sec rsn_flags;
- Ecore_List *ssid; /* unsigned char */
+ Eina_List *ssid; /* unsigned char */
unsigned int frequency;
char *hw_address;
E_NM_802_11_Mode mode;
typedef struct E_NM_IP4_Config E_NM_IP4_Config;
struct E_NM_IP4_Config
{
- Ecore_List *addresses; /* list unsigned int */
- Ecore_List *nameservers;/* unsigned int */
- Ecore_List *domains; /* char* */
- Ecore_List *routes; /* list unsigned int */
+ Eina_List *addresses; /* list unsigned int */
+ Eina_List *nameservers;/* unsigned int */
+ Eina_List *domains; /* char* */
+ Eina_List *routes; /* list unsigned int */
};
/* TODO typedef struct E_NM_DHCP4_Config E_NM_DHCP4_Config; */
struct E_NMS
{
const char *service_name;
- Ecore_List *unmanaged_devices; /* object_path */
+ Eina_List *unmanaged_devices; /* object_path */
char *hostname;
};
char *service_name;
char *connection; /* object_path */
char *specific_object; /* object_path */
- Ecore_List *devices; /* object_path */
+ Eina_List *devices; /* object_path */
E_NM_Active_Connection_State state;
int def; /* default */
};
char *s;
unsigned long long t;
int b;
- Ecore_List *a;
+ Eina_List *a;
};
char type;
};
EAPI int e_nm_wireless_enabled_set(E_NM *nm, int enabled);
- EAPI int e_nm_get_devices(E_NM *nm, int (*cb_func)(void *data, Ecore_List *list), void *data);
+ EAPI int e_nm_get_devices(E_NM *nm, int (*cb_func)(void *data, Eina_List *list), void *data);
/* TODO: Add return value cb */
EAPI int e_nm_activate_connection(E_NM *nm, const char *service_name, const char *connection, E_NM_Device *device, const char *specific_object);
EAPI int e_nm_deactivate_connection(E_NM *nm, E_NM_Active_Connection *connection);
EAPI void e_nm_device_free(E_NM_Device *device);
EAPI void e_nm_device_dump(E_NM_Device *device);
- EAPI int e_nm_device_wireless_get_access_points(E_NM_Device *device, int (*cb_func)(void *data, Ecore_List *access_points), void *data);
+ EAPI int e_nm_device_wireless_get_access_points(E_NM_Device *device, int (*cb_func)(void *data, Eina_List *access_points), void *data);
EAPI void e_nm_device_data_set(E_NM_Device *device, void *data);
EAPI void *e_nm_device_data_get(E_NM_Device *device);
EAPI void e_nms_free(E_NMS *nms);
EAPI void e_nms_dump(E_NMS *nms);
EAPI int e_nms_list_connections(E_NMS *nms,
- int (*cb_func)(void *data, Ecore_List *list),
+ int (*cb_func)(void *data, Eina_List *list),
void *data);
EAPI void e_nms_callback_new_connection_set(E_NMS *nms, int (*cb_func)(E_NMS *nms, const char *service_name, const char *connection));
/* org.freedesktop.NetworkManagerSettings.System */
EAPI int e_nms_system_save_hostname(E_NMS *nms, const char *hostname);
- EAPI int e_nms_system_add_connection(E_NMS *nms, Ecore_Hash *settings);
+ EAPI int e_nms_system_add_connection(E_NMS *nms, Eina_Hash *settings);
EAPI void e_nms_system_callback_properties_changed_set(E_NMS *nms, int (*cb_func)(E_NMS *nms));
/* TODO: e_nms_connection_delete */
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 int e_nms_connection_secrets_get_secrets(E_NMS_Connection *connection, const char *setting_name, Eina_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));
+ EAPI void e_nms_connection_callback_updated_set(E_NMS_Connection *connection, int (*cb_func)(E_NMS_Connection *conn, Eina_Hash *settings));
/* TODO: e_nms_connection_callback_removed_set */
/* org.freedesktop.NetworkManager.Connection.Active api */
dbus_message_get_args(msg, &err, DBUS_TYPE_UINT32, &state, DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err))
{
- E_DBUS_LOG_ERR("%s - %s", err.name, err.message);
+ ERR("%s - %s", err.name, err.message);
return;
}
dbus_message_get_args(msg, &err, DBUS_TYPE_OBJECT_PATH, &device, DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err))
{
- E_DBUS_LOG_ERR("%s - %s", err.name, err.message);
+ ERR("%s - %s", err.name, err.message);
return;
}
dbus_message_get_args(msg, &err, DBUS_TYPE_OBJECT_PATH, &device, DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err))
{
- E_DBUS_LOG_ERR("%s - %s", err.name, err.message);
+ ERR("%s - %s", err.name, err.message);
return;
}
nmi->conn = e_dbus_bus_get(DBUS_BUS_SYSTEM);
if (!nmi->conn) goto error;
- nmi->handlers = ecore_list_new();
- ecore_list_append(nmi->handlers, e_nm_signal_handler_add(nmi->conn, "StateChanged", cb_state_changed, nmi));
- ecore_list_append(nmi->handlers, e_nm_signal_handler_add(nmi->conn, "PropertiesChanged", cb_properties_changed, nmi));
- ecore_list_append(nmi->handlers, e_nm_signal_handler_add(nmi->conn, "DeviceAdded", cb_device_added, nmi));
- ecore_list_append(nmi->handlers, e_nm_signal_handler_add(nmi->conn, "DeviceRemoved", cb_device_removed, nmi));
+ nmi->handlers = NULL;
+ nmi->handlers = eina_list_append(nmi->handlers, e_nm_signal_handler_add(nmi->conn, "StateChanged", cb_state_changed, nmi));
+ nmi->handlers = eina_list_append(nmi->handlers, e_nm_signal_handler_add(nmi->conn, "PropertiesChanged", cb_properties_changed, nmi));
+ nmi->handlers = eina_list_append(nmi->handlers, e_nm_signal_handler_add(nmi->conn, "DeviceAdded", cb_device_added, nmi));
+ nmi->handlers = eina_list_append(nmi->handlers, e_nm_signal_handler_add(nmi->conn, "DeviceRemoved", cb_device_removed, nmi));
return property_get(nmi->conn, d);
e_nm_free(E_NM *nm)
{
E_NM_Internal *nmi;
+ void *data;
if (!nm) return;
nmi = (E_NM_Internal *)nm;
- if (nmi->nm.active_connections) ecore_list_destroy(nmi->nm.active_connections);
- if (nmi->handlers)
- {
- E_DBus_Signal_Handler *sh;
-
- while ((sh = ecore_list_first_remove(nmi->handlers)))
- e_dbus_signal_handler_del(nmi->conn, sh);
- ecore_list_destroy(nmi->handlers);
- }
+ EINA_LIST_FREE(nmi->nm.active_connections, data)
+ free(data);
+ EINA_LIST_FREE(nmi->handlers, data)
+ e_dbus_signal_handler_del(nmi->conn, data);
e_dbus_connection_close(nmi->conn);
free(nmi);
}
e_nm_dump(E_NM *nm)
{
const char *conn;
+ Eina_List *l;
if (!nm) return;
- INFO("E_NM:");
- INFO("wireless_enabled : %d", nm->wireless_enabled);
- INFO("wireless_hardware_enabled: %d", nm->wireless_hardware_enabled);
- INFO("active_connections :");
- if (nm->active_connections)
- {
- ecore_list_first_goto(nm->active_connections);
- while ((conn = ecore_list_next(nm->active_connections)))
- INFO(" - %s", conn);
- }
- INFO("state : ");
+ printf("E_NM:\n");
+ printf("wireless_enabled : %d\n", nm->wireless_enabled);
+ printf("wireless_hardware_enabled: %d\n", nm->wireless_hardware_enabled);
+ printf("active_connections :\n");
+ EINA_LIST_FOREACH(nm->active_connections, l, conn)
+ printf(" - %s\n", conn);
+ printf("state : ");
switch (nm->state)
{
case E_NM_STATE_UNKNOWN:
- INFO("E_NM_STATE_UNKNOWN");
+ printf("E_NM_STATE_UNKNOWN\n");
break;
case E_NM_STATE_ASLEEP:
- INFO("E_NM_STATE_ASLEEP");
+ printf("E_NM_STATE_ASLEEP\n");
break;
case E_NM_STATE_CONNECTING:
- INFO("E_NM_STATE_CONNECTING");
+ printf("E_NM_STATE_CONNECTING\n");
break;
case E_NM_STATE_CONNECTED:
- INFO("E_NM_STATE_CONNECTED");
+ printf("E_NM_STATE_CONNECTED\n");
break;
case E_NM_STATE_DISCONNECTED:
- INFO("E_NM_STATE_DISCONNECTED");
+ printf("E_NM_STATE_DISCONNECTED\n");
break;
}
- INFO("");
}
EAPI void
d->object = strdup(access_point);
d->interface = E_NM_INTERFACE_ACCESSPOINT;
- ap->handlers = ecore_list_new();
- ecore_list_append(ap->handlers, e_nm_access_point_signal_handler_add(nmi->conn, access_point, "PropertiesChanged", cb_properties_changed, ap));
+ ap->handlers = eina_list_append(ap->handlers, e_nm_access_point_signal_handler_add(nmi->conn, access_point, "PropertiesChanged", cb_properties_changed, ap));
return property_get(nmi->conn, d);
}
e_nm_access_point_free(E_NM_Access_Point *access_point)
{
E_NM_Access_Point_Internal *ap;
+ void *data;
if (!access_point) return;
ap = (E_NM_Access_Point_Internal *)access_point;
if (ap->ap.path) free(ap->ap.path);
- if (ap->ap.ssid) ecore_list_destroy(ap->ap.ssid);
+ EINA_LIST_FREE(ap->ap.ssid, data)
+ free(data);
if (ap->ap.hw_address) free(ap->ap.hw_address);
- if (ap->handlers)
- {
- E_DBus_Signal_Handler *sh;
-
- while ((sh = ecore_list_first_remove(ap->handlers)))
- e_dbus_signal_handler_del(ap->nmi->conn, sh);
- ecore_list_destroy(ap->handlers);
- }
+ EINA_LIST_FREE(ap->handlers, data)
+ e_dbus_signal_handler_del(ap->nmi->conn, data);
free(ap);
}
EAPI void
e_nm_access_point_dump(E_NM_Access_Point *ap)
{
+ Eina_List *l;
char buffer[1024];
- unsigned char *c;
+ char *c;
if (!ap) return;
- E_DBUS_LOG_INFO("E_NM_Access_Point:");
- E_DBUS_LOG_INFO("flags :");
+ INFO("E_NM_Access_Point:");
+ INFO("flags :");
if (ap->flags & E_NM_802_11_AP_FLAGS_PRIVACY)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_FLAGS_PRIVACY");
+ INFO(" E_NM_802_11_AP_FLAGS_PRIVACY");
if (ap->flags == E_NM_802_11_AP_FLAGS_NONE)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_FLAGS_NONE");
- E_DBUS_LOG_INFO("");
- E_DBUS_LOG_INFO("wpa_flags :");
+ INFO(" E_NM_802_11_AP_FLAGS_NONE");
+ INFO("wpa_flags :");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_PAIR_WEP40)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_WEP40");
+ INFO(" E_NM_802_11_AP_SEC_PAIR_WEP40");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_PAIR_WEP104)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_WEP104");
+ INFO(" E_NM_802_11_AP_SEC_PAIR_WEP104");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_PAIR_TKIP)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_TKIP");
+ INFO(" E_NM_802_11_AP_SEC_PAIR_TKIP");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_PAIR_CCMP)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_CCMP");
+ INFO(" E_NM_802_11_AP_SEC_PAIR_CCMP");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_GROUP_WEP40)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_WEP40");
+ INFO(" E_NM_802_11_AP_SEC_GROUP_WEP40");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_GROUP_WEP104)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_WEP104");
+ INFO(" E_NM_802_11_AP_SEC_GROUP_WEP104");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_GROUP_TKIP)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_TKIP");
+ INFO(" E_NM_802_11_AP_SEC_GROUP_TKIP");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_GROUP_CCMP)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_CCMP");
+ INFO(" E_NM_802_11_AP_SEC_GROUP_CCMP");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_KEY_MGMT_PSK)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_KEY_MGMT_PSK");
+ INFO(" E_NM_802_11_AP_SEC_KEY_MGMT_PSK");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_KEY_MGMT_802_1X)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_KEY_MGMT_802_1X");
+ INFO(" E_NM_802_11_AP_SEC_KEY_MGMT_802_1X");
if (ap->wpa_flags == E_NM_802_11_AP_SEC_NONE)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_NONE");
- E_DBUS_LOG_INFO("");
- E_DBUS_LOG_INFO("rsn_flags :");
+ INFO(" E_NM_802_11_AP_SEC_NONE");
+ INFO("rsn_flags :");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_PAIR_WEP40)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_WEP40");
+ INFO(" E_NM_802_11_AP_SEC_PAIR_WEP40");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_PAIR_WEP104)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_WEP104");
+ INFO(" E_NM_802_11_AP_SEC_PAIR_WEP104");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_PAIR_TKIP)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_TKIP");
+ INFO(" E_NM_802_11_AP_SEC_PAIR_TKIP");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_PAIR_CCMP)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_CCMP");
+ INFO(" E_NM_802_11_AP_SEC_PAIR_CCMP");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_GROUP_WEP40)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_WEP40");
+ INFO(" E_NM_802_11_AP_SEC_GROUP_WEP40");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_GROUP_WEP104)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_WEP104");
+ INFO(" E_NM_802_11_AP_SEC_GROUP_WEP104");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_GROUP_TKIP)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_TKIP");
+ INFO(" E_NM_802_11_AP_SEC_GROUP_TKIP");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_GROUP_CCMP)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_CCMP");
+ INFO(" E_NM_802_11_AP_SEC_GROUP_CCMP");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_KEY_MGMT_PSK)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_KEY_MGMT_PSK");
+ INFO(" E_NM_802_11_AP_SEC_KEY_MGMT_PSK");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_KEY_MGMT_802_1X)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_KEY_MGMT_802_1X");
+ INFO(" E_NM_802_11_AP_SEC_KEY_MGMT_802_1X");
if (ap->rsn_flags == E_NM_802_11_AP_SEC_NONE)
- E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_NONE");
- E_DBUS_LOG_INFO("");
+ INFO(" E_NM_802_11_AP_SEC_NONE");
strcpy(buffer, "ssid : ");
- if (ap->ssid)
- {
-
- ecore_list_first_goto(ap->ssid);
- while ((c = ecore_list_next(ap->ssid)))
- snprintf("%s%c", buffer, *c);
- }
- E_DBUS_LOG_INFO("%s", buffer);
- E_DBUS_LOG_INFO("frequency : %u", ap->frequency);
- E_DBUS_LOG_INFO("hw_address : %s", ap->hw_address);
- E_DBUS_LOG_INFO("mode : ");
+ EINA_LIST_FOREACH(ap->ssid, l, c)
+ strcat(buffer, c);
+ INFO("%s", buffer);
+ INFO("frequency : %u", ap->frequency);
+ INFO("hw_address : %s", ap->hw_address);
+ INFO("mode : ");
switch (ap->mode)
{
case E_NM_802_11_MODE_UNKNOWN:
- E_DBUS_LOG_INFO("E_NM_802_11_MODE_UNKNOWN");
+ INFO("E_NM_802_11_MODE_UNKNOWN");
break;
case E_NM_802_11_MODE_ADHOC:
- E_DBUS_LOG_INFO("E_NM_802_11_MODE_ADHOC");
+ INFO("E_NM_802_11_MODE_ADHOC");
break;
case E_NM_802_11_MODE_INFRA:
- E_DBUS_LOG_INFO("E_NM_802_11_MODE_INFRA");
+ INFO("E_NM_802_11_MODE_INFRA");
break;
}
- E_DBUS_LOG_INFO("max_bitrate: %u", ap->max_bitrate);
- E_DBUS_LOG_INFO("strength : %u", ap->strength);
- E_DBUS_LOG_INFO("");
+ INFO("max_bitrate: %u", ap->max_bitrate);
+ INFO("strength : %u", ap->strength);
}
EAPI void
EAPI void
e_nm_active_connection_free(E_NM_Active_Connection *conn)
{
+ void *data;
+
if (!conn) return;
if (conn->path) free(conn->path);
if (conn->service_name) free(conn->service_name);
if (conn->connection) free(conn->connection);
if (conn->specific_object) free(conn->specific_object);
- if (conn->devices) ecore_list_destroy(conn->devices);
+ EINA_LIST_FREE(conn->devices, data)
+ free(data);
free(conn);
}
EAPI void
e_nm_active_connection_dump(E_NM_Active_Connection *conn)
{
+ Eina_List *l;
const char *device;
if (!conn) return;
- E_DBUS_LOG_INFO("E_NM_Active_Connection:");
- E_DBUS_LOG_INFO("service_name : %s", conn->service_name);
- E_DBUS_LOG_INFO("connection : %s", conn->connection);
- E_DBUS_LOG_INFO("specific_object: %s", conn->specific_object);
- E_DBUS_LOG_INFO("devices :");
- ecore_list_first_goto(conn->devices);
- while ((device = ecore_list_next(conn->devices)))
- E_DBUS_LOG_INFO(" - %s", device);
- E_DBUS_LOG_INFO("state : ");
+ printf("E_NM_Active_Connection:\n");
+ printf("service_name : %s\n", conn->service_name);
+ printf("connection : %s\n", conn->connection);
+ printf("specific_object: %s\n", conn->specific_object);
+ printf("devices :\n");
+ EINA_LIST_FOREACH(conn->devices, l, device)
+ printf(" - %s\n", device);
+ printf("state : ");
switch (conn->state)
{
case E_NM_ACTIVE_CONNECTION_STATE_UNKNOWN:
- E_DBUS_LOG_INFO("E_NM_ACTIVE_CONNECTION_STATE_UNKNOWN");
+ printf("E_NM_ACTIVE_CONNECTION_STATE_UNKNOWN\n");
break;
case E_NM_ACTIVE_CONNECTION_STATE_ACTIVATING:
- E_DBUS_LOG_INFO("E_NM_ACTIVE_CONNECTION_STATE_ACTIVATING");
+ printf("E_NM_ACTIVE_CONNECTION_STATE_ACTIVATING\n");
break;
case E_NM_ACTIVE_CONNECTION_STATE_ACTIVATED:
- E_DBUS_LOG_INFO("E_NM_ACTIVE_CONNECTION_STATE_ACTIVATED");
+ printf("E_NM_ACTIVE_CONNECTION_STATE_ACTIVATED\n");
break;
}
- E_DBUS_LOG_INFO("default : %d", conn->def);
- E_DBUS_LOG_INFO("");
+ printf("default : %d\n", conn->def);
}
DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err))
{
- E_DBUS_LOG_ERR("%s - %s", err.name, err.message);
+ ERR("%s - %s", err.name, err.message);
return;
}
DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err))
{
- E_DBUS_LOG_ERR("%s - %s", err.name, err.message);
+ ERR("%s - %s", err.name, err.message);
return;
}
DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err))
{
- E_DBUS_LOG_ERR("%s - %s", err.name, err.message);
+ ERR("%s - %s", err.name, err.message);
return;
}
case E_NM_DEVICE_TYPE_WIRED:
data->property = device_wired_properties;
data->interface = E_NM_INTERFACE_DEVICE_WIRED;
- ecore_list_append(dev->handlers, e_nm_device_wired_signal_handler_add(data->nmi->conn, dev->dev.udi, "PropertiesChanged", cb_wired_properties_changed, dev));
+ dev->handlers = eina_list_append(dev->handlers, e_nm_device_wired_signal_handler_add(data->nmi->conn, dev->dev.udi, "PropertiesChanged", cb_wired_properties_changed, dev));
property_get(data->nmi->conn, data);
break;
case E_NM_DEVICE_TYPE_WIRELESS:
data->property = device_wireless_properties;
data->interface = E_NM_INTERFACE_DEVICE_WIRELESS;
- ecore_list_append(dev->handlers, e_nm_device_wireless_signal_handler_add(data->nmi->conn, dev->dev.udi, "PropertiesChanged", cb_wireless_properties_changed, dev));
- ecore_list_append(dev->handlers, e_nm_device_wireless_signal_handler_add(data->nmi->conn, dev->dev.udi, "AccessPointAdded", cb_wireless_access_point_added, dev));
- ecore_list_append(dev->handlers, e_nm_device_wireless_signal_handler_add(data->nmi->conn, dev->dev.udi, "AccessPointRemoved", cb_wireless_access_point_removed, dev));
+ dev->handlers = eina_list_append(dev->handlers, e_nm_device_wireless_signal_handler_add(data->nmi->conn, dev->dev.udi, "PropertiesChanged", cb_wireless_properties_changed, dev));
+ dev->handlers = eina_list_append(dev->handlers, e_nm_device_wireless_signal_handler_add(data->nmi->conn, dev->dev.udi, "AccessPointAdded", cb_wireless_access_point_added, dev));
+ dev->handlers = eina_list_append(dev->handlers, e_nm_device_wireless_signal_handler_add(data->nmi->conn, dev->dev.udi, "AccessPointRemoved", cb_wireless_access_point_removed, dev));
property_get(data->nmi->conn, data);
break;
default:
}
static void
-check_done(Reply_Data *d, Ecore_List *list)
+check_done(Reply_Data *d, Eina_List *list)
{
- ecore_list_first_goto(list);
- if (ecore_list_empty_is(list))
+ if (!list)
{
d->cb_func(d->data, NULL);
- ecore_list_destroy(list);
free(d);
}
- else if (ecore_list_current(list) != (void *)-1)
+ else if (eina_list_data_get(list) != (void *)-1)
{
d->cb_func(d->data, list);
free(d);
cb_access_point(void *data, E_NM_Access_Point *ap)
{
Reply_Data *d;
- Ecore_List *list;
+ Eina_List *list;
d = data;
list = d->reply;
if (ap)
- ecore_list_append(list, ap);
- ecore_list_first_remove(list);
+ list = eina_list_append(list, ap);
+ list = eina_list_remove_list(list, list);
check_done(d, list);
+ d->reply = list;
return 1;
}
{
Reply_Data *d;
E_NM_Device_Internal *dev;
- Ecore_List *access_points;
- Ecore_List *list;
+ Eina_List *access_points;
+ Eina_List *list = NULL;
+ Eina_List *l;
const char *ap;
d = data;
dev = d->object;
if (dbus_error_is_set(err))
{
- E_DBUS_LOG_ERR("%s - %s", err->name, err->message);
+ ERR("%s - %s", err->name, err->message);
d->cb_func(d->data, NULL);
free(d);
return;
}
access_points = reply;
- ecore_list_first_goto(access_points);
- list = ecore_list_new();
- ecore_list_free_cb_set(list, ECORE_FREE_CB(e_nm_access_point_free));
- d->reply = list;
- while ((ap = ecore_list_next(access_points)))
+ //TODO: ecore_list_free_cb_set(list, ECORE_FREE_CB(e_nm_access_point_free));
+ EINA_LIST_FOREACH(access_points, l, ap)
{
- ecore_list_prepend(list, (void *)-1);
+ list = eina_list_prepend(list, (void *)-1);
+ d->reply = list;
e_nm_access_point_get(&(dev->nmi->nm), ap, cb_access_point, d);
}
}
d->object = strdup(device);
d->interface = E_NM_INTERFACE_DEVICE;
- dev->handlers = ecore_list_new();
- ecore_list_append(dev->handlers, e_nm_device_signal_handler_add(nmi->conn, device, "StateChanged", cb_state_changed, dev));
- ecore_list_append(dev->handlers, e_nm_device_signal_handler_add(nmi->conn, device, "PropertiesChanged", cb_properties_changed, dev));
+ dev->handlers = eina_list_append(dev->handlers, e_nm_device_signal_handler_add(nmi->conn, device, "StateChanged", cb_state_changed, dev));
+ dev->handlers = eina_list_append(dev->handlers, e_nm_device_signal_handler_add(nmi->conn, device, "PropertiesChanged", cb_properties_changed, dev));
return property_get(nmi->conn, d);
}
e_nm_device_free(E_NM_Device *device)
{
E_NM_Device_Internal *dev;
+ void *data;
if (!device) return;
dev = (E_NM_Device_Internal *)device;
if (dev->dev.wireless.active_access_point) free(dev->dev.wireless.active_access_point);
break;
}
- if (dev->handlers)
- {
- E_DBus_Signal_Handler *sh;
-
- while ((sh = ecore_list_first_remove(dev->handlers)))
- e_dbus_signal_handler_del(dev->nmi->conn, sh);
- ecore_list_destroy(dev->handlers);
- }
+ EINA_LIST_FREE(dev->handlers, data)
+ e_dbus_signal_handler_del(dev->nmi->conn, data);
free(dev);
}
e_nm_device_dump(E_NM_Device *dev)
{
if (!dev) return;
- E_DBUS_LOG_INFO("E_NM_Device:");
- E_DBUS_LOG_INFO("udi : %s", dev->udi);
- E_DBUS_LOG_INFO("interface : %s", dev->interface);
- E_DBUS_LOG_INFO("driver : %s", dev->driver);
- E_DBUS_LOG_INFO("capabilities :");
+ printf("E_NM_Device:\n");
+ printf("udi : %s\n", dev->udi);
+ printf("interface : %s\n", dev->interface);
+ printf("driver : %s\n", dev->driver);
+ printf("capabilities : ");
if (dev->capabilities & E_NM_DEVICE_CAP_NM_SUPPORTED)
- E_DBUS_LOG_INFO(" E_NM_DEVICE_CAP_NM_SUPPORTED");
+ printf(" E_NM_DEVICE_CAP_NM_SUPPORTED");
if (dev->capabilities & E_NM_DEVICE_CAP_CARRIER_DETECT)
- E_DBUS_LOG_INFO(" E_NM_DEVICE_CAP_CARRIER_DETECT");
+ printf(" E_NM_DEVICE_CAP_CARRIER_DETECT");
if (dev->capabilities == E_NM_DEVICE_CAP_NONE)
- E_DBUS_LOG_INFO(" E_NM_DEVICE_CAP_NONE");
- E_DBUS_LOG_INFO("");
- E_DBUS_LOG_INFO("ip4_address : %s", ip4_address2str(dev->ip4_address));
- E_DBUS_LOG_INFO("state : ");
+ printf(" E_NM_DEVICE_CAP_NONE");
+ printf("\n");
+ printf("ip4_address : %s\n", ip4_address2str(dev->ip4_address));
+ printf("state : ");
switch (dev->state)
{
case E_NM_DEVICE_STATE_UNKNOWN:
- E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_UNKNOWN");
+ printf("E_NM_DEVICE_STATE_UNKNOWN\n");
break;
case E_NM_DEVICE_STATE_UNMANAGED:
- E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_UNMANAGED");
+ printf("E_NM_DEVICE_STATE_UNMANAGED\n");
break;
case E_NM_DEVICE_STATE_UNAVAILABLE:
- E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_UNAVAILABLE");
+ printf("E_NM_DEVICE_STATE_UNAVAILABLE\n");
break;
case E_NM_DEVICE_STATE_DISCONNECTED:
- E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_DISCONNECTED");
+ printf("E_NM_DEVICE_STATE_DISCONNECTED\n");
break;
case E_NM_DEVICE_STATE_PREPARE:
- E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_PREPARE");
+ printf("E_NM_DEVICE_STATE_PREPARE\n");
break;
case E_NM_DEVICE_STATE_CONFIG:
- E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_CONFIG");
+ printf("E_NM_DEVICE_STATE_CONFIG\n");
break;
case E_NM_DEVICE_STATE_NEED_AUTH:
- E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_NEED_AUTH");
+ printf("E_NM_DEVICE_STATE_NEED_AUTH\n");
break;
case E_NM_DEVICE_STATE_IP_CONFIG:
- E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_IP_CONFIG");
+ printf("E_NM_DEVICE_STATE_IP_CONFIG\n");
break;
case E_NM_DEVICE_STATE_ACTIVATED:
- E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_ACTIVATED");
+ printf("E_NM_DEVICE_STATE_ACTIVATED\n");
break;
case E_NM_DEVICE_STATE_FAILED:
- E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_FAILED");
+ printf("E_NM_DEVICE_STATE_FAILED\n");
break;
}
- E_DBUS_LOG_INFO("ip4_config : %s", dev->ip4_config);
- E_DBUS_LOG_INFO("dhcp4_config : %s", dev->dhcp4_config);
- E_DBUS_LOG_INFO("managed : %d", dev->managed);
- E_DBUS_LOG_INFO("device_type : %u", dev->device_type);
+ printf("ip4_config : %s\n", dev->ip4_config);
+ printf("dhcp4_config : %s\n", dev->dhcp4_config);
+ printf("managed : %d\n", dev->managed);
+ printf("device_type : %u\n", dev->device_type);
switch (dev->device_type)
{
case E_NM_DEVICE_TYPE_WIRED:
- E_DBUS_LOG_INFO("hw_address : %s", dev->wired.hw_address);
- E_DBUS_LOG_INFO("speed : %u", dev->wired.speed);
- E_DBUS_LOG_INFO("carrier : %d", dev->wired.carrier);
+ printf("hw_address : %s\n", dev->wired.hw_address);
+ printf("speed : %u\n", dev->wired.speed);
+ printf("carrier : %d\n", dev->wired.carrier);
break;
case E_NM_DEVICE_TYPE_WIRELESS:
- E_DBUS_LOG_INFO("hw_address : %s", dev->wireless.hw_address);
- E_DBUS_LOG_INFO("mode : ");
+ printf("hw_address : %s\n", dev->wireless.hw_address);
+ printf("mode : ");
switch (dev->wireless.mode)
{
case E_NM_802_11_MODE_UNKNOWN:
- E_DBUS_LOG_INFO("E_NM_802_11_MODE_UNKNOWN");
+ printf("E_NM_802_11_MODE_UNKNOWN\n");
break;
case E_NM_802_11_MODE_ADHOC:
- E_DBUS_LOG_INFO("E_NM_802_11_MODE_ADHOC");
+ printf("E_NM_802_11_MODE_ADHOC\n");
break;
case E_NM_802_11_MODE_INFRA:
- E_DBUS_LOG_INFO("E_NM_802_11_MODE_INFRA");
+ printf("E_NM_802_11_MODE_INFRA\n");
break;
}
- E_DBUS_LOG_INFO("bitrate : %u", dev->wireless.bitrate);
- E_DBUS_LOG_INFO("active_access_point : %s", dev->wireless.active_access_point);
- E_DBUS_LOG_INFO("wireless_capabilities:");
+ printf("bitrate : %u\n", dev->wireless.bitrate);
+ printf("active_access_point : %s\n", dev->wireless.active_access_point);
+ printf("wireless_capabilities: ");
if (dev->wireless.wireless_capabilities & E_NM_802_11_DEVICE_CAP_CIPHER_WEP40)
- E_DBUS_LOG_INFO(" E_NM_802_11_DEVICE_CAP_CIPHER_WEP40");
+ printf(" E_NM_802_11_DEVICE_CAP_CIPHER_WEP40");
if (dev->wireless.wireless_capabilities & E_NM_802_11_DEVICE_CAP_CIPHER_WEP104)
- E_DBUS_LOG_INFO(" E_NM_802_11_DEVICE_CAP_CIPHER_WEP104");
+ printf(" E_NM_802_11_DEVICE_CAP_CIPHER_WEP104");
if (dev->wireless.wireless_capabilities & E_NM_802_11_DEVICE_CAP_CIPHER_TKIP)
- E_DBUS_LOG_INFO(" E_NM_802_11_DEVICE_CAP_CIPHER_TKIP");
+ printf(" E_NM_802_11_DEVICE_CAP_CIPHER_TKIP");
if (dev->wireless.wireless_capabilities & E_NM_802_11_DEVICE_CAP_CIPHER_CCMP)
- E_DBUS_LOG_INFO(" E_NM_802_11_DEVICE_CAP_CIPHER_CCMP");
+ printf(" E_NM_802_11_DEVICE_CAP_CIPHER_CCMP");
if (dev->wireless.wireless_capabilities & E_NM_802_11_DEVICE_CAP_WPA)
- E_DBUS_LOG_INFO(" E_NM_802_11_DEVICE_CAP_WPA");
+ printf(" E_NM_802_11_DEVICE_CAP_WPA");
if (dev->wireless.wireless_capabilities & E_NM_802_11_DEVICE_CAP_RSN)
- E_DBUS_LOG_INFO(" E_NM_802_11_DEVICE_CAP_RSN");
+ printf(" E_NM_802_11_DEVICE_CAP_RSN");
if (dev->wireless.wireless_capabilities == E_NM_802_11_DEVICE_CAP_NONE)
- E_DBUS_LOG_INFO(" E_NM_802_11_DEVICE_CAP_NONE");
- E_DBUS_LOG_INFO("");
+ printf(" E_NM_802_11_DEVICE_CAP_NONE");
+ printf("\n");
break;
}
- E_DBUS_LOG_INFO("");
}
EAPI int
-e_nm_device_wireless_get_access_points(E_NM_Device *device, int (*cb_func)(void *data, Ecore_List *access_points), void *data)
+e_nm_device_wireless_get_access_points(E_NM_Device *device, int (*cb_func)(void *data, Eina_List *access_points), void *data)
{
DBusMessage *msg;
Reply_Data *d;
EAPI void
e_nm_ip4_config_free(E_NM_IP4_Config *config)
{
+ Eina_List *l;
+ void *data;
+
if (!config) return;
- if (config->addresses) ecore_list_destroy(config->addresses);
- if (config->nameservers) ecore_list_destroy(config->nameservers);
- if (config->domains) ecore_list_destroy(config->domains);
- if (config->routes) ecore_list_destroy(config->routes);
+ EINA_LIST_FREE(config->addresses, l)
+ EINA_LIST_FREE(l, data)
+ free(data);
+ EINA_LIST_FREE(config->nameservers, data)
+ free(data);
+ EINA_LIST_FREE(config->domains, data)
+ free(data);
+ EINA_LIST_FREE(config->routes, l)
+ EINA_LIST_FREE(l, data)
+ free(data);
free(config);
}
{
unsigned int *u;
const char *domain;
- Ecore_List *list;
+ Eina_List *list, *l;
if (!config) return;
- E_DBUS_LOG_INFO("E_NM_IP4_Config:");
- if (config->addresses)
+ printf("E_NM_IP4_Config:\n");
+ printf("addresses :\n");
+ EINA_LIST_FOREACH(config->addresses, l, list)
{
char buffer[1024];
+ Eina_List *l2;
- E_DBUS_LOG_INFO("addresses :");
- ecore_list_first_goto(config->addresses);
- while ((list = ecore_list_next(config->addresses)))
+ strcpy(buffer, " -");
+ EINA_LIST_FOREACH(list, l2, u)
{
- strcpy(buffer, " -");
- ecore_list_first_goto(list);
- while ((u = ecore_list_next(list)))
- {
- strcat(buffer, " ");
- strcat(buffer, ip4_address2str(*u));
- }
- E_DBUS_LOG_INFO(buffer);
+ strcat(buffer, " ");
+ strcat(buffer, ip4_address2str(*u));
}
+ printf("%s\n", buffer);
}
- if (config->nameservers)
+ printf("nameservers:\n");
+ EINA_LIST_FOREACH(config->nameservers, l, u)
{
- E_DBUS_LOG_INFO("nameservers:");
- ecore_list_first_goto(config->nameservers);
- while ((u = ecore_list_next(config->nameservers)))
- E_DBUS_LOG_INFO(" - %s", ip4_address2str(*u));
+ printf(" - %s\n", ip4_address2str(*u));
}
- if (config->domains)
+ printf("domains :\n");
+ EINA_LIST_FOREACH(config->domains, l, domain)
{
- E_DBUS_LOG_INFO("domains :");
- ecore_list_first_goto(config->domains);
- while ((domain = ecore_list_next(config->domains)))
- E_DBUS_LOG_INFO(" - %s", domain);
+ printf(" - %s\n", domain);
}
- if (config->routes)
+ printf("routes :\n");
+ EINA_LIST_FOREACH(config->routes, l, list)
{
- E_DBUS_LOG_INFO("routes :");
- ecore_list_first_goto(config->routes);
- while ((list = ecore_list_next(config->routes)))
- {
- char buffer[1024];
+ char buffer[1024];
+ Eina_List *l2;
- strcpy(buffer, " -");
- ecore_list_first_goto(list);
- while ((u = ecore_list_next(list)))
- {
- strcat(buffer, " ");
- strcat(buffer, ip4_address2str(*u));
- }
- E_DBUS_LOG_INFO("%s", buffer);
+ strcpy(buffer, " -");
+ EINA_LIST_FOREACH(list, l2, u)
+ {
+ strcat(buffer, " ");
+ strcat(buffer, ip4_address2str(*u));
}
+ printf("%s\n", buffer);
}
- E_DBUS_LOG_INFO("");
}
#include "E_Nm.h"
#include "e_nm_private.h"
#include "e_dbus_private.h"
+
static void
-check_done(Reply_Data *d, Ecore_List *list)
+check_done(Reply_Data *d, Eina_List *list)
{
- ecore_list_first_goto(list);
- if (ecore_list_empty_is(list))
+ if (!list)
{
d->cb_func(d->data, NULL);
- ecore_list_destroy(list);
free(d);
}
- else if (ecore_list_current(list) != (void *)-1)
+ else if (eina_list_data_get(list) != (void *)-1)
{
d->cb_func(d->data, list);
free(d);
static int
cb_nm_device(void *data, E_NM_Device *dev)
{
- Reply_Data *d;
- Ecore_List *list;
+ Reply_Data *d;
+ Eina_List *list;
d = data;
list = d->reply;
if (dev)
- ecore_list_append(list, dev);
- ecore_list_first_remove(list);
+ list = eina_list_append(list, dev);
+ list = eina_list_remove_list(list, list);
check_done(d, list);
+ d->reply = list;
return 1;
}
{
Reply_Data *d;
E_NM *nm;
- Ecore_List *devices;
- Ecore_List *list;
+ Eina_List *devices;
+ Eina_List *list = NULL;
+ Eina_List *l;
const char *dev;
d = data;
nm = d->object;
if (dbus_error_is_set(err))
{
- E_DBUS_LOG_ERR("%s - %s", err->name, err->message);
+ ERR("%s - %s", err->name, err->message);
d->cb_func(d->data, NULL);
free(d);
return;
}
devices = reply;
- ecore_list_first_goto(devices);
- list = ecore_list_new();
- ecore_list_free_cb_set(list, ECORE_FREE_CB(e_nm_device_free));
- d->reply = list;
- while ((dev = ecore_list_next(devices)))
+ //TODO: ecore_list_free_cb_set(list, ECORE_FREE_CB(e_nm_device_free));
+ EINA_LIST_FOREACH(devices, l, dev)
{
- ecore_list_prepend(list, (void *)-1);
+ list = eina_list_prepend(list, (void *)-1);
+ d->reply = list;
e_nm_device_get(nm, dev, cb_nm_device, d);
}
}
/**
* Get all network devices.
*
- * Returns an Ecore_List of dbus object paths for network devices. This list is
+ * Returns an Eina_List of dbus object paths for network devices. This list is
* of const char *, and is freed automatically after the callback returns.
*
* @param nm an e_nm context
* @param data user data to pass to the callback function
**/
EAPI int
-e_nm_get_devices(E_NM *nm, int (*cb_func)(void *data, Ecore_List *list), void *data)
+e_nm_get_devices(E_NM *nm, int (*cb_func)(void *data, Eina_List *list), void *data)
{
DBusMessage *msg;
Reply_Data *d;
int (*properties_changed)(E_NM *nm);
int (*device_added)(E_NM *nm, const char *device);
int (*device_removed)(E_NM *nm, const char *device);
- Ecore_List *handlers;
+ Eina_List *handlers;
void *data;
};
/* TODO: Save some bytes by having internal wired and wireless object */
int (*access_point_added)(E_NM_Device *device, const char *access_point);
int (*access_point_removed)(E_NM_Device *device, const char *access_point);
- Ecore_List *handlers;
+ Eina_List *handlers;
void *data;
};
E_NM_Internal *nmi;
int (*properties_changed)(E_NM_Access_Point *device);
- Ecore_List *handlers;
+ Eina_List *handlers;
void *data;
};
int (*new_connection)(E_NMS *nms, const char *service_name, const char *connection);
int (*properties_changed)(E_NMS *nms);
- Ecore_List *handlers;
+ Eina_List *handlers;
void *data;
};
E_NMS_Connection conn;
E_NM_Internal *nmi;
- int (*updated)(E_NMS_Connection *conn, Ecore_Hash *settings);
+ int (*updated)(E_NMS_Connection *conn, Eina_Hash *settings);
/* TODO: int (*removed)(E_NMS_Connection *conn); */
- Ecore_List *handlers;
+ Eina_List *handlers;
void *data;
};
void *cb_nm_object_path_list(DBusMessage *msg, DBusError *err);
void free_nm_object_path_list(void *data);
-Ecore_Hash *parse_settings(DBusMessage *msg);
+Eina_Hash *parse_settings(DBusMessage *msg);
int check_arg_type(DBusMessageIter *iter, char type);
#include "E_DBus.h"
#include "e_dbus_private.h"
#include <string.h>
-#include <Ecore_Data.h>
#define CHECK_SIGNATURE(msg, err, sig) \
if (dbus_error_is_set((err))) \
{ \
- E_DBUS_LOG_ERR("%s - %s", (err)->name, (err)->message); \
+ ERR("%s - %s", (err)->name, (err)->message); \
return NULL; \
} \
\
if (!strcmp(t->sig, sig))
return t->func;
}
- E_DBUS_LOG_ERR("Missing property parser for sig: %s", sig);
+ ERR("Missing property parser for sig: %s", sig);
return NULL;
}
if ((value) && (!sig))
{
- E_DBUS_LOG_ERR("Can't have value and no sig");
+ ERR("Can't have value and no sig");
return NULL;
}
dbus_message_iter_get_basic(iter, &str);
if ((value) && (!sig))
{
- E_DBUS_LOG_ERR("Can't have value and no sig");
+ ERR("Can't have value and no sig");
return NULL;
}
if (sig)
property_array(DBusMessageIter *iter, const char *sig, void *value)
{
DBusMessageIter a_iter;
- Ecore_List **list;
+ Eina_List **list;
Property_Cb func;
E_NM_Variant *var = NULL;
const char *subsig = NULL;
if ((value) && (!sig))
{
- E_DBUS_LOG_ERR("Can't have value and no sig");
+ ERR("Can't have value and no sig");
return NULL;
}
dbus_message_iter_recurse(iter, &a_iter);
if (sig)
{
-
if (!check_arg_type(iter, sig[0])) return NULL;
subsig = (sig + 1);
func = find_property_cb(subsig);
if (!func) return NULL;
if (!value) value = &var;
- list = (Ecore_List **)value;
- *list = ecore_list_new();
- if (subsig[0] == 'a')
- ecore_list_free_cb_set(*list, ECORE_FREE_CB(ecore_list_destroy));
- else
- ecore_list_free_cb_set(*list, free);
+ list = (Eina_List **)value;
+ *list = NULL;
}
else
{
if (!func) return NULL;
var = malloc(sizeof(E_NM_Variant));
var->type = dbus_message_iter_get_arg_type(iter);
- list = (Ecore_List **)&var->a;
- *list = ecore_list_new();
- ecore_list_free_cb_set(*list, ECORE_FREE_CB(property_free));
+ list = (Eina_List **)&var->a;
+ *list = NULL;
}
while (dbus_message_iter_get_arg_type(&a_iter) != DBUS_TYPE_INVALID)
void *subvar;
subvar = (*func)(&a_iter, subsig, NULL);
- if (subvar) ecore_list_append(*list, subvar);
+ if (subvar) *list = eina_list_append(*list, subvar);
dbus_message_iter_next(&a_iter);
}
if ((var->type == 's') || (var->type == 'o'))
free(var->s);
else if (var->type == 'a')
- ecore_list_destroy(var->a);
+ {
+ E_NM_Variant *v;
+
+ EINA_LIST_FREE(var->a, v)
+ property_free(v);
+ }
free(var);
}
d = data;
if (dbus_error_is_set(err))
{
- E_DBUS_LOG_ERR("%s - %s", err->name, err->message);
+ ERR("%s - %s", err->name, err->message);
goto error;
}
if (!dbus_message_has_signature(msg, "v")) goto error;
void *
cb_nm_object_path_list(DBusMessage *msg, DBusError *err)
{
- Ecore_List *devices;
+ Eina_List *devices = NULL;
+ char *dev;
+
DBusMessageIter iter, sub;
CHECK_SIGNATURE(msg, err, "ao");
dbus_message_iter_init(msg, &iter);
- devices = ecore_list_new();
dbus_message_iter_recurse(&iter, &sub);
while (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_INVALID)
{
- char *dev = NULL;
-
+ dev = NULL;
if (!check_arg_type(&sub, 'o')) goto error;
dbus_message_iter_get_basic(&sub, &dev);
- if (dev) ecore_list_append(devices, dev);
+ if (dev) devices = eina_list_append(devices, strdup(dev));
dbus_message_iter_next(&sub);
}
+ printf("Hm: devices create = %p\n", devices);
return devices;
error:
- ecore_list_destroy(devices);
+ EINA_LIST_FREE(devices, dev)
+ free(dev);
return NULL;
}
void
free_nm_object_path_list(void *data)
{
- Ecore_List *list = data;
+ Eina_List *list = data;
+ char *s;
- if (list) ecore_list_destroy(list);
+ printf("Hm: devices delete = %p\n", list);
+ EINA_LIST_FREE(list, s)
+ free(s);
}
-Ecore_Hash *
+Eina_Hash *
parse_settings(DBusMessage *msg)
{
Eina_Hash *settings;
variant = malloc(sizeof(E_NM_Variant));
variant->type = 'a';
- variant->a = ecore_list_new();
- ecore_list_free_cb_set(variant->a, ECORE_FREE_CB(e_nm_variant_free));
+ variant->a = NULL;
for (i = 0; i < size; i++)
- ecore_list_append(variant->a, e_nm_variant_new(type, &(value[i])));
+ variant->a = eina_list_append(variant->a, e_nm_variant_new(type, &(value[i])));
return variant;
}
EAPI void
e_nm_variant_free(E_NM_Variant *variant)
{
- if (variant->type == 'a') ecore_list_destroy(variant->a);
+ if (variant->type == 'a')
+ {
+ void *data;
+
+ EINA_LIST_FREE(variant->a, data)
+ e_nm_variant_free(data);
+ }
else if ((variant->type == 's') || (variant->type == 'o')) free(variant->s);
free(variant);
}
{
Reply_Data *d;
E_NMS_Internal *nmsi;
- Ecore_List *connections;
- Ecore_List *list;
+ Eina_List *connections;
+ Eina_List *list = NULL;
+ Eina_List *l;
const char *path;
d = data;
nmsi = d->object;
if (dbus_error_is_set(err))
{
- E_DBUS_LOG_ERR("%s - %s", err->name, err->message);
+ ERR("%s - %s", err->name, err->message);
d->cb_func(d->data, NULL);
free(d);
return;
}
- list = ecore_list_new();
- ecore_list_free_cb_set(list, ECORE_FREE_CB(e_nms_connection_free));
+ //TODO: ecore_list_free_cb_set(list, ECORE_FREE_CB(e_nms_connection_free));
connections = reply;
- ecore_list_first_goto(connections);
- while ((path = ecore_list_next(connections)))
- ecore_list_append(list, e_nms_connection_get(&(nmsi->nms), nmsi->nms.service_name, path));
+ EINA_LIST_FOREACH(connections, l, path)
+ list = eina_list_append(list, e_nms_connection_get(&(nmsi->nms), nmsi->nms.service_name, path));
d->cb_func(d->data, list);
free(d);
}
dbus_message_get_args(msg, &err, DBUS_TYPE_OBJECT_PATH, &conn, DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err))
{
- E_DBUS_LOG_ERR("%s - %s", err.name, err.message);
+ ERR("%s - %s", err.name, err.message);
return;
}
switch (variant->type)
{
case 'a':
- E_DBUS_LOG_ERR("No support for array of array");
+ ERR("No support for array of array");
break;
case 's':
case 'o':
case 'a': {
E_NM_Variant *subvar;
DBusMessageIter a_iter;
+ Eina_List *l;
- if (!ecore_list_empty_is(variant->a))
+ if (variant->a)
{
- subvar = ecore_list_first(variant->a);
+ subvar = eina_list_data_get(variant->a);
sig[0] = 'a';
sig[1] = subvar->type;
sig[2] = 0;
dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT, sig, &v_iter);
dbus_message_iter_open_container(&v_iter, DBUS_TYPE_ARRAY, sig, &a_iter);
- ecore_list_first_goto(variant->a);
- while ((subvar = ecore_list_next(variant->a)))
+ EINA_LIST_FOREACH(variant->a, l, subvar)
add_basic(&a_iter, subvar);
dbus_message_iter_close_container(&v_iter, &a_iter);
dbus_message_iter_close_container(iter, &v_iter);
}
}
-static void
-add_value(void *value, void *data)
+static Eina_Bool
+add_value(const Eina_Hash *hash, const void *key, void *data, void *fdata)
{
- Ecore_Hash_Node *node;
- E_NM_Variant *variant;
DBusMessageIter *iter, d_iter;
- node = value;
- iter = data;
+ iter = fdata;
dbus_message_iter_open_container(iter, DBUS_TYPE_DICT_ENTRY, NULL, &d_iter);
- dbus_message_iter_append_basic(&d_iter, DBUS_TYPE_STRING, &node->key);
- add_variant(&d_iter, node->value);
+ dbus_message_iter_append_basic(&d_iter, DBUS_TYPE_STRING, &key);
+ add_variant(&d_iter, data);
dbus_message_iter_close_container(iter, &d_iter);
+
+ return 1;
}
-static void
-add_array(void *value, void *data)
+static Eina_Bool
+add_array(const Eina_Hash *hash, const void *key, void *data, void *fdata)
{
- Ecore_Hash_Node *node;
DBusMessageIter *iter, d_iter, a_iter;
- node = value;
- iter = data;
+ iter = fdata;
dbus_message_iter_open_container(iter, DBUS_TYPE_DICT_ENTRY, NULL, &d_iter);
- dbus_message_iter_append_basic(&d_iter, DBUS_TYPE_STRING, &node->key);
+ dbus_message_iter_append_basic(&d_iter, DBUS_TYPE_STRING, &key);
dbus_message_iter_open_container(&d_iter, DBUS_TYPE_ARRAY, "{sv}", &a_iter);
- ecore_hash_for_each_node(node->value, add_value, &a_iter);
+ eina_hash_foreach(data, add_value, &a_iter);
dbus_message_iter_close_container(&d_iter, &a_iter);
dbus_message_iter_close_container(iter, &d_iter);
+
+ return 1;
}
EAPI int
nmsi = calloc(1, sizeof(E_NMS_Internal));
nmsi->nmi = (E_NM_Internal *)nm;
- nmsi->handlers = ecore_list_new();
d = calloc(1, sizeof(Property_Data));
d->nmi = nmsi->nmi;
{
case E_NMS_CONTEXT_SYSTEM:
nmsi->nms.service_name = E_NMS_SERVICE_SYSTEM;
- ecore_list_append(nmsi->handlers, e_nms_signal_handler_add(nmsi->nmi->conn, nmsi->nms.service_name, "NewConnection", cb_new_connection, nmsi));
- ecore_list_append(nmsi->handlers, e_nms_system_signal_handler_add(nmsi->nmi->conn, nmsi->nms.service_name, "PropertiesChanged", cb_properties_changed, nmsi));
+ nmsi->handlers = eina_list_append(nmsi->handlers, e_nms_signal_handler_add(nmsi->nmi->conn, nmsi->nms.service_name, "NewConnection", cb_new_connection, nmsi));
+ nmsi->handlers = eina_list_append(nmsi->handlers, e_nms_system_signal_handler_add(nmsi->nmi->conn, nmsi->nms.service_name, "PropertiesChanged", cb_properties_changed, nmsi));
d->service = nmsi->nms.service_name;
//(*cb_func)(data, &(nmsi->nms));
return property_get(nmsi->nmi->conn, d);
e_nms_free(E_NMS *nms)
{
E_NMS_Internal *nmsi;
+ void *data;
+
if (!nms) return;
nmsi = (E_NMS_Internal *)nms;
- if (nms->unmanaged_devices) ecore_list_destroy(nms->unmanaged_devices);
+ EINA_LIST_FREE(nms->unmanaged_devices, data)
+ free(data);
if (nms->hostname) free(nms->hostname);
- if (nmsi->handlers)
- {
- E_DBus_Signal_Handler *sh;
-
- while ((sh = ecore_list_first_remove(nmsi->handlers)))
- e_dbus_signal_handler_del(nmsi->nmi->conn, sh);
- ecore_list_destroy(nmsi->handlers);
- }
+ EINA_LIST_FREE(nmsi->handlers, data)
+ e_dbus_signal_handler_del(nmsi->nmi->conn, data);
free(nmsi);
}
EAPI void
e_nms_dump(E_NMS *nms)
{
- if (!nms) return;
- E_DBUS_LOG_INFO("E_NMS:");
- E_DBUS_LOG_INFO("unmanaged_devices:");
- if (nms->unmanaged_devices)
- {
- const char *dev;
+ const char *dev;
+ Eina_List *l;
- ecore_list_first_goto(nms->unmanaged_devices);
- while ((dev = ecore_list_next(nms->unmanaged_devices)))
- INFO(" - %s", dev);
- }
- INFO("hostname : %s", nms->hostname);
- INFO("");
+ if (!nms) return;
+ printf("E_NMS:\n");
+ printf("unmanaged_devices:\n");
+ EINA_LIST_FOREACH(nms->unmanaged_devices, l, dev)
+ printf(" - %s\n", dev);
+ printf("hostname : %s\n", nms->hostname);
}
EAPI int
-e_nms_list_connections(E_NMS *nms, int (*cb_func)(void *data, Ecore_List *list), void *data)
+e_nms_list_connections(E_NMS *nms, int (*cb_func)(void *data, Eina_List *list), void *data)
{
DBusMessage *msg;
Reply_Data *d;
{
if (dbus_error_is_set(err))
{
- E_DBUS_LOG_ERR("%s - %s", err->name, err->message);
+ ERR("%s - %s", err->name, err->message);
}
else
{
- E_DBUS_LOG_ERR("Yay!");
+ ERR("Yay!");
}
}
EAPI int
-e_nms_system_add_connection(E_NMS *nms, Ecore_Hash *settings)
+e_nms_system_add_connection(E_NMS *nms, Eina_Hash *settings)
{
DBusMessage *msg;
DBusMessageIter iter, a_iter;
msg = e_nms_system_call_new(nms->service_name, "AddConnection");
dbus_message_iter_init_append(msg, &iter);
dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "{sa{sv}}", &a_iter);
- ecore_hash_for_each_node(settings, add_array, &a_iter);
+ eina_hash_foreach(settings, add_array, &a_iter);
dbus_message_iter_close_container(&iter, &a_iter);
ret = e_dbus_message_send(nmsi->nmi->conn, msg, cb, -1, NULL) ? 1 : 0;
cb_updated(void *data, DBusMessage *msg)
{
E_NMS_Connection_Internal *conn;
- Ecore_Hash *settings;
+ Eina_Hash *settings;
if (!msg || !data) return;
conn = data;
cb_settings(void *data, DBusMessage *msg, DBusError *err)
{
Reply_Data *d;
- Ecore_Hash *settings;
+ Eina_Hash *settings;
d = data;
if (dbus_error_is_set(err))
{
- E_DBUS_LOG_ERR("%s - %s", err->name, err->message);
+ ERR("%s - %s", err->name, err->message);
d->cb_func(d->data, NULL);
free(d);
return;
cb_secrets(void *data, DBusMessage *msg, DBusError *err)
{
Reply_Data *d;
- Ecore_Hash *secrets;
+ Eina_Hash *secrets;
d = data;
if (dbus_error_is_set(err))
{
- E_DBUS_LOG_ERR("%s - %s", err->name, err->message);
+ ERR("%s - %s", err->name, err->message);
d->cb_func(d->data, NULL);
free(d);
return;
conn->nmi = nmsi->nmi;
conn->conn.path = strdup(connection);
conn->conn.service_name = strdup(service_name);
- conn->handlers = ecore_list_new();
- ecore_list_append(conn->handlers, e_nms_connection_signal_handler_add(nmsi->nmi->conn, service_name, connection, "Updated", cb_updated, conn));
+ conn->handlers = eina_list_append(conn->handlers, e_nms_connection_signal_handler_add(nmsi->nmi->conn, service_name, connection, "Updated", cb_updated, conn));
return &conn->conn;
}
e_nms_connection_free(E_NMS_Connection *connection)
{
E_NMS_Connection_Internal *conn;
+ void *data;
if (!connection) return;
conn = (E_NMS_Connection_Internal *)connection;
if (conn->conn.service_name) free(conn->conn.service_name);
if (conn->conn.path) free(conn->conn.path);
- if (conn->handlers)
- {
- E_DBus_Signal_Handler *sh;
-
- while ((sh = ecore_list_first_remove(conn->handlers)))
- e_dbus_signal_handler_del(conn->nmi->conn, sh);
- ecore_list_destroy(conn->handlers);
- }
+ EINA_LIST_FREE(conn->handlers, data)
+ e_dbus_signal_handler_del(conn->nmi->conn, data);
free(conn);
}
{
if (!conn) return;
- E_DBUS_LOG_INFO("E_NMS_Connection:");
- E_DBUS_LOG_INFO("service_name: %s", conn->service_name);
- E_DBUS_LOG_INFO("path : %s", conn->path);
- E_DBUS_LOG_INFO("");
+ printf("E_NMS_Connection:\n");
+ printf("service_name: %s\n", conn->service_name);
+ printf("path : %s\n", conn->path);
}
EAPI int
}
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)
+e_nms_connection_secrets_get_secrets(E_NMS_Connection *connection, const char *setting_name, Eina_List *hints, int request_new, int (*cb_func)(void *data, Eina_Hash *secrets), void *data)
{
DBusMessage *msg;
DBusMessageIter iter, a_iter;
Reply_Data *d;
E_NMS_Connection_Internal *conn;
int ret;
+ const char *hint;
+ Eina_List *l;
conn = (E_NMS_Connection_Internal *)connection;
d = calloc(1, sizeof(Reply_Data));
dbus_message_iter_init_append(msg, &iter);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &setting_name);
dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "s", &a_iter);
- if (hints)
- {
- const char *hint;
- ecore_list_first_goto(hints);
- while ((hint = ecore_list_next(hints)))
- dbus_message_iter_append_basic(&a_iter, DBUS_TYPE_STRING, &hint);
- }
+ EINA_LIST_FOREACH(hints, l, hint)
+ dbus_message_iter_append_basic(&a_iter, DBUS_TYPE_STRING, &hint);
dbus_message_iter_close_container(&iter, &a_iter);
dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &request_new);
}
EAPI void
-e_nms_connection_callback_updated_set(E_NMS_Connection *connection, int (*cb_func)(E_NMS_Connection *conn, Ecore_Hash *settings))
+e_nms_connection_callback_updated_set(E_NMS_Connection *connection, int (*cb_func)(E_NMS_Connection *conn, Eina_Hash *settings))
{
E_NMS_Connection_Internal *conn;