summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2014-03-13 10:59:58 +0100
committerSebastien Helleu <flashcode@flashtux.org>2014-03-13 10:59:58 +0100
commitcd65198c713577e3fee2232a10984fedfc274aa9 (patch)
tree667d54587a06bcf897e71a5b36ef4f176245bd35 /src/plugins
parentc8f574d7305b5a064b084e82d93cd90950ea2306 (diff)
downloadweechat-cd65198c713577e3fee2232a10984fedfc274aa9.zip
api: add callback in function string_replace_regex
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/trigger/trigger-callback.c3
-rw-r--r--src/plugins/weechat-plugin.h12
2 files changed, 10 insertions, 5 deletions
diff --git a/src/plugins/trigger/trigger-callback.c b/src/plugins/trigger/trigger-callback.c
index d9d82101e..00a941b20 100644
--- a/src/plugins/trigger/trigger-callback.c
+++ b/src/plugins/trigger/trigger-callback.c
@@ -213,7 +213,8 @@ trigger_callback_replace_regex (struct t_trigger *trigger,
value = weechat_string_replace_regex (ptr_value,
trigger->regex[i].regex,
replace_eval,
- '$');
+ '$',
+ NULL, NULL);
if (value)
{
/* display debug info on trigger buffer */
diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h
index 6bfb54bb8..9f3d219d0 100644
--- a/src/plugins/weechat-plugin.h
+++ b/src/plugins/weechat-plugin.h
@@ -57,7 +57,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 "20140311-01"
+#define WEECHAT_PLUGIN_API_VERSION "20140313-01"
/* macros for defining plugin infos */
#define WEECHAT_PLUGIN_NAME(__name) \
@@ -250,7 +250,9 @@ struct t_weechat_plugin
int (*string_has_highlight_regex) (const char *string, const char *regex);
char *(*string_replace_regex) (const char *string, void *regex,
const char *replace,
- const char reference_char);
+ const char reference_char,
+ char *(*callback)(void *data, const char *text),
+ void *callback_data);
char **(*string_split) (const char *string, const char *separators,
int keep_eol, int num_items_max, int *num_items);
char **(*string_split_shell) (const char *string, int *num_items);
@@ -1017,9 +1019,11 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
#define weechat_string_has_highlight_regex(__string, __regex) \
weechat_plugin->string_has_highlight_regex(__string, __regex)
#define weechat_string_replace_regex(__string, __regex, __replace, \
- __reference_char) \
+ __reference_char, __callback, \
+ __callback_data) \
weechat_plugin->string_replace_regex(__string, __regex, __replace, \
- __reference_char)
+ __reference_char, __callback, \
+ __callback_data)
#define weechat_string_split(__string, __separator, __eol, __max, \
__num_items) \
weechat_plugin->string_split(__string, __separator, __eol, \