Eina model: Made i_method_resolve a macro (for interface as well)
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 9 Feb 2012 10:32:14 +0000 (10:32 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 9 Feb 2012 10:32:14 +0000 (10:32 +0000)
Same as the previous commit about "Type" this time about Interface.
This will also hopefully remove the likelihood for hacks.
Previous functions are still available as method_offset_resolve.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@67786 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/include/eina_model.h
src/lib/eina_model.c

index ebc3842..9e5aa01 100644 (file)
@@ -961,9 +961,9 @@ EAPI Eina_Bool eina_model_interface_deep_copy(const Eina_Model_Interface *iface,
                                               const Eina_Model *src,
                                               Eina_Model *dst) EINA_ARG_NONNULL(1, 2, 3);
 
-EAPI const void *eina_model_interface_method_resolve(const Eina_Model_Interface *iface,
-                                                     const Eina_Model *model,
-                                                     unsigned int offset) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT EINA_PURE;
+#define eina_model_interface_method_resolve(iface, model, struct_type, method) eina_model_interface_method_offset_resolve((iface), (model), offsetof(struct_type, method))
+
+EAPI const void *eina_model_interface_method_offset_resolve(const Eina_Model_Interface *iface, const Eina_Model *model, unsigned int offset) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT EINA_PURE;
 
 
 struct _Eina_Model_Event_Description
index 0b986b9..de5de0b 100644 (file)
@@ -4829,8 +4829,8 @@ eina_model_interface_deep_copy(const Eina_Model_Interface *iface, const Eina_Mod
    return deep_copy(src, dst);
 }
 
-EAPI const void *
-eina_model_interface_method_resolve(const Eina_Model_Interface *iface, const Eina_Model *model, unsigned int offset)
+EAPI const void
+*eina_model_interface_method_offset_resolve(const Eina_Model_Interface *iface, const Eina_Model *model, unsigned int offset)
 {
    EINA_MODEL_INTERFACE_IMPLEMENTED_CHECK_VAL(iface, model, NULL);
    EINA_SAFETY_ON_FALSE_RETURN_VAL(offset >= sizeof(Eina_Model_Interface), NULL);