#include "util.h"
#include <stdlib.h>
#include <unistd.h>
#include "def.h"
Go to the source code of this file.
Functions | |
int | DEC_UNTIL_ZERO (int x) |
decrements a signed number by one, but not past zero | |
errorcode | safe_free (void *memory) |
a 'safe' free | |
errorcode | wait_for_flag (flag_t *check_flag, flag_t stop_flags, int timeout) |
waits for a flag to take one of many specified values |
Definition in file util.c.
|
decrements a signed number by one, but not past zero
Definition at line 31 of file util.c. Referenced by find_conn2(), get_buddy(), and wait_for_flag(). |
|
a 'safe' free
Definition at line 35 of file util.c. References CHECK_NOT_NULL, ERROR_NULL_ARG_1, and errorcode. Referenced by create_new_handler(), list_destroy(), list_remove(), readMsg(), run_direct_conn_connect(), run_helper_fsm_thread(), sendMsg(), and start_direct_conn(). |
|
waits for a flag to take one of many specified values Success if the check_flag takes on any one of the stop_flags before timeout
Definition at line 48 of file util.c. References CHECK_NOT_NEG, CHECK_NOT_NULL, DEC_UNTIL_ZERO(), ERROR_NEG_ARG_3, ERROR_NULL_ARG_1, and errorcode. Referenced by wait_and_join_find_synack(), wait_for_buddy_bday_port(), wait_for_buddy_port_alloc(), wait_for_buddy_port_known(), wait_for_buddy_syn_flood(), wait_for_buddy_syn_seq_num(), and wait_for_direct_conn(). |