cedric pushed a commit to branch master. http://git.enlightenment.org/tools/examples.git/commit/?id=5cd1e7fd27f8b2c6d4ff2db30529f7c31a866853
commit 5cd1e7fd27f8b2c6d4ff2db30529f7c31a866853 Author: Cedric BAIL <ced...@osg.samsung.com> Date: Tue Nov 14 13:39:59 2017 -0800 eina: add an example of EINA_ITERATOR_FOREACH in the iterator references code. --- reference/c/eina/src/eina_iterator.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reference/c/eina/src/eina_iterator.c b/reference/c/eina/src/eina_iterator.c index 8aa48a5..757d61f 100644 --- a/reference/c/eina/src/eina_iterator.c +++ b/reference/c/eina/src/eina_iterator.c @@ -68,6 +68,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) Eina_Array *array; Eina_List *list; Eina_Iterator *it; + char *s; // create an eina_array and iterate through it's contents array = _create_array(); @@ -76,14 +77,15 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) eina_iterator_free(it); eina_array_free(array); - // perform the dame iteration with an eina_list + // perform the same iteration with an eina_list but without + // using a callback. list = _create_list(); it = eina_list_iterator_new(list); - _print_iterator(it); + EINA_ITERATOR_FOREACH(it, s) + _print_item(eina_iterator_container_get(it), s, NULL); eina_iterator_free(it); eina_list_free(list); efl_exit(0); } EFL_MAIN() - --