summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-09-26 23:32:43 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2013-09-26 23:32:43 +0200
commitf1f38f813c17e0a89850ebe36136106fca1f8c8c (patch)
treef17947353cb69030d44727bb7afeeadf00262849
parent92fd0b3324e1faeeef655847c48bd416d48cd07a (diff)
downloadefl-f1f38f813c17e0a89850ebe36136106fca1f8c8c.tar.gz
eo: add _eo_is_a_class(const Eo *obj_id)
-rw-r--r--src/lib/eo/eo.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 48d6a56ac9..ececc603e2 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -134,6 +134,19 @@ _dich_func_clean_all(_Eo_Class *klass)
static const Eo_Op_Description noop_desc =
EO_OP_DESCRIPTION(EO_NOOP, "No operation.");
+
+static inline Eina_Bool
+_eo_is_a_class(const Eo *obj_id)
+{
+#ifdef HAVE_EO_ID
+ return (((((Eo_Id) obj_id) >> REF_TAG_SHIFT) & 0x1) == 0x0);
+#else
+ /* fortunately EO_OBJ_POINTER_RETURN* will handle NULL obj_id */
+ if (!obj_id) return EINA_FALSE;
+ return (((_Eo_Handle *) obj_id)->is_a_class == 1);
+#endif
+}
+
static inline _Eo_Class *
_eo_class_pointer_get(const Eo *klass_id)
{