diff options
Diffstat (limited to 'include/qapi/util.h')
-rw-r--r-- | include/qapi/util.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/qapi/util.h b/include/qapi/util.h index 7436ed815c..a7c3c64148 100644 --- a/include/qapi/util.h +++ b/include/qapi/util.h @@ -11,8 +11,14 @@ #ifndef QAPI_UTIL_H #define QAPI_UTIL_H -int qapi_enum_parse(const char * const lookup[], const char *buf, - int max, int def, Error **errp); +typedef struct QEnumLookup { + const char *const *array; + int size; +} QEnumLookup; + +const char *qapi_enum_lookup(const QEnumLookup *lookup, int val); +int qapi_enum_parse(const QEnumLookup *lookup, const char *buf, + int def, Error **errp); int parse_qapi_name(const char *name, bool complete); |