* eina: Patch from Albin Tonnerre that add a new accessor for Inlist container.
authorcedric <cedric>
Mon, 18 May 2009 14:49:57 +0000 (14:49 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 18 May 2009 14:49:57 +0000 (14:49 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@40726 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

AUTHORS
src/include/eina_inlist.h

diff --git a/AUTHORS b/AUTHORS
index 95d68a9..7c8af1f 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -8,3 +8,4 @@ Cedric Bail <cedric.bail@free.fr>
 Peter "pfritz" Wehrfritz <peter.wehrfritz@web.de>
 Arnaud de Turckheim "quarium" <quarium@gmail.com>
 Alexandre "diaxen" Becoulet <diaxen@free.fr>
+Albin Tonnerre <albin.tonnerre@gmail.com>
index cbcd80d..7a010be 100644 (file)
@@ -38,6 +38,7 @@ struct _Eina_Inlist
 
 #define EINA_INLIST Eina_Inlist __in_list
 #define EINA_INLIST_GET(Inlist) (&((Inlist)->__in_list))
+#define EINA_INLIST_CONTAINER_GET(ptr, type) ((type *) ((Eina_Inlist *) ptr - offsetof(type, __in_list)))
 
 EAPI Eina_Inlist * eina_inlist_append(Eina_Inlist *in_list, Eina_Inlist *in_item) EINA_ARG_NONNULL(2) EINA_WARN_UNUSED_RESULT;
 EAPI Eina_Inlist * eina_inlist_prepend(Eina_Inlist *in_list, Eina_Inlist *in_item) EINA_ARG_NONNULL(2) EINA_WARN_UNUSED_RESULT;