1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef QAPI_VISITOR_CORE_H
15#define QAPI_VISITOR_CORE_H
16
17#include "qapi/qmp/qobject.h"
18
19
20
21
22typedef struct GenericList {
23 struct GenericList *next;
24 char padding[];
25} GenericList;
26
27
28
29typedef struct GenericAlternate {
30 QType type;
31 char padding[];
32} GenericAlternate;
33
34void visit_start_struct(Visitor *v, const char *name, void **obj,
35 size_t size, Error **errp);
36void visit_end_struct(Visitor *v, Error **errp);
37
38void visit_start_list(Visitor *v, const char *name, Error **errp);
39GenericList *visit_next_list(Visitor *v, GenericList **list, size_t size);
40void visit_end_list(Visitor *v);
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58void visit_start_alternate(Visitor *v, const char *name,
59 GenericAlternate **obj, size_t size,
60 bool promote_int, Error **errp);
61
62
63
64
65
66
67
68
69
70
71void visit_end_alternate(Visitor *v);
72
73
74
75
76
77
78
79bool visit_optional(Visitor *v, const char *name, bool *present);
80
81void visit_type_enum(Visitor *v, const char *name, int *obj,
82 const char *const strings[], Error **errp);
83void visit_type_int(Visitor *v, const char *name, int64_t *obj, Error **errp);
84void visit_type_uint8(Visitor *v, const char *name, uint8_t *obj,
85 Error **errp);
86void visit_type_uint16(Visitor *v, const char *name, uint16_t *obj,
87 Error **errp);
88void visit_type_uint32(Visitor *v, const char *name, uint32_t *obj,
89 Error **errp);
90void visit_type_uint64(Visitor *v, const char *name, uint64_t *obj,
91 Error **errp);
92void visit_type_int8(Visitor *v, const char *name, int8_t *obj, Error **errp);
93void visit_type_int16(Visitor *v, const char *name, int16_t *obj,
94 Error **errp);
95void visit_type_int32(Visitor *v, const char *name, int32_t *obj,
96 Error **errp);
97void visit_type_int64(Visitor *v, const char *name, int64_t *obj,
98 Error **errp);
99void visit_type_size(Visitor *v, const char *name, uint64_t *obj,
100 Error **errp);
101void visit_type_bool(Visitor *v, const char *name, bool *obj, Error **errp);
102void visit_type_str(Visitor *v, const char *name, char **obj, Error **errp);
103void visit_type_number(Visitor *v, const char *name, double *obj,
104 Error **errp);
105void visit_type_any(Visitor *v, const char *name, QObject **obj, Error **errp);
106
107#endif
108