target/arm: Add read/write_neon_element32
[qemu/ar7.git] / include / qapi / util.h
blobbc312e90aa0c86c1df19ef683c412c56dbd16757
1 /*
2 * QAPI util functions
4 * Copyright Fujitsu, Inc. 2014
6 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
7 * See the COPYING.LIB file in the top-level directory.
9 */
11 #ifndef QAPI_UTIL_H
12 #define QAPI_UTIL_H
14 typedef struct QEnumLookup {
15 const char *const *array;
16 int size;
17 } QEnumLookup;
19 const char *qapi_enum_lookup(const QEnumLookup *lookup, int val);
20 int qapi_enum_parse(const QEnumLookup *lookup, const char *buf,
21 int def, Error **errp);
23 int parse_qapi_name(const char *name, bool complete);
26 * For any GenericList @list, insert @element at the front.
28 * Note that this macro evaluates @element exactly once, so it is safe
29 * to have side-effects with that argument.
31 #define QAPI_LIST_PREPEND(list, element) do { \
32 typeof(list) _tmp = g_malloc(sizeof(*(list))); \
33 _tmp->value = (element); \
34 _tmp->next = (list); \
35 (list) = _tmp; \
36 } while (0)
38 #endif