5 #ifndef ___REGRESS_RPC_
6 #define ___REGRESS_RPC_
8 #include <event-config.h>
9 #ifdef _EVENT_HAVE_STDINT_H
12 #define EVTAG_HAS(msg, member) ((msg)->member##_set == 1)
14 #define EVTAG_ASSIGN(msg, member, args...) (*(msg)->base->member##_assign)(msg, ## args)
15 #define EVTAG_GET(msg, member, args...) (*(msg)->base->member##_get)(msg, ## args)
17 #define EVTAG_ASSIGN(msg, member, ...) (*(msg)->base->member##_assign)(msg, ## __VA_ARGS__)
18 #define EVTAG_GET(msg, member, ...) (*(msg)->base->member##_get)(msg, ## __VA_ARGS__)
20 #define EVTAG_ADD(msg, member) (*(msg)->base->member##_add)(msg)
21 #define EVTAG_LEN(msg, member) ((msg)->member##_length)
38 int (*from_name_assign)(
struct msg *,
const char *);
39 int (*from_name_get)(
struct msg *,
char * *);
40 int (*to_name_assign)(
struct msg *,
const char *);
41 int (*to_name_get)(
struct msg *,
char * *);
42 int (*attack_assign)(
struct msg *,
const struct kill*);
43 int (*attack_get)(
struct msg *,
struct kill* *);
44 int (*run_assign)(
struct msg *, int,
const struct run *);
45 int (*run_get)(
struct msg *, int,
struct run * *);
46 struct run * (*run_add)(
struct msg *);
54 struct kill* attack_data;
55 struct run **run_data;
57 int run_num_allocated;
59 uint8_t from_name_set;
65 struct msg *msg_new(
void);
66 void msg_free(
struct msg *);
67 void msg_clear(
struct msg *);
68 void msg_marshal(
struct evbuffer *,
const struct msg *);
70 int msg_complete(
struct msg *);
71 void evtag_marshal_msg(
struct evbuffer *, uint32_t,
73 int evtag_unmarshal_msg(
struct evbuffer *, uint32_t,
75 int msg_from_name_assign(
struct msg *,
const char *);
76 int msg_from_name_get(
struct msg *,
char * *);
77 int msg_to_name_assign(
struct msg *,
const char *);
78 int msg_to_name_get(
struct msg *,
char * *);
79 int msg_attack_assign(
struct msg *,
const struct kill*);
80 int msg_attack_get(
struct msg *,
struct kill* *);
81 int msg_run_assign(
struct msg *,
int,
const struct run *);
82 int msg_run_get(
struct msg *,
int,
struct run * *);
83 struct run * msg_run_add(
struct msg *);
96 int (*weapon_assign)(
struct kill *,
const char *);
97 int (*weapon_get)(
struct kill *,
char * *);
98 int (*action_assign)(
struct kill *,
const char *);
99 int (*action_get)(
struct kill *,
char * *);
100 int (*how_often_assign)(
struct kill *,
const uint32_t);
101 int (*how_often_get)(
struct kill *, uint32_t *);
109 uint32_t how_often_data;
113 uint8_t how_often_set;
116 struct kill *kill_new(
void);
117 void kill_free(
struct kill *);
118 void kill_clear(
struct kill *);
119 void kill_marshal(
struct evbuffer *,
const struct kill *);
121 int kill_complete(
struct kill *);
122 void evtag_marshal_kill(
struct evbuffer *, uint32_t,
123 const struct kill *);
124 int evtag_unmarshal_kill(
struct evbuffer *, uint32_t,
126 int kill_weapon_assign(
struct kill *,
const char *);
127 int kill_weapon_get(
struct kill *,
char * *);
128 int kill_action_assign(
struct kill *,
const char *);
129 int kill_action_get(
struct kill *,
char * *);
130 int kill_how_often_assign(
struct kill *,
const uint32_t);
131 int kill_how_often_get(
struct kill *, uint32_t *);
144 int (*how_assign)(
struct run *,
const char *);
145 int (*how_get)(
struct run *,
char * *);
146 int (*some_bytes_assign)(
struct run *,
const uint8_t *, uint32_t);
147 int (*some_bytes_get)(
struct run *, uint8_t * *, uint32_t *);
148 int (*fixed_bytes_assign)(
struct run *,
const uint8_t *);
149 int (*fixed_bytes_get)(
struct run *, uint8_t **);
156 uint8_t *some_bytes_data;
157 uint32_t some_bytes_length;
158 uint8_t fixed_bytes_data[24];
161 uint8_t some_bytes_set;
162 uint8_t fixed_bytes_set;
165 struct run *run_new(
void);
166 void run_free(
struct run *);
167 void run_clear(
struct run *);
168 void run_marshal(
struct evbuffer *,
const struct run *);
169 int run_unmarshal(
struct run *,
struct evbuffer *);
170 int run_complete(
struct run *);
171 void evtag_marshal_run(
struct evbuffer *, uint32_t,
173 int evtag_unmarshal_run(
struct evbuffer *, uint32_t,
175 int run_how_assign(
struct run *,
const char *);
176 int run_how_get(
struct run *,
char * *);
177 int run_some_bytes_assign(
struct run *,
const uint8_t *, uint32_t);
178 int run_some_bytes_get(
struct run *, uint8_t * *, uint32_t *);
179 int run_fixed_bytes_assign(
struct run *,
const uint8_t *);
180 int run_fixed_bytes_get(
struct run *, uint8_t **);