ecore_con: remove use of list<> from Efl.Net.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11044
This commit is contained in:
Cedric BAIL 2020-01-02 11:48:45 -08:00 committed by Marcel Hollerbach
parent fc0c60ca8c
commit 81cbe8bdc8
3 changed files with 10 additions and 5 deletions

View File

@ -466,7 +466,6 @@ _ctl_agent_request_input(void *data EINA_UNUSED, const Efl_Event *event)
char buf[100];
Eo *ctl = event->object;
Efl_Net_Control_Agent_Request_Input *ri = event->info;
Eina_List *n;
Efl_Net_Control_Agent_Request_Input_Information *info;
char *name = NULL;
char *username = NULL;
@ -475,10 +474,11 @@ _ctl_agent_request_input(void *data EINA_UNUSED, const Efl_Event *event)
char *wps = NULL;
Eina_Slice ssid_slice = { };
size_t len;
unsigned int n;
printf("INFO: Needs agent input!\n");
EINA_LIST_FOREACH(ri->informational, n, info)
EINA_ACCESSOR_FOREACH(ri->informational, n, info)
printf("INFO: - %s: %s\n", info->name, info->value);

View File

@ -212,6 +212,7 @@ _efl_net_control_agent_request_input(const Eldbus_Service_Interface *service, co
Efl_Net_Control_Agent_Request_Input event = { };
Efl_Net_Control_Agent_Request_Input_Information *info;
Eldbus_Message_Iter *array, *entry;
Eina_Array infos;
const char *path;
DBG("Agent %p requested input %s", o, eldbus_message_path_get(msg));
@ -231,6 +232,8 @@ _efl_net_control_agent_request_input(const Eldbus_Service_Interface *service, co
if (!eldbus_message_arguments_get(msg, "oa{sv}", &path, &array))
goto err;
eina_array_step_set(&infos, sizeof (Eina_Array), 4);
event.informational = eina_array_accessor_new(&infos);
event.access_point = _efl_net_control_access_point_find(pd, path);
while (eldbus_message_iter_get_and_next(array, 'e', &entry))
@ -261,7 +264,7 @@ _efl_net_control_agent_request_input(const Eldbus_Service_Interface *service, co
{
info = _efl_net_control_agent_informational_get(name, var);
if (info)
event.informational = eina_list_append(event.informational, info);
eina_array_push(&infos, info);
else
WRN("Unknown field name '%s'", name);
}
@ -270,7 +273,9 @@ _efl_net_control_agent_request_input(const Eldbus_Service_Interface *service, co
pd->agent_request_input.msg = eldbus_message_ref((Eldbus_Message *)msg);
efl_event_callback_call(o, EFL_NET_CONTROL_MANAGER_EVENT_AGENT_REQUEST_INPUT, &event);
EINA_LIST_FREE(event.informational, info) free(info);
eina_accessor_free(event.informational);
while ((info = eina_array_pop(&infos))) free(info);
eina_array_flush(&infos);
return NULL; /* reply later */

View File

@ -36,7 +36,7 @@ struct @beta Efl.Net.Control.Agent_Request_Input {
access_point: Efl.Net.Control.Access_Point; [[The access point which triggered this request.]]
fields: Efl.Net.Control.Agent_Request_Input_Field; [[Bitwise OR of fields present in this request.]]
passphrase_type: string; [[Extra detail for the passphrase field, such as wep, psk, response (IEEE802.X GTC/OTP), string...]]
informational: list<Efl.Net.Control.Agent_Request_Input_Information>; [[Such as the previous passphrase, VPN host]]
informational: accessor<Efl.Net.Control.Agent_Request_Input_Information>; [[Such as the previous passphrase, VPN host]]
}
struct @beta Efl.Net.Control.Agent_Error {