diff options
Diffstat (limited to 'include/qom')
-rw-r--r-- | include/qom/object.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/qom/object.h b/include/qom/object.h index 701b4c57e7..a8a53049cb 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1344,6 +1344,25 @@ void object_property_add_bool(Object *obj, const char *name, Error **errp); /** + * object_property_add_enum: + * @obj: the object to add a property to + * @name: the name of the property + * @typename: the name of the enum data type + * @get: the getter or %NULL if the property is write-only. + * @set: the setter or %NULL if the property is read-only + * @errp: if an error occurs, a pointer to an area to store the error + * + * Add an enum property using getters/setters. This function will add a + * property of type '@typename'. + */ +void object_property_add_enum(Object *obj, const char *name, + const char *typename, + const char * const *strings, + int (*get)(Object *, Error **), + void (*set)(Object *, int, Error **), + Error **errp); + +/** * object_property_add_tm: * @obj: the object to add a property to * @name: the name of the property |