Hi C# guys ;)

Thanks so much for finally merging those patches!

As for this one in particular, I don't think we want to use inarray or
inlist in the EO API.
Those types are quite weird in C, I'm not convinced we should try and
expose them outside of EFL (in EO API). We are currently not using them, I
think.

I will myself merge a large series of patches for C++ generation, including
parts and function pointer support.
I understand perfectly that the code may not be that great, but I want to
merge to master so that we have a common base for work. Please feel free to
modify or let me know what's wrong :)

Best regards,



On Tue, Dec 5, 2017 at 7:37 AM, Felipe Magno de Almeida <
fel...@expertisesolutions.com.br> wrote:

> 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;
>        }
>
> --
>
> --
> Jean-Philippe André
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to