Tor 0.4.9.8
Loading...
Searching...
No Matches
dispatch_cfg.c File Reference

Create and configure a dispatch_cfg_t. More...

Go to the source code of this file.

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

Create and configure a dispatch_cfg_t.

A dispatch_cfg_t object is used to configure a set of messages and associated information before creating a dispatch_t.

Definition in file dispatch_cfg.c.

Macro Definition Documentation

◆ DISPATCH_PRIVATE

#define DISPATCH_PRIVATE

Definition at line 15 of file dispatch_cfg.c.

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 message ID.

Return 0 on success, on failure.

Definition at line 101 of file dispatch_cfg.c.

Referenced by pubsub_add_sub_().

◆ 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.

Referenced by pubsub_add_pub_(), and pubsub_add_sub_().

◆ 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.

Referenced by pubsub_add_pub_(), and pubsub_add_sub_().

◆ 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.

Referenced by pubsub_builder_new().

◆ 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.

Referenced by pubsub_connector_register_type_().