From 54551defa60dc3f0f82a4f919b9cfbd2d8f171b9 Mon Sep 17 00:00:00 2001 From: Tae-Hwan Kim Date: Wed, 25 Sep 2013 18:29:23 +0900 Subject: [PATCH] eina: add EINA_INLIST_REVERSE_FOREACH_FROM. --- src/lib/eina/eina_inlist.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 @@ -857,6 +857,21 @@ EAPI Eina_Inlist *eina_inlist_sort(Eina_Inlist *head, Eina_Compare_Cb func); for (it = NULL, it = (list ? _EINA_INLIST_CONTAINER(it, list->last) : NULL); \ 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.