summaryrefslogtreecommitdiff
path: root/src/plugins/lua
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2019-02-26 20:02:07 +0100
committerSébastien Helleu <flashcode@flashtux.org>2019-02-27 07:46:22 +0100
commitc2859096cbf2030f977c9838af99bf13c8584625 (patch)
tree8d505344feee0e3e0f4af5ac8978a7527f541983 /src/plugins/lua
parente473161c9fc3323a86d1cbf61705dcd24233de2a (diff)
downloadweechat-c2859096cbf2030f977c9838af99bf13c8584625.zip
api: add function string_match_list
Diffstat (limited to 'src/plugins/lua')
-rw-r--r--src/plugins/lua/weechat-lua-api.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c
index 4a943a9c0..a07709fa1 100644
--- a/src/plugins/lua/weechat-lua-api.c
+++ b/src/plugins/lua/weechat-lua-api.c
@@ -338,6 +338,27 @@ API_FUNC(string_match)
API_RETURN_INT(value);
}
+API_FUNC(string_match_list)
+{
+ const char *string, *masks;
+ int case_sensitive, value;
+
+ API_INIT_FUNC(1, "string_match_list", API_RETURN_INT(0));
+ if (lua_gettop (L) < 3)
+ API_WRONG_ARGS(API_RETURN_INT(0));
+
+ string = lua_tostring (L, -3);
+ masks = lua_tostring (L, -2);
+ case_sensitive = lua_tonumber (L, -1);
+
+ value = plugin_script_api_string_match_list (weechat_lua_plugin,
+ string,
+ masks,
+ case_sensitive);
+
+ API_RETURN_INT(value);
+}
+
API_FUNC(string_has_highlight)
{
const char *string, *highlight_words;
@@ -5154,6 +5175,7 @@ const struct luaL_Reg weechat_lua_api_funcs[] = {
API_DEF_FUNC(ngettext),
API_DEF_FUNC(strlen_screen),
API_DEF_FUNC(string_match),
+ API_DEF_FUNC(string_match_list),
API_DEF_FUNC(string_has_highlight),
API_DEF_FUNC(string_has_highlight_regex),
API_DEF_FUNC(string_mask_to_regex),