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