From 66eb8ddfebf65f944a44f8b8871a8628757fe74e Mon Sep 17 00:00:00 2001 From: Felipe Magno de Almeida Date: Mon, 4 Dec 2017 20:32:06 -0200 Subject: [PATCH] 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 2ba900c..a8a349f 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 db6f13b..bf13a57 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; + @in arr: inarray; } return: bool; } @@ -387,7 +387,7 @@ class Test.Testing (Efl.Object) { eina_inarray_int_out { params { - @out arr: inarray; + @out arr: inarray; } return: bool; } -- 2.7.4