bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=81cbe8bdc80084433cefec4896734ce32fdfc379

commit 81cbe8bdc80084433cefec4896734ce32fdfc379
Author: Cedric BAIL <[email protected]>
Date:   Thu Jan 2 11:48:45 2020 -0800

    ecore_con: remove use of list<> from Efl.Net.
    
    Reviewed-by: Marcel Hollerbach <[email protected]>
    Reviewed-by: Mike Blumenkrantz <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D11044
---
 src/examples/ecore/efl_net_control_example.c | 4 ++--
 src/lib/ecore_con/efl_net_control-connman.c  | 9 +++++++--
 src/lib/ecore_con/efl_net_control_manager.eo | 2 +-
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/examples/ecore/efl_net_control_example.c 
b/src/examples/ecore/efl_net_control_example.c
index 408ea8e6c9..f634953467 100644
--- a/src/examples/ecore/efl_net_control_example.c
+++ b/src/examples/ecore/efl_net_control_example.c
@@ -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);
 
 
diff --git a/src/lib/ecore_con/efl_net_control-connman.c 
b/src/lib/ecore_con/efl_net_control-connman.c
index 8334d4d0b2..ceb3541f31 100644
--- a/src/lib/ecore_con/efl_net_control-connman.c
+++ b/src/lib/ecore_con/efl_net_control-connman.c
@@ -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 */
 
diff --git a/src/lib/ecore_con/efl_net_control_manager.eo 
b/src/lib/ecore_con/efl_net_control_manager.eo
index 3c84235bf7..eb0a61477b 100644
--- a/src/lib/ecore_con/efl_net_control_manager.eo
+++ b/src/lib/ecore_con/efl_net_control_manager.eo
@@ -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 {

-- 


Reply via email to