enhanced the interactive mode processing a bit
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -2489,6 +2489,10 @@ HCL_EXPORT int hcl_feeduchars (
|
||||
hcl_oow_t len
|
||||
);
|
||||
|
||||
HCL_EXPORT int hcl_feedpending (
|
||||
hcl_t* hcl
|
||||
);
|
||||
|
||||
HCL_EXPORT int hcl_feedbchars (
|
||||
hcl_t* hcl,
|
||||
const hcl_bch_t* data,
|
||||
|
20
lib/read.c
20
lib/read.c
@ -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?
|
||||
|
Reference in New Issue
Block a user