summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-07-20 13:16:35 +0200
committerSébastien Helleu <flashcode@flashtux.org>2022-07-20 13:16:35 +0200
commitb7441bd7a30e1fdee837fad9923d372b4b283374 (patch)
tree1a27579f0d8bfeed77a2377f9245d6b6d6553238 /src/plugins
parent62e68f965f7bce87eb0bf61bb134de5a3d3b7507 (diff)
downloadweechat-b7441bd7a30e1fdee837fad9923d372b4b283374.zip
api: add arguments "index_start" and "index_end" in function string_rebuild_split_string
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/fset/fset-option.c2
-rw-r--r--src/plugins/guile/weechat-guile-api.c2
-rw-r--r--src/plugins/irc/irc-mode.c2
-rw-r--r--src/plugins/javascript/weechat-js-api.cpp2
-rw-r--r--src/plugins/lua/weechat-lua-api.c2
-rw-r--r--src/plugins/perl/weechat-perl-api.c2
-rw-r--r--src/plugins/python/weechat-python-api.c2
-rw-r--r--src/plugins/ruby/weechat-ruby-api.c2
-rw-r--r--src/plugins/tcl/weechat-tcl-api.c2
-rw-r--r--src/plugins/trigger/trigger-callback.c2
-rw-r--r--src/plugins/weechat-plugin.h13
11 files changed, 19 insertions, 14 deletions
diff --git a/src/plugins/fset/fset-option.c b/src/plugins/fset/fset-option.c
index ce2a02a0e..2ee03a7b9 100644
--- a/src/plugins/fset/fset-option.c
+++ b/src/plugins/fset/fset-option.c
@@ -571,7 +571,7 @@ fset_option_set_values (struct t_fset_option *fset_option,
if (ptr_string_values)
{
fset_option->string_values = weechat_string_rebuild_split_string (
- ptr_string_values, ",");
+ ptr_string_values, ",", 0, -1);
}
else
{
diff --git a/src/plugins/guile/weechat-guile-api.c b/src/plugins/guile/weechat-guile-api.c
index 5d1309990..e847f6167 100644
--- a/src/plugins/guile/weechat-guile-api.c
+++ b/src/plugins/guile/weechat-guile-api.c
@@ -2601,7 +2601,7 @@ weechat_guile_api_hook_print_cb (const void *pointer, void *data,
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (char *)API_PTR2STR(buffer);
func_argv[2] = timebuffer;
- func_argv[3] = weechat_string_rebuild_split_string (tags, ",");
+ func_argv[3] = weechat_string_rebuild_split_string (tags, ",", 0, -1);
if (!func_argv[3])
func_argv[3] = strdup ("");
func_argv[4] = &displayed;
diff --git a/src/plugins/irc/irc-mode.c b/src/plugins/irc/irc-mode.c
index 7174bce24..4fe3f7187 100644
--- a/src/plugins/irc/irc-mode.c
+++ b/src/plugins/irc/irc-mode.c
@@ -69,7 +69,7 @@ irc_mode_get_arguments (const char *arguments)
argv2[argc] = NULL;
new_arguments = weechat_string_rebuild_split_string (
- (const char **)argv2, " ");
+ (const char **)argv2, " ", 0, -1);
weechat_string_free_split (argv);
free (argv2);
diff --git a/src/plugins/javascript/weechat-js-api.cpp b/src/plugins/javascript/weechat-js-api.cpp
index 8c0e95b6c..271108387 100644
--- a/src/plugins/javascript/weechat-js-api.cpp
+++ b/src/plugins/javascript/weechat-js-api.cpp
@@ -2521,7 +2521,7 @@ weechat_js_api_hook_print_cb (const void *pointer, void *data,
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (char *)API_PTR2STR(buffer);
func_argv[2] = timebuffer;
- func_argv[3] = weechat_string_rebuild_split_string (tags, ",");
+ func_argv[3] = weechat_string_rebuild_split_string (tags, ",", 0, -1);
if (!func_argv[3])
func_argv[3] = strdup ("");
func_argv[4] = &displayed;
diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c
index fdbe2ed13..678061137 100644
--- a/src/plugins/lua/weechat-lua-api.c
+++ b/src/plugins/lua/weechat-lua-api.c
@@ -2736,7 +2736,7 @@ weechat_lua_api_hook_print_cb (const void *pointer, void *data,
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (char *)API_PTR2STR(buffer);
func_argv[2] = timebuffer;
- func_argv[3] = weechat_string_rebuild_split_string (tags, ",");
+ func_argv[3] = weechat_string_rebuild_split_string (tags, ",", 0, -1);
if (!func_argv[3])
func_argv[3] = strdup ("");
func_argv[4] = &displayed;
diff --git a/src/plugins/perl/weechat-perl-api.c b/src/plugins/perl/weechat-perl-api.c
index c3b70d5cf..895730620 100644
--- a/src/plugins/perl/weechat-perl-api.c
+++ b/src/plugins/perl/weechat-perl-api.c
@@ -2631,7 +2631,7 @@ weechat_perl_api_hook_print_cb (const void *pointer, void *data,
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (char *)API_PTR2STR(buffer);
func_argv[2] = timebuffer;
- func_argv[3] = weechat_string_rebuild_split_string (tags, ",");
+ func_argv[3] = weechat_string_rebuild_split_string (tags, ",", 0, -1);
if (!func_argv[3])
func_argv[3] = strdup ("");
func_argv[4] = &displayed;
diff --git a/src/plugins/python/weechat-python-api.c b/src/plugins/python/weechat-python-api.c
index dbbe6d1e0..3bacf63f7 100644
--- a/src/plugins/python/weechat-python-api.c
+++ b/src/plugins/python/weechat-python-api.c
@@ -2642,7 +2642,7 @@ weechat_python_api_hook_print_cb (const void *pointer, void *data,
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (char *)API_PTR2STR(buffer);
func_argv[2] = timebuffer;
- func_argv[3] = weechat_string_rebuild_split_string (tags, ",");
+ func_argv[3] = weechat_string_rebuild_split_string (tags, ",", 0, -1);
if (!func_argv[3])
func_argv[3] = strdup ("");
func_argv[4] = &displayed;
diff --git a/src/plugins/ruby/weechat-ruby-api.c b/src/plugins/ruby/weechat-ruby-api.c
index 74f240a83..8bad2f8e2 100644
--- a/src/plugins/ruby/weechat-ruby-api.c
+++ b/src/plugins/ruby/weechat-ruby-api.c
@@ -3216,7 +3216,7 @@ weechat_ruby_api_hook_print_cb (const void *pointer, void *data,
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (char *)API_PTR2STR(buffer);
func_argv[2] = timebuffer;
- func_argv[3] = weechat_string_rebuild_split_string (tags, ",");
+ func_argv[3] = weechat_string_rebuild_split_string (tags, ",", 0, -1);
if (!func_argv[3])
func_argv[3] = strdup ("");
func_argv[4] = &displayed;
diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c
index 0eee83317..6e4d2b1d5 100644
--- a/src/plugins/tcl/weechat-tcl-api.c
+++ b/src/plugins/tcl/weechat-tcl-api.c
@@ -2936,7 +2936,7 @@ weechat_tcl_api_hook_print_cb (const void *pointer, void *data,
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (char *)API_PTR2STR(buffer);
func_argv[2] = timebuffer;
- func_argv[3] = weechat_string_rebuild_split_string (tags, ",");
+ func_argv[3] = weechat_string_rebuild_split_string (tags, ",", 0, -1);
if (!func_argv[3])
func_argv[3] = strdup ("");
func_argv[4] = &displayed;
diff --git a/src/plugins/trigger/trigger-callback.c b/src/plugins/trigger/trigger-callback.c
index 0659911f4..b5bc3585c 100644
--- a/src/plugins/trigger/trigger-callback.c
+++ b/src/plugins/trigger/trigger-callback.c
@@ -1030,7 +1030,7 @@ trigger_callback_print_cb (const void *pointer, void *data,
free (str_no_color);
}
- str_tags = weechat_string_rebuild_split_string (tags, ",");
+ str_tags = weechat_string_rebuild_split_string (tags, ",", 0, -1);
if (str_tags)
{
/* build string with tags and commas around: ",tag1,tag2,tag3," */
diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h
index 8146031d8..43e04964c 100644
--- a/src/plugins/weechat-plugin.h
+++ b/src/plugins/weechat-plugin.h
@@ -68,7 +68,7 @@ struct timeval;
* please change the date with current one; for a second change at same
* date, increment the 01, otherwise please keep 01.
*/
-#define WEECHAT_PLUGIN_API_VERSION "20220720-01"
+#define WEECHAT_PLUGIN_API_VERSION "20220720-02"
/* macros for defining plugin infos */
#define WEECHAT_PLUGIN_NAME(__name) \
@@ -333,7 +333,8 @@ struct t_weechat_plugin
char **(*string_split_shell) (const char *string, int *num_items);
void (*string_free_split) (char **split_string);
char *(*string_rebuild_split_string) (const char **split_string,
- const char *separator);
+ const char *separator,
+ int index_start, int index_end);
char **(*string_split_command) (const char *command, char separator);
void (*string_free_split_command) (char **split_command);
char *(*string_format_size) (unsigned long long size);
@@ -1286,9 +1287,13 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
#define weechat_string_free_split(__split_string) \
(weechat_plugin->string_free_split)(__split_string)
#define weechat_string_rebuild_split_string(__split_string, \
- __separator) \
+ __separator, \
+ __index_start, \
+ __index_end) \
(weechat_plugin->string_rebuild_split_string)(__split_string, \
- __separator)
+ __separator, \
+ __index_start, \
+ __index_end)
#define weechat_string_split_command(__command, __separator) \
(weechat_plugin->string_split_command)(__command, __separator)
#define weechat_string_free_split_command(__split_command) \