regress.gen.h revision 1.1.1.8 1 /* $NetBSD: regress.gen.h,v 1.1.1.8 2020/05/25 20:40:14 christos Exp $ */
2
3 /*
4 * Automatically generated from /ntpbuild/data/snaps/ntp-stable/sntp/libevent/test/regress.rpc
5 */
6
7 #ifndef EVENT_RPCOUT__NTPBUILD_DATA_SNAPS_NTP_STABLE_SNTP_LIBEVENT_TEST_REGRESS_RPC_
8 #define EVENT_RPCOUT__NTPBUILD_DATA_SNAPS_NTP_STABLE_SNTP_LIBEVENT_TEST_REGRESS_RPC_
9
10 #include <event2/util.h> /* for ev_uint*_t */
11 #include <event2/rpc.h>
12
13 struct msg;
14 struct kill;
15 struct run;
16
17 /* Tag definition for msg */
18 enum msg_ {
19 MSG_FROM_NAME=1,
20 MSG_TO_NAME=2,
21 MSG_ATTACK=3,
22 MSG_RUN=4,
23 MSG_MAX_TAGS
24 };
25
26 /* Structure declaration for msg */
27 struct msg_access_ {
28 int (*from_name_assign)(struct msg *, const char *);
29 int (*from_name_get)(struct msg *, char * *);
30 int (*to_name_assign)(struct msg *, const char *);
31 int (*to_name_get)(struct msg *, char * *);
32 int (*attack_assign)(struct msg *, const struct kill*);
33 int (*attack_get)(struct msg *, struct kill* *);
34 int (*run_assign)(struct msg *, int, const struct run*);
35 int (*run_get)(struct msg *, int, struct run* *);
36 struct run* (*run_add)(struct msg *msg);
37 };
38
39 struct msg {
40 struct msg_access_ *base;
41
42 char *from_name_data;
43 char *to_name_data;
44 struct kill* attack_data;
45 struct run* *run_data;
46 int run_length;
47 int run_num_allocated;
48
49 ev_uint8_t from_name_set;
50 ev_uint8_t to_name_set;
51 ev_uint8_t attack_set;
52 ev_uint8_t run_set;
53 };
54
55 struct msg *msg_new(void);
56 struct msg *msg_new_with_arg(void *);
57 void msg_free(struct msg *);
58 void msg_clear(struct msg *);
59 void msg_marshal(struct evbuffer *, const struct msg *);
60 int msg_unmarshal(struct msg *, struct evbuffer *);
61 int msg_complete(struct msg *);
62 void evtag_marshal_msg(struct evbuffer *, ev_uint32_t,
63 const struct msg *);
64 int evtag_unmarshal_msg(struct evbuffer *, ev_uint32_t,
65 struct msg *);
66 int msg_from_name_assign(struct msg *, const char *);
67 int msg_from_name_get(struct msg *, char * *);
68 int msg_to_name_assign(struct msg *, const char *);
69 int msg_to_name_get(struct msg *, char * *);
70 int msg_attack_assign(struct msg *, const struct kill*);
71 int msg_attack_get(struct msg *, struct kill* *);
72 int msg_run_assign(struct msg *, int, const struct run*);
73 int msg_run_get(struct msg *, int, struct run* *);
74 struct run* msg_run_add(struct msg *msg);
75 /* --- msg done --- */
76
77 /* Tag definition for kill */
78 enum kill_ {
79 KILL_WEAPON=65825,
80 KILL_ACTION=2,
81 KILL_HOW_OFTEN=3,
82 KILL_MAX_TAGS
83 };
84
85 /* Structure declaration for kill */
86 struct kill_access_ {
87 int (*weapon_assign)(struct kill *, const char *);
88 int (*weapon_get)(struct kill *, char * *);
89 int (*action_assign)(struct kill *, const char *);
90 int (*action_get)(struct kill *, char * *);
91 int (*how_often_assign)(struct kill *, int, const ev_uint32_t);
92 int (*how_often_get)(struct kill *, int, ev_uint32_t *);
93 ev_uint32_t * (*how_often_add)(struct kill *msg, const ev_uint32_t value);
94 };
95
96 struct kill {
97 struct kill_access_ *base;
98
99 char *weapon_data;
100 char *action_data;
101 ev_uint32_t *how_often_data;
102 int how_often_length;
103 int how_often_num_allocated;
104
105 ev_uint8_t weapon_set;
106 ev_uint8_t action_set;
107 ev_uint8_t how_often_set;
108 };
109
110 struct kill *kill_new(void);
111 struct kill *kill_new_with_arg(void *);
112 void kill_free(struct kill *);
113 void kill_clear(struct kill *);
114 void kill_marshal(struct evbuffer *, const struct kill *);
115 int kill_unmarshal(struct kill *, struct evbuffer *);
116 int kill_complete(struct kill *);
117 void evtag_marshal_kill(struct evbuffer *, ev_uint32_t,
118 const struct kill *);
119 int evtag_unmarshal_kill(struct evbuffer *, ev_uint32_t,
120 struct kill *);
121 int kill_weapon_assign(struct kill *, const char *);
122 int kill_weapon_get(struct kill *, char * *);
123 int kill_action_assign(struct kill *, const char *);
124 int kill_action_get(struct kill *, char * *);
125 int kill_how_often_assign(struct kill *, int, const ev_uint32_t);
126 int kill_how_often_get(struct kill *, int, ev_uint32_t *);
127 ev_uint32_t * kill_how_often_add(struct kill *msg, const ev_uint32_t value);
128 /* --- kill done --- */
129
130 /* Tag definition for run */
131 enum run_ {
132 RUN_HOW=1,
133 RUN_SOME_BYTES=2,
134 RUN_FIXED_BYTES=3,
135 RUN_NOTES=4,
136 RUN_LARGE_NUMBER=5,
137 RUN_OTHER_NUMBERS=6,
138 RUN_MAX_TAGS
139 };
140
141 /* Structure declaration for run */
142 struct run_access_ {
143 int (*how_assign)(struct run *, const char *);
144 int (*how_get)(struct run *, char * *);
145 int (*some_bytes_assign)(struct run *, const ev_uint8_t *, ev_uint32_t);
146 int (*some_bytes_get)(struct run *, ev_uint8_t * *, ev_uint32_t *);
147 int (*fixed_bytes_assign)(struct run *, const ev_uint8_t *);
148 int (*fixed_bytes_get)(struct run *, ev_uint8_t **);
149 int (*notes_assign)(struct run *, int, const char *);
150 int (*notes_get)(struct run *, int, char * *);
151 char * * (*notes_add)(struct run *msg, const char * value);
152 int (*large_number_assign)(struct run *, const ev_uint64_t);
153 int (*large_number_get)(struct run *, ev_uint64_t *);
154 int (*other_numbers_assign)(struct run *, int, const ev_uint32_t);
155 int (*other_numbers_get)(struct run *, int, ev_uint32_t *);
156 ev_uint32_t * (*other_numbers_add)(struct run *msg, const ev_uint32_t value);
157 };
158
159 struct run {
160 struct run_access_ *base;
161
162 char *how_data;
163 ev_uint8_t *some_bytes_data;
164 ev_uint32_t some_bytes_length;
165 ev_uint8_t fixed_bytes_data[24];
166 char * *notes_data;
167 int notes_length;
168 int notes_num_allocated;
169 ev_uint64_t large_number_data;
170 ev_uint32_t *other_numbers_data;
171 int other_numbers_length;
172 int other_numbers_num_allocated;
173
174 ev_uint8_t how_set;
175 ev_uint8_t some_bytes_set;
176 ev_uint8_t fixed_bytes_set;
177 ev_uint8_t notes_set;
178 ev_uint8_t large_number_set;
179 ev_uint8_t other_numbers_set;
180 };
181
182 struct run *run_new(void);
183 struct run *run_new_with_arg(void *);
184 void run_free(struct run *);
185 void run_clear(struct run *);
186 void run_marshal(struct evbuffer *, const struct run *);
187 int run_unmarshal(struct run *, struct evbuffer *);
188 int run_complete(struct run *);
189 void evtag_marshal_run(struct evbuffer *, ev_uint32_t,
190 const struct run *);
191 int evtag_unmarshal_run(struct evbuffer *, ev_uint32_t,
192 struct run *);
193 int run_how_assign(struct run *, const char *);
194 int run_how_get(struct run *, char * *);
195 int run_some_bytes_assign(struct run *, const ev_uint8_t *, ev_uint32_t);
196 int run_some_bytes_get(struct run *, ev_uint8_t * *, ev_uint32_t *);
197 int run_fixed_bytes_assign(struct run *, const ev_uint8_t *);
198 int run_fixed_bytes_get(struct run *, ev_uint8_t **);
199 int run_notes_assign(struct run *, int, const char *);
200 int run_notes_get(struct run *, int, char * *);
201 char * * run_notes_add(struct run *msg, const char * value);
202 int run_large_number_assign(struct run *, const ev_uint64_t);
203 int run_large_number_get(struct run *, ev_uint64_t *);
204 int run_other_numbers_assign(struct run *, int, const ev_uint32_t);
205 int run_other_numbers_get(struct run *, int, ev_uint32_t *);
206 ev_uint32_t * run_other_numbers_add(struct run *msg, const ev_uint32_t value);
207 /* --- run done --- */
208
209 #endif /* EVENT_RPCOUT__NTPBUILD_DATA_SNAPS_NTP_STABLE_SNTP_LIBEVENT_TEST_REGRESS_RPC_ */
210