1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 06:16:40 +02:00

api: add new function strlen_screen

This commit is contained in:
Sebastien Helleu
2013-07-27 18:21:50 +02:00
parent 50ab62b75d
commit 6be17ac263
12 changed files with 242 additions and 2 deletions
+18
View File
@@ -276,6 +276,23 @@ weechat_lua_api_ngettext (lua_State *L)
API_RETURN_STRING(result);
}
static int
weechat_lua_api_strlen_screen (lua_State *L)
{
const char *string;
int value;
API_FUNC(1, "strlen_screen", API_RETURN_INT(0));
if (lua_gettop (L) < 1)
API_WRONG_ARGS(API_RETURN_INT(0));
string = lua_tostring (L, -1);
value = weechat_strlen_screen (string);
API_RETURN_INT(value);
}
static int
weechat_lua_api_string_match (lua_State *L)
{
@@ -5070,6 +5087,7 @@ const struct luaL_Reg weechat_lua_api_funcs[] = {
API_DEF_FUNC(iconv_from_internal),
API_DEF_FUNC(gettext),
API_DEF_FUNC(ngettext),
API_DEF_FUNC(strlen_screen),
API_DEF_FUNC(string_match),
API_DEF_FUNC(string_has_highlight),
API_DEF_FUNC(string_has_highlight_regex),