summaryrefslogtreecommitdiff
path: root/src/bin/eolian/eo_generator.c
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-07-23 10:24:59 +0300
committerDaniel Kolesa <d.kolesa@samsung.com>2014-07-23 13:45:25 +0100
commit0efeeaf1c0dbfdb921eee7f50c15c73da0e16f22 (patch)
treee5e1edaf1458dfb823444163181416bbfcac26a6 /src/bin/eolian/eo_generator.c
parent356d10fbeefd3f79f3cc848ed266d33e04ac7238 (diff)
Eolian: modify APIs to return iterators instead of lists.
The change affects the C and the C++ generators.
Diffstat (limited to 'src/bin/eolian/eo_generator.c')
-rw-r--r--src/bin/eolian/eo_generator.c151
1 files changed, 96 insertions, 55 deletions
diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index 5f2d111931..e0e0b6fb47 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -83,8 +83,8 @@ eo_fundef_generate(const Eolian_Class *class, Eolian_Function *func, Eolian_Func
83{ 83{
84 _eolian_class_func_vars func_env; 84 _eolian_class_func_vars func_env;
85 const char *str_dir[] = {"in", "out", "inout"}; 85 const char *str_dir[] = {"in", "out", "inout"};
86 const Eina_List *l; 86 Eina_Iterator *itr;
87 void *data; 87 void *data, *data2;
88 char funcname[0xFF]; 88 char funcname[0xFF];
89 char descname[0xFF]; 89 char descname[0xFF];
90 char *tmpstr = malloc(0x1FF); 90 char *tmpstr = malloc(0x1FF);
@@ -102,14 +102,15 @@ eo_fundef_generate(const Eolian_Class *class, Eolian_Function *func, Eolian_Func
102 fsuffix = "_get"; 102 fsuffix = "_get";
103 if (!rettypet) 103 if (!rettypet)
104 { 104 {
105 l = eolian_parameters_list_get(func); 105 itr = eolian_parameters_list_get(func);
106 if (eina_list_count(l) == 1) 106 /* We want to check if there is only one parameter */
107 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
107 { 108 {
108 data = eina_list_data_get(l);
109 eolian_parameter_information_get((Eolian_Function_Parameter*)data, NULL, &rettypet, NULL, NULL); 109 eolian_parameter_information_get((Eolian_Function_Parameter*)data, NULL, &rettypet, NULL, NULL);
110 var_as_ret = EINA_TRUE; 110 var_as_ret = EINA_TRUE;
111 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE); 111 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE);
112 } 112 }
113 eina_iterator_free(itr);
113 } 114 }
114 } 115 }
115 if (ftype == EOLIAN_PROP_SET) fsuffix = "_set"; 116 if (ftype == EOLIAN_PROP_SET) fsuffix = "_set";
@@ -150,7 +151,8 @@ eo_fundef_generate(const Eolian_Class *class, Eolian_Function *func, Eolian_Func
150 Eina_Strbuf *str_retdesc = eina_strbuf_new(); 151 Eina_Strbuf *str_retdesc = eina_strbuf_new();
151 Eina_Strbuf *str_typecheck = eina_strbuf_new(); 152 Eina_Strbuf *str_typecheck = eina_strbuf_new();
152 153
153 EINA_LIST_FOREACH(eolian_property_keys_list_get(func), l, data) 154 itr = eolian_property_keys_list_get(func);
155 EINA_ITERATOR_FOREACH(itr, data)
154 { 156 {
155 const Eolian_Type *ptypet; 157 const Eolian_Type *ptypet;
156 const char *pname; 158 const char *pname;
@@ -166,10 +168,12 @@ eo_fundef_generate(const Eolian_Class *class, Eolian_Function *func, Eolian_Func
166 eina_strbuf_append_printf(str_par, "%s %s", ptype, pname); 168 eina_strbuf_append_printf(str_par, "%s %s", ptype, pname);
167 eina_stringshare_del(ptype); 169 eina_stringshare_del(ptype);
168 } 170 }
171 eina_iterator_free(itr);
169 172
170 if (!var_as_ret) 173 if (!var_as_ret)
171 { 174 {
172 EINA_LIST_FOREACH(eolian_parameters_list_get(func), l, data) 175 itr = eolian_parameters_list_get(func);
176 EINA_ITERATOR_FOREACH(itr, data)
173 { 177 {
174 const Eolian_Type *ptypet; 178 const Eolian_Type *ptypet;
175 const char *pname; 179 const char *pname;
@@ -201,6 +205,7 @@ eo_fundef_generate(const Eolian_Class *class, Eolian_Function *func, Eolian_Func
201 205
202 eina_stringshare_del(ptype); 206 eina_stringshare_del(ptype);
203 } 207 }
208 eina_iterator_free(itr);
204 } 209 }
205 210
206 if (rettypet) rettype = eolian_type_c_type_get(rettypet); 211 if (rettypet) rettype = eolian_type_c_type_get(rettypet);
@@ -237,7 +242,8 @@ Eina_Bool
237eo_header_generate(const Eolian_Class *class, Eina_Strbuf *buf) 242eo_header_generate(const Eolian_Class *class, Eina_Strbuf *buf)
238{ 243{
239 const Eolian_Function_Type ftype_order[] = {EOLIAN_CTOR, EOLIAN_PROPERTY, EOLIAN_METHOD}; 244 const Eolian_Function_Type ftype_order[] = {EOLIAN_CTOR, EOLIAN_PROPERTY, EOLIAN_METHOD};
240 const Eina_List *itr; 245 Eina_Iterator *itr;
246 Eolian_Event *event;
241 Eolian_Function *fid; 247 Eolian_Function *fid;
242 char *tmpstr = malloc(0x1FF); 248 char *tmpstr = malloc(0x1FF);
243 Eina_Strbuf * str_hdr = eina_strbuf_new(); 249 Eina_Strbuf * str_hdr = eina_strbuf_new();
@@ -266,8 +272,8 @@ eo_header_generate(const Eolian_Class *class, Eina_Strbuf *buf)
266 Eina_Strbuf *str_extrn_ev = eina_strbuf_new(); 272 Eina_Strbuf *str_extrn_ev = eina_strbuf_new();
267 Eina_Strbuf *tmpbuf = eina_strbuf_new(); 273 Eina_Strbuf *tmpbuf = eina_strbuf_new();
268 274
269 Eolian_Event *event; 275 itr = eolian_class_events_list_get(class);
270 EINA_LIST_FOREACH(eolian_class_events_list_get(class), itr, event) 276 EINA_ITERATOR_FOREACH(itr, event)
271 { 277 {
272 const char *evname = NULL; 278 const char *evname = NULL;
273 const char *evdesc = NULL; 279 const char *evdesc = NULL;
@@ -291,25 +297,29 @@ eo_header_generate(const Eolian_Class *class, Eina_Strbuf *buf)
291 297
292 int i; 298 int i;
293 for (i = 0; i < 3; i++) 299 for (i = 0; i < 3; i++)
294 EINA_LIST_FOREACH(eolian_class_functions_list_get(class, ftype_order[i]), itr, fid) 300 {
295 { 301 itr = eolian_class_functions_list_get(class, ftype_order[i]);
296 const Eolian_Function_Type ftype = eolian_function_type_get(fid); 302 EINA_ITERATOR_FOREACH(itr, fid)
297 Eina_Bool prop_read = (ftype == EOLIAN_PROPERTY || ftype == EOLIAN_PROP_GET ) ? EINA_TRUE : EINA_FALSE ; 303 {
298 Eina_Bool prop_write = (ftype == EOLIAN_PROPERTY || ftype == EOLIAN_PROP_SET ) ? EINA_TRUE : EINA_FALSE ; 304 const Eolian_Function_Type ftype = eolian_function_type_get(fid);
299 305 Eina_Bool prop_read = (ftype == EOLIAN_PROPERTY || ftype == EOLIAN_PROP_GET ) ? EINA_TRUE : EINA_FALSE ;
300 if (!prop_read && !prop_write) 306 Eina_Bool prop_write = (ftype == EOLIAN_PROPERTY || ftype == EOLIAN_PROP_SET ) ? EINA_TRUE : EINA_FALSE ;
301 { 307
302 eo_fundef_generate(class, fid, EOLIAN_UNRESOLVED, str_hdr); 308 if (!prop_read && !prop_write)
303 } 309 {
304 if (prop_write) 310 eo_fundef_generate(class, fid, EOLIAN_UNRESOLVED, str_hdr);
305 { 311 }
306 eo_fundef_generate(class, fid, EOLIAN_PROP_SET, str_hdr); 312 if (prop_write)
307 } 313 {
308 if (prop_read) 314 eo_fundef_generate(class, fid, EOLIAN_PROP_SET, str_hdr);
309 { 315 }
310 eo_fundef_generate(class, fid, EOLIAN_PROP_GET, str_hdr); 316 if (prop_read)
311 } 317 {
312 } 318 eo_fundef_generate(class, fid, EOLIAN_PROP_GET, str_hdr);
319 }
320 }
321 eina_iterator_free(itr);
322 }
313 323
314 eina_strbuf_append(str_hdr, eina_strbuf_string_get(str_extrn_ev)); 324 eina_strbuf_append(str_hdr, eina_strbuf_string_get(str_extrn_ev));
315 eina_strbuf_append(str_hdr, eina_strbuf_string_get(str_ev)); 325 eina_strbuf_append(str_hdr, eina_strbuf_string_get(str_ev));
@@ -336,6 +346,8 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
336 const char *retname = NULL; 346 const char *retname = NULL;
337 Eina_Bool ret_const = EINA_FALSE; 347 Eina_Bool ret_const = EINA_FALSE;
338 Eina_Bool add_star = EINA_FALSE; 348 Eina_Bool add_star = EINA_FALSE;
349 Eina_Iterator *itr;
350 void *data, *data2;
339 351
340 Eina_Bool need_implementation = EINA_TRUE; 352 Eina_Bool need_implementation = EINA_TRUE;
341 if (!impl_env && eolian_function_is_virtual_pure(funcid, ftype)) need_implementation = EINA_FALSE; 353 if (!impl_env && eolian_function_is_virtual_pure(funcid, ftype)) need_implementation = EINA_FALSE;
@@ -353,14 +365,15 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
353 add_star = EINA_TRUE; 365 add_star = EINA_TRUE;
354 if (!rettypet) 366 if (!rettypet)
355 { 367 {
356 const Eina_List *l = eolian_parameters_list_get(funcid); 368 itr = eolian_parameters_list_get(funcid);
357 if (eina_list_count(l) == 1) 369 /* We want to check if there is only one parameter */
370 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
358 { 371 {
359 void* data = eina_list_data_get(l);
360 eolian_parameter_information_get((Eolian_Function_Parameter*)data, NULL, &rettypet, &retname, NULL); 372 eolian_parameter_information_get((Eolian_Function_Parameter*)data, NULL, &rettypet, &retname, NULL);
361 var_as_ret = EINA_TRUE; 373 var_as_ret = EINA_TRUE;
362 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE); 374 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE);
363 } 375 }
376 eina_iterator_free(itr);
364 } 377 }
365 } 378 }
366 if (ftype == EOLIAN_PROP_SET) 379 if (ftype == EOLIAN_PROP_SET)
@@ -368,10 +381,8 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
368 suffix = "_set"; 381 suffix = "_set";
369 } 382 }
370 383
371 const Eina_List *l; 384 itr = eolian_property_keys_list_get(funcid);
372 void *data; 385 EINA_ITERATOR_FOREACH(itr, data)
373
374 EINA_LIST_FOREACH(eolian_property_keys_list_get(funcid), l, data)
375 { 386 {
376 const Eolian_Type *ptypet; 387 const Eolian_Type *ptypet;
377 const char *pname; 388 const char *pname;
@@ -388,9 +399,11 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
388 ptype, pname); 399 ptype, pname);
389 eina_stringshare_del(ptype); 400 eina_stringshare_del(ptype);
390 } 401 }
402 eina_iterator_free(itr);
391 if (!var_as_ret) 403 if (!var_as_ret)
392 { 404 {
393 EINA_LIST_FOREACH(eolian_parameters_list_get(funcid), l, data) 405 itr = eolian_parameters_list_get(funcid);
406 EINA_ITERATOR_FOREACH(itr, data)
394 { 407 {
395 const Eolian_Type *ptypet; 408 const Eolian_Type *ptypet;
396 const char *pname; 409 const char *pname;
@@ -410,6 +423,7 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
410 ptype, had_star?"":" ", add_star?"*":"", pname); 423 ptype, had_star?"":" ", add_star?"*":"", pname);
411 eina_stringshare_del(ptype); 424 eina_stringshare_del(ptype);
412 } 425 }
426 eina_iterator_free(itr);
413 } 427 }
414 428
415 if (rettypet) rettype = eolian_type_c_type_get(rettypet); 429 if (rettypet) rettype = eolian_type_c_type_get(rettypet);
@@ -430,9 +444,18 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
430 if (!impl_env) 444 if (!impl_env)
431 { 445 {
432 Eina_Strbuf *eo_func_decl = eina_strbuf_new(); 446 Eina_Strbuf *eo_func_decl = eina_strbuf_new();
433 Eina_Bool has_params = 447 Eina_Bool has_params = EINA_FALSE;
434 eina_list_count(eolian_property_keys_list_get(funcid)) || 448
435 (!var_as_ret && eina_list_count(eolian_parameters_list_get(funcid)) != 0); 449 itr = eolian_property_keys_list_get(funcid);
450 has_params |= (eina_iterator_next(itr, &data));
451 eina_iterator_free(itr);
452
453 if (!has_params && !var_as_ret)
454 {
455 itr = eolian_parameters_list_get(funcid);
456 has_params |= (eina_iterator_next(itr, &data));
457 eina_iterator_free(itr);
458 }
436 Eina_Bool ret_is_void = (!rettype || !strcmp(rettype, "void")); 459 Eina_Bool ret_is_void = (!rettype || !strcmp(rettype, "void"));
437 _class_func_env_create(class, eolian_function_name_get(funcid), ftype, &func_env); 460 _class_func_env_create(class, eolian_function_name_get(funcid), ftype, &func_env);
438 eina_strbuf_append_printf(eo_func_decl, 461 eina_strbuf_append_printf(eo_func_decl,
@@ -512,13 +535,14 @@ eo_op_desc_generate(const Eolian_Class *class, Eolian_Function *fid, Eolian_Func
512static Eina_Bool 535static Eina_Bool
513eo_source_beginning_generate(const Eolian_Class *class, Eina_Strbuf *buf) 536eo_source_beginning_generate(const Eolian_Class *class, Eina_Strbuf *buf)
514{ 537{
515 const Eina_List *itr; 538 Eina_Iterator *itr;
516 539
517 Eina_Strbuf *tmpbuf = eina_strbuf_new(); 540 Eina_Strbuf *tmpbuf = eina_strbuf_new();
518 Eina_Strbuf *str_ev = eina_strbuf_new(); 541 Eina_Strbuf *str_ev = eina_strbuf_new();
519 542
520 Eolian_Event *event; 543 Eolian_Event *event;
521 EINA_LIST_FOREACH(eolian_class_events_list_get(class), itr, event) 544 itr = eolian_class_events_list_get(class);
545 EINA_ITERATOR_FOREACH(itr, event)
522 { 546 {
523 const char *evname; 547 const char *evname;
524 const char *evdesc; 548 const char *evdesc;
@@ -538,6 +562,7 @@ eo_source_beginning_generate(const Eolian_Class *class, Eina_Strbuf *buf)
538 eina_strbuf_string_get(str_ev), evname, evdesc_line1); 562 eina_strbuf_string_get(str_ev), evname, evdesc_line1);
539 free(evdesc_line1); 563 free(evdesc_line1);
540 } 564 }
565 eina_iterator_free(itr);
541 566
542 eina_strbuf_append(buf, eina_strbuf_string_get(tmpbuf)); 567 eina_strbuf_append(buf, eina_strbuf_string_get(tmpbuf));
543 568
@@ -550,8 +575,11 @@ static Eina_Bool
550eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf) 575eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
551{ 576{
552 Eina_Bool ret = EINA_FALSE; 577 Eina_Bool ret = EINA_FALSE;
553 const Eina_List *itr; 578 Eina_Iterator *itr;
554 Eolian_Function *fn; 579 Eolian_Function *fn;
580 Eolian_Implement *impl_desc;
581 Eolian_Event *event;
582 const char *inherit_name;
555 583
556 const char *str_classtype = NULL; 584 const char *str_classtype = NULL;
557 switch(eolian_class_type_get(class)) 585 switch(eolian_class_type_get(class))
@@ -617,8 +645,8 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
617 eina_strbuf_reset(tmpbuf); 645 eina_strbuf_reset(tmpbuf);
618 646
619 //Implements - TODO one generate func def for all 647 //Implements - TODO one generate func def for all
620 Eolian_Implement *impl_desc; 648 itr = eolian_class_implements_list_get(class);
621 EINA_LIST_FOREACH(eolian_class_implements_list_get(class), itr, impl_desc) 649 EINA_ITERATOR_FOREACH(itr, impl_desc)
622 { 650 {
623 _eolian_class_vars impl_env; 651 _eolian_class_vars impl_env;
624 char implname[0xFF]; 652 char implname[0xFF];
@@ -671,9 +699,11 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
671 } 699 }
672 eina_stringshare_del(rets); 700 eina_stringshare_del(rets);
673 } 701 }
702 eina_iterator_free(itr);
674 703
675 //Constructors 704 //Constructors
676 EINA_LIST_FOREACH(eolian_class_functions_list_get(class, EOLIAN_CTOR), itr, fn) 705 itr = eolian_class_functions_list_get(class, EOLIAN_CTOR);
706 EINA_ITERATOR_FOREACH(itr, fn)
677 { 707 {
678 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment")); 708 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment"));
679 eo_op_desc_generate(class, fn, EOLIAN_CTOR, desc, tmpbuf); 709 eo_op_desc_generate(class, fn, EOLIAN_CTOR, desc, tmpbuf);
@@ -682,9 +712,11 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
682 712
683 eo_bind_func_generate(class, fn, EOLIAN_UNRESOLVED, str_bodyf, NULL); 713 eo_bind_func_generate(class, fn, EOLIAN_UNRESOLVED, str_bodyf, NULL);
684 } 714 }
715 eina_iterator_free(itr);
685 716
686 //Properties 717 //Properties
687 EINA_LIST_FOREACH(eolian_class_functions_list_get(class, EOLIAN_PROPERTY), itr, fn) 718 itr = eolian_class_functions_list_get(class, EOLIAN_PROPERTY);
719 EINA_ITERATOR_FOREACH(itr, fn)
688 { 720 {
689 const char *funcname = eolian_function_name_get(fn); 721 const char *funcname = eolian_function_name_get(fn);
690 const Eolian_Function_Type ftype = eolian_function_type_get(fn); 722 const Eolian_Function_Type ftype = eolian_function_type_get(fn);
@@ -712,18 +744,21 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
712 free(desc); 744 free(desc);
713 } 745 }
714 } 746 }
747 eina_iterator_free(itr);
715 748
716 //Methods 749 //Methods
717 EINA_LIST_FOREACH(eolian_class_functions_list_get(class, EOLIAN_METHOD), itr, fn) 750 itr = eolian_class_functions_list_get(class, EOLIAN_METHOD);
751 EINA_ITERATOR_FOREACH(itr, fn)
718 { 752 {
719 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment")); 753 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment"));
720 eo_op_desc_generate(class, fn, EOLIAN_METHOD, desc, tmpbuf); 754 eo_op_desc_generate(class, fn, EOLIAN_METHOD, desc, tmpbuf);
721 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf)); 755 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
722 free(desc); 756 free(desc);
723 } 757 }
758 eina_iterator_free(itr);
724 759
725 Eolian_Event *event; 760 itr = eolian_class_events_list_get(class);
726 EINA_LIST_FOREACH(eolian_class_events_list_get(class), itr, event) 761 EINA_ITERATOR_FOREACH(itr, event)
727 { 762 {
728 const char *evname; 763 const char *evname;
729 char *p; 764 char *p;
@@ -736,6 +771,7 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
736 eina_strbuf_replace_all(tmpbuf, ",", "_"); 771 eina_strbuf_replace_all(tmpbuf, ",", "_");
737 eina_strbuf_append_printf(str_ev, "\n %s,", eina_strbuf_string_get(tmpbuf)); 772 eina_strbuf_append_printf(str_ev, "\n %s,", eina_strbuf_string_get(tmpbuf));
738 } 773 }
774 eina_iterator_free(itr);
739 775
740 eina_strbuf_reset(tmpbuf); 776 eina_strbuf_reset(tmpbuf);
741 if (eina_strbuf_length_get(str_ev)) 777 if (eina_strbuf_length_get(str_ev))
@@ -754,9 +790,9 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
754 } 790 }
755 eina_strbuf_replace_all(str_end, "@#Events_Desc", eina_strbuf_string_get(tmpbuf)); 791 eina_strbuf_replace_all(str_end, "@#Events_Desc", eina_strbuf_string_get(tmpbuf));
756 792
757 const char *inherit_name;
758 eina_strbuf_reset(tmpbuf); 793 eina_strbuf_reset(tmpbuf);
759 EINA_LIST_FOREACH(eolian_class_inherits_list_get(class), itr, inherit_name) 794 itr = eolian_class_inherits_list_get(class);
795 EINA_ITERATOR_FOREACH(itr, inherit_name)
760 { 796 {
761 const Eolian_Class *inherit_class = eolian_class_find_by_name(inherit_name); 797 const Eolian_Class *inherit_class = eolian_class_find_by_name(inherit_name);
762 _eolian_class_vars inherit_env; 798 _eolian_class_vars inherit_env;
@@ -764,6 +800,7 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
764 eina_strbuf_append_printf(tmpbuf, "%s_%s, ", inherit_env.upper_classname, 800 eina_strbuf_append_printf(tmpbuf, "%s_%s, ", inherit_env.upper_classname,
765 inherit_env.upper_classtype); 801 inherit_env.upper_classtype);
766 } 802 }
803 eina_iterator_free(itr);
767 804
768 if (eina_strbuf_length_get(tmpbuf) == 0) eina_strbuf_append(tmpbuf, "NULL, "); 805 if (eina_strbuf_length_get(tmpbuf) == 0) eina_strbuf_append(tmpbuf, "NULL, ");
769 eina_strbuf_replace_all(str_end, "@#list_inherit", eina_strbuf_string_get(tmpbuf)); 806 eina_strbuf_replace_all(str_end, "@#list_inherit", eina_strbuf_string_get(tmpbuf));
@@ -818,7 +855,7 @@ Eina_Bool
818eo_source_generate(const Eolian_Class *class, Eina_Strbuf *buf) 855eo_source_generate(const Eolian_Class *class, Eina_Strbuf *buf)
819{ 856{
820 Eina_Bool ret = EINA_FALSE; 857 Eina_Bool ret = EINA_FALSE;
821 const Eina_List *itr; 858 Eina_Iterator *itr;
822 Eolian_Function *fn; 859 Eolian_Function *fn;
823 860
824 Eina_Strbuf *str_bodyf = eina_strbuf_new(); 861 Eina_Strbuf *str_bodyf = eina_strbuf_new();
@@ -828,7 +865,8 @@ eo_source_generate(const Eolian_Class *class, Eina_Strbuf *buf)
828 if (!eo_source_beginning_generate(class, buf)) goto end; 865 if (!eo_source_beginning_generate(class, buf)) goto end;
829 866
830 //Properties 867 //Properties
831 EINA_LIST_FOREACH(eolian_class_functions_list_get(class, EOLIAN_PROPERTY), itr, fn) 868 itr = eolian_class_functions_list_get(class, EOLIAN_PROPERTY);
869 EINA_ITERATOR_FOREACH(itr, fn)
832 { 870 {
833 const Eolian_Function_Type ftype = eolian_function_type_get(fn); 871 const Eolian_Function_Type ftype = eolian_function_type_get(fn);
834 872
@@ -844,12 +882,15 @@ eo_source_generate(const Eolian_Class *class, Eina_Strbuf *buf)
844 if (!eo_bind_func_generate(class, fn, EOLIAN_PROP_GET, str_bodyf, NULL)) goto end; 882 if (!eo_bind_func_generate(class, fn, EOLIAN_PROP_GET, str_bodyf, NULL)) goto end;
845 } 883 }
846 } 884 }
885 eina_iterator_free(itr);
847 886
848 //Methods 887 //Methods
849 EINA_LIST_FOREACH(eolian_class_functions_list_get(class, EOLIAN_METHOD), itr, fn) 888 itr = eolian_class_functions_list_get(class, EOLIAN_METHOD);
889 EINA_ITERATOR_FOREACH(itr, fn)
850 { 890 {
851 if (!eo_bind_func_generate(class, fn, EOLIAN_UNRESOLVED, str_bodyf, NULL)) goto end; 891 if (!eo_bind_func_generate(class, fn, EOLIAN_UNRESOLVED, str_bodyf, NULL)) goto end;
852 } 892 }
893 eina_iterator_free(itr);
853 894
854 eina_strbuf_append(buf, eina_strbuf_string_get(str_bodyf)); 895 eina_strbuf_append(buf, eina_strbuf_string_get(str_bodyf));
855 eina_strbuf_reset(str_bodyf); 896 eina_strbuf_reset(str_bodyf);