Tor  0.4.6.0-alpha-dev
Macros | Functions
dispatch_cfg.h File Reference

Header for distpach_cfg.c. More...

#include "lib/dispatch/msgtypes.h"
#include "lib/testsupport/testsupport.h"

Go to the source code of this file.

Macros

#define dcfg_free(cfg)    FREE_AND_NULL(dispatch_cfg_t, dcfg_free_, (cfg))
 

Functions

dispatch_cfg_tdcfg_new (void)
 
int dcfg_msg_set_type (dispatch_cfg_t *cfg, message_id_t msg, msg_type_id_t type)
 
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)
 
int dcfg_add_recv (dispatch_cfg_t *cfg, message_id_t msg, subsys_id_t sys, recv_fn_t fn)
 
void dcfg_free_ (dispatch_cfg_t *cfg)
 

Detailed Description

Header for distpach_cfg.c.

Definition in file dispatch_cfg.h.

Macro Definition Documentation

◆ dcfg_free

#define dcfg_free (   cfg)     FREE_AND_NULL(dispatch_cfg_t, dcfg_free_, (cfg))

Free a dispatch_cfg_t.

Definition at line 40 of file dispatch_cfg.h.

Function Documentation

◆ dcfg_add_recv()

int dcfg_add_recv ( dispatch_cfg_t cfg,
message_id_t  msg,
subsys_id_t  sys,
recv_fn_t  fn 
)

Associate a receiver with a message ID. Multiple receivers may be associated with a single messasge ID.

Return 0 on success, on failure.

Definition at line 101 of file dispatch_cfg.c.

◆ dcfg_free_()

void dcfg_free_ ( dispatch_cfg_t cfg)

Helper: release all storage held by cfg.

Definition at line 121 of file dispatch_cfg.c.

◆ dcfg_msg_set_chan()

int dcfg_msg_set_chan ( dispatch_cfg_t cfg,
message_id_t  msg,
channel_id_t  chan 
)

Associate a message with a channel. Return 0 on success, -1 if a different channel was previously associated with the message ID.

Definition at line 63 of file dispatch_cfg.c.

◆ dcfg_msg_set_type()

int dcfg_msg_set_type ( dispatch_cfg_t cfg,
message_id_t  msg,
msg_type_id_t  type 
)

Associate a message with a datatype. Return 0 on success, -1 if a different type was previously associated with the message ID.

Definition at line 45 of file dispatch_cfg.c.

◆ dcfg_new()

dispatch_cfg_t* dcfg_new ( void  )

Create and return a new dispatch_cfg_t.

Definition at line 30 of file dispatch_cfg.c.

◆ dcfg_type_set_fns()

int dcfg_type_set_fns ( dispatch_cfg_t cfg,
msg_type_id_t  type,
const dispatch_typefns_t fns 
)

Associate a set of functions with a datatype. Return 0 on success, -1 if different functions were previously associated with the type.

Definition at line 81 of file dispatch_cfg.c.