int object_property_get_enum(Object *obj, const char *name,

                             const char *typename, Error **errp)

{

    StringOutputVisitor *sov;

    StringInputVisitor *siv;

    char *str;

    int ret;

    ObjectProperty *prop = object_property_find(obj, name, errp);

    EnumProperty *enumprop;



    if (prop == NULL) {

        return 0;

    }



    if (!g_str_equal(prop->type, typename)) {

        error_setg(errp, "Property %s on %s is not '%s' enum type",

                   name, object_class_get_name(

                       object_get_class(obj)), typename);

        return 0;

    }



    enumprop = prop->opaque;



    sov = string_output_visitor_new(false);

    object_property_get(obj, string_output_get_visitor(sov), name, errp);

    str = string_output_get_string(sov);

    siv = string_input_visitor_new(str);

    string_output_visitor_cleanup(sov);

    visit_type_enum(string_input_get_visitor(siv),

                    &ret, enumprop->strings, NULL, name, errp);



    g_free(str);

    string_input_visitor_cleanup(siv);



    return ret;

}

int object_property_get_enum(Object *obj, const char *name,

                             const char *typename, Error **errp)

{

    StringOutputVisitor *sov;

    StringInputVisitor *siv;

    char *str;

    int ret;

    ObjectProperty *prop = object_property_find(obj, name, errp);

    EnumProperty *enumprop;



    if (prop == NULL) {

        return 0;

    }



    if (!g_str_equal(prop->type, typename)) {

        error_setg(errp, "Property %s on %s is not '%s' enum type",

                   name, object_class_get_name(

                       object_get_class(obj)), typename);

        return 0;

    }



    enumprop = prop->opaque;



    sov = string_output_visitor_new(false);

    object_property_get(obj, string_output_get_visitor(sov), name, errp);

    str = string_output_get_string(sov);

    siv = string_input_visitor_new(str);

    string_output_visitor_cleanup(sov);

    visit_type_enum(string_input_get_visitor(siv),

                    &ret, enumprop->strings, NULL, name, errp);



    g_free(str);

    string_input_visitor_cleanup(siv);



    return ret;

}

    object_property_get(obj, string_output_get_visitor(sov), name, errp);
int FUNC_0(Object *VAR_0, const char *VAR_1,

                             const char *VAR_2, Error **VAR_3)

{

    StringOutputVisitor *sov;

    StringInputVisitor *siv;

    char *VAR_4;

    int VAR_5;

    ObjectProperty *prop = object_property_find(VAR_0, VAR_1, VAR_3);

    EnumProperty *enumprop;



    if (prop == NULL) {

        return 0;

    }



    if (!g_str_equal(prop->type, VAR_2)) {

        error_setg(VAR_3, "Property %s on %s is not '%s' enum type",

                   VAR_1, object_class_get_name(

                       object_get_class(VAR_0)), VAR_2);

        return 0;

    }



    enumprop = prop->opaque;



    sov = string_output_visitor_new(false);

    object_property_get(VAR_0, string_output_get_visitor(sov), VAR_1, VAR_3);

    VAR_4 = string_output_get_string(sov);

    siv = string_input_visitor_new(VAR_4);

    string_output_visitor_cleanup(sov);

    visit_type_enum(string_input_get_visitor(siv),

                    &VAR_5, enumprop->strings, NULL, VAR_1, VAR_3);



    g_free(VAR_4);

    string_input_visitor_cleanup(siv);



    return VAR_5;

}

int FUNC_0(Object *VAR_0, const char *VAR_1,
const char *VAR_2, Error **VAR_3)
{ StringOutputVisitor *sov; StringInputVisitor *siv; char *VAR_4; int VAR_5; ObjectProperty *prop = object_property_find(VAR_0, VAR_1, VAR_3); EnumProperty *enumprop; if (prop == NULL) { return 0; } if (!g_str_equal(prop->type, VAR_2)) { error_setg(VAR_3, "Property %s on %s is not '%s' enum type",
VAR_1, object_class_get_name(
object_get_class(VAR_0)), VAR_2); return 0; } enumprop = prop->opaque; sov = string_output_visitor_new(false); object_property_get(VAR_0, string_output_get_visitor(sov), VAR_1, VAR_3); VAR_4 = string_output_get_string(sov); siv = string_input_visitor_new(VAR_4); string_output_visitor_cleanup(sov); visit_type_enum(string_input_get_visitor(siv),
&VAR_5, enumprop->strings, NULL, VAR_1, VAR_3); g_free(VAR_4); string_input_visitor_cleanup(siv); return VAR_5; }