added hawk::cap(), hawk::size()

This commit is contained in:
2025-07-06 11:26:51 +09:00
parent 9a87e03b5e
commit 6be6ad9b9a
6 changed files with 304 additions and 140 deletions

View File

@ -25,6 +25,11 @@
#include "mod-str.h"
#include "hawk-prv.h"
static int fnc_length (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
{
return hawk_fnc_length(rtx, fi, 0);
}
static int fnc_normspace (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
{
/* normalize spaces
@ -763,7 +768,7 @@ static hawk_mod_fnc_tab_t fnctab[] =
{ HAWK_T("isspace"), { { 1, 1, HAWK_NULL }, fnc_isspace, 0 } },
{ HAWK_T("isupper"), { { 1, 1, HAWK_NULL }, fnc_isupper, 0 } },
{ HAWK_T("isxdigit"), { { 1, 1, HAWK_NULL }, fnc_isxdigit, 0 } },
{ HAWK_T("length"), { { 1, 1, HAWK_NULL }, hawk_fnc_length, 0 } },
{ HAWK_T("length"), { { 1, 1, HAWK_NULL }, fnc_length, 0 } },
{ HAWK_T("ltrim"), { { 1, 1, HAWK_NULL }, fnc_ltrim, 0 } },
{ HAWK_T("match"), { { 2, 4, HAWK_T("vxvr") }, hawk_fnc_match, 0 } },
{ HAWK_T("normspace"), { { 1, 1, HAWK_NULL }, fnc_normspace, 0 } }, /* deprecated, use trim("xxx", str::TRIM_PAC_SPACES) */