enhanced the interactive mode processing a bit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-04-17 02:00:28 +09:00
parent 658e69635a
commit 65d64f7c5f
3 changed files with 45 additions and 15 deletions

View File

@ -2990,7 +2990,7 @@ not_consumed:
/* ------------------------------------------------------------------------ */
static int _feed_char (hcl_t* hcl, hcl_ooci_t c)
static int feed_char (hcl_t* hcl, hcl_ooci_t c)
{
/*hcl_logbfmt (hcl, HCL_LOG_STDERR, "FEED->[%jc] %d STATE->%d\n", c, c, FLX_STATE(hcl));*/
@ -3022,19 +3022,6 @@ static int _feed_char (hcl_t* hcl, hcl_ooci_t c)
return -1;
}
static int feed_char (hcl_t* hcl, hcl_ooci_t c)
{
int n;
n = _feed_char(hcl, c);
if (n <= -1)
{
/* arrange to read from the start phase next time
* in case feeding continues after an error */
FEED_CONTINUE (hcl, HCL_FLX_START);
}
return n;
}
static void feed_update_lx_loc (hcl_t* hcl, hcl_ooci_t ch)
{
if (is_linebreak(ch))
@ -3234,6 +3221,11 @@ int hcl_endfeed (hcl_t* hcl)
return hcl_feed(hcl, HCL_NULL, 0);
}
int hcl_feedpending (hcl_t* hcl)
{
return hcl->c->r.st != HCL_NULL;
}
int hcl_feed (hcl_t* hcl, const hcl_ooch_t* data, hcl_oow_t len)
{
/* TODO: need to return the number of processed characters?