felipealmeida pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=66eb8ddfebf65f944a44f8b8871a8628757fe74e

commit 66eb8ddfebf65f944a44f8b8871a8628757fe74e
Author: Felipe Magno de Almeida <fel...@expertisesolutions.com.br>
Date:   Mon Dec 4 20:32:06 2017 -0200

    eolian: Add inarray and inlist to source generation
---
 src/bin/eolian/sources.c           | 28 ++++++++++++++++++++++++++--
 src/tests/efl_mono/test_testing.eo |  4 ++--
 2 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c
index 2ba900c9bd..a8a349fa86 100644
--- a/src/bin/eolian/sources.c
+++ b/src/bin/eolian/sources.c
@@ -189,14 +189,20 @@ _generate_iterative_free(Eina_Strbuf **buf, const 
Eolian_Type *type, const Eolia
    iterator_header = eina_strbuf_new();
    iter_param = eina_strbuf_new();
 
+   Eolian_Type_Builtin_Type t = eolian_type_builtin_type_get(type);
+
    eina_strbuf_append_printf(iter_param, "%s_iter", 
eolian_parameter_name_get(parameter));
 
    //generate the field definition
    eina_strbuf_append_printf(*buf, "   %s", eolian_type_c_type_get(inner_type, 
EOLIAN_C_TYPE_DEFAULT));
+   if(t == EOLIAN_TYPE_BUILTIN_INARRAY
+      || t == EOLIAN_TYPE_BUILTIN_INLIST)
+     {
+       eina_strbuf_append(*buf, "*");
+     }
    eina_strbuf_append_buffer(*buf, iter_param);
    eina_strbuf_append(*buf, ";\n");
 
-   Eolian_Type_Builtin_Type t = eolian_type_builtin_type_get(type);
 
    if (t == EOLIAN_TYPE_BUILTIN_LIST)
      {
@@ -207,6 +213,24 @@ _generate_iterative_free(Eina_Strbuf **buf, const 
Eolian_Type *type, const Eolia
         eina_strbuf_append(*buf, ")\n");
         _generate_loop_content(buf, inner_type, iter_param);
      }
+   else if (t == EOLIAN_TYPE_BUILTIN_INARRAY)
+     {
+        eina_strbuf_append_printf(*buf, "   EINA_INARRAY_FOREACH(");
+        eina_strbuf_append_buffer(*buf, param);
+        eina_strbuf_append_char(*buf, ',');
+        eina_strbuf_append_buffer(*buf, iter_param);
+        eina_strbuf_append(*buf, ")\n");
+        _generate_loop_content(buf, inner_type, iter_param);
+     }
+   else if (t == EOLIAN_TYPE_BUILTIN_INLIST)
+     {
+        eina_strbuf_append_printf(*buf, "   EINA_INLIST_FREE(");
+        eina_strbuf_append_buffer(*buf, param);
+        eina_strbuf_append_char(*buf, ',');
+        eina_strbuf_append_buffer(*buf, iter_param);
+        eina_strbuf_append(*buf, ")\n");
+        _generate_loop_content(buf, inner_type, iter_param);
+     }
    else if (t == EOLIAN_TYPE_BUILTIN_ITERATOR)
      {
         eina_strbuf_append_printf(*buf, "   EINA_ITERATOR_FOREACH(");
@@ -237,7 +261,7 @@ _generate_iterative_free(Eina_Strbuf **buf, const 
Eolian_Type *type, const Eolia
      }
    else
      {
-        printf("Error, container unknown?!\n");
+        printf("Error, container unknown?! %d\n", (int)t);
      }
 
    eina_strbuf_free(iterator_header);
diff --git a/src/tests/efl_mono/test_testing.eo 
b/src/tests/efl_mono/test_testing.eo
index db6f13bcf2..bf13a57283 100644
--- a/src/tests/efl_mono/test_testing.eo
+++ b/src/tests/efl_mono/test_testing.eo
@@ -370,7 +370,7 @@ class Test.Testing (Efl.Object) {
       /* Integer */
       eina_inarray_int_in {
          params {
-            @in arr: inarray<int>;
+            @in arr: inarray<ptr(int)>;
          }
          return: bool;
       }
@@ -387,7 +387,7 @@ class Test.Testing (Efl.Object) {
 
       eina_inarray_int_out {
          params {
-            @out arr: inarray<int>;
+            @out arr: inarray<ptr(int)>;
          }
          return: bool;
       }

-- 


Reply via email to