15 #define DISPATCH_PRIVATE
50 if (oldval != NULL && *oldval != type) {
54 smartlist_set(cfg->
type_by_msg, msg, tor_memdup(&type,
sizeof(type)));
67 channel_id_t *oldval = smartlist_get(cfg->
chan_by_msg, msg);
68 if (oldval != NULL && *oldval != chan) {
72 smartlist_set(cfg->
chan_by_msg, msg, tor_memdup(&chan,
sizeof(chan)));
90 smartlist_set(cfg->
fns_by_type, type, tor_memdup(fns,
sizeof(*fns)));
111 dispatch_rcv_t *rcv = tor_malloc(
sizeof(dispatch_rcv_t));
136 smartlist_free(receivers);
137 } SMARTLIST_FOREACH_END(receivers);
Low-level APIs for message-passing system.
int dcfg_msg_set_chan(dispatch_cfg_t *cfg, message_id_t msg, channel_id_t chan)
int dcfg_type_set_fns(dispatch_cfg_t *cfg, msg_type_id_t type, const dispatch_typefns_t *fns)
void dcfg_free_(dispatch_cfg_t *cfg)
dispatch_cfg_t * dcfg_new(void)
int dcfg_msg_set_type(dispatch_cfg_t *cfg, message_id_t msg, msg_type_id_t type)
int dcfg_add_recv(dispatch_cfg_t *cfg, message_id_t msg, subsys_id_t sys, recv_fn_t fn)
Header for distpach_cfg.c.
Declarations for dispatch-configuration types.
private structures used for the dispatcher module
Headers for util_malloc.c.
void(* recv_fn_t)(const msg_t *m)
void smartlist_grow(smartlist_t *sl, size_t new_size)
smartlist_t * smartlist_new(void)
void smartlist_add(smartlist_t *sl, void *element)
#define SMARTLIST_FOREACH_BEGIN(sl, type, var)
#define SMARTLIST_FOREACH(sl, type, var, cmd)
struct smartlist_t * type_by_msg
struct smartlist_t * recv_by_msg
struct smartlist_t * chan_by_msg
struct smartlist_t * fns_by_type
char *(* fmt_fn)(msg_aux_data_t)
void(* free_fn)(msg_aux_data_t)