enhanced formatting functions to accept hcl as the first parameter in order to extend hcl_fmttobcstr() adn hcl_fmttoucstr() to handle %O and %J
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-05-14 20:52:25 +09:00
parent 320a3f2d56
commit fdbe17729e
12 changed files with 361 additions and 292 deletions

View File

@ -834,8 +834,13 @@ int main (int argc, char* argv[])
/*trait |= HCL_TRAIT_NOGC;*/
trait |= HCL_TRAIT_AWAIT_PROCS;
#if 0
if (enable_block) trait |= HCL_TRAIT_LANG_ENABLE_BLOCK;
if (nl_terminator) trait |= HCL_TRAIT_LANG_ENABLE_EOL;
#else
trait |= HCL_TRAIT_LANG_ENABLE_BLOCK;
trait |= HCL_TRAIT_LANG_ENABLE_EOL;
#endif
hcl_setoption (hcl, HCL_TRAIT, &trait);
}

View File

@ -706,7 +706,7 @@ oops:
}
/* -------------------------------------------------------------- */
static int client_on_packet (hcl_xproto_t* proto, hcl_xpkt_type_t type, const void* data, hcl_oow_t len)
static int client_on_packet (hcl_client_t* client, hcl_xpkt_type_t type, const void* data, hcl_oow_t len)
{
if (type == HCL_XPKT_STDOUT)
{
@ -721,6 +721,11 @@ static int client_on_packet (hcl_xproto_t* proto, hcl_xpkt_type_t type, const vo
/* error notification */
if (len > 0) fprintf (stderr, "ERROR: %.*s\n", (int)len, data);
}
else if (type == HCL_XPKT_RETVAL)
{
if (len > 0) fprintf (stderr, "RETURN VALUE: %.*s\n", (int)len, data);
hcl_client_stop (client);
}
return 1;
}