1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

api: add function string_parse_size

This commit is contained in:
Sébastien Helleu
2022-09-25 10:53:37 +02:00
parent be6a29a596
commit 4d74a89cfc
32 changed files with 566 additions and 1 deletions
+17
View File
@@ -423,6 +423,22 @@ API_FUNC(string_format_size)
API_RETURN_STRING_FREE(result);
}
API_FUNC(string_parse_size)
{
const char *size;
unsigned long long value;
API_INIT_FUNC(1, "string_parse_size", API_RETURN_LONG(0));
if (lua_gettop (L) < 1)
API_WRONG_ARGS(API_RETURN_LONG(0));
size = lua_tostring (L, -1);
value = weechat_string_parse_size (size);
API_RETURN_LONG(value);
}
API_FUNC(string_color_code_size)
{
const char *string;
@@ -5416,6 +5432,7 @@ const struct luaL_Reg weechat_lua_api_funcs[] = {
API_DEF_FUNC(string_has_highlight_regex),
API_DEF_FUNC(string_mask_to_regex),
API_DEF_FUNC(string_format_size),
API_DEF_FUNC(string_parse_size),
API_DEF_FUNC(string_color_code_size),
API_DEF_FUNC(string_remove_color),
API_DEF_FUNC(string_is_command_char),