static bool object_is_type(Object *obj, const char *typename)

{

    TypeImpl *target_type = type_get_by_name(typename);

    TypeImpl *type = obj->class->type;

    GSList *i;



    /* Check if typename is a direct ancestor of type */

    while (type) {

        if (type == target_type) {

            return true;

        }



        type = type_get_parent(type);

    }



    /* Check if obj has an interface of typename */

    for (i = obj->interfaces; i; i = i->next) {

        Interface *iface = i->data;



        if (object_is_type(OBJECT(iface), typename)) {

            return true;

        }

    }



    return false;

}

static bool object_is_type(Object *obj, const char *typename)

{

    TypeImpl *target_type = type_get_by_name(typename);

    TypeImpl *type = obj->class->type;

    GSList *i;



    

    while (type) {

        if (type == target_type) {

            return true;

        }



        type = type_get_parent(type);

    }



    

    for (i = obj->interfaces; i; i = i->next) {

        Interface *iface = i->data;



        if (object_is_type(OBJECT(iface), typename)) {

            return true;

        }

    }



    return false;

}

static bool FUNC_0(Object *obj, const char *typename)

{

    TypeImpl *target_type = type_get_by_name(typename);

    TypeImpl *type = obj->class->type;

    GSList *i;



    

    while (type) {

        if (type == target_type) {

            return true;

        }



        type = type_get_parent(type);

    }



    

    for (i = obj->interfaces; i; i = i->next) {

        Interface *iface = i->data;



        if (FUNC_0(OBJECT(iface), typename)) {

            return true;

        }

    }



    return false;

}

static bool FUNC_0(Object *obj, const char *typename)
{ TypeImpl *target_type = type_get_by_name(typename); TypeImpl *type = obj->class->type; GSList *i; while (type) { if (type == target_type) { return true; } type = type_get_parent(type); } for (i = obj->interfaces; i; i = i->next) { Interface *iface = i->data; if (FUNC_0(OBJECT(iface), typename)) { return true; } } return false; }