added hcl_seterrumsg() and hcl_seterrbfmt() in case the caller can't use variadic arguments
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-05-29 01:49:13 +09:00
parent ce47037b79
commit 0845e12a93
3 changed files with 30 additions and 8 deletions

View File

@ -242,6 +242,17 @@ void hcl_seterrnum (hcl_t* hcl, hcl_errnum_t errnum)
hcl->errmsg.len = 0;
}
void hcl_seterrbmsg (hcl_t* hcl, hcl_errnum_t errnum, const hcl_bch_t* errmsg)
{
hcl_seterrbfmt(hcl, errnum, "%hs", errmsg);
}
void hcl_seterrumsg (hcl_t* hcl, hcl_errnum_t errnum, const hcl_uch_t* errmsg)
{
hcl_seterrbfmt(hcl, errnum, "%ls", errmsg);
}
static int err_bcs (hcl_fmtout_t* fmtout, const hcl_bch_t* ptr, hcl_oow_t len)
{