Hello, While playing with Eina_Inlist, I noticed that given a pointer to an Eina_Inlist, one can't easily get a pointer to the structure containing it. The only option now is to put the Eina_Inlist first in the structure, and then cast this structure to an Eina_Inlist, which is far from optimal. I'd therefore like to propose that we add in eina_inlist.h a macro along the lines of
#define FIND_A_SENSBILE_NAME_FOR_THIS(ptr, type) ((type *) ((Eina_Inlist *) ptr - offsetof(type, __in_list))) Then, we could get a pointer to the containing structure, no matter where the Eina_Inlist is (note that I used __in_list as the member as we already have a macro '#define EINA_INLIST Eina_Inlist __in_list', but a member argument could be added just as well) Thoughts ? Regards, -- Albin Tonnerre
signature.asc
Description: Digital signature
------------------------------------------------------------------------------ Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel