summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/demo/demo.c11
-rw-r--r--src/plugins/plugin-api.c14
-rw-r--r--src/plugins/plugin-api.h5
-rw-r--r--src/plugins/weechat-plugin.h10
4 files changed, 21 insertions, 19 deletions
diff --git a/src/plugins/demo/demo.c b/src/plugins/demo/demo.c
index 16c55323b..9b63e63a6 100644
--- a/src/plugins/demo/demo.c
+++ b/src/plugins/demo/demo.c
@@ -55,7 +55,7 @@ demo_print_list (void *list, char *item_name)
fields = weechat_list_fields (list);
if (fields)
{
- argv = weechat_string_explode (fields, ",", 0, &argc);
+ argv = weechat_string_explode (fields, ",", 0, 0, &argc);
if (argv && (argc > 0))
{
for (j = 0; j < argc; j++)
@@ -119,14 +119,15 @@ demo_buffer_infos ()
*/
static int
-demo_command (void *data, char *args)
+demo_command (void *data, int argc, char **argv, char **argv_eol)
{
/* make C compiler happy */
(void) data;
-
- if (args)
+ (void) argv_eol;
+
+ if (argc > 1)
{
- if (weechat_strcasecmp (args, "buffer") == 0)
+ if (weechat_strcasecmp (argv[1], "buffer") == 0)
{
demo_buffer_infos ();
return PLUGIN_RC_SUCCESS;
diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c
index 6f0ec9e25..348bb49f5 100644
--- a/src/plugins/plugin-api.c
+++ b/src/plugins/plugin-api.c
@@ -160,17 +160,14 @@ plugin_api_strncasecmp (struct t_weechat_plugin *plugin,
char **
plugin_api_string_explode (struct t_weechat_plugin *plugin, char *string,
- char *separators, int num_items_max,
- int *num_items)
+ char *separators, int keep_eol,
+ int num_items_max, int *num_items)
{
- /* make C compiler happy */
- (void) plugin;
-
if (!plugin || !string || !separators || !num_items)
return NULL;
- return string_explode (string, separators, num_items_max,
- num_items);
+ return string_explode (string, separators, keep_eol,
+ num_items_max, num_items);
}
/*
@@ -371,7 +368,8 @@ struct t_hook *
plugin_api_hook_command (struct t_weechat_plugin *plugin, char *command,
char *description, char *args,
char *args_desc, char *completion,
- int (*callback)(void *, char *), void *data)
+ int (*callback)(void *, int, char **, char **),
+ void *data)
{
if (plugin && callback)
return hook_command (plugin, command, description, args,
diff --git a/src/plugins/plugin-api.h b/src/plugins/plugin-api.h
index 8ac174e7c..7f34c16e6 100644
--- a/src/plugins/plugin-api.h
+++ b/src/plugins/plugin-api.h
@@ -33,7 +33,7 @@ extern int plugin_api_strcasecmp (struct t_weechat_plugin *,char *, char *);
extern int plugin_api_strncasecmp (struct t_weechat_plugin *,char *, char *,
int);
extern char **plugin_api_string_explode (struct t_weechat_plugin *, char *,
- char *, int, int *);
+ char *, int, int, int *);
extern void plugin_api_string_free_exploded (struct t_weechat_plugin *,
char **);
@@ -54,7 +54,8 @@ extern void plugin_api_infobar_remove (struct t_weechat_plugin *, int);
/* hooks */
extern struct t_hook *plugin_api_hook_command (struct t_weechat_plugin *,
char *, char *, char *, char *,
- char *, int (*)(void *, char *),
+ char *,
+ int (*)(void *, int, char **, char **),
void *);
extern struct t_hook *plugin_api_hook_message (struct t_weechat_plugin *,
char *, int (*)(void *, char *),
diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h
index 19569da37..924891335 100644
--- a/src/plugins/weechat-plugin.h
+++ b/src/plugins/weechat-plugin.h
@@ -64,7 +64,7 @@ struct t_weechat_plugin
int (*strcasecmp) (struct t_weechat_plugin *, char *, char *);
int (*strncasecmp) (struct t_weechat_plugin *, char *, char *, int);
char **(*string_explode) (struct t_weechat_plugin *, char *, char *, int,
- int *);
+ int, int *);
void (*string_free_exploded) (struct t_weechat_plugin *, char **);
/* directories */
@@ -82,7 +82,8 @@ struct t_weechat_plugin
/* hooks */
struct t_hook *(*hook_command) (struct t_weechat_plugin *, char *, char *,
char *, char *, char *,
- int (*)(void *, char *),void *);
+ int (*)(void *, int, char **, char **),
+ void *);
struct t_hook *(*hook_message) (struct t_weechat_plugin *, char *,
int (*)(void *, char *), void *);
struct t_hook *(*hook_config) (struct t_weechat_plugin *, char *, char *,
@@ -148,9 +149,10 @@ struct t_weechat_plugin
weechat_plugin->strcasecmp(weechat_plugin, string1, string2)
#define weechat_strncasecmp(string1, string2, max) \
weechat_plugin->strncasecmp(weechat_plugin, string1, string2, max)
-#define weechat_string_explode(string1, separator, max, num_items) \
+#define weechat_string_explode(string1, separator, eol, max, \
+ num_items) \
weechat_plugin->string_explode(weechat_plugin, string1, separator, \
- max, num_items)
+ eol, max, num_items)
#define weechat_string_free_exploded(array_str) \
weechat_plugin->string_free_exploded(weechat_plugin, array_str)