diff options
author | Cedric Bail <cedric.bail@samsung.com> | 2013-05-09 09:57:19 +0900 |
---|---|---|
committer | Cedric Bail <cedric.bail@samsung.com> | 2013-05-09 09:57:19 +0900 |
commit | 2c8ff3178862851fea8fd83704c5a201f8a20728 (patch) | |
tree | abb4d7c25a40ed1436d3018c3b11a316a96abf8d | |
parent | 56180a7ff46f46790a7735bcadf43b5f04f72839 (diff) | |
download | efl-2c8ff3178862851fea8fd83704c5a201f8a20728.tar.gz |
eina: add EINA_INLIST_FREE.
-rw-r--r-- | src/lib/eina/eina_inlist.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/eina/eina_inlist.h b/src/lib/eina/eina_inlist.h index 2829967e12..a87b744cec 100644 --- a/src/lib/eina/eina_inlist.h +++ b/src/lib/eina/eina_inlist.h @@ -857,6 +857,22 @@ 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_FREE + * @param list The list to free. + * @param it The pointer to the list item, i.e. a pointer to each item + * that is part of the list. + * + * NOTE: it is the duty of the body loop to properly remove the item from the + * inlist and free it. This function will turn into a infinite loop if you + * don't remove all items from the list. + * @since 1.8 + */ +#define EINA_INLIST_FREE(list, it) \ + for (it = (typeof(it)) list; list; it = (typeof(it)) list) \ + + + #include "eina_inline_inlist.x" /** |