• Home
  • Raw
  • Download

Lines Matching full:tmp

50   struct msg *tmp;  in msg_new_with_arg()  local
51 if ((tmp = malloc(sizeof(struct msg))) == NULL) { in msg_new_with_arg()
55 tmp->base = &msg_base__; in msg_new_with_arg()
57 tmp->from_name_data = NULL; in msg_new_with_arg()
58 tmp->from_name_set = 0; in msg_new_with_arg()
60 tmp->to_name_data = NULL; in msg_new_with_arg()
61 tmp->to_name_set = 0; in msg_new_with_arg()
63 tmp->attack_data = NULL; in msg_new_with_arg()
64 tmp->attack_set = 0; in msg_new_with_arg()
66 tmp->run_data = NULL; in msg_new_with_arg()
67 tmp->run_length = 0; in msg_new_with_arg()
68 tmp->run_num_allocated = 0; in msg_new_with_arg()
69 tmp->run_set = 0; in msg_new_with_arg()
71 return (tmp); in msg_new_with_arg()
136 struct evbuffer *tmp = NULL; in msg_attack_assign() local
147 if ((tmp = evbuffer_new()) == NULL) { in msg_attack_assign()
151 kill_marshal(tmp, value); in msg_attack_assign()
152 if (kill_unmarshal(msg->attack_data, tmp) == -1) { in msg_attack_assign()
157 evbuffer_free(tmp); in msg_attack_assign()
160 if (tmp != NULL) in msg_attack_assign()
161 evbuffer_free(tmp); in msg_attack_assign()
178 struct evbuffer *tmp = NULL; in msg_run_assign() local
180 if ((tmp = evbuffer_new()) == NULL) { in msg_run_assign()
185 run_marshal(tmp, value); in msg_run_assign()
186 if (run_unmarshal(msg->run_data[off], tmp) == -1) { in msg_run_assign()
191 done:if (tmp != NULL) in msg_run_assign()
192 evbuffer_free(tmp); in msg_run_assign()
243 msg_clear(struct msg *tmp) in msg_clear() argument
245 if (tmp->from_name_set == 1) { in msg_clear()
246 free(tmp->from_name_data); in msg_clear()
247 tmp->from_name_data = NULL; in msg_clear()
248 tmp->from_name_set = 0; in msg_clear()
250 if (tmp->to_name_set == 1) { in msg_clear()
251 free(tmp->to_name_data); in msg_clear()
252 tmp->to_name_data = NULL; in msg_clear()
253 tmp->to_name_set = 0; in msg_clear()
255 if (tmp->attack_set == 1) { in msg_clear()
256 kill_free(tmp->attack_data); in msg_clear()
257 tmp->attack_data = NULL; in msg_clear()
258 tmp->attack_set = 0; in msg_clear()
260 if (tmp->run_set == 1) { in msg_clear()
262 for (i = 0; i < tmp->run_length; ++i) { in msg_clear()
263 run_free(tmp->run_data[i]); in msg_clear()
265 free(tmp->run_data); in msg_clear()
266 tmp->run_data = NULL; in msg_clear()
267 tmp->run_set = 0; in msg_clear()
268 tmp->run_length = 0; in msg_clear()
269 tmp->run_num_allocated = 0; in msg_clear()
274 msg_free(struct msg *tmp) in msg_free() argument
276 if (tmp->from_name_data != NULL) in msg_free()
277 free (tmp->from_name_data); in msg_free()
278 if (tmp->to_name_data != NULL) in msg_free()
279 free (tmp->to_name_data); in msg_free()
280 if (tmp->attack_data != NULL) in msg_free()
281 kill_free(tmp->attack_data); in msg_free()
282 if (tmp->run_set == 1) { in msg_free()
284 for (i = 0; i < tmp->run_length; ++i) { in msg_free()
285 run_free(tmp->run_data[i]); in msg_free()
287 free(tmp->run_data); in msg_free()
288 tmp->run_data = NULL; in msg_free()
289 tmp->run_set = 0; in msg_free()
290 tmp->run_length = 0; in msg_free()
291 tmp->run_num_allocated = 0; in msg_free()
293 free(tmp->run_data); in msg_free()
294 free(tmp); in msg_free()
298 msg_marshal(struct evbuffer *evbuf, const struct msg *tmp){ in msg_marshal() argument
299 evtag_marshal_string(evbuf, MSG_FROM_NAME, tmp->from_name_data); in msg_marshal()
300 evtag_marshal_string(evbuf, MSG_TO_NAME, tmp->to_name_data); in msg_marshal()
301 if (tmp->attack_set) { in msg_marshal()
302 evtag_marshal_kill(evbuf, MSG_ATTACK, tmp->attack_data); in msg_marshal()
304 if (tmp->run_set) { in msg_marshal()
307 for (i = 0; i < tmp->run_length; ++i) { in msg_marshal()
308 evtag_marshal_run(evbuf, MSG_RUN, tmp->run_data[i]); in msg_marshal()
315 msg_unmarshal(struct msg *tmp, struct evbuffer *evbuf) in msg_unmarshal() argument
325 if (tmp->from_name_set) in msg_unmarshal()
327 if (evtag_unmarshal_string(evbuf, MSG_FROM_NAME, &tmp->from_name_data) == -1) { in msg_unmarshal()
331 tmp->from_name_set = 1; in msg_unmarshal()
336 if (tmp->to_name_set) in msg_unmarshal()
338 if (evtag_unmarshal_string(evbuf, MSG_TO_NAME, &tmp->to_name_data) == -1) { in msg_unmarshal()
342 tmp->to_name_set = 1; in msg_unmarshal()
347 if (tmp->attack_set) in msg_unmarshal()
349 tmp->attack_data = kill_new(); in msg_unmarshal()
350 if (tmp->attack_data == NULL) in msg_unmarshal()
352 if (evtag_unmarshal_kill(evbuf, MSG_ATTACK, tmp->attack_data) == -1) { in msg_unmarshal()
356 tmp->attack_set = 1; in msg_unmarshal()
361 if (tmp->run_length >= tmp->run_num_allocated && in msg_unmarshal()
362 msg_run_expand_to_hold_more(tmp) < 0) { in msg_unmarshal()
366 tmp->run_data[tmp->run_length] = run_new(); in msg_unmarshal()
367 if (tmp->run_data[tmp->run_length] == NULL) in msg_unmarshal()
369 if (evtag_unmarshal_run(evbuf, MSG_RUN, tmp->run_data[tmp->run_length]) == -1) { in msg_unmarshal()
373 ++tmp->run_length; in msg_unmarshal()
374 tmp->run_set = 1; in msg_unmarshal()
382 if (msg_complete(tmp) == -1) in msg_unmarshal()
412 struct evbuffer *tmp = evbuffer_new(); in evtag_unmarshal_msg() local
414 if (evtag_unmarshal(evbuf, &tag, tmp) == -1 || tag != need_tag) in evtag_unmarshal_msg()
417 if (msg_unmarshal(msg, tmp) == -1) in evtag_unmarshal_msg()
423 evbuffer_free(tmp); in evtag_unmarshal_msg()
460 struct kill *tmp; in kill_new_with_arg() local
461 if ((tmp = malloc(sizeof(struct kill))) == NULL) { in kill_new_with_arg()
465 tmp->base = &kill_base__; in kill_new_with_arg()
467 tmp->weapon_data = NULL; in kill_new_with_arg()
468 tmp->weapon_set = 0; in kill_new_with_arg()
470 tmp->action_data = NULL; in kill_new_with_arg()
471 tmp->action_set = 0; in kill_new_with_arg()
473 tmp->how_often_data = NULL; in kill_new_with_arg()
474 tmp->how_often_length = 0; in kill_new_with_arg()
475 tmp->how_often_num_allocated = 0; in kill_new_with_arg()
476 tmp->how_often_set = 0; in kill_new_with_arg()
478 return (tmp); in kill_new_with_arg()
578 kill_clear(struct kill *tmp) in kill_clear() argument
580 if (tmp->weapon_set == 1) { in kill_clear()
581 free(tmp->weapon_data); in kill_clear()
582 tmp->weapon_data = NULL; in kill_clear()
583 tmp->weapon_set = 0; in kill_clear()
585 if (tmp->action_set == 1) { in kill_clear()
586 free(tmp->action_data); in kill_clear()
587 tmp->action_data = NULL; in kill_clear()
588 tmp->action_set = 0; in kill_clear()
590 if (tmp->how_often_set == 1) { in kill_clear()
591 free(tmp->how_often_data); in kill_clear()
592 tmp->how_often_data = NULL; in kill_clear()
593 tmp->how_often_set = 0; in kill_clear()
594 tmp->how_often_length = 0; in kill_clear()
595 tmp->how_often_num_allocated = 0; in kill_clear()
600 kill_free(struct kill *tmp) in kill_free() argument
602 if (tmp->weapon_data != NULL) in kill_free()
603 free (tmp->weapon_data); in kill_free()
604 if (tmp->action_data != NULL) in kill_free()
605 free (tmp->action_data); in kill_free()
606 if (tmp->how_often_set == 1) { in kill_free()
607 free(tmp->how_often_data); in kill_free()
608 tmp->how_often_data = NULL; in kill_free()
609 tmp->how_often_set = 0; in kill_free()
610 tmp->how_often_length = 0; in kill_free()
611 tmp->how_often_num_allocated = 0; in kill_free()
613 free(tmp->how_often_data); in kill_free()
614 free(tmp); in kill_free()
618 kill_marshal(struct evbuffer *evbuf, const struct kill *tmp){ in kill_marshal() argument
619 evtag_marshal_string(evbuf, KILL_WEAPON, tmp->weapon_data); in kill_marshal()
620 evtag_marshal_string(evbuf, KILL_ACTION, tmp->action_data); in kill_marshal()
621 if (tmp->how_often_set) { in kill_marshal()
624 for (i = 0; i < tmp->how_often_length; ++i) { in kill_marshal()
625 evtag_marshal_int(evbuf, KILL_HOW_OFTEN, tmp->how_often_data[i]); in kill_marshal()
632 kill_unmarshal(struct kill *tmp, struct evbuffer *evbuf) in kill_unmarshal() argument
642 if (tmp->weapon_set) in kill_unmarshal()
644 if (evtag_unmarshal_string(evbuf, KILL_WEAPON, &tmp->weapon_data) == -1) { in kill_unmarshal()
648 tmp->weapon_set = 1; in kill_unmarshal()
653 if (tmp->action_set) in kill_unmarshal()
655 if (evtag_unmarshal_string(evbuf, KILL_ACTION, &tmp->action_data) == -1) { in kill_unmarshal()
659 tmp->action_set = 1; in kill_unmarshal()
664 if (tmp->how_often_length >= tmp->how_often_num_allocated && in kill_unmarshal()
665 kill_how_often_expand_to_hold_more(tmp) < 0) { in kill_unmarshal()
669 …if (evtag_unmarshal_int(evbuf, KILL_HOW_OFTEN, &tmp->how_often_data[tmp->how_often_length]) == -1)… in kill_unmarshal()
673 ++tmp->how_often_length; in kill_unmarshal()
674 tmp->how_often_set = 1; in kill_unmarshal()
682 if (kill_complete(tmp) == -1) in kill_unmarshal()
703 struct evbuffer *tmp = evbuffer_new(); in evtag_unmarshal_kill() local
705 if (evtag_unmarshal(evbuf, &tag, tmp) == -1 || tag != need_tag) in evtag_unmarshal_kill()
708 if (kill_unmarshal(msg, tmp) == -1) in evtag_unmarshal_kill()
714 evbuffer_free(tmp); in evtag_unmarshal_kill()
758 struct run *tmp; in run_new_with_arg() local
759 if ((tmp = malloc(sizeof(struct run))) == NULL) { in run_new_with_arg()
763 tmp->base = &run_base__; in run_new_with_arg()
765 tmp->how_data = NULL; in run_new_with_arg()
766 tmp->how_set = 0; in run_new_with_arg()
768 tmp->some_bytes_data = NULL; in run_new_with_arg()
769 tmp->some_bytes_length = 0; in run_new_with_arg()
770 tmp->some_bytes_set = 0; in run_new_with_arg()
772 memset(tmp->fixed_bytes_data, 0, sizeof(tmp->fixed_bytes_data)); in run_new_with_arg()
773 tmp->fixed_bytes_set = 0; in run_new_with_arg()
775 tmp->notes_data = NULL; in run_new_with_arg()
776 tmp->notes_length = 0; in run_new_with_arg()
777 tmp->notes_num_allocated = 0; in run_new_with_arg()
778 tmp->notes_set = 0; in run_new_with_arg()
780 tmp->large_number_data = 0; in run_new_with_arg()
781 tmp->large_number_set = 0; in run_new_with_arg()
783 tmp->other_numbers_data = NULL; in run_new_with_arg()
784 tmp->other_numbers_length = 0; in run_new_with_arg()
785 tmp->other_numbers_num_allocated = 0; in run_new_with_arg()
786 tmp->other_numbers_set = 0; in run_new_with_arg()
788 return (tmp); in run_new_with_arg()
992 run_clear(struct run *tmp) in run_clear() argument
994 if (tmp->how_set == 1) { in run_clear()
995 free(tmp->how_data); in run_clear()
996 tmp->how_data = NULL; in run_clear()
997 tmp->how_set = 0; in run_clear()
999 if (tmp->some_bytes_set == 1) { in run_clear()
1000 free (tmp->some_bytes_data); in run_clear()
1001 tmp->some_bytes_data = NULL; in run_clear()
1002 tmp->some_bytes_length = 0; in run_clear()
1003 tmp->some_bytes_set = 0; in run_clear()
1005 tmp->fixed_bytes_set = 0; in run_clear()
1006 memset(tmp->fixed_bytes_data, 0, sizeof(tmp->fixed_bytes_data)); in run_clear()
1007 if (tmp->notes_set == 1) { in run_clear()
1009 for (i = 0; i < tmp->notes_length; ++i) { in run_clear()
1010 if (tmp->notes_data[i] != NULL) free(tmp->notes_data[i]); in run_clear()
1012 free(tmp->notes_data); in run_clear()
1013 tmp->notes_data = NULL; in run_clear()
1014 tmp->notes_set = 0; in run_clear()
1015 tmp->notes_length = 0; in run_clear()
1016 tmp->notes_num_allocated = 0; in run_clear()
1018 tmp->large_number_set = 0; in run_clear()
1019 if (tmp->other_numbers_set == 1) { in run_clear()
1020 free(tmp->other_numbers_data); in run_clear()
1021 tmp->other_numbers_data = NULL; in run_clear()
1022 tmp->other_numbers_set = 0; in run_clear()
1023 tmp->other_numbers_length = 0; in run_clear()
1024 tmp->other_numbers_num_allocated = 0; in run_clear()
1029 run_free(struct run *tmp) in run_free() argument
1031 if (tmp->how_data != NULL) in run_free()
1032 free (tmp->how_data); in run_free()
1033 if (tmp->some_bytes_data != NULL) in run_free()
1034 free(tmp->some_bytes_data); in run_free()
1035 if (tmp->notes_set == 1) { in run_free()
1037 for (i = 0; i < tmp->notes_length; ++i) { in run_free()
1038 if (tmp->notes_data[i] != NULL) free(tmp->notes_data[i]); in run_free()
1040 free(tmp->notes_data); in run_free()
1041 tmp->notes_data = NULL; in run_free()
1042 tmp->notes_set = 0; in run_free()
1043 tmp->notes_length = 0; in run_free()
1044 tmp->notes_num_allocated = 0; in run_free()
1046 free(tmp->notes_data); in run_free()
1047 if (tmp->other_numbers_set == 1) { in run_free()
1048 free(tmp->other_numbers_data); in run_free()
1049 tmp->other_numbers_data = NULL; in run_free()
1050 tmp->other_numbers_set = 0; in run_free()
1051 tmp->other_numbers_length = 0; in run_free()
1052 tmp->other_numbers_num_allocated = 0; in run_free()
1054 free(tmp->other_numbers_data); in run_free()
1055 free(tmp); in run_free()
1059 run_marshal(struct evbuffer *evbuf, const struct run *tmp){ in run_marshal() argument
1060 evtag_marshal_string(evbuf, RUN_HOW, tmp->how_data); in run_marshal()
1061 if (tmp->some_bytes_set) { in run_marshal()
1062 evtag_marshal(evbuf, RUN_SOME_BYTES, tmp->some_bytes_data, tmp->some_bytes_length); in run_marshal()
1064 evtag_marshal(evbuf, RUN_FIXED_BYTES, tmp->fixed_bytes_data, (24)); in run_marshal()
1065 if (tmp->notes_set) { in run_marshal()
1068 for (i = 0; i < tmp->notes_length; ++i) { in run_marshal()
1069 evtag_marshal_string(evbuf, RUN_NOTES, tmp->notes_data[i]); in run_marshal()
1073 if (tmp->large_number_set) { in run_marshal()
1074 evtag_marshal_int64(evbuf, RUN_LARGE_NUMBER, tmp->large_number_data); in run_marshal()
1076 if (tmp->other_numbers_set) { in run_marshal()
1079 for (i = 0; i < tmp->other_numbers_length; ++i) { in run_marshal()
1080 evtag_marshal_int(evbuf, RUN_OTHER_NUMBERS, tmp->other_numbers_data[i]); in run_marshal()
1087 run_unmarshal(struct run *tmp, struct evbuffer *evbuf) in run_unmarshal() argument
1097 if (tmp->how_set) in run_unmarshal()
1099 if (evtag_unmarshal_string(evbuf, RUN_HOW, &tmp->how_data) == -1) { in run_unmarshal()
1103 tmp->how_set = 1; in run_unmarshal()
1108 if (tmp->some_bytes_set) in run_unmarshal()
1110 if (evtag_payload_length(evbuf, &tmp->some_bytes_length) == -1) in run_unmarshal()
1112 if (tmp->some_bytes_length > evbuffer_get_length(evbuf)) in run_unmarshal()
1114 if ((tmp->some_bytes_data = malloc(tmp->some_bytes_length)) == NULL) in run_unmarshal()
1116 …if (evtag_unmarshal_fixed(evbuf, RUN_SOME_BYTES, tmp->some_bytes_data, tmp->some_bytes_length) == … in run_unmarshal()
1120 tmp->some_bytes_set = 1; in run_unmarshal()
1125 if (tmp->fixed_bytes_set) in run_unmarshal()
1127 if (evtag_unmarshal_fixed(evbuf, RUN_FIXED_BYTES, tmp->fixed_bytes_data, (24)) == -1) { in run_unmarshal()
1131 tmp->fixed_bytes_set = 1; in run_unmarshal()
1136 if (tmp->notes_length >= tmp->notes_num_allocated && in run_unmarshal()
1137 run_notes_expand_to_hold_more(tmp) < 0) { in run_unmarshal()
1141 if (evtag_unmarshal_string(evbuf, RUN_NOTES, &tmp->notes_data[tmp->notes_length]) == -1) { in run_unmarshal()
1145 ++tmp->notes_length; in run_unmarshal()
1146 tmp->notes_set = 1; in run_unmarshal()
1151 if (tmp->large_number_set) in run_unmarshal()
1153 if (evtag_unmarshal_int64(evbuf, RUN_LARGE_NUMBER, &tmp->large_number_data) == -1) { in run_unmarshal()
1157 tmp->large_number_set = 1; in run_unmarshal()
1162 if (tmp->other_numbers_length >= tmp->other_numbers_num_allocated && in run_unmarshal()
1163 run_other_numbers_expand_to_hold_more(tmp) < 0) { in run_unmarshal()
1167 …if (evtag_unmarshal_int(evbuf, RUN_OTHER_NUMBERS, &tmp->other_numbers_data[tmp->other_numbers_leng… in run_unmarshal()
1171 ++tmp->other_numbers_length; in run_unmarshal()
1172 tmp->other_numbers_set = 1; in run_unmarshal()
1180 if (run_complete(tmp) == -1) in run_unmarshal()
1201 struct evbuffer *tmp = evbuffer_new(); in evtag_unmarshal_run() local
1203 if (evtag_unmarshal(evbuf, &tag, tmp) == -1 || tag != need_tag) in evtag_unmarshal_run()
1206 if (run_unmarshal(msg, tmp) == -1) in evtag_unmarshal_run()
1212 evbuffer_free(tmp); in evtag_unmarshal_run()