aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/eolian
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2017-12-04 20:32:06 -0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2017-12-04 20:34:47 -0200
commit66eb8ddfebf65f944a44f8b8871a8628757fe74e (patch)
treedc3791cba5f48ee2d7f493bc7b20c8b8ba0b8f92 /src/bin/eolian
parentefl_mono: fix switched reference to generated and non-generated source file i... (diff)
downloadefl-66eb8ddfebf65f944a44f8b8871a8628757fe74e.tar.gz
eolian: Add inarray and inlist to source generation
Diffstat (limited to 'src/bin/eolian')
-rw-r--r--src/bin/eolian/sources.c28
1 files changed, 26 insertions, 2 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);