• Home
  • Raw
  • Download

Lines Matching refs:tmp

47   struct msg *tmp;  in msg_new()  local
48 if ((tmp = malloc(sizeof(struct msg))) == NULL) { in msg_new()
52 tmp->base = &__msg_base; in msg_new()
54 tmp->from_name_data = NULL; in msg_new()
55 tmp->from_name_set = 0; in msg_new()
57 tmp->to_name_data = NULL; in msg_new()
58 tmp->to_name_set = 0; in msg_new()
60 tmp->attack_data = NULL; in msg_new()
61 tmp->attack_set = 0; in msg_new()
63 tmp->run_data = NULL; in msg_new()
64 tmp->run_length = 0; in msg_new()
65 tmp->run_num_allocated = 0; in msg_new()
66 tmp->run_set = 0; in msg_new()
68 return (tmp); in msg_new()
127 struct evbuffer *tmp = NULL; in msg_attack_assign() local
138 if ((tmp = evbuffer_new()) == NULL) { in msg_attack_assign()
142 kill_marshal(tmp, value); in msg_attack_assign()
143 if (kill_unmarshal(msg->attack_data, tmp) == -1) { in msg_attack_assign()
148 evbuffer_free(tmp); in msg_attack_assign()
151 if (tmp != NULL) in msg_attack_assign()
152 evbuffer_free(tmp); in msg_attack_assign()
164 struct evbuffer *tmp = NULL; in msg_run_assign() local
168 if ((tmp = evbuffer_new()) == NULL) { in msg_run_assign()
172 run_marshal(tmp, value); in msg_run_assign()
173 if (run_unmarshal(msg->run_data[off], tmp) == -1) { in msg_run_assign()
177 evbuffer_free(tmp); in msg_run_assign()
180 if (tmp != NULL) in msg_run_assign()
181 evbuffer_free(tmp); in msg_run_assign()
228 msg_clear(struct msg *tmp) in msg_clear() argument
230 if (tmp->from_name_set == 1) { in msg_clear()
231 free (tmp->from_name_data); in msg_clear()
232 tmp->from_name_data = NULL; in msg_clear()
233 tmp->from_name_set = 0; in msg_clear()
235 if (tmp->to_name_set == 1) { in msg_clear()
236 free (tmp->to_name_data); in msg_clear()
237 tmp->to_name_data = NULL; in msg_clear()
238 tmp->to_name_set = 0; in msg_clear()
240 if (tmp->attack_set == 1) { in msg_clear()
241 kill_free(tmp->attack_data); in msg_clear()
242 tmp->attack_data = NULL; in msg_clear()
243 tmp->attack_set = 0; in msg_clear()
245 if (tmp->run_set == 1) { in msg_clear()
247 for (i = 0; i < tmp->run_length; ++i) { in msg_clear()
248 run_free(tmp->run_data[i]); in msg_clear()
250 free(tmp->run_data); in msg_clear()
251 tmp->run_data = NULL; in msg_clear()
252 tmp->run_set = 0; in msg_clear()
253 tmp->run_length = 0; in msg_clear()
254 tmp->run_num_allocated = 0; in msg_clear()
259 msg_free(struct msg *tmp) in msg_free() argument
261 if (tmp->from_name_data != NULL) in msg_free()
262 free (tmp->from_name_data); in msg_free()
263 if (tmp->to_name_data != NULL) in msg_free()
264 free (tmp->to_name_data); in msg_free()
265 if (tmp->attack_data != NULL) in msg_free()
266 kill_free(tmp->attack_data); in msg_free()
267 if (tmp->run_data != NULL) { in msg_free()
269 for (i = 0; i < tmp->run_length; ++i) { in msg_free()
270 run_free(tmp->run_data[i]); in msg_free()
271 tmp->run_data[i] = NULL; in msg_free()
273 free(tmp->run_data); in msg_free()
274 tmp->run_data = NULL; in msg_free()
275 tmp->run_length = 0; in msg_free()
276 tmp->run_num_allocated = 0; in msg_free()
278 free(tmp); in msg_free()
282 msg_marshal(struct evbuffer *evbuf, const struct msg *tmp){ in msg_marshal() argument
283 evtag_marshal_string(evbuf, MSG_FROM_NAME, tmp->from_name_data); in msg_marshal()
284 evtag_marshal_string(evbuf, MSG_TO_NAME, tmp->to_name_data); in msg_marshal()
285 if (tmp->attack_set) { in msg_marshal()
286 evtag_marshal_kill(evbuf, MSG_ATTACK, tmp->attack_data); in msg_marshal()
290 for (i = 0; i < tmp->run_length; ++i) { in msg_marshal()
291 evtag_marshal_run(evbuf, MSG_RUN, tmp->run_data[i]); in msg_marshal()
297 msg_unmarshal(struct msg *tmp, struct evbuffer *evbuf) in msg_unmarshal() argument
307 if (tmp->from_name_set) in msg_unmarshal()
309 if (evtag_unmarshal_string(evbuf, MSG_FROM_NAME, &tmp->from_name_data) == -1) { in msg_unmarshal()
313 tmp->from_name_set = 1; in msg_unmarshal()
318 if (tmp->to_name_set) in msg_unmarshal()
320 if (evtag_unmarshal_string(evbuf, MSG_TO_NAME, &tmp->to_name_data) == -1) { in msg_unmarshal()
324 tmp->to_name_set = 1; in msg_unmarshal()
329 if (tmp->attack_set) in msg_unmarshal()
331 tmp->attack_data = kill_new(); in msg_unmarshal()
332 if (tmp->attack_data == NULL) in msg_unmarshal()
334 if (evtag_unmarshal_kill(evbuf, MSG_ATTACK, tmp->attack_data) == -1) { in msg_unmarshal()
338 tmp->attack_set = 1; in msg_unmarshal()
343 if (msg_run_add(tmp) == NULL) in msg_unmarshal()
346 tmp->run_data[tmp->run_length - 1]) == -1) { in msg_unmarshal()
347 --tmp->run_length; in msg_unmarshal()
351 tmp->run_set = 1; in msg_unmarshal()
359 if (msg_complete(tmp) == -1) in msg_unmarshal()
389 struct evbuffer *tmp = evbuffer_new(); in evtag_unmarshal_msg() local
391 if (evtag_unmarshal(evbuf, &tag, tmp) == -1 || tag != need_tag) in evtag_unmarshal_msg()
394 if (msg_unmarshal(msg, tmp) == -1) in evtag_unmarshal_msg()
400 evbuffer_free(tmp); in evtag_unmarshal_msg()
431 struct kill *tmp; in kill_new() local
432 if ((tmp = malloc(sizeof(struct kill))) == NULL) { in kill_new()
436 tmp->base = &__kill_base; in kill_new()
438 tmp->weapon_data = NULL; in kill_new()
439 tmp->weapon_set = 0; in kill_new()
441 tmp->action_data = NULL; in kill_new()
442 tmp->action_set = 0; in kill_new()
444 tmp->how_often_data = 0; in kill_new()
445 tmp->how_often_set = 0; in kill_new()
447 return (tmp); in kill_new()
513 kill_clear(struct kill *tmp) in kill_clear() argument
515 if (tmp->weapon_set == 1) { in kill_clear()
516 free (tmp->weapon_data); in kill_clear()
517 tmp->weapon_data = NULL; in kill_clear()
518 tmp->weapon_set = 0; in kill_clear()
520 if (tmp->action_set == 1) { in kill_clear()
521 free (tmp->action_data); in kill_clear()
522 tmp->action_data = NULL; in kill_clear()
523 tmp->action_set = 0; in kill_clear()
525 tmp->how_often_set = 0; in kill_clear()
529 kill_free(struct kill *tmp) in kill_free() argument
531 if (tmp->weapon_data != NULL) in kill_free()
532 free (tmp->weapon_data); in kill_free()
533 if (tmp->action_data != NULL) in kill_free()
534 free (tmp->action_data); in kill_free()
535 free(tmp); in kill_free()
539 kill_marshal(struct evbuffer *evbuf, const struct kill *tmp){ in kill_marshal() argument
540 evtag_marshal_string(evbuf, KILL_WEAPON, tmp->weapon_data); in kill_marshal()
541 evtag_marshal_string(evbuf, KILL_ACTION, tmp->action_data); in kill_marshal()
542 if (tmp->how_often_set) { in kill_marshal()
543 evtag_marshal_int(evbuf, KILL_HOW_OFTEN, tmp->how_often_data); in kill_marshal()
548 kill_unmarshal(struct kill *tmp, struct evbuffer *evbuf) in kill_unmarshal() argument
558 if (tmp->weapon_set) in kill_unmarshal()
560 if (evtag_unmarshal_string(evbuf, KILL_WEAPON, &tmp->weapon_data) == -1) { in kill_unmarshal()
564 tmp->weapon_set = 1; in kill_unmarshal()
569 if (tmp->action_set) in kill_unmarshal()
571 if (evtag_unmarshal_string(evbuf, KILL_ACTION, &tmp->action_data) == -1) { in kill_unmarshal()
575 tmp->action_set = 1; in kill_unmarshal()
580 if (tmp->how_often_set) in kill_unmarshal()
582 if (evtag_unmarshal_int(evbuf, KILL_HOW_OFTEN, &tmp->how_often_data) == -1) { in kill_unmarshal()
586 tmp->how_often_set = 1; in kill_unmarshal()
594 if (kill_complete(tmp) == -1) in kill_unmarshal()
615 struct evbuffer *tmp = evbuffer_new(); in evtag_unmarshal_kill() local
617 if (evtag_unmarshal(evbuf, &tag, tmp) == -1 || tag != need_tag) in evtag_unmarshal_kill()
620 if (kill_unmarshal(msg, tmp) == -1) in evtag_unmarshal_kill()
626 evbuffer_free(tmp); in evtag_unmarshal_kill()
657 struct run *tmp; in run_new() local
658 if ((tmp = malloc(sizeof(struct run))) == NULL) { in run_new()
662 tmp->base = &__run_base; in run_new()
664 tmp->how_data = NULL; in run_new()
665 tmp->how_set = 0; in run_new()
667 tmp->some_bytes_data = NULL; in run_new()
668 tmp->some_bytes_length = 0; in run_new()
669 tmp->some_bytes_set = 0; in run_new()
671 memset(tmp->fixed_bytes_data, 0, sizeof(tmp->fixed_bytes_data)); in run_new()
672 tmp->fixed_bytes_set = 0; in run_new()
674 return (tmp); in run_new()
743 run_clear(struct run *tmp) in run_clear() argument
745 if (tmp->how_set == 1) { in run_clear()
746 free (tmp->how_data); in run_clear()
747 tmp->how_data = NULL; in run_clear()
748 tmp->how_set = 0; in run_clear()
750 if (tmp->some_bytes_set == 1) { in run_clear()
751 free (tmp->some_bytes_data); in run_clear()
752 tmp->some_bytes_data = NULL; in run_clear()
753 tmp->some_bytes_length = 0; in run_clear()
754 tmp->some_bytes_set = 0; in run_clear()
756 tmp->fixed_bytes_set = 0; in run_clear()
757 memset(tmp->fixed_bytes_data, 0, sizeof(tmp->fixed_bytes_data)); in run_clear()
761 run_free(struct run *tmp) in run_free() argument
763 if (tmp->how_data != NULL) in run_free()
764 free (tmp->how_data); in run_free()
765 if (tmp->some_bytes_data != NULL) in run_free()
766 free (tmp->some_bytes_data); in run_free()
767 free(tmp); in run_free()
771 run_marshal(struct evbuffer *evbuf, const struct run *tmp){ in run_marshal() argument
772 evtag_marshal_string(evbuf, RUN_HOW, tmp->how_data); in run_marshal()
773 if (tmp->some_bytes_set) { in run_marshal()
774 evtag_marshal(evbuf, RUN_SOME_BYTES, tmp->some_bytes_data, tmp->some_bytes_length); in run_marshal()
776 evtag_marshal(evbuf, RUN_FIXED_BYTES, tmp->fixed_bytes_data, sizeof(tmp->fixed_bytes_data)); in run_marshal()
780 run_unmarshal(struct run *tmp, struct evbuffer *evbuf) in run_unmarshal() argument
790 if (tmp->how_set) in run_unmarshal()
792 if (evtag_unmarshal_string(evbuf, RUN_HOW, &tmp->how_data) == -1) { in run_unmarshal()
796 tmp->how_set = 1; in run_unmarshal()
801 if (tmp->some_bytes_set) in run_unmarshal()
803 if (evtag_payload_length(evbuf, &tmp->some_bytes_length) == -1) in run_unmarshal()
805 if (tmp->some_bytes_length > EVBUFFER_LENGTH(evbuf)) in run_unmarshal()
807 if ((tmp->some_bytes_data = malloc(tmp->some_bytes_length)) == NULL) in run_unmarshal()
809 …if (evtag_unmarshal_fixed(evbuf, RUN_SOME_BYTES, tmp->some_bytes_data, tmp->some_bytes_length) == … in run_unmarshal()
813 tmp->some_bytes_set = 1; in run_unmarshal()
818 if (tmp->fixed_bytes_set) in run_unmarshal()
820 …if (evtag_unmarshal_fixed(evbuf, RUN_FIXED_BYTES, tmp->fixed_bytes_data, sizeof(tmp->fixed_bytes_d… in run_unmarshal()
824 tmp->fixed_bytes_set = 1; in run_unmarshal()
832 if (run_complete(tmp) == -1) in run_unmarshal()
853 struct evbuffer *tmp = evbuffer_new(); in evtag_unmarshal_run() local
855 if (evtag_unmarshal(evbuf, &tag, tmp) == -1 || tag != need_tag) in evtag_unmarshal_run()
858 if (run_unmarshal(msg, tmp) == -1) in evtag_unmarshal_run()
864 evbuffer_free(tmp); in evtag_unmarshal_run()