diff options
author | Tae-Hwan Kim <the81.kim@samsung.com> | 2013-09-25 18:29:23 +0900 |
---|---|---|
committer | Cedric Bail <cedric.bail@samsung.com> | 2013-09-25 18:29:23 +0900 |
commit | 54551defa60dc3f0f82a4f919b9cfbd2d8f171b9 (patch) | |
tree | c4309b1b2e5f69bdd56c5df6fdab04ac47083bfd | |
parent | 4033943a0d9ea40b8b25af27754172de5094b8df (diff) | |
download | efl-54551defa60dc3f0f82a4f919b9cfbd2d8f171b9.tar.gz |
eina: add EINA_INLIST_REVERSE_FOREACH_FROM.
-rw-r--r-- | src/lib/eina/eina_inlist.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/eina/eina_inlist.h b/src/lib/eina/eina_inlist.h index 0cc187ead4..e3f15769b7 100644 --- a/src/lib/eina/eina_inlist.h +++ b/src/lib/eina/eina_inlist.h @@ -858,6 +858,21 @@ EAPI Eina_Inlist *eina_inlist_sort(Eina_Inlist *head, Eina_Compare_Cb func); it; it = (EINA_INLIST_GET(it)->prev ? _EINA_INLIST_CONTAINER(it, EINA_INLIST_GET(it)->prev) : NULL)) /** + * @def EINA_INLIST_REVERSE_FOREACH_FROM + * @param list The last list to traversed in reverse order. + * @param it The pointer to the list item, i.e. a pointer to each item + * that is part of the list. + * @see EINA_INLIST_REVERSE_FOREACH() + * @since 1.8 + * + * EINA_INLIST_REVERSE_FOREACH() starts from last list of the given list. + * This starts from given list, not the last one. + */ +#define EINA_INLIST_REVERSE_FOREACH_FROM(list, it) \ + for (it = NULL, it = (list ? _EINA_INLIST_CONTAINER(it, list) : NULL); \ + it; it = (EINA_INLIST_GET(it)->prev ? _EINA_INLIST_CONTAINER(it, EINA_INLIST_GET(it)->prev) : NULL)) + +/** * @def EINA_INLIST_FREE * @param list The list to free. * @param it The pointer to the list item, i.e. a pointer to each item |