summaryrefslogtreecommitdiff
path: root/src/bin
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
parente7803cc429a15e09b60aaff29c98a65064b405be (diff)
eolian: Add inarray and inlist to source generation
Diffstat (limited to 'src/bin')
-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
189 iterator_header = eina_strbuf_new(); 189 iterator_header = eina_strbuf_new();
190 iter_param = eina_strbuf_new(); 190 iter_param = eina_strbuf_new();
191 191
192 Eolian_Type_Builtin_Type t = eolian_type_builtin_type_get(type);
193
192 eina_strbuf_append_printf(iter_param, "%s_iter", eolian_parameter_name_get(parameter)); 194 eina_strbuf_append_printf(iter_param, "%s_iter", eolian_parameter_name_get(parameter));
193 195
194 //generate the field definition 196 //generate the field definition
195 eina_strbuf_append_printf(*buf, " %s", eolian_type_c_type_get(inner_type, EOLIAN_C_TYPE_DEFAULT)); 197 eina_strbuf_append_printf(*buf, " %s", eolian_type_c_type_get(inner_type, EOLIAN_C_TYPE_DEFAULT));
198 if(t == EOLIAN_TYPE_BUILTIN_INARRAY
199 || t == EOLIAN_TYPE_BUILTIN_INLIST)
200 {
201 eina_strbuf_append(*buf, "*");
202 }
196 eina_strbuf_append_buffer(*buf, iter_param); 203 eina_strbuf_append_buffer(*buf, iter_param);
197 eina_strbuf_append(*buf, ";\n"); 204 eina_strbuf_append(*buf, ";\n");
198 205
199 Eolian_Type_Builtin_Type t = eolian_type_builtin_type_get(type);
200 206
201 if (t == EOLIAN_TYPE_BUILTIN_LIST) 207 if (t == EOLIAN_TYPE_BUILTIN_LIST)
202 { 208 {
@@ -207,6 +213,24 @@ _generate_iterative_free(Eina_Strbuf **buf, const Eolian_Type *type, const Eolia
207 eina_strbuf_append(*buf, ")\n"); 213 eina_strbuf_append(*buf, ")\n");
208 _generate_loop_content(buf, inner_type, iter_param); 214 _generate_loop_content(buf, inner_type, iter_param);
209 } 215 }
216 else if (t == EOLIAN_TYPE_BUILTIN_INARRAY)
217 {
218 eina_strbuf_append_printf(*buf, " EINA_INARRAY_FOREACH(");
219 eina_strbuf_append_buffer(*buf, param);
220 eina_strbuf_append_char(*buf, ',');
221 eina_strbuf_append_buffer(*buf, iter_param);
222 eina_strbuf_append(*buf, ")\n");
223 _generate_loop_content(buf, inner_type, iter_param);
224 }
225 else if (t == EOLIAN_TYPE_BUILTIN_INLIST)
226 {
227 eina_strbuf_append_printf(*buf, " EINA_INLIST_FREE(");
228 eina_strbuf_append_buffer(*buf, param);
229 eina_strbuf_append_char(*buf, ',');
230 eina_strbuf_append_buffer(*buf, iter_param);
231 eina_strbuf_append(*buf, ")\n");
232 _generate_loop_content(buf, inner_type, iter_param);
233 }
210 else if (t == EOLIAN_TYPE_BUILTIN_ITERATOR) 234 else if (t == EOLIAN_TYPE_BUILTIN_ITERATOR)
211 { 235 {
212 eina_strbuf_append_printf(*buf, " EINA_ITERATOR_FOREACH("); 236 eina_strbuf_append_printf(*buf, " EINA_ITERATOR_FOREACH(");
@@ -237,7 +261,7 @@ _generate_iterative_free(Eina_Strbuf **buf, const Eolian_Type *type, const Eolia
237 } 261 }
238 else 262 else
239 { 263 {
240 printf("Error, container unknown?!\n"); 264 printf("Error, container unknown?! %d\n", (int)t);
241 } 265 }
242 266
243 eina_strbuf_free(iterator_header); 267 eina_strbuf_free(iterator_header);