1/* 2 * Automatically generated from ./regress.rpc 3 */ 4 5#ifndef ___REGRESS_RPC_ 6#define ___REGRESS_RPC_ 7 8#include <event-config.h> 9#ifdef _EVENT_HAVE_STDINT_H 10#include <stdint.h> 11#endif 12#define EVTAG_HAS(msg, member) ((msg)->member##_set == 1) 13#ifdef __GNUC__ 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) 16#else 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__) 19#endif 20#define EVTAG_ADD(msg, member) (*(msg)->base->member##_add)(msg) 21#define EVTAG_LEN(msg, member) ((msg)->member##_length) 22 23struct msg; 24struct kill; 25struct run; 26 27/* Tag definition for msg */ 28enum msg_ { 29 MSG_FROM_NAME=1, 30 MSG_TO_NAME=2, 31 MSG_ATTACK=3, 32 MSG_RUN=4, 33 MSG_MAX_TAGS 34}; 35 36/* Structure declaration for msg */ 37struct msg_access_ { 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 *); 47}; 48 49struct msg { 50 struct msg_access_ *base; 51 52 char *from_name_data; 53 char *to_name_data; 54 struct kill* attack_data; 55 struct run **run_data; 56 int run_length; 57 int run_num_allocated; 58 59 ev_uint8_t from_name_set; 60 ev_uint8_t to_name_set; 61 ev_uint8_t attack_set; 62 ev_uint8_t run_set; 63}; 64 65struct msg *msg_new(void); 66void msg_free(struct msg *); 67void msg_clear(struct msg *); 68void msg_marshal(struct evbuffer *, const struct msg *); 69int msg_unmarshal(struct msg *, struct evbuffer *); 70int msg_complete(struct msg *); 71void evtag_marshal_msg(struct evbuffer *, ev_uint32_t, 72 const struct msg *); 73int evtag_unmarshal_msg(struct evbuffer *, ev_uint32_t, 74 struct msg *); 75int msg_from_name_assign(struct msg *, const char *); 76int msg_from_name_get(struct msg *, char * *); 77int msg_to_name_assign(struct msg *, const char *); 78int msg_to_name_get(struct msg *, char * *); 79int msg_attack_assign(struct msg *, const struct kill*); 80int msg_attack_get(struct msg *, struct kill* *); 81int msg_run_assign(struct msg *, int, const struct run *); 82int msg_run_get(struct msg *, int, struct run * *); 83struct run * msg_run_add(struct msg *); 84/* --- msg done --- */ 85 86/* Tag definition for kill */ 87enum kill_ { 88 KILL_WEAPON=65825, 89 KILL_ACTION=2, 90 KILL_HOW_OFTEN=3, 91 KILL_MAX_TAGS 92}; 93 94/* Structure declaration for kill */ 95struct kill_access_ { 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 ev_uint32_t); 101 int (*how_often_get)(struct kill *, ev_uint32_t *); 102}; 103 104struct kill { 105 struct kill_access_ *base; 106 107 char *weapon_data; 108 char *action_data; 109 ev_uint32_t how_often_data; 110 111 ev_uint8_t weapon_set; 112 ev_uint8_t action_set; 113 ev_uint8_t how_often_set; 114}; 115 116struct kill *kill_new(void); 117void kill_free(struct kill *); 118void kill_clear(struct kill *); 119void kill_marshal(struct evbuffer *, const struct kill *); 120int kill_unmarshal(struct kill *, struct evbuffer *); 121int kill_complete(struct kill *); 122void evtag_marshal_kill(struct evbuffer *, ev_uint32_t, 123 const struct kill *); 124int evtag_unmarshal_kill(struct evbuffer *, ev_uint32_t, 125 struct kill *); 126int kill_weapon_assign(struct kill *, const char *); 127int kill_weapon_get(struct kill *, char * *); 128int kill_action_assign(struct kill *, const char *); 129int kill_action_get(struct kill *, char * *); 130int kill_how_often_assign(struct kill *, const ev_uint32_t); 131int kill_how_often_get(struct kill *, ev_uint32_t *); 132/* --- kill done --- */ 133 134/* Tag definition for run */ 135enum run_ { 136 RUN_HOW=1, 137 RUN_SOME_BYTES=2, 138 RUN_FIXED_BYTES=3, 139 RUN_MAX_TAGS 140}; 141 142/* Structure declaration for run */ 143struct run_access_ { 144 int (*how_assign)(struct run *, const char *); 145 int (*how_get)(struct run *, char * *); 146 int (*some_bytes_assign)(struct run *, const ev_uint8_t *, ev_uint32_t); 147 int (*some_bytes_get)(struct run *, ev_uint8_t * *, ev_uint32_t *); 148 int (*fixed_bytes_assign)(struct run *, const ev_uint8_t *); 149 int (*fixed_bytes_get)(struct run *, ev_uint8_t **); 150}; 151 152struct run { 153 struct run_access_ *base; 154 155 char *how_data; 156 ev_uint8_t *some_bytes_data; 157 ev_uint32_t some_bytes_length; 158 ev_uint8_t fixed_bytes_data[24]; 159 160 ev_uint8_t how_set; 161 ev_uint8_t some_bytes_set; 162 ev_uint8_t fixed_bytes_set; 163}; 164 165struct run *run_new(void); 166void run_free(struct run *); 167void run_clear(struct run *); 168void run_marshal(struct evbuffer *, const struct run *); 169int run_unmarshal(struct run *, struct evbuffer *); 170int run_complete(struct run *); 171void evtag_marshal_run(struct evbuffer *, ev_uint32_t, 172 const struct run *); 173int evtag_unmarshal_run(struct evbuffer *, ev_uint32_t, 174 struct run *); 175int run_how_assign(struct run *, const char *); 176int run_how_get(struct run *, char * *); 177int run_some_bytes_assign(struct run *, const ev_uint8_t *, ev_uint32_t); 178int run_some_bytes_get(struct run *, ev_uint8_t * *, ev_uint32_t *); 179int run_fixed_bytes_assign(struct run *, const ev_uint8_t *); 180int run_fixed_bytes_get(struct run *, ev_uint8_t **); 181/* --- run done --- */ 182 183#endif /* ___REGRESS_RPC_ */ 184