enhanced the feed_loop() in bin/main.c

This commit is contained in:
2022-07-29 14:41:00 +00:00
parent 6bcf266107
commit f3c3bfcf07
3 changed files with 21 additions and 73 deletions

View File

@ -3731,7 +3731,10 @@ static int feed_from_included (hcl_t* hcl)
void hcl_beginfeed (hcl_t* hcl, hcl_on_cnode_t on_cnode)
{
hcl->c->feed.on_cnode = on_cnode;
init_feed (hcl);
if (on_cnode) hcl->c->feed.on_cnode = on_cnode;
/* if you pass HCL_NULL for on_cnode, hcl->c->feed.on_cnode resets
* back to the default handler in init_feed() */
}
int hcl_feed (hcl_t* hcl, const hcl_ooch_t* data, hcl_oow_t len)
@ -4034,3 +4037,8 @@ void hcl_detachio (hcl_t* hcl)
}
}
}
hcl_ioinarg_t* hcl_getbaseioarg (hcl_t* hcl)
{
return &hcl->c->inarg;
}