Index: src/object.c ================================================================== --- src/object.c +++ src/object.c @@ -116,10 +116,18 @@ if (obj->cls->dtor != NULL) obj->cls->dtor(obj); free(obj); } + +CFWClass* +cfw_class(void *ptr) +{ + CFWObject *obj; + + return obj->cls; +} bool cfw_is(void *ptr, CFWClass *cls) { CFWObject *obj = ptr; Index: src/object.h ================================================================== --- src/object.h +++ src/object.h @@ -38,10 +38,11 @@ extern void* cfw_new(CFWClass*, ...); extern void* cfw_new_p(CFWClass*, ...); extern void* cfw_ref(void*); extern void cfw_unref(void*); extern void cfw_free(void*); +extern CFWClass* cfw_class(void*); extern bool cfw_is(void*, CFWClass*); extern bool cfw_equal(void*, void*); extern uint32_t cfw_hash(void*); extern void* cfw_copy(void*);