18#include "../dlib/dlib.h"
29 const char *StrOps[] = {
"",
"OpStart",
"OpSend",
30 "OpStop",
"OpEnd",
"OpAbort"};
31 MSG(
"%-*s: %-*s [%d%s] Info=%p Flags=%d\n",
32 12, FuncStr, 7, StrOps[Op], Branch, (Dir == 1) ?
"F" :
"B",
33 Info, Info ? Info->
Flags : -1);
57 int AtoB_branch,
int BtoA_branch)
62 if (Direction ==
BCK) {
88 if (Direction ==
FWD) {
109 }
else if (Info->
Fcb) {
132 }
else if (Info->
Bcb) {
158 Info->
Flags &= ~CCC_Ended;
160 Info->
Flags &= ~CCC_Aborted;
196 MSG_WARN(
"CCC: call on already finished chain. Flags=%s%s\n",
static void Chain_debug_msg(char *FuncStr, int Op, int Branch, int Dir, ChainLink *Info)
Show debugging info.
int a_Chain_bcb(int Op, ChainLink *Info, void *Data1, void *Data2)
Issue the backward callback of the 'Info' link.
DataBuf * a_Chain_dbuf_new(void *buf, int size, int code)
Allocate and initialize a new DataBuf structure.
ChainLink * a_Chain_link_new(ChainLink *AInfo, ChainFunction_t AFunc, int Direction, ChainFunction_t BFunc, int AtoB_branch, int BtoA_branch)
Create a new link from module A to module B.
void a_Chain_unlink(ChainLink *Info, int Direction)
Unlink a previously used link.
int a_Chain_check(char *FuncStr, int Op, int Branch, int Dir, ChainLink *Info)
Check whether the CCC is operative.
int a_Chain_bfcb(int Op, ChainLink *Info, void *Data1, void *Data2)
Issue the backward callback of the 'Info' link and then the forward callback (used for OpAbort and Op...
int a_Chain_fcb(int Op, ChainLink *Info, void *Data1, void *Data2)
Issue the forward callback of the 'Info' link.
ChainLink * a_Chain_new(void)
Create and initialize a new chain-link.
void(* ChainFunction_t)(int Op, int Branch, int Dir, ChainLink *Info, void *Data1, void *Data2)
#define dNew0(type, count)
#define dNew(type, count)
Main data structure for CCC nodes.
A convenience data structure for passing data chunks between nodes.