diff --git a/include/ifax/module.h b/include/ifax/module.h index a9997ac..171fb24 100644 --- a/include/ifax/module.h +++ b/include/ifax/module.h @@ -129,4 +129,7 @@ void ifax_handle_demand(struct ifax_module *self, size_t len); */ int ifax_command(struct ifax_module *self, int command, ...); +/* Establish a signal chain from src-module to dst-module */ +void ifax_connect(struct ifax_module *src, struct ifax_module *dst); + #endif diff --git a/lib/module.c b/lib/module.c index e594796..27e594f 100644 --- a/lib/module.c +++ b/lib/module.c @@ -123,3 +123,12 @@ int ifax_command(struct ifax_module *self, int command, ...) return rc; } +/* Make a connection in a chain of signal-processing modules and update + * both forward and backward pointers. The direction of the flow of data + * is from the source module to the destination module. + */ +void ifax_connect(struct ifax_module *src, struct ifax_module *dst) +{ + src->sendto = dst; + dst->recvfrom = src; +}