19e7dac7cSPeter Lieven /* 29e7dac7cSPeter Lieven * QAPI util functions 39e7dac7cSPeter Lieven * 49e7dac7cSPeter Lieven * Copyright Fujitsu, Inc. 2014 59e7dac7cSPeter Lieven * 69e7dac7cSPeter Lieven * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. 79e7dac7cSPeter Lieven * See the COPYING.LIB file in the top-level directory. 89e7dac7cSPeter Lieven * 99e7dac7cSPeter Lieven */ 109e7dac7cSPeter Lieven 119e7dac7cSPeter Lieven #ifndef QAPI_UTIL_H 129e7dac7cSPeter Lieven #define QAPI_UTIL_H 139e7dac7cSPeter Lieven 14*f7abe0ecSMarc-André Lureau typedef struct QEnumLookup { 15*f7abe0ecSMarc-André Lureau const char *const *array; 16*f7abe0ecSMarc-André Lureau int size; 17*f7abe0ecSMarc-André Lureau } QEnumLookup; 18*f7abe0ecSMarc-André Lureau 19*f7abe0ecSMarc-André Lureau const char *qapi_enum_lookup(const QEnumLookup *lookup, int val); 20*f7abe0ecSMarc-André Lureau int qapi_enum_parse(const QEnumLookup *lookup, const char *buf, 2106c60b6cSMarkus Armbruster int def, Error **errp); 229e7dac7cSPeter Lieven 23069b64e3SMarkus Armbruster int parse_qapi_name(const char *name, bool complete); 24069b64e3SMarkus Armbruster 259e7dac7cSPeter Lieven #endif 26