summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-command.c118
-rw-r--r--src/core/wee-command.h9
-rw-r--r--src/core/wee-completion.c180
-rw-r--r--src/core/wee-completion.h3
-rw-r--r--src/core/wee-config-file.c284
-rw-r--r--src/core/wee-config-file.h87
-rw-r--r--src/core/wee-config.c1269
-rw-r--r--src/core/wee-debug.c21
-rw-r--r--src/core/wee-hook.c293
-rw-r--r--src/core/wee-hook.h83
-rw-r--r--src/core/wee-input.c3
-rw-r--r--src/core/wee-network.c89
-rw-r--r--src/core/wee-proxy.c16
-rw-r--r--src/core/wee-proxy.h4
-rw-r--r--src/core/wee-secure.c66
-rw-r--r--src/core/wee-upgrade-file.c68
-rw-r--r--src/core/wee-upgrade-file.h19
-rw-r--r--src/core/wee-upgrade.c20
-rw-r--r--src/core/wee-util.c7
-rw-r--r--src/core/wee-util.h4
-rw-r--r--src/gui/curses/gui-curses-color.c26
-rw-r--r--src/gui/curses/gui-curses-key.c3
-rw-r--r--src/gui/curses/gui-curses-main.c5
-rw-r--r--src/gui/curses/gui-curses-mouse.c5
-rw-r--r--src/gui/curses/gui-curses-window.c6
-rw-r--r--src/gui/curses/gui-curses.h2
-rw-r--r--src/gui/gui-bar-item.c186
-rw-r--r--src/gui/gui-bar-item.h13
-rw-r--r--src/gui/gui-bar-window.c4
-rw-r--r--src/gui/gui-bar-window.h3
-rw-r--r--src/gui/gui-bar.c126
-rw-r--r--src/gui/gui-bar.h3
-rw-r--r--src/gui/gui-buffer.c64
-rw-r--r--src/gui/gui-buffer.h31
-rw-r--r--src/gui/gui-chat.c10
-rw-r--r--src/gui/gui-chat.h3
-rw-r--r--src/gui/gui-color.c25
-rw-r--r--src/gui/gui-completion.c27
-rw-r--r--src/gui/gui-completion.h6
-rw-r--r--src/gui/gui-filter.c4
-rw-r--r--src/gui/gui-filter.h3
-rw-r--r--src/gui/gui-focus.c6
-rw-r--r--src/gui/gui-history.c4
-rw-r--r--src/gui/gui-history.h3
-rw-r--r--src/gui/gui-hotlist.c13
-rw-r--r--src/gui/gui-hotlist.h3
-rw-r--r--src/gui/gui-key.c23
-rw-r--r--src/gui/gui-key.h3
-rw-r--r--src/gui/gui-layout.c12
-rw-r--r--src/gui/gui-layout.h9
-rw-r--r--src/gui/gui-line.c12
-rw-r--r--src/gui/gui-line.h9
-rw-r--r--src/gui/gui-nicklist.c14
-rw-r--r--src/gui/gui-nicklist.h6
-rw-r--r--src/gui/gui-window.c12
-rw-r--r--src/gui/gui-window.h9
-rw-r--r--src/plugins/CMakeLists.txt3
-rw-r--r--src/plugins/Makefile.am2
-rw-r--r--src/plugins/alias/alias-command.c6
-rw-r--r--src/plugins/alias/alias-completion.c12
-rw-r--r--src/plugins/alias/alias-config.c76
-rw-r--r--src/plugins/alias/alias-info.c14
-rw-r--r--src/plugins/alias/alias.c8
-rw-r--r--src/plugins/aspell/weechat-aspell-bar-item.c14
-rw-r--r--src/plugins/aspell/weechat-aspell-command.c6
-rw-r--r--src/plugins/aspell/weechat-aspell-completion.c11
-rw-r--r--src/plugins/aspell/weechat-aspell-config.c138
-rw-r--r--src/plugins/aspell/weechat-aspell-info.c6
-rw-r--r--src/plugins/aspell/weechat-aspell-speller.c9
-rw-r--r--src/plugins/aspell/weechat-aspell.c32
-rw-r--r--src/plugins/charset/charset.c83
-rw-r--r--src/plugins/exec/exec-buffer.c12
-rw-r--r--src/plugins/exec/exec-command.c12
-rw-r--r--src/plugins/exec/exec-completion.c6
-rw-r--r--src/plugins/exec/exec-config.c37
-rw-r--r--src/plugins/exec/exec.c23
-rw-r--r--src/plugins/exec/exec.h3
-rw-r--r--src/plugins/fifo/fifo-command.c6
-rw-r--r--src/plugins/fifo/fifo-info.c6
-rw-r--r--src/plugins/fifo/fifo.c17
-rw-r--r--src/plugins/guile/weechat-guile-api.c678
-rw-r--r--src/plugins/guile/weechat-guile-api.h6
-rw-r--r--src/plugins/guile/weechat-guile.c71
-rw-r--r--src/plugins/irc/irc-bar-item.c69
-rw-r--r--src/plugins/irc/irc-buffer.c13
-rw-r--r--src/plugins/irc/irc-buffer.h8
-rw-r--r--src/plugins/irc/irc-channel.c29
-rw-r--r--src/plugins/irc/irc-channel.h9
-rw-r--r--src/plugins/irc/irc-color.c6
-rw-r--r--src/plugins/irc/irc-color.h3
-rw-r--r--src/plugins/irc/irc-command.c533
-rw-r--r--src/plugins/irc/irc-command.h6
-rw-r--r--src/plugins/irc/irc-completion.c96
-rw-r--r--src/plugins/irc/irc-config.c1055
-rw-r--r--src/plugins/irc/irc-config.h12
-rw-r--r--src/plugins/irc/irc-debug.c7
-rw-r--r--src/plugins/irc/irc-ignore.c4
-rw-r--r--src/plugins/irc/irc-ignore.h3
-rw-r--r--src/plugins/irc/irc-info.c173
-rw-r--r--src/plugins/irc/irc-input.c8
-rw-r--r--src/plugins/irc/irc-input.h8
-rw-r--r--src/plugins/irc/irc-message.c6
-rw-r--r--src/plugins/irc/irc-nick.c4
-rw-r--r--src/plugins/irc/irc-nick.h5
-rw-r--r--src/plugins/irc/irc-notify.c20
-rw-r--r--src/plugins/irc/irc-notify.h9
-rw-r--r--src/plugins/irc/irc-protocol.c7
-rw-r--r--src/plugins/irc/irc-raw.c7
-rw-r--r--src/plugins/irc/irc-redirect.c22
-rw-r--r--src/plugins/irc/irc-redirect.h12
-rw-r--r--src/plugins/irc/irc-server.c116
-rw-r--r--src/plugins/irc/irc-server.h27
-rw-r--r--src/plugins/irc/irc-upgrade.c25
-rw-r--r--src/plugins/irc/irc.c44
-rw-r--r--src/plugins/javascript/weechat-js-api.cpp749
-rw-r--r--src/plugins/javascript/weechat-js-api.h6
-rw-r--r--src/plugins/javascript/weechat-js.cpp73
-rw-r--r--src/plugins/logger/logger-config.c152
-rw-r--r--src/plugins/logger/logger-info.c15
-rw-r--r--src/plugins/logger/logger.c66
-rw-r--r--src/plugins/logger/logger.h3
-rw-r--r--src/plugins/lua/weechat-lua-api.c681
-rw-r--r--src/plugins/lua/weechat-lua-api.h6
-rw-r--r--src/plugins/lua/weechat-lua.c70
-rw-r--r--src/plugins/perl/weechat-perl-api.c682
-rw-r--r--src/plugins/perl/weechat-perl-api.h6
-rw-r--r--src/plugins/perl/weechat-perl.c83
-rw-r--r--src/plugins/plugin-api.c411
-rw-r--r--src/plugins/plugin-config.c62
-rw-r--r--src/plugins/plugin-script-api.c910
-rw-r--r--src/plugins/plugin-script-api.h132
-rw-r--r--src/plugins/plugin-script-callback.c202
-rw-r--r--src/plugins/plugin-script-callback.h50
-rw-r--r--src/plugins/plugin-script.c395
-rw-r--r--src/plugins/plugin-script.h43
-rw-r--r--src/plugins/plugin.c21
-rw-r--r--src/plugins/plugin.h3
-rw-r--r--src/plugins/python/weechat-python-api.c668
-rw-r--r--src/plugins/python/weechat-python-api.h6
-rw-r--r--src/plugins/python/weechat-python.c81
-rw-r--r--src/plugins/relay/irc/relay-irc.c43
-rw-r--r--src/plugins/relay/relay-buffer.c12
-rw-r--r--src/plugins/relay/relay-buffer.h8
-rw-r--r--src/plugins/relay/relay-client.c34
-rw-r--r--src/plugins/relay/relay-client.h5
-rw-r--r--src/plugins/relay/relay-command.c17
-rw-r--r--src/plugins/relay/relay-completion.c18
-rw-r--r--src/plugins/relay/relay-config.c222
-rw-r--r--src/plugins/relay/relay-config.h2
-rw-r--r--src/plugins/relay/relay-info.c20
-rw-r--r--src/plugins/relay/relay-raw.c7
-rw-r--r--src/plugins/relay/relay-server.c7
-rw-r--r--src/plugins/relay/relay-upgrade.c13
-rw-r--r--src/plugins/relay/relay.c14
-rw-r--r--src/plugins/relay/weechat/relay-weechat-msg.c3
-rw-r--r--src/plugins/relay/weechat/relay-weechat-protocol.c35
-rw-r--r--src/plugins/relay/weechat/relay-weechat-protocol.h15
-rw-r--r--src/plugins/relay/weechat/relay-weechat.c33
-rw-r--r--src/plugins/ruby/weechat-ruby-api.c708
-rw-r--r--src/plugins/ruby/weechat-ruby-api.h6
-rw-r--r--src/plugins/ruby/weechat-ruby.c73
-rw-r--r--src/plugins/script/script-action.c38
-rw-r--r--src/plugins/script/script-buffer.c244
-rw-r--r--src/plugins/script/script-buffer.h9
-rw-r--r--src/plugins/script/script-command.c6
-rw-r--r--src/plugins/script/script-completion.c42
-rw-r--r--src/plugins/script/script-config.c202
-rw-r--r--src/plugins/script/script-info.c17
-rw-r--r--src/plugins/script/script-repo.c29
-rw-r--r--src/plugins/script/script-repo.h3
-rw-r--r--src/plugins/script/script.c42
-rw-r--r--src/plugins/tcl/weechat-tcl-api.c697
-rw-r--r--src/plugins/tcl/weechat-tcl-api.h6
-rw-r--r--src/plugins/tcl/weechat-tcl.c73
-rw-r--r--src/plugins/trigger/trigger-buffer.c17
-rw-r--r--src/plugins/trigger/trigger-callback.c43
-rw-r--r--src/plugins/trigger/trigger-callback.h44
-rw-r--r--src/plugins/trigger/trigger-command.c6
-rw-r--r--src/plugins/trigger/trigger-completion.c66
-rw-r--r--src/plugins/trigger/trigger-config.c129
-rw-r--r--src/plugins/trigger/trigger.c24
-rw-r--r--src/plugins/weechat-plugin.h307
-rw-r--r--src/plugins/xfer/xfer-buffer.c12
-rw-r--r--src/plugins/xfer/xfer-buffer.h6
-rw-r--r--src/plugins/xfer/xfer-chat.c20
-rw-r--r--src/plugins/xfer/xfer-chat.h2
-rw-r--r--src/plugins/xfer/xfer-command.c14
-rw-r--r--src/plugins/xfer/xfer-completion.c6
-rw-r--r--src/plugins/xfer/xfer-config.c136
-rw-r--r--src/plugins/xfer/xfer-info.c14
-rw-r--r--src/plugins/xfer/xfer-network.c35
-rw-r--r--src/plugins/xfer/xfer-upgrade.c16
-rw-r--r--src/plugins/xfer/xfer.c35
193 files changed, 9434 insertions, 6756 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index 9d72741a3..ac6bd6ce6 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -180,6 +180,7 @@ COMMAND_CALLBACK(bar)
struct t_gui_window *ptr_window;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -547,6 +548,7 @@ COMMAND_CALLBACK(buffer)
int i, error_main_buffer, num_buffers, count, prev_number, clear_number;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if ((argc == 1)
@@ -1293,6 +1295,7 @@ COMMAND_CALLBACK(color)
struct t_gui_color_palette *color_palette;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -1484,6 +1487,7 @@ COMMAND_CALLBACK(command)
struct t_gui_buffer *ptr_buffer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
COMMAND_MIN_ARGS(3, "");
@@ -1548,6 +1552,7 @@ COMMAND_CALLBACK(cursor)
int x, y;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
(void) argv_eol;
@@ -1636,6 +1641,7 @@ COMMAND_CALLBACK(debug)
int debug;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if ((argc == 1)
@@ -1820,6 +1826,7 @@ COMMAND_CALLBACK(eval)
struct t_hashtable *pointers, *options;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -1996,6 +2003,7 @@ COMMAND_CALLBACK(filter)
struct t_gui_filter *ptr_filter;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if ((argc == 1)
@@ -2466,6 +2474,7 @@ COMMAND_CALLBACK(help)
char empty_string[1] = { '\0' }, str_format[64];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
(void) argv_eol;
@@ -2856,6 +2865,7 @@ COMMAND_CALLBACK(history)
int n, n_total, n_user, displayed;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -2908,6 +2918,7 @@ COMMAND_CALLBACK(history)
COMMAND_CALLBACK(input)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
COMMAND_MIN_ARGS(2, "");
@@ -3280,6 +3291,7 @@ COMMAND_CALLBACK(key)
int old_keys_count, keys_added, i, context, rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -3697,6 +3709,7 @@ COMMAND_CALLBACK(layout)
int flag_buffers, flag_windows, layout_is_current;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
(void) argv_eol;
@@ -3884,9 +3897,10 @@ COMMAND_CALLBACK(layout)
*/
int
-command_mouse_timer_cb (void *data, int remaining_calls)
+command_mouse_timer_cb (const void *pointer, void *data, int remaining_calls)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) remaining_calls;
@@ -3911,7 +3925,8 @@ command_mouse_timer (const char *delay)
seconds = strtol (delay, &error, 10);
if (error && !error[0] && (seconds > 0))
{
- hook_timer (NULL, seconds * 1000, 0, 1, &command_mouse_timer_cb, NULL);
+ hook_timer (NULL, seconds * 1000, 0, 1,
+ &command_mouse_timer_cb, NULL, NULL);
}
}
@@ -3922,6 +3937,7 @@ command_mouse_timer (const char *delay)
COMMAND_CALLBACK(mouse)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
(void) argv_eol;
@@ -3984,6 +4000,7 @@ COMMAND_CALLBACK(mute)
struct t_gui_buffer *mute_buffer, *ptr_buffer, *gui_chat_mute_buffer_old;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (argc < 2)
@@ -4369,6 +4386,7 @@ COMMAND_CALLBACK(plugin)
char **plugin_argv, *full_name;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -4481,6 +4499,7 @@ COMMAND_CALLBACK(print)
long value;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_buffer = buffer;
@@ -4711,6 +4730,7 @@ COMMAND_CALLBACK(proxy)
struct t_proxy *ptr_proxy;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -4833,6 +4853,7 @@ COMMAND_CALLBACK(quit)
char *pos_args;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -4884,7 +4905,9 @@ command_reload_file (struct t_config_file *config_file)
if (config_file->callback_reload)
rc = (int) (config_file->callback_reload)
- (config_file->callback_reload_data, config_file);
+ (config_file->callback_reload_pointer,
+ config_file->callback_reload_data,
+ config_file);
else
rc = config_file_reload (config_file);
@@ -4913,6 +4936,7 @@ COMMAND_CALLBACK(reload)
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
(void) argv_eol;
@@ -4951,13 +4975,16 @@ COMMAND_CALLBACK(reload)
*/
int
-command_repeat_timer_cb (void *data, int remaining_calls)
+command_repeat_timer_cb (const void *pointer, void *data, int remaining_calls)
{
char **repeat_args;
int i;
struct t_gui_buffer *ptr_buffer;
- repeat_args = (char **)data;
+ /* make C compiler happy */
+ (void) data;
+
+ repeat_args = (char **)pointer;
if (!repeat_args)
return WEECHAT_RC_ERROR;
@@ -4997,6 +5024,7 @@ COMMAND_CALLBACK(repeat)
char *error, *command, **repeat_args;
/* make C compiler happy */
+ (void) pointer;
(void) data;
COMMAND_MIN_ARGS(3, "");
@@ -5060,7 +5088,7 @@ COMMAND_CALLBACK(repeat)
repeat_args[0] = strdup (buffer->full_name);
repeat_args[1] = command;
hook_timer (NULL, interval, 0, count - 1,
- &command_repeat_timer_cb, repeat_args);
+ &command_repeat_timer_cb, repeat_args, NULL);
}
}
else
@@ -5104,6 +5132,7 @@ COMMAND_CALLBACK(save)
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
(void) argv_eol;
@@ -5166,6 +5195,7 @@ COMMAND_CALLBACK(secure)
int passphrase_was_set, count_encrypted;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -5587,6 +5617,7 @@ COMMAND_CALLBACK(set)
struct t_weelist_item *item;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -5817,6 +5848,7 @@ COMMAND_CALLBACK(unset)
int mask, length, number_reset, number_removed;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -5912,6 +5944,7 @@ COMMAND_CALLBACK(upgrade)
int confirm_ok, index_args, rc, quit;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -6090,6 +6123,7 @@ COMMAND_CALLBACK(uptime)
char string[512];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -6239,6 +6273,7 @@ COMMAND_CALLBACK(version)
int send_to_buffer_as_input, translated_string;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -6267,16 +6302,17 @@ COMMAND_CALLBACK(version)
*/
int
-command_wait_timer_cb (void *data, int remaining_calls)
+command_wait_timer_cb (const void *pointer, void *data, int remaining_calls)
{
char **timer_args;
int i;
struct t_gui_buffer *ptr_buffer;
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- timer_args = (char **)data;
+ timer_args = (char **)pointer;
if (!timer_args)
return WEECHAT_RC_ERROR;
@@ -6314,6 +6350,7 @@ COMMAND_CALLBACK(wait)
char **timer_args;
/* make C compiler happy */
+ (void) pointer;
(void) data;
COMMAND_MIN_ARGS(3, "");
@@ -6372,7 +6409,7 @@ COMMAND_CALLBACK(wait)
/* schedule command, execute it after "delay" milliseconds */
hook_timer (NULL, delay, 0, 1,
- &command_wait_timer_cb, timer_args);
+ &command_wait_timer_cb, timer_args, NULL);
return WEECHAT_RC_OK;
}
@@ -6389,6 +6426,7 @@ COMMAND_CALLBACK(window)
int win_args;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
(void) argv_eol;
@@ -6761,7 +6799,7 @@ command_init ()
N_(" -all: set or remove away status on all connected servers\n"
"message: message for away (if no message is given, away status is "
"removed)"),
- "-all", &command_away, NULL);
+ "-all", &command_away, NULL, NULL);
hook_command (
NULL, "bar",
N_("manage bars"),
@@ -6833,7 +6871,7 @@ command_init ()
" || show %(bars_names)"
" || toggle %(bars_names)"
" || scroll %(bars_names) %(windows_numbers)|*",
- &command_bar, NULL);
+ &command_bar, NULL, NULL);
hook_command (
NULL, "buffer",
N_("manage buffers"),
@@ -6930,7 +6968,7 @@ command_init ()
" || get %(buffer_properties_get)"
" || %(buffers_plugins_names)|%(buffers_names)|%(irc_channels)|"
"%(irc_privates)|%(buffers_numbers)|-|-1|+|+1",
- &command_buffer, NULL);
+ &command_buffer, NULL, NULL);
hook_command (
NULL, "color",
N_("define color aliases and display palette of colors"),
@@ -6967,7 +7005,7 @@ command_init ()
" || term2rgb"
" || rgb2term"
" || -o",
- &command_color, NULL);
+ &command_color, NULL, NULL);
/*
* give high priority (50000) so that an alias will not take precedence
* over this command
@@ -6985,7 +7023,7 @@ command_init ()
"-buffer %(buffers_plugins_names) "
"%(plugins_names)|" PLUGIN_CORE " %(plugins_commands)"
" || %(plugins_names)|" PLUGIN_CORE " %(plugins_commands)",
- &command_command, NULL);
+ &command_command, NULL, NULL);
hook_command (
NULL, "cursor",
N_("free movement of cursor on screen to execute actions on specific "
@@ -7023,7 +7061,7 @@ command_init ()
"go %(cursor_areas)"
" || move up|down|left|right|area_up|area_down|area_left|area_right"
" || stop",
- &command_cursor, NULL);
+ &command_cursor, NULL, NULL);
hook_command (
NULL, "debug",
N_("control debug for core/plugins"),
@@ -7069,7 +7107,7 @@ command_init ()
" || tags"
" || term"
" || windows",
- &command_debug, NULL);
+ &command_debug, NULL, NULL);
hook_command (
NULL, "eval",
N_("evaluate expression"),
@@ -7160,7 +7198,7 @@ command_init ()
" /eval -n -c abcd =~ (?-i)^abc ==> 1\n"
" /eval -n -c abcd !~ abc ==> 0"),
"-n|-s|-c -n|-s|-c",
- &command_eval, NULL);
+ &command_eval, NULL, NULL);
hook_command (
NULL, "filter",
N_("filter messages in buffers, to hide/show them according to tags or "
@@ -7243,7 +7281,7 @@ command_init ()
" || add %(filters_names) %(buffers_plugins_names)|*"
" || rename %(filters_names) %(filters_names)"
" || del %(filters_names)|-all",
- &command_filter, NULL);
+ &command_filter, NULL, NULL);
hook_command (
NULL, "help",
N_("display help about commands and options"),
@@ -7257,7 +7295,7 @@ command_init ()
"-list %(plugins_names)|" PLUGIN_CORE "|%*"
" || -listfull %(plugins_names)|" PLUGIN_CORE "|%*"
" || %(commands)|%(config_options)",
- &command_help, NULL);
+ &command_help, NULL, NULL);
hook_command (
NULL, "history",
N_("show buffer command history"),
@@ -7265,7 +7303,7 @@ command_init ()
N_("clear: clear history\n"
"value: number of history entries to show"),
"clear",
- &command_history, NULL);
+ &command_history, NULL, NULL);
/*
* give high priority (50000) so that an alias will not take precedence
* over this command
@@ -7348,7 +7386,7 @@ command_init ()
"grab_mouse|grab_mouse_area|set_unread|set_unread_current_buffer|"
"switch_active_buffer|switch_active_buffer_previous|"
"zoom_merged_buffer|insert|send|paste_start|paste_stop",
- &command_input, NULL);
+ &command_input, NULL, NULL);
hook_command (
NULL, "key",
N_("bind/unbind keys"),
@@ -7426,7 +7464,7 @@ command_init ()
" || resetctxt %(keys_contexts) %(keys_codes_for_reset)"
" || resetall %- %(keys_contexts)"
" || missing %(keys_contexts)",
- &command_key, NULL);
+ &command_key, NULL, NULL);
hook_command (
NULL, "layout",
N_("manage buffers/windows layouts"),
@@ -7456,7 +7494,7 @@ command_init ()
" || leave"
" || del %(layouts_names)|buffers|windows buffers|windows"
" || rename %(layouts_names) %(layouts_names)",
- &command_layout, NULL);
+ &command_layout, NULL, NULL);
hook_command (
NULL, "mouse",
N_("mouse control"),
@@ -7475,7 +7513,7 @@ command_init ()
" toggle mouse for 5 seconds:\n"
" /mouse toggle 5"),
"enable|disable|toggle",
- &command_mouse, NULL);
+ &command_mouse, NULL, NULL);
hook_command (
NULL, "mute",
N_("execute a command silently"),
@@ -7501,7 +7539,7 @@ command_init ()
"-core|-current %(commands)|%*"
" || -buffer %(buffers_plugins_names) %(commands)|%*"
" || %(commands)|%*",
- &command_mute, NULL);
+ &command_mute, NULL, NULL);
hook_command (
NULL, "plugin",
N_("list/load/unload plugins"),
@@ -7528,7 +7566,7 @@ command_init ()
" || autoload"
" || reload %(plugins_names)|* -a|-s"
" || unload %(plugins_names)",
- &command_plugin, NULL);
+ &command_plugin, NULL, NULL);
hook_command (
NULL, "print",
N_("display text on a buffer"),
@@ -7582,7 +7620,7 @@ command_init ()
" || -stdout"
" || -stderr"
" || -beep",
- &command_print, NULL);
+ &command_print, NULL, NULL);
hook_command (
NULL, "proxy",
N_("manage proxies"),
@@ -7618,7 +7656,7 @@ command_init ()
" || add %(proxies_names) http|socks4|socks5"
" || del %(proxies_names)"
" || set %(proxies_names) %(proxies_options)",
- &command_proxy, NULL);
+ &command_proxy, NULL, NULL);
hook_command (
NULL, "quit",
N_("quit WeeChat"),
@@ -7634,7 +7672,7 @@ command_init ()
"layout can be saved (see option "
"\"weechat.look.save_layout_on_exit\")."),
"",
- &command_quit, NULL);
+ &command_quit, NULL, NULL);
hook_command (
NULL, "reload",
N_("reload configuration files from disk"),
@@ -7643,7 +7681,7 @@ command_init ()
"\n"
"Without argument, all files (WeeChat and plugins) are reloaded."),
"%(config_files)|%*",
- &command_reload, NULL);
+ &command_reload, NULL, NULL);
hook_command (
NULL, "repeat",
N_("execute a command several times"),
@@ -7659,7 +7697,7 @@ command_init ()
" scroll 2 pages up:\n"
" /repeat 2 /window page_up"),
"%- %(commands)",
- &command_repeat, NULL);
+ &command_repeat, NULL, NULL);
hook_command (
NULL, "save",
N_("save configuration files to disk"),
@@ -7671,7 +7709,7 @@ command_init ()
"By default all configuration files are saved to disk on /quit "
"command (see option \"weechat.look.save_config_on_exit\")."),
"%(config_files)|%*",
- &command_save, NULL);
+ &command_save, NULL, NULL);
hook_command (
NULL, "secure",
N_("manage secured data (passwords or private data encrypted in file "
@@ -7723,7 +7761,7 @@ command_init ()
" || decrypt -discard"
" || set %(secured_data)"
" || del %(secured_data)",
- &command_secure, NULL);
+ &command_secure, NULL, NULL);
hook_command (
NULL, "set",
N_("set config options and environment variables"),
@@ -7762,7 +7800,7 @@ command_init ()
"%(config_options) %(config_option_values)"
" || diff %(config_options)|%*"
" || env %(env_vars) %(env_value)",
- &command_set, NULL);
+ &command_set, NULL, NULL);
hook_command (
NULL, "unset",
N_("unset/reset config options"),
@@ -7782,7 +7820,7 @@ command_init ()
" /unset -mask weechat.color.*"),
"%(config_options)"
" || -mask %(config_options)",
- &command_unset, NULL);
+ &command_unset, NULL, NULL);
hook_command (
NULL, "upgrade",
N_("upgrade WeeChat without disconnecting from servers"),
@@ -7823,7 +7861,7 @@ command_init ()
"It is possible to restore WeeChat session on another machine if you "
"copy the content of directory \"~/.weechat\"."),
"%(filename)|-dummy|-quit",
- &command_upgrade, NULL);
+ &command_upgrade, NULL, NULL);
hook_command (
NULL, "uptime",
N_("show WeeChat uptime"),
@@ -7831,7 +7869,7 @@ command_init ()
N_(" -o: send uptime to current buffer as input (English string)\n"
"-ol: send uptime to current buffer as input (translated string)"),
"-o|-ol",
- &command_uptime, NULL);
+ &command_uptime, NULL, NULL);
hook_command (
NULL, "version",
N_("show WeeChat version and compilation date"),
@@ -7843,7 +7881,7 @@ command_init ()
"all buffers (otherwise the irc command /version is used on irc "
"buffers)."),
"-o|-ol",
- &command_version, NULL);
+ &command_version, NULL, NULL);
hook_command (
NULL, "wait",
N_("schedule a command execution in future"),
@@ -7870,7 +7908,7 @@ command_init ()
" say 'hello' in 2 minutes:\n"
" /wait 2m hello"),
"%- %(commands)",
- &command_wait, NULL);
+ &command_wait, NULL, NULL);
hook_command (
NULL, "window",
N_("manage windows"),
@@ -7976,7 +8014,7 @@ command_init ()
" || merge all|-window %(windows_numbers)"
" || bare"
" || %(windows_numbers)",
- &command_window, NULL);
+ &command_window, NULL, NULL);
}
/*
diff --git a/src/core/wee-command.h b/src/core/wee-command.h
index 3c58aa7e4..365fe7a3f 100644
--- a/src/core/wee-command.h
+++ b/src/core/wee-command.h
@@ -23,7 +23,8 @@
#define COMMAND_CALLBACK(__command) \
int \
- command_##__command (void *data, struct t_gui_buffer *buffer, \
+ command_##__command (const void *pointer, void *data, \
+ struct t_gui_buffer *buffer, \
int argc, char **argv, char **argv_eol)
/*
@@ -34,9 +35,11 @@
*/
#define COMMAND_EMPTY(__command) \
int \
- command_##__command (void *data, struct t_gui_buffer *buffer, \
+ command_##__command (const void *pointer, void *data, \
+ struct t_gui_buffer *buffer, \
int argc, char **argv, char **argv_eol) \
{ \
+ (void) pointer; \
(void) data; \
(void) buffer; \
(void) argc; \
@@ -80,8 +83,6 @@
struct t_gui_buffer;
-extern int command_reload (void *data, struct t_gui_buffer *buffer,
- int argc, char **argv, char **argv_eol);
extern void command_init ();
extern void command_startup (int plugins_loaded);
extern void command_version_display (struct t_gui_buffer *buffer,
diff --git a/src/core/wee-completion.c b/src/core/wee-completion.c
index c99265983..a1faeeae8 100644
--- a/src/core/wee-completion.c
+++ b/src/core/wee-completion.c
@@ -64,7 +64,7 @@ extern char **environ;
*/
int
-completion_list_add_bars_names_cb (void *data,
+completion_list_add_bars_names_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -72,6 +72,7 @@ completion_list_add_bars_names_cb (void *data,
struct t_gui_bar *ptr_bar;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -90,7 +91,7 @@ completion_list_add_bars_names_cb (void *data,
*/
int
-completion_list_add_bars_options_cb (void *data,
+completion_list_add_bars_options_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -98,6 +99,7 @@ completion_list_add_bars_options_cb (void *data,
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -116,7 +118,7 @@ completion_list_add_bars_options_cb (void *data,
*/
int
-completion_list_add_buffers_names_cb (void *data,
+completion_list_add_buffers_names_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -124,6 +126,7 @@ completion_list_add_buffers_names_cb (void *data,
struct t_gui_buffer *ptr_buffer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -143,7 +146,7 @@ completion_list_add_buffers_names_cb (void *data,
*/
int
-completion_list_add_buffers_numbers_cb (void *data,
+completion_list_add_buffers_numbers_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -152,6 +155,7 @@ completion_list_add_buffers_numbers_cb (void *data,
char str_number[32];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -172,7 +176,7 @@ completion_list_add_buffers_numbers_cb (void *data,
*/
int
-completion_list_add_buffers_plugins_names_cb (void *data,
+completion_list_add_buffers_plugins_names_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -180,6 +184,7 @@ completion_list_add_buffers_plugins_names_cb (void *data,
struct t_gui_buffer *ptr_buffer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -199,7 +204,7 @@ completion_list_add_buffers_plugins_names_cb (void *data,
*/
int
-completion_list_add_buffer_properties_set_cb (void *data,
+completion_list_add_buffer_properties_set_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -207,6 +212,7 @@ completion_list_add_buffer_properties_set_cb (void *data,
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -226,7 +232,7 @@ completion_list_add_buffer_properties_set_cb (void *data,
*/
int
-completion_list_add_buffer_properties_get_cb (void *data,
+completion_list_add_buffer_properties_get_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -234,6 +240,7 @@ completion_list_add_buffer_properties_get_cb (void *data,
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -265,7 +272,7 @@ completion_list_add_buffer_properties_get_cb (void *data,
*/
int
-completion_list_add_windows_numbers_cb (void *data,
+completion_list_add_windows_numbers_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -274,6 +281,7 @@ completion_list_add_windows_numbers_cb (void *data,
char str_number[32];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -293,7 +301,7 @@ completion_list_add_windows_numbers_cb (void *data,
*/
int
-completion_list_add_colors_cb (void *data,
+completion_list_add_colors_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -304,6 +312,7 @@ completion_list_add_colors_cb (void *data,
struct t_gui_color_palette *color_palette;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -367,12 +376,13 @@ completion_list_map_add_palette_color_cb (void *data,
*/
int
-completion_list_add_palette_colors_cb (void *data,
+completion_list_add_palette_colors_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -389,7 +399,7 @@ completion_list_add_palette_colors_cb (void *data,
*/
int
-completion_list_add_config_files_cb (void *data,
+completion_list_add_config_files_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -397,6 +407,7 @@ completion_list_add_config_files_cb (void *data,
struct t_config_file *ptr_config_file;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -416,7 +427,7 @@ completion_list_add_config_files_cb (void *data,
*/
int
-completion_list_add_filename_cb (void *data,
+completion_list_add_filename_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -430,6 +441,7 @@ completion_list_add_filename_cb (void *data,
struct stat statbuf;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -549,7 +561,7 @@ end:
*/
int
-completion_list_add_filters_cb (void *data,
+completion_list_add_filters_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -557,6 +569,7 @@ completion_list_add_filters_cb (void *data,
struct t_gui_filter *ptr_filter;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -576,7 +589,7 @@ completion_list_add_filters_cb (void *data,
*/
int
-completion_list_add_commands_cb (void *data,
+completion_list_add_commands_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -584,6 +597,7 @@ completion_list_add_commands_cb (void *data,
struct t_hook *ptr_hook;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -607,7 +621,7 @@ completion_list_add_commands_cb (void *data,
*/
int
-completion_list_add_infos_cb (void *data,
+completion_list_add_infos_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -615,6 +629,7 @@ completion_list_add_infos_cb (void *data,
struct t_hook *ptr_hook;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -638,7 +653,7 @@ completion_list_add_infos_cb (void *data,
*/
int
-completion_list_add_infolists_cb (void *data,
+completion_list_add_infolists_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -646,6 +661,7 @@ completion_list_add_infolists_cb (void *data,
struct t_hook *ptr_hook;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -669,7 +685,7 @@ completion_list_add_infolists_cb (void *data,
*/
int
-completion_list_add_nicks_cb (void *data,
+completion_list_add_nicks_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -679,6 +695,7 @@ completion_list_add_nicks_cb (void *data,
int count_before;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -719,7 +736,7 @@ completion_list_add_nicks_cb (void *data,
*/
int
-completion_list_add_config_options_cb (void *data,
+completion_list_add_config_options_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -731,6 +748,7 @@ completion_list_add_config_options_cb (void *data,
char *option_full_name;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -770,7 +788,7 @@ completion_list_add_config_options_cb (void *data,
*/
int
-completion_list_add_plugins_cb (void *data,
+completion_list_add_plugins_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -778,6 +796,7 @@ completion_list_add_plugins_cb (void *data,
struct t_weechat_plugin *ptr_plugin;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -797,7 +816,8 @@ completion_list_add_plugins_cb (void *data,
*/
void
-completion_list_add_plugins_installed_exec_cb (void *data, const char *filename)
+completion_list_add_plugins_installed_exec_cb (void *data,
+ const char *filename)
{
struct t_gui_completion *completion;
const char *pos, *pos2;
@@ -831,7 +851,7 @@ completion_list_add_plugins_installed_exec_cb (void *data, const char *filename)
*/
int
-completion_list_add_plugins_installed_cb (void *data,
+completion_list_add_plugins_installed_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -840,6 +860,7 @@ completion_list_add_plugins_installed_cb (void *data,
int length;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -858,8 +879,8 @@ completion_list_add_plugins_installed_cb (void *data,
plugin_path2 : ((plugin_path) ?
plugin_path : CONFIG_STRING(config_plugin_path)),
0,
- completion,
- &completion_list_add_plugins_installed_exec_cb);
+ &completion_list_add_plugins_installed_exec_cb,
+ completion);
if (plugin_path)
free (plugin_path);
if (plugin_path2)
@@ -872,8 +893,9 @@ completion_list_add_plugins_installed_cb (void *data,
if (dir_name)
{
snprintf (dir_name, length, "%s/plugins", WEECHAT_LIBDIR);
- util_exec_on_files (dir_name, 0, completion,
- &completion_list_add_plugins_installed_exec_cb);
+ util_exec_on_files (dir_name, 0,
+ &completion_list_add_plugins_installed_exec_cb,
+ completion);
free (dir_name);
}
@@ -887,7 +909,7 @@ completion_list_add_plugins_installed_cb (void *data,
*/
int
-completion_list_add_plugins_commands_cb (void *data,
+completion_list_add_plugins_commands_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -898,6 +920,7 @@ completion_list_add_plugins_commands_cb (void *data,
struct t_hook *ptr_hook;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -951,7 +974,7 @@ completion_list_add_plugins_commands_cb (void *data,
*/
int
-completion_list_add_config_option_values_cb (void *data,
+completion_list_add_config_option_values_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -965,7 +988,6 @@ completion_list_add_config_option_values_cb (void *data,
struct t_config_option *option_found;
/* make C compiler happy */
- (void) data;
(void) completion_item;
(void) buffer;
@@ -1122,7 +1144,8 @@ completion_list_add_config_option_values_cb (void *data,
break;
case CONFIG_OPTION_TYPE_COLOR:
completion_list_add_colors_cb (
- data, completion_item, buffer, completion);
+ pointer, data, completion_item, buffer,
+ completion);
gui_completion_list_add (completion, "++1",
0, WEECHAT_LIST_POS_END);
gui_completion_list_add (completion, "--1",
@@ -1175,7 +1198,7 @@ completion_list_add_config_option_values_cb (void *data,
*/
int
-completion_list_add_weechat_commands_cb (void *data,
+completion_list_add_weechat_commands_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -1183,6 +1206,7 @@ completion_list_add_weechat_commands_cb (void *data,
struct t_hook *ptr_hook;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -1209,7 +1233,7 @@ completion_list_add_weechat_commands_cb (void *data,
*/
int
-completion_list_add_proxies_names_cb (void *data,
+completion_list_add_proxies_names_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -1217,6 +1241,7 @@ completion_list_add_proxies_names_cb (void *data,
struct t_proxy *ptr_proxy;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -1236,7 +1261,7 @@ completion_list_add_proxies_names_cb (void *data,
*/
int
-completion_list_add_proxies_options_cb (void *data,
+completion_list_add_proxies_options_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -1244,6 +1269,7 @@ completion_list_add_proxies_options_cb (void *data,
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -1262,7 +1288,7 @@ completion_list_add_proxies_options_cb (void *data,
*/
int
-completion_list_add_keys_contexts_cb (void *data,
+completion_list_add_keys_contexts_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -1270,6 +1296,7 @@ completion_list_add_keys_contexts_cb (void *data,
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -1288,7 +1315,7 @@ completion_list_add_keys_contexts_cb (void *data,
*/
int
-completion_list_add_keys_codes_cb (void *data,
+completion_list_add_keys_codes_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -1298,6 +1325,7 @@ completion_list_add_keys_codes_cb (void *data,
char *expanded_name;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -1325,7 +1353,7 @@ completion_list_add_keys_codes_cb (void *data,
*/
int
-completion_list_add_keys_codes_for_reset_cb (void *data,
+completion_list_add_keys_codes_for_reset_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -1335,6 +1363,7 @@ completion_list_add_keys_codes_for_reset_cb (void *data,
char *expanded_name;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -1385,7 +1414,7 @@ completion_list_add_keys_codes_for_reset_cb (void *data,
*/
int
-completion_list_add_cursor_areas_cb (void *data,
+completion_list_add_cursor_areas_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -1394,6 +1423,7 @@ completion_list_add_cursor_areas_cb (void *data,
struct t_gui_bar *ptr_bar;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -1425,7 +1455,7 @@ completion_list_add_cursor_areas_cb (void *data,
*/
int
-completion_list_add_layouts_names_cb (void *data,
+completion_list_add_layouts_names_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -1433,6 +1463,7 @@ completion_list_add_layouts_names_cb (void *data,
struct t_gui_layout *ptr_layout;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -1470,12 +1501,13 @@ completion_list_map_add_secured_data_cb (void *data,
*/
int
-completion_list_add_secured_data_cb (void *data,
+completion_list_add_secured_data_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -1492,7 +1524,7 @@ completion_list_add_secured_data_cb (void *data,
*/
int
-completion_list_add_env_vars_cb (void *data,
+completion_list_add_env_vars_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -1501,6 +1533,7 @@ completion_list_add_env_vars_cb (void *data,
char *pos, *name;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -1528,7 +1561,7 @@ completion_list_add_env_vars_cb (void *data,
*/
int
-completion_list_add_env_value_cb (void *data,
+completion_list_add_env_value_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -1537,6 +1570,7 @@ completion_list_add_env_value_cb (void *data,
int argc, arg_index;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -1574,106 +1608,106 @@ completion_init ()
{
hook_completion (NULL, "buffers_names", /* formerly "%b" */
N_("names of buffers"),
- &completion_list_add_buffers_names_cb, NULL);
+ &completion_list_add_buffers_names_cb, NULL, NULL);
hook_completion (NULL, "buffers_numbers",
N_("numbers of buffers"),
- &completion_list_add_buffers_numbers_cb, NULL);
+ &completion_list_add_buffers_numbers_cb, NULL, NULL);
hook_completion (NULL, "buffers_plugins_names", /* formerly "%B" */
N_("names of buffers (including plugins names)"),
- &completion_list_add_buffers_plugins_names_cb, NULL);
+ &completion_list_add_buffers_plugins_names_cb, NULL, NULL);
hook_completion (NULL, "buffer_properties_set",
N_("properties that can be set on a buffer"),
- &completion_list_add_buffer_properties_set_cb, NULL);
+ &completion_list_add_buffer_properties_set_cb, NULL, NULL);
hook_completion (NULL, "buffer_properties_get",
N_("properties that can be read on a buffer"),
- &completion_list_add_buffer_properties_get_cb, NULL);
+ &completion_list_add_buffer_properties_get_cb, NULL, NULL);
hook_completion (NULL, "windows_numbers",
N_("numbers of windows"),
- &completion_list_add_windows_numbers_cb, NULL);
+ &completion_list_add_windows_numbers_cb, NULL, NULL);
hook_completion (NULL, "colors",
N_("color names"),
- &completion_list_add_colors_cb, NULL);
+ &completion_list_add_colors_cb, NULL, NULL);
hook_completion (NULL, "palette_colors",
N_("palette colors"),
- &completion_list_add_palette_colors_cb, NULL);
+ &completion_list_add_palette_colors_cb, NULL, NULL);
hook_completion (NULL, "config_files", /* formerly "%c" */
N_("configuration files"),
- &completion_list_add_config_files_cb, NULL);
+ &completion_list_add_config_files_cb, NULL, NULL);
hook_completion (NULL, "filename", /* formerly "%f" */
N_("filename"),
- &completion_list_add_filename_cb, NULL);
+ &completion_list_add_filename_cb, NULL, NULL);
hook_completion (NULL, "filters_names", /* formerly "%F" */
N_("names of filters"),
- &completion_list_add_filters_cb, NULL);
+ &completion_list_add_filters_cb, NULL, NULL);
hook_completion (NULL, "commands", /* formerly "%h" */
N_("commands (weechat and plugins)"),
- &completion_list_add_commands_cb, NULL);
+ &completion_list_add_commands_cb, NULL, NULL);
hook_completion (NULL, "infos", /* formerly "%i" */
N_("names of infos hooked"),
- &completion_list_add_infos_cb, NULL);
+ &completion_list_add_infos_cb, NULL, NULL);
hook_completion (NULL, "infolists", /* formerly "%I" */
N_("names of infolists hooked"),
- &completion_list_add_infolists_cb, NULL);
+ &completion_list_add_infolists_cb, NULL, NULL);
hook_completion (NULL, "nicks", /* formerly "%n" */
N_("nicks in nicklist of current buffer"),
- &completion_list_add_nicks_cb, NULL);
+ &completion_list_add_nicks_cb, NULL, NULL);
hook_completion (NULL, "config_options", /* formerly "%o" */
N_("configuration options"),
- &completion_list_add_config_options_cb, NULL);
+ &completion_list_add_config_options_cb, NULL, NULL);
hook_completion (NULL, "plugins_names", /* formerly "%p" */
N_("names of plugins"),
- &completion_list_add_plugins_cb, NULL);
+ &completion_list_add_plugins_cb, NULL, NULL);
hook_completion (NULL, "plugins_installed",
N_("names of plugins installed"),
- &completion_list_add_plugins_installed_cb, NULL);
+ &completion_list_add_plugins_installed_cb, NULL, NULL);
hook_completion (NULL, "plugins_commands", /* formerly "%P" */
N_("commands defined by plugins"),
- &completion_list_add_plugins_commands_cb, NULL);
+ &completion_list_add_plugins_commands_cb, NULL, NULL);
hook_completion (NULL, "bars_names", /* formerly "%r" */
N_("names of bars"),
- &completion_list_add_bars_names_cb, NULL);
+ &completion_list_add_bars_names_cb, NULL, NULL);
hook_completion (NULL, "config_option_values", /* formerly "%v" */
N_("values for a configuration option"),
- &completion_list_add_config_option_values_cb, NULL);
+ &completion_list_add_config_option_values_cb, NULL, NULL);
hook_completion (NULL, "weechat_commands", /* formerly "%w" */
N_("weechat commands"),
- &completion_list_add_weechat_commands_cb, NULL);
+ &completion_list_add_weechat_commands_cb, NULL, NULL);
hook_completion (NULL, "proxies_names", /* formerly "%y" */
N_("names of proxies"),
- &completion_list_add_proxies_names_cb, NULL);
+ &completion_list_add_proxies_names_cb, NULL, NULL);
hook_completion (NULL, "proxies_options",
N_("options for proxies"),
- &completion_list_add_proxies_options_cb, NULL);
+ &completion_list_add_proxies_options_cb, NULL, NULL);
hook_completion (NULL, "bars_options",
N_("options for bars"),
- &completion_list_add_bars_options_cb, NULL);
+ &completion_list_add_bars_options_cb, NULL, NULL);
hook_completion (NULL, "keys_contexts",
/* TRANSLATORS: "key" means "key on the keyboard" */
N_("key contexts"),
- &completion_list_add_keys_contexts_cb, NULL);
+ &completion_list_add_keys_contexts_cb, NULL, NULL);
hook_completion (NULL, "keys_codes",
/* TRANSLATORS: "key" means "key on the keyboard" */
N_("key codes"),
- &completion_list_add_keys_codes_cb, NULL);
+ &completion_list_add_keys_codes_cb, NULL, NULL);
hook_completion (NULL, "keys_codes_for_reset",
/* TRANSLATORS: "key" means "key on the keyboard" */
N_("key codes that can be reset (keys added, redefined "
"or removed)"),
- &completion_list_add_keys_codes_for_reset_cb, NULL);
+ &completion_list_add_keys_codes_for_reset_cb, NULL, NULL);
hook_completion (NULL, "cursor_areas",
N_("areas (\"chat\" or bar name) for free cursor "
"movement"),
- &completion_list_add_cursor_areas_cb, NULL);
+ &completion_list_add_cursor_areas_cb, NULL, NULL);
hook_completion (NULL, "layouts_names",
N_("names of layouts"),
- &completion_list_add_layouts_names_cb, NULL);
+ &completion_list_add_layouts_names_cb, NULL, NULL);
hook_completion (NULL, "secured_data",
N_("names of secured data (file sec.conf, section data)"),
- &completion_list_add_secured_data_cb, NULL);
+ &completion_list_add_secured_data_cb, NULL, NULL);
hook_completion (NULL, "env_vars",
N_("environment variables"),
- &completion_list_add_env_vars_cb, NULL);
+ &completion_list_add_env_vars_cb, NULL, NULL);
hook_completion (NULL, "env_value",
N_("value of an environment variable"),
- &completion_list_add_env_value_cb, NULL);
+ &completion_list_add_env_value_cb, NULL, NULL);
}
diff --git a/src/core/wee-completion.h b/src/core/wee-completion.h
index 2fc54b0c8..1763b341f 100644
--- a/src/core/wee-completion.h
+++ b/src/core/wee-completion.h
@@ -23,7 +23,8 @@
struct t_gui_buffer;
struct t_gui_completion;
-extern int completion_list_add_filename_cb (void *data,
+extern int completion_list_add_filename_cb (const void *pointer,
+ void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion);
diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c
index 6b265e060..bcea8d2ac 100644
--- a/src/core/wee-config-file.c
+++ b/src/core/wee-config-file.c
@@ -160,8 +160,10 @@ config_file_config_insert (struct t_config_file *config_file)
struct t_config_file *
config_file_new (struct t_weechat_plugin *plugin, const char *name,
- int (*callback_reload)(void *data,
+ int (*callback_reload)(const void *pointer,
+ void *data,
struct t_config_file *config_file),
+ const void *callback_reload_pointer,
void *callback_reload_data)
{
struct t_config_file *new_config_file;
@@ -203,6 +205,7 @@ config_file_new (struct t_weechat_plugin *plugin, const char *name,
}
new_config_file->file = NULL;
new_config_file->callback_reload = callback_reload;
+ new_config_file->callback_reload_pointer = callback_reload_pointer;
new_config_file->callback_reload_data = callback_reload_data;
new_config_file->sections = NULL;
new_config_file->last_section = NULL;
@@ -299,30 +302,40 @@ config_file_section_insert_in_config (struct t_config_section *section)
struct t_config_section *
config_file_new_section (struct t_config_file *config_file, const char *name,
int user_can_add_options, int user_can_delete_options,
- int (*callback_read)(void *data,
+ int (*callback_read)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value),
+ const void *callback_read_pointer,
void *callback_read_data,
- int (*callback_write)(void *data,
+ int (*callback_write)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
const char *section_name),
+ const void *callback_write_pointer,
void *callback_write_data,
- int (*callback_write_default)(void *data,
+ int (*callback_write_default)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
const char *section_name),
+ const void *callback_write_default_pointer,
void *callback_write_default_data,
- int (*callback_create_option)(void *data,
+ int (*callback_create_option)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value),
+ const void *callback_create_option_pointer,
void *callback_create_option_data,
- int (*callback_delete_option)(void *data,
+ int (*callback_delete_option)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option),
+ const void *callback_delete_option_pointer,
void *callback_delete_option_data)
{
struct t_config_section *new_section;
@@ -346,14 +359,19 @@ config_file_new_section (struct t_config_file *config_file, const char *name,
new_section->user_can_add_options = user_can_add_options;
new_section->user_can_delete_options = user_can_delete_options;
new_section->callback_read = callback_read;
+ new_section->callback_read_pointer = callback_read_pointer;
new_section->callback_read_data = callback_read_data;
new_section->callback_write = callback_write;
+ new_section->callback_write_pointer = callback_write_pointer;
new_section->callback_write_data = callback_write_data;
new_section->callback_write_default = callback_write_default;
+ new_section->callback_write_default_pointer = callback_write_default_pointer;
new_section->callback_write_default_data = callback_write_default_data;
new_section->callback_create_option = callback_create_option;
+ new_section->callback_create_option_pointer = callback_create_option_pointer;
new_section->callback_create_option_data = callback_create_option_data;
new_section->callback_delete_option = callback_delete_option;
+ new_section->callback_delete_option_pointer = callback_delete_option_pointer;
new_section->callback_delete_option_data = callback_delete_option_data;
new_section->options = NULL;
new_section->last_option = NULL;
@@ -575,10 +593,13 @@ config_file_option_malloc ()
new_option->value = NULL;
new_option->null_value_allowed = 0;
new_option->callback_check_value = NULL;
+ new_option->callback_check_value_pointer = NULL;
new_option->callback_check_value_data = NULL;
new_option->callback_change = NULL;
+ new_option->callback_change_pointer = NULL;
new_option->callback_change_data = NULL;
new_option->callback_delete = NULL;
+ new_option->callback_delete_pointer = NULL;
new_option->callback_delete_data = NULL;
new_option->loaded = 0;
new_option->prev_option = NULL;
@@ -602,15 +623,21 @@ config_file_new_option (struct t_config_file *config_file,
const char *default_value,
const char *value,
int null_value_allowed,
- int (*callback_check_value)(void *data,
+ int (*callback_check_value)(const void *pointer,
+ void *data,
struct t_config_option *option,
const char *value),
+ const void *callback_check_value_pointer,
void *callback_check_value_data,
- void (*callback_change)(void *data,
+ void (*callback_change)(const void *pointer,
+ void *data,
struct t_config_option *option),
+ const void *callback_change_pointer,
void *callback_change_data,
- void (*callback_delete)(void *data,
+ void (*callback_delete)(const void *pointer,
+ void *data,
struct t_config_option *option),
+ const void *callback_delete_pointer,
void *callback_delete_data)
{
struct t_config_option *new_option;
@@ -833,10 +860,13 @@ config_file_new_option (struct t_config_file *config_file,
}
new_option->null_value_allowed = null_value_allowed;
new_option->callback_check_value = callback_check_value;
+ new_option->callback_check_value_pointer = callback_check_value_pointer;
new_option->callback_check_value_data = callback_check_value_data;
new_option->callback_change = callback_change;
+ new_option->callback_change_pointer = callback_change_pointer;
new_option->callback_change_data = callback_change_data;
new_option->callback_delete = callback_delete;
+ new_option->callback_delete_pointer = callback_delete_pointer;
new_option->callback_delete_data = callback_delete_data;
new_option->loaded = 1;
@@ -1216,7 +1246,10 @@ config_file_option_reset (struct t_config_option *option, int run_callback)
if ((rc == WEECHAT_CONFIG_OPTION_SET_OK_CHANGED)
&& run_callback && option->callback_change)
{
- (void)(option->callback_change)(option->callback_change_data, option);
+ (void) (option->callback_change) (
+ option->callback_change_pointer,
+ option->callback_change_data,
+ option);
}
/* run config hook(s) */
@@ -1253,11 +1286,14 @@ config_file_option_set (struct t_config_option *option, const char *value,
if (option->callback_check_value)
{
- if (!(int)(option->callback_check_value)
- (option->callback_check_value_data,
- option,
- value))
+ if (!(int)(option->callback_check_value) (
+ option->callback_check_value_pointer,
+ option->callback_check_value_data,
+ option,
+ value))
+ {
return WEECHAT_CONFIG_OPTION_SET_ERROR;
+ }
}
if (value)
@@ -1529,7 +1565,10 @@ config_file_option_set (struct t_config_option *option, const char *value,
if ((rc == WEECHAT_CONFIG_OPTION_SET_OK_CHANGED)
&& run_callback && option->callback_change)
{
- (void)(option->callback_change)(option->callback_change_data, option);
+ (void) (option->callback_change) (
+ option->callback_change_pointer,
+ option->callback_change_data,
+ option);
}
/* run config hook(s) */
@@ -1580,7 +1619,10 @@ config_file_option_set_null (struct t_config_option *option, int run_callback)
if ((rc == WEECHAT_CONFIG_OPTION_SET_OK_CHANGED)
&& run_callback && option->callback_change)
{
- (void)(option->callback_change)(option->callback_change_data, option);
+ (void) (option->callback_change) (
+ option->callback_change_pointer,
+ option->callback_change_data,
+ option);
}
/* run config hook(s) */
@@ -1619,20 +1661,22 @@ config_file_option_unset (struct t_config_option *option)
/* delete option */
if (option->callback_delete)
{
- (void)(option->callback_delete)
- (option->callback_delete_data,
- option);
+ (void) (option->callback_delete) (
+ option->callback_delete_pointer,
+ option->callback_delete_data,
+ option);
}
option_full_name = config_file_option_full_name (option);
if (option->section->callback_delete_option)
{
- rc = (int)(option->section->callback_delete_option)
- (option->section->callback_delete_option_data,
- option->config_file,
- option->section,
- option);
+ rc = (int) (option->section->callback_delete_option) (
+ option->section->callback_delete_option_pointer,
+ option->section->callback_delete_option_data,
+ option->config_file,
+ option->section,
+ option);
}
else
{
@@ -2015,12 +2059,13 @@ config_file_option_set_with_string (const char *option_name, const char *value)
if (ptr_section->user_can_add_options
&& ptr_section->callback_create_option)
{
- rc = (int)(ptr_section->callback_create_option)
- (ptr_section->callback_create_option_data,
- ptr_config,
- ptr_section,
- pos_option,
- value);
+ rc = (int) (ptr_section->callback_create_option) (
+ ptr_section->callback_create_option_pointer,
+ ptr_section->callback_create_option_data,
+ ptr_config,
+ ptr_section,
+ pos_option,
+ value);
}
}
}
@@ -2429,16 +2474,20 @@ config_file_write_internal (struct t_config_file *config_file,
/* call write callback if defined for section */
if (default_options && ptr_section->callback_write_default)
{
- if ((ptr_section->callback_write_default) (ptr_section->callback_write_default_data,
- config_file,
- ptr_section->name) != WEECHAT_CONFIG_WRITE_OK)
+ if ((ptr_section->callback_write_default) (
+ ptr_section->callback_write_default_pointer,
+ ptr_section->callback_write_default_data,
+ config_file,
+ ptr_section->name) != WEECHAT_CONFIG_WRITE_OK)
goto error;
}
else if (!default_options && ptr_section->callback_write)
{
- if ((ptr_section->callback_write) (ptr_section->callback_write_data,
- config_file,
- ptr_section->name) != WEECHAT_CONFIG_WRITE_OK)
+ if ((ptr_section->callback_write) (
+ ptr_section->callback_write_pointer,
+ ptr_section->callback_write_data,
+ config_file,
+ ptr_section->name) != WEECHAT_CONFIG_WRITE_OK)
goto error;
}
else
@@ -2688,7 +2737,8 @@ config_file_read_internal (struct t_config_file *config_file, int reload)
{
ptr_option = NULL;
rc = (ptr_section->callback_read)
- (ptr_section->callback_read_data,
+ (ptr_section->callback_read_pointer,
+ ptr_section->callback_read_data,
config_file,
ptr_section,
ptr_option_name,
@@ -2713,12 +2763,13 @@ config_file_read_internal (struct t_config_file *config_file, int reload)
if (ptr_section
&& ptr_section->callback_create_option)
{
- rc = (int)(ptr_section->callback_create_option)
- (ptr_section->callback_create_option_data,
- config_file,
- ptr_section,
- ptr_option_name,
- (undefined_value) ? NULL : pos);
+ rc = (int) (ptr_section->callback_create_option) (
+ ptr_section->callback_create_option_pointer,
+ ptr_section->callback_create_option_data,
+ config_file,
+ ptr_section,
+ ptr_option_name,
+ (undefined_value) ? NULL : pos);
}
}
}
@@ -2859,6 +2910,12 @@ config_file_option_free_data (struct t_config_option *option)
free (option->default_value);
if (option->value)
free (option->value);
+ if (option->callback_check_value_data)
+ free (option->callback_check_value_data);
+ if (option->callback_change_data)
+ free (option->callback_change_data);
+ if (option->callback_delete_data)
+ free (option->callback_delete_data);
}
/*
@@ -2934,6 +2991,16 @@ config_file_section_free (struct t_config_section *section)
config_file_section_free_options (section);
if (section->name)
free (section->name);
+ if (section->callback_read_data)
+ free (section->callback_read_data);
+ if (section->callback_write_data)
+ free (section->callback_write_data);
+ if (section->callback_write_default_data)
+ free (section->callback_write_default_data);
+ if (section->callback_create_option_data)
+ free (section->callback_create_option_data);
+ if (section->callback_delete_option_data)
+ free (section->callback_delete_option_data);
/* remove section from list */
if (ptr_config->last_section == section)
@@ -2990,6 +3057,10 @@ config_file_free (struct t_config_file *config_file)
if (config_file->next_config)
(config_file->next_config)->prev_config = config_file->prev_config;
+ /* free data */
+ if (config_file->callback_reload_data)
+ free (config_file->callback_reload_data);
+
free (config_file);
config_files = new_config_files;
@@ -3034,11 +3105,13 @@ config_file_free_all_plugin (struct t_weechat_plugin *plugin)
*/
struct t_hdata *
-config_file_hdata_config_file_cb (void *data, const char *hdata_name)
+config_file_hdata_config_file_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_config", "next_config",
@@ -3050,6 +3123,7 @@ config_file_hdata_config_file_cb (void *data, const char *hdata_name)
HDATA_VAR(struct t_config_file, filename, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_config_file, file, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_file, callback_reload, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_file, callback_reload_pointer, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_file, callback_reload_data, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_file, sections, POINTER, 0, NULL, "config_section");
HDATA_VAR(struct t_config_file, last_section, POINTER, 0, NULL, "config_section");
@@ -3066,11 +3140,13 @@ config_file_hdata_config_file_cb (void *data, const char *hdata_name)
*/
struct t_hdata *
-config_file_hdata_config_section_cb (void *data, const char *hdata_name)
+config_file_hdata_config_section_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_section", "next_section",
@@ -3082,14 +3158,19 @@ config_file_hdata_config_section_cb (void *data, const char *hdata_name)
HDATA_VAR(struct t_config_section, user_can_add_options, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_config_section, user_can_delete_options, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_config_section, callback_read, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, callback_read_pointer, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_section, callback_read_data, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_section, callback_write, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, callback_write_pointer, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_section, callback_write_data, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_section, callback_write_default, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, callback_write_default_pointer, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_section, callback_write_default_data, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_section, callback_create_option, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, callback_create_option_pointer, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_section, callback_create_option_data, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_section, callback_delete_option, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_section, callback_delete_option_pointer, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_section, callback_delete_option_data, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_section, options, POINTER, 0, NULL, "config_option");
HDATA_VAR(struct t_config_section, last_option, POINTER, 0, NULL, "config_option");
@@ -3104,11 +3185,13 @@ config_file_hdata_config_section_cb (void *data, const char *hdata_name)
*/
struct t_hdata *
-config_file_hdata_config_option_cb (void *data, const char *hdata_name)
+config_file_hdata_config_option_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_option", "next_option",
@@ -3128,10 +3211,13 @@ config_file_hdata_config_option_cb (void *data, const char *hdata_name)
HDATA_VAR(struct t_config_option, value, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_option, null_value_allowed, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_config_option, callback_check_value, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, callback_check_value_pointer, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_option, callback_check_value_data, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_option, callback_change, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, callback_change_pointer, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_option, callback_change_data, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_option, callback_delete, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_config_option, callback_delete_pointer, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_option, callback_delete_data, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_config_option, loaded, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_config_option, prev_option, POINTER, 0, NULL, hdata_name);
@@ -3350,6 +3436,7 @@ config_file_print_log ()
log_printf (" filename . . . . . . . : '%s'", ptr_config_file->filename);
log_printf (" file . . . . . . . . . : 0x%lx", ptr_config_file->file);
log_printf (" callback_reload. . . . : 0x%lx", ptr_config_file->callback_reload);
+ log_printf (" callback_reload_pointer: 0x%lx", ptr_config_file->callback_reload_pointer);
log_printf (" callback_reload_data . : 0x%lx", ptr_config_file->callback_reload_data);
log_printf (" sections . . . . . . . : 0x%lx", ptr_config_file->sections);
log_printf (" last_section . . . . . : 0x%lx", ptr_config_file->last_section);
@@ -3361,45 +3448,50 @@ config_file_print_log ()
{
log_printf ("");
log_printf (" [section (addr:0x%lx)]", ptr_section);
- log_printf (" config_file. . . . . . . . : 0x%lx", ptr_section->config_file);
- log_printf (" name . . . . . . . . . . . : '%s'", ptr_section->name);
- log_printf (" callback_read. . . . . . . : 0x%lx", ptr_section->callback_read);
- log_printf (" callback_read_data . . . . : 0x%lx", ptr_section->callback_read_data);
- log_printf (" callback_write . . . . . . : 0x%lx", ptr_section->callback_write);
- log_printf (" callback_write_data. . . . : 0x%lx", ptr_section->callback_write_data);
- log_printf (" callback_write_default . . : 0x%lx", ptr_section->callback_write_default);
- log_printf (" callback_write_default_data: 0x%lx", ptr_section->callback_write_default_data);
- log_printf (" callback_create_option. . .: 0x%lx", ptr_section->callback_create_option);
- log_printf (" callback_create_option_data: 0x%lx", ptr_section->callback_create_option_data);
- log_printf (" callback_delete_option. . .: 0x%lx", ptr_section->callback_delete_option);
- log_printf (" callback_delete_option_data: 0x%lx", ptr_section->callback_delete_option_data);
- log_printf (" options. . . . . . . . . . : 0x%lx", ptr_section->options);
- log_printf (" last_option. . . . . . . . : 0x%lx", ptr_section->last_option);
- log_printf (" prev_section . . . . . . . : 0x%lx", ptr_section->prev_section);
- log_printf (" next_section . . . . . . . : 0x%lx", ptr_section->next_section);
+ log_printf (" config_file . . . . . . . . . : 0x%lx", ptr_section->config_file);
+ log_printf (" name. . . . . . . . . . . . . : '%s'", ptr_section->name);
+ log_printf (" callback_read . . . . . . . . : 0x%lx", ptr_section->callback_read);
+ log_printf (" callback_read_pointer . . . . : 0x%lx", ptr_section->callback_read_pointer);
+ log_printf (" callback_read_data. . . . . . : 0x%lx", ptr_section->callback_read_data);
+ log_printf (" callback_write. . . . . . . . : 0x%lx", ptr_section->callback_write);
+ log_printf (" callback_write_pointer. . . . : 0x%lx", ptr_section->callback_write_pointer);
+ log_printf (" callback_write_data . . . . . : 0x%lx", ptr_section->callback_write_data);
+ log_printf (" callback_write_default. . . . : 0x%lx", ptr_section->callback_write_default);
+ log_printf (" callback_write_default_pointer: 0x%lx", ptr_section->callback_write_default_pointer);
+ log_printf (" callback_write_default_data . : 0x%lx", ptr_section->callback_write_default_data);
+ log_printf (" callback_create_option. . . . : 0x%lx", ptr_section->callback_create_option);
+ log_printf (" callback_create_option_pointer: 0x%lx", ptr_section->callback_create_option_pointer);
+ log_printf (" callback_create_option_data . : 0x%lx", ptr_section->callback_create_option_data);
+ log_printf (" callback_delete_option. . . . : 0x%lx", ptr_section->callback_delete_option);
+ log_printf (" callback_delete_option_pointer: 0x%lx", ptr_section->callback_delete_option_pointer);
+ log_printf (" callback_delete_option_data . : 0x%lx", ptr_section->callback_delete_option_data);
+ log_printf (" options . . . . . . . . . . . : 0x%lx", ptr_section->options);
+ log_printf (" last_option . . . . . . . . . : 0x%lx", ptr_section->last_option);
+ log_printf (" prev_section. . . . . . . . . : 0x%lx", ptr_section->prev_section);
+ log_printf (" next_section. . . . . . . . . : 0x%lx", ptr_section->next_section);
for (ptr_option = ptr_section->options; ptr_option;
ptr_option = ptr_option->next_option)
{
log_printf ("");
log_printf (" [option (addr:0x%lx)]", ptr_option);
- log_printf (" config_file. . . . . : 0x%lx", ptr_option->config_file);
- log_printf (" section. . . . . . . : 0x%lx", ptr_option->section);
- log_printf (" name . . . . . . . . : '%s'", ptr_option->name);
- log_printf (" parent_name. . . . . : '%s'", ptr_option->parent_name);
- log_printf (" type . . . . . . . . : %d", ptr_option->type);
- log_printf (" description. . . . . : '%s'", ptr_option->description);
- log_printf (" string_values. . . . : 0x%lx", ptr_option->string_values);
- log_printf (" min. . . . . . . . . : %d", ptr_option->min);
- log_printf (" max. . . . . . . . . : %d", ptr_option->max);
+ log_printf (" config_file. . . . . . . . . : 0x%lx", ptr_option->config_file);
+ log_printf (" section. . . . . . . . . . . : 0x%lx", ptr_option->section);
+ log_printf (" name . . . . . . . . . . . . : '%s'", ptr_option->name);
+ log_printf (" parent_name. . . . . . . . . : '%s'", ptr_option->parent_name);
+ log_printf (" type . . . . . . . . . . . . : %d", ptr_option->type);
+ log_printf (" description. . . . . . . . . : '%s'", ptr_option->description);
+ log_printf (" string_values. . . . . . . . : 0x%lx", ptr_option->string_values);
+ log_printf (" min. . . . . . . . . . . . . : %d", ptr_option->min);
+ log_printf (" max. . . . . . . . . . . . . : %d", ptr_option->max);
switch (ptr_option->type)
{
case CONFIG_OPTION_TYPE_BOOLEAN:
- log_printf (" default value. . . . : %s",
+ log_printf (" default value. . . . . . . . : %s",
(ptr_option->default_value) ?
((CONFIG_BOOLEAN_DEFAULT(ptr_option) == CONFIG_BOOLEAN_TRUE) ?
"on" : "off") : "null");
- log_printf (" value (boolean). . . : %s",
+ log_printf (" value (boolean). . . . . . . : %s",
(ptr_option->value) ?
((CONFIG_BOOLEAN(ptr_option) == CONFIG_BOOLEAN_TRUE) ?
"on" : "off") : "null");
@@ -3407,61 +3499,69 @@ config_file_print_log ()
case CONFIG_OPTION_TYPE_INTEGER:
if (ptr_option->string_values)
{
- log_printf (" default value. . . . : '%s'",
+ log_printf (" default value. . . . . . . . : '%s'",
(ptr_option->default_value) ?
ptr_option->string_values[CONFIG_INTEGER_DEFAULT(ptr_option)] : "null");
- log_printf (" value (integer/str). : '%s'",
+ log_printf (" value (integer/str). . . . . : '%s'",
(ptr_option->value) ?
ptr_option->string_values[CONFIG_INTEGER(ptr_option)] : "null");
}
else
{
if (ptr_option->default_value)
- log_printf (" default value. . . . : %d",
+ log_printf (" default value. . . . . . . . : %d",
CONFIG_INTEGER_DEFAULT(ptr_option));
else
- log_printf (" default value. . . . : null");
+ log_printf (" default value. . . . . . . . : null");
if (ptr_option->value)
- log_printf (" value (integer). . . : %d",
+ log_printf (" value (integer). . . . . . . : %d",
CONFIG_INTEGER(ptr_option));
else
- log_printf (" value (integer). . . : null");
+ log_printf (" value (integer). . . . . . . : null");
}
break;
case CONFIG_OPTION_TYPE_STRING:
if (ptr_option->default_value)
- log_printf (" default value. . . . : '%s'",
+ log_printf (" default value. . . . . . . . : '%s'",
CONFIG_STRING_DEFAULT(ptr_option));
else
- log_printf (" default value. . . . : null");
+ log_printf (" default value. . . . . . . . : null");
if (ptr_option->value)
- log_printf (" value (string) . . . : '%s'",
+ log_printf (" value (string) . . . . . . . : '%s'",
CONFIG_STRING(ptr_option));
else
- log_printf (" value (string) . . . : null");
+ log_printf (" value (string) . . . . . . . : null");
break;
case CONFIG_OPTION_TYPE_COLOR:
if (ptr_option->default_value)
- log_printf (" default value. . . . : %d ('%s')",
+ log_printf (" default value. . . . . . . . : %d ('%s')",
CONFIG_COLOR_DEFAULT(ptr_option),
gui_color_get_name (CONFIG_COLOR_DEFAULT(ptr_option)));
else
- log_printf (" default value. . . . : null");
+ log_printf (" default value. . . . . . . . : null");
if (ptr_option->value)
- log_printf (" value (color). . . . : %d ('%s')",
+ log_printf (" value (color). . . . . . . . : %d ('%s')",
CONFIG_COLOR(ptr_option),
gui_color_get_name (CONFIG_COLOR(ptr_option)));
else
- log_printf (" value (color). . . . : null");
+ log_printf (" value (color). . . . . . . . : null");
break;
case CONFIG_NUM_OPTION_TYPES:
break;
}
- log_printf (" null_value_allowed . : %d", ptr_option->null_value_allowed);
- log_printf (" callback_change. . . : 0x%lx", ptr_option->callback_change);
- log_printf (" loaded . . . . . . . : %d", ptr_option->loaded);
- log_printf (" prev_option. . . . . : 0x%lx", ptr_option->prev_option);
- log_printf (" next_option. . . . . : 0x%lx", ptr_option->next_option);
+ log_printf (" null_value_allowed . . . . . : %d", ptr_option->null_value_allowed);
+ log_printf (" callback_check_value . . . . : 0x%lx", ptr_option->callback_check_value);
+ log_printf (" callback_check_value_pointer : 0x%lx", ptr_option->callback_check_value_pointer);
+ log_printf (" callback_check_value_data. . : 0x%lx", ptr_option->callback_check_value_data);
+ log_printf (" callback_change. . . . . . . : 0x%lx", ptr_option->callback_change);
+ log_printf (" callback_change_pointer. . . : 0x%lx", ptr_option->callback_change_pointer);
+ log_printf (" callback_change_data . . . . : 0x%lx", ptr_option->callback_change_data);
+ log_printf (" callback_delete. . . . . . . : 0x%lx", ptr_option->callback_delete);
+ log_printf (" callback_delete_pointer. . . : 0x%lx", ptr_option->callback_delete_pointer);
+ log_printf (" callback_delete_data . . . . : 0x%lx", ptr_option->callback_delete_data);
+ log_printf (" loaded . . . . . . . . . . . : %d", ptr_option->loaded);
+ log_printf (" prev_option. . . . . . . . . : 0x%lx", ptr_option->prev_option);
+ log_printf (" next_option. . . . . . . . . : 0x%lx", ptr_option->next_option);
}
}
}
diff --git a/src/core/wee-config-file.h b/src/core/wee-config-file.h
index 2d637743e..2b662443f 100644
--- a/src/core/wee-config-file.h
+++ b/src/core/wee-config-file.h
@@ -49,8 +49,10 @@ struct t_config_file
/* (example: "weechat.conf") */
FILE *file; /* file pointer */
int (*callback_reload) /* callback for reloading file */
- (void *data,
+ (const void *pointer,
+ void *data,
struct t_config_file *config_file);
+ const void *callback_reload_pointer; /* pointer sent to callback */
void *callback_reload_data; /* data sent to callback */
struct t_config_section *sections; /* config sections */
struct t_config_section *last_section; /* last config section */
@@ -65,34 +67,44 @@ struct t_config_section
int user_can_add_options; /* user can add with /set ? */
int user_can_delete_options; /* user can del with /unset ? */
int (*callback_read) /* called to read a line from */
- (void *data, /* config file (only for some */
- struct t_config_file *config_file, /* special sections) */
+ (const void *pointer, /* config file (only for some */
+ void *data, /* special sections) */
+ struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value);
+ const void *callback_read_pointer; /* pointer sent to read callback */
void *callback_read_data; /* data sent to read callback */
int (*callback_write) /* called to write options */
- (void *data, /* in config file (only for some */
- struct t_config_file *config_file, /* special sections) */
+ (const void *pointer, /* in config file (only for some */
+ void *data, /* special sections) */
+ struct t_config_file *config_file,
const char *section_name);
+ const void *callback_write_pointer; /* pointer sent to write cb */
void *callback_write_data; /* data sent to write callback */
int (*callback_write_default) /* called to write default */
- (void *data, /* options in config file */
+ (const void *pointer, /* options in config file */
+ void *data,
struct t_config_file *config_file,
const char *section_name);
+ const void *callback_write_default_pointer; /* ptr sent to write def.cb */
void *callback_write_default_data; /* data sent to write def. callb.*/
int (*callback_create_option) /* called to create option in */
- (void *data, /* section */
+ (const void *pointer, /* section */
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value);
+ const void *callback_create_option_pointer; /* ptr sent to create cb */
void *callback_create_option_data; /* data sent to create callback */
int (*callback_delete_option) /* called to delete option in */
- (void *data, /* section */
+ (const void *pointer, /* section */
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option);
+ const void *callback_delete_option_pointer; /* ptr sent to delete cb */
void *callback_delete_option_data; /* data sent to delete callback */
struct t_config_option *options; /* options in section */
struct t_config_option *last_option; /* last option in section */
@@ -125,17 +137,23 @@ struct t_config_option
void *value; /* value */
int null_value_allowed; /* null value allowed ? */
int (*callback_check_value) /* called to check value before */
- (void *data, /* assigning new value */
+ (const void *pointer, /* assigning new value */
+ void *data,
struct t_config_option *option,
const char *value);
+ const void *callback_check_value_pointer; /* pointer sent to check cb */
void *callback_check_value_data; /* data sent to check callback */
void (*callback_change) /* called when value is changed */
- (void *data,
+ (const void *pointer,
+ void *data,
struct t_config_option *option);
+ const void *callback_change_pointer; /* pointer sent to change cb */
void *callback_change_data; /* data sent to change callback */
void (*callback_delete) /* called when option is deleted */
- (void *data,
+ (const void *pointer,
+ void *data,
struct t_config_option *option);
+ const void *callback_delete_pointer; /* pointer sent to delete cb */
void *callback_delete_data; /* data sent to delete callback */
int loaded; /* 1 if opt was found in config */
struct t_config_option *prev_option; /* link to previous option */
@@ -148,37 +166,49 @@ extern struct t_config_file *last_config_file;
extern struct t_config_file *config_file_search (const char *name);
extern struct t_config_file *config_file_new (struct t_weechat_plugin *plugin,
const char *name,
- int (*callback_reload)(void *data,
+ int (*callback_reload)(const void *pointer,
+ void *data,
struct t_config_file *config_file),
- void *callback_data);
+ const void *callback_reload_pointer,
+ void *callback_reload_data);
extern struct t_config_section *config_file_new_section (struct t_config_file *config_file,
const char *name,
int user_can_add_options,
int user_can_delete_options,
- int (*callback_read)(void *data,
+ int (*callback_read)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value),
+ const void *callback_read_pointer,
void *callback_read_data,
- int (*callback_write)(void *data,
+ int (*callback_write)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
const char *section_name),
+ const void *callback_write_pointer,
void *callback_write_data,
- int (*callback_write_default)(void *data,
+ int (*callback_write_default)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
const char *section_name),
+ const void *callback_write_default_pointer,
void *callback_write_default_data,
- int (*callback_create_option)(void *data,
+ int (*callback_create_option)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value),
+ const void *callback_create_option_pointer,
void *callback_create_option_data,
- int (*callback_delete_option)(void *data,
+ int (*callback_delete_option)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option),
+ const void *callback_delete_option_pointer,
void *callback_delete_option_data);
extern struct t_config_section *config_file_search_section (struct t_config_file *config_file,
const char *section_name);
@@ -191,15 +221,21 @@ extern struct t_config_option *config_file_new_option (struct t_config_file *con
const char *default_value,
const char *value,
int null_value_allowed,
- int (*callback_check_value)(void *data,
+ int (*callback_check_value)(const void *pointer,
+ void *data,
struct t_config_option *option,
const char *value),
+ const void *callback_check_value_pointer,
void *callback_check_value_data,
- void (*callback_change)(void *data,
+ void (*callback_change)(const void *pointer,
+ void *data,
struct t_config_option *option),
+ const void *callback_change_pointer,
void *callback_change_data,
- void (*callback_delete)(void *data,
+ void (*callback_delete)(const void *pointer,
+ void *data,
struct t_config_option *option),
+ const void *callback_delete_pointer,
void *callback_delete_data);
extern struct t_config_option *config_file_search_option (struct t_config_file *config_file,
struct t_config_section *section,
@@ -255,11 +291,14 @@ extern void config_file_section_free (struct t_config_section *section);
extern void config_file_free (struct t_config_file *config_file);
extern void config_file_free_all ();
extern void config_file_free_all_plugin (struct t_weechat_plugin *plugin);
-extern struct t_hdata *config_file_hdata_config_file_cb (void *data,
+extern struct t_hdata *config_file_hdata_config_file_cb (const void *pointer,
+ void *data,
const char *hdata_name);
-extern struct t_hdata *config_file_hdata_config_section_cb (void *data,
+extern struct t_hdata *config_file_hdata_config_section_cb (const void *pointer,
+ void *data,
const char *hdata_name);
-extern struct t_hdata *config_file_hdata_config_option_cb (void *data,
+extern struct t_hdata *config_file_hdata_config_option_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int config_file_add_to_infolist (struct t_infolist *infolist,
const char *option_name);
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 7868d2c2f..798bfea7a 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -314,9 +314,11 @@ int config_word_chars_input_count = 0;
*/
void
-config_change_sys_rlimit (void *data, struct t_config_option *option)
+config_change_sys_rlimit (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -346,9 +348,11 @@ config_change_save_config_layout_on_exit ()
*/
void
-config_change_save_config_on_exit (void *data, struct t_config_option *option)
+config_change_save_config_on_exit (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -368,9 +372,11 @@ config_change_save_config_on_exit (void *data, struct t_config_option *option)
*/
void
-config_change_save_layout_on_exit (void *data, struct t_config_option *option)
+config_change_save_layout_on_exit (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -382,9 +388,11 @@ config_change_save_layout_on_exit (void *data, struct t_config_option *option)
*/
void
-config_change_window_title (void *data, struct t_config_option *option)
+config_change_window_title (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -494,9 +502,11 @@ config_set_word_chars (const char *str_word_chars,
*/
void
-config_change_word_chars_highlight (void *data, struct t_config_option *option)
+config_change_word_chars_highlight (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -510,9 +520,11 @@ config_change_word_chars_highlight (void *data, struct t_config_option *option)
*/
void
-config_change_word_chars_input (void *data, struct t_config_option *option)
+config_change_word_chars_input (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -526,9 +538,11 @@ config_change_word_chars_input (void *data, struct t_config_option *option)
*/
void
-config_change_buffers (void *data, struct t_config_option *option)
+config_change_buffers (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -540,9 +554,11 @@ config_change_buffers (void *data, struct t_config_option *option)
*/
void
-config_change_buffer_content (void *data, struct t_config_option *option)
+config_change_buffer_content (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -555,9 +571,11 @@ config_change_buffer_content (void *data, struct t_config_option *option)
*/
void
-config_change_mouse (void *data, struct t_config_option *option)
+config_change_mouse (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -575,9 +593,11 @@ config_change_mouse (void *data, struct t_config_option *option)
*/
void
-config_change_buffer_auto_renumber (void *data, struct t_config_option *option)
+config_change_buffer_auto_renumber (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -590,9 +610,11 @@ config_change_buffer_auto_renumber (void *data, struct t_config_option *option)
*/
void
-config_change_buffer_notify_default (void *data, struct t_config_option *option)
+config_change_buffer_notify_default (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -604,9 +626,11 @@ config_change_buffer_notify_default (void *data, struct t_config_option *option)
*/
void
-config_change_buffer_time_format (void *data, struct t_config_option *option)
+config_change_buffer_time_format (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -641,9 +665,11 @@ config_compute_prefix_max_length_all_buffers ()
*/
void
-config_change_nick_prefix_suffix (void *data, struct t_config_option *option)
+config_change_nick_prefix_suffix (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -660,9 +686,11 @@ config_change_nick_prefix_suffix (void *data, struct t_config_option *option)
*/
void
-config_change_prefix_same_nick (void *data, struct t_config_option *option)
+config_change_prefix_same_nick (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -678,9 +706,11 @@ config_change_prefix_same_nick (void *data, struct t_config_option *option)
*/
void
-config_change_eat_newline_glitch (void *data, struct t_config_option *option)
+config_change_eat_newline_glitch (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -704,12 +734,14 @@ config_change_eat_newline_glitch (void *data, struct t_config_option *option)
*/
void
-config_change_emphasized_attributes (void *data, struct t_config_option *option)
+config_change_emphasized_attributes (const void *pointer, void *data,
+ struct t_config_option *option)
{
int i;
const char *ptr_attr;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -732,9 +764,11 @@ config_change_emphasized_attributes (void *data, struct t_config_option *option)
*/
void
-config_change_highlight_regex (void *data, struct t_config_option *option)
+config_change_highlight_regex (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -767,12 +801,14 @@ config_change_highlight_regex (void *data, struct t_config_option *option)
*/
void
-config_change_highlight_tags (void *data, struct t_config_option *option)
+config_change_highlight_tags (const void *pointer, void *data,
+ struct t_config_option *option)
{
int i;
char **tags_array;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -814,9 +850,11 @@ config_change_highlight_tags (void *data, struct t_config_option *option)
*/
void
-config_change_hotlist_sort (void *data, struct t_config_option *option)
+config_change_hotlist_sort (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -829,9 +867,11 @@ config_change_hotlist_sort (void *data, struct t_config_option *option)
*/
void
-config_change_item_away (void *data, struct t_config_option *option)
+config_change_item_away (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -843,9 +883,11 @@ config_change_item_away (void *data, struct t_config_option *option)
*/
void
-config_change_paste_bracketed (void *data, struct t_config_option *option)
+config_change_paste_bracketed (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -858,9 +900,11 @@ config_change_paste_bracketed (void *data, struct t_config_option *option)
*/
void
-config_change_read_marker (void *data, struct t_config_option *option)
+config_change_read_marker (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -872,9 +916,11 @@ config_change_read_marker (void *data, struct t_config_option *option)
*/
void
-config_change_prefix (void *data, struct t_config_option *option)
+config_change_prefix (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -886,9 +932,11 @@ config_change_prefix (void *data, struct t_config_option *option)
*/
void
-config_change_prefix_align_min (void *data, struct t_config_option *option)
+config_change_prefix_align_min (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -901,10 +949,12 @@ config_change_prefix_align_min (void *data, struct t_config_option *option)
*/
int
-config_check_prefix_align_more (void *data, struct t_config_option *option,
+config_check_prefix_align_more (const void *pointer, void *data,
+ struct t_config_option *option,
const char *value)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -916,11 +966,12 @@ config_check_prefix_align_more (void *data, struct t_config_option *option,
*/
int
-config_check_prefix_buffer_align_more (void *data,
+config_check_prefix_buffer_align_more (const void *pointer, void *data,
struct t_config_option *option,
const char *value)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -932,10 +983,12 @@ config_check_prefix_buffer_align_more (void *data,
*/
int
-config_check_separator (void *data, struct t_config_option *option,
+config_check_separator (const void *pointer, void *data,
+ struct t_config_option *option,
const char *value)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -947,9 +1000,11 @@ config_check_separator (void *data, struct t_config_option *option,
*/
void
-config_change_tab_width (void *data, struct t_config_option *option)
+config_change_tab_width (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -964,9 +1019,11 @@ config_change_tab_width (void *data, struct t_config_option *option)
*/
void
-config_change_color (void *data, struct t_config_option *option)
+config_change_color (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -982,9 +1039,11 @@ config_change_color (void *data, struct t_config_option *option)
*/
void
-config_change_nick_colors (void *data, struct t_config_option *option)
+config_change_nick_colors (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -996,10 +1055,11 @@ config_change_nick_colors (void *data, struct t_config_option *option)
*/
void
-config_change_network_gnutls_ca_file (void *data,
+config_change_network_gnutls_ca_file (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -1012,10 +1072,12 @@ config_change_network_gnutls_ca_file (void *data,
*/
int
-config_check_proxy_curl (void *data, struct t_config_option *option,
+config_check_proxy_curl (const void *pointer, void *data,
+ struct t_config_option *option,
const char *value)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -1035,9 +1097,11 @@ config_check_proxy_curl (void *data, struct t_config_option *option,
*/
void
-config_change_plugin_extension (void *data, struct t_config_option *option)
+config_change_plugin_extension (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -1063,7 +1127,8 @@ config_change_plugin_extension (void *data, struct t_config_option *option)
*/
int
-config_day_change_timer_cb (void *data, int remaining_calls)
+config_day_change_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
struct timeval tv_time;
struct tm *local_time;
@@ -1072,6 +1137,7 @@ config_day_change_timer_cb (void *data, int remaining_calls)
char str_time[256];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) remaining_calls;
@@ -1154,11 +1220,13 @@ config_weechat_init_after_read ()
*/
int
-config_weechat_reload_cb (void *data, struct t_config_file *config_file)
+config_weechat_reload_cb (const void *pointer, void *data,
+ struct t_config_file *config_file)
{
int i, rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
/* remove all keys */
@@ -1233,10 +1301,11 @@ config_weechat_debug_set_all ()
*/
void
-config_weechat_debug_change_cb (void *data,
+config_weechat_debug_change_cb (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -1248,7 +1317,7 @@ config_weechat_debug_change_cb (void *data,
*/
int
-config_weechat_debug_create_option_cb (void *data,
+config_weechat_debug_create_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
@@ -1258,6 +1327,7 @@ config_weechat_debug_create_option_cb (void *data,
int rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
rc = WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -1284,9 +1354,10 @@ config_weechat_debug_create_option_cb (void *data,
config_file, section,
option_name, "integer",
_("debug level for plugin (\"core\" for WeeChat core)"),
- NULL, 0, 32, "0", value, 0, NULL, NULL,
- &config_weechat_debug_change_cb, NULL,
- NULL, NULL);
+ NULL, 0, 32, "0", value, 0,
+ NULL, NULL, NULL,
+ &config_weechat_debug_change_cb, NULL, NULL,
+ NULL, NULL, NULL);
rc = (ptr_option) ?
WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
}
@@ -1306,12 +1377,13 @@ config_weechat_debug_create_option_cb (void *data,
*/
int
-config_weechat_debug_delete_option_cb (void *data,
+config_weechat_debug_delete_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -1330,7 +1402,7 @@ config_weechat_debug_delete_option_cb (void *data,
int
config_weechat_debug_set (const char *plugin_name, const char *value)
{
- return config_weechat_debug_create_option_cb (NULL,
+ return config_weechat_debug_create_option_cb (NULL, NULL,
weechat_config_file,
weechat_config_section_debug,
plugin_name,
@@ -1342,13 +1414,14 @@ config_weechat_debug_set (const char *plugin_name, const char *value)
*/
void
-config_weechat_palette_change_cb (void *data,
+config_weechat_palette_change_cb (const void *pointer, void *data,
struct t_config_option *option)
{
char *error;
int number;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -1365,7 +1438,7 @@ config_weechat_palette_change_cb (void *data,
*/
int
-config_weechat_palette_create_option_cb (void *data,
+config_weechat_palette_create_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
@@ -1376,6 +1449,7 @@ config_weechat_palette_create_option_cb (void *data,
int rc, number;
/* make C compiler happy */
+ (void) pointer;
(void) data;
rc = WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -1406,9 +1480,10 @@ config_weechat_palette_create_option_cb (void *data,
config_file, section,
option_name, "string",
_("alias for color"),
- NULL, 0, 0, "", value, 0, NULL, NULL,
- &config_weechat_palette_change_cb, NULL,
- NULL, NULL);
+ NULL, 0, 0, "", value, 0,
+ NULL, NULL, NULL,
+ &config_weechat_palette_change_cb, NULL, NULL,
+ NULL, NULL, NULL);
rc = (ptr_option) ?
WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
if (ptr_option)
@@ -1434,7 +1509,7 @@ config_weechat_palette_create_option_cb (void *data,
*/
int
-config_weechat_palette_delete_option_cb (void *data,
+config_weechat_palette_delete_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
@@ -1443,6 +1518,7 @@ config_weechat_palette_delete_option_cb (void *data,
int number;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -1462,7 +1538,8 @@ config_weechat_palette_delete_option_cb (void *data,
*/
int
-config_weechat_proxy_read_cb (void *data, struct t_config_file *config_file,
+config_weechat_proxy_read_cb (const void *pointer, void *data,
+ struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
@@ -1471,6 +1548,7 @@ config_weechat_proxy_read_cb (void *data, struct t_config_file *config_file,
int index_option;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
@@ -1539,7 +1617,8 @@ config_weechat_proxy_read_cb (void *data, struct t_config_file *config_file,
*/
int
-config_weechat_bar_read_cb (void *data, struct t_config_file *config_file,
+config_weechat_bar_read_cb (const void *pointer, void *data,
+ struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
@@ -1548,6 +1627,7 @@ config_weechat_bar_read_cb (void *data, struct t_config_file *config_file,
int index_option;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -1617,7 +1697,8 @@ config_weechat_bar_read_cb (void *data, struct t_config_file *config_file,
*/
int
-config_weechat_layout_read_cb (void *data, struct t_config_file *config_file,
+config_weechat_layout_read_cb (const void *pointer, void *data,
+ struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
@@ -1629,6 +1710,7 @@ config_weechat_layout_read_cb (void *data, struct t_config_file *config_file,
struct t_gui_layout_window *parent;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -1781,7 +1863,8 @@ config_weechat_layout_write_tree (struct t_config_file *config_file,
*/
int
-config_weechat_layout_write_cb (void *data, struct t_config_file *config_file,
+config_weechat_layout_write_cb (const void *pointer, void *data,
+ struct t_config_file *config_file,
const char *section_name)
{
struct t_gui_layout *ptr_layout;
@@ -1789,6 +1872,7 @@ config_weechat_layout_write_cb (void *data, struct t_config_file *config_file,
char option_name[1024];
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!config_file_write_line (config_file, section_name, NULL))
@@ -1839,9 +1923,11 @@ config_weechat_layout_write_cb (void *data, struct t_config_file *config_file,
*/
void
-config_weechat_notify_change_cb (void *data, struct t_config_option *option)
+config_weechat_notify_change_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -1853,7 +1939,7 @@ config_weechat_notify_change_cb (void *data, struct t_config_option *option)
*/
int
-config_weechat_notify_create_option_cb (void *data,
+config_weechat_notify_create_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
@@ -1863,6 +1949,7 @@ config_weechat_notify_create_option_cb (void *data,
int rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
rc = WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -1889,9 +1976,10 @@ config_weechat_notify_create_option_cb (void *data,
config_file, section,
option_name, "integer", _("Notify level for buffer"),
"none|highlight|message|all",
- 0, 0, "", value, 0, NULL, NULL,
- &config_weechat_notify_change_cb, NULL,
- NULL, NULL);
+ 0, 0, "", value, 0,
+ NULL, NULL, NULL,
+ &config_weechat_notify_change_cb, NULL, NULL,
+ NULL, NULL, NULL);
rc = (ptr_option) ?
WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
}
@@ -1911,12 +1999,13 @@ config_weechat_notify_create_option_cb (void *data,
*/
int
-config_weechat_notify_delete_option_cb (void *data,
+config_weechat_notify_delete_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -1960,12 +2049,13 @@ config_weechat_notify_set (struct t_gui_buffer *buffer, const char *notify)
return 0;
/* create/update option */
- return (config_weechat_notify_create_option_cb (NULL,
- weechat_config_file,
- weechat_config_section_notify,
- buffer->full_name,
- (value < 0) ?
- NULL : gui_buffer_notify_string[value]) != WEECHAT_CONFIG_OPTION_SET_ERROR) ? 1 : 0;
+ return (config_weechat_notify_create_option_cb (
+ NULL, NULL,
+ weechat_config_file,
+ weechat_config_section_notify,
+ buffer->full_name,
+ (value < 0) ?
+ NULL : gui_buffer_notify_string[value]) != WEECHAT_CONFIG_OPTION_SET_ERROR) ? 1 : 0;
}
/*
@@ -1973,7 +2063,7 @@ config_weechat_notify_set (struct t_gui_buffer *buffer, const char *notify)
*/
int
-config_weechat_filter_read_cb (void *data,
+config_weechat_filter_read_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
@@ -1982,6 +2072,7 @@ config_weechat_filter_read_cb (void *data,
int argc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -2009,12 +2100,14 @@ config_weechat_filter_read_cb (void *data,
*/
int
-config_weechat_filter_write_cb (void *data, struct t_config_file *config_file,
+config_weechat_filter_write_cb (const void *pointer, void *data,
+ struct t_config_file *config_file,
const char *section_name)
{
struct t_gui_filter *ptr_filter;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!config_file_write_line (config_file, section_name, NULL))
@@ -2041,7 +2134,8 @@ config_weechat_filter_write_cb (void *data, struct t_config_file *config_file,
*/
int
-config_weechat_key_read_cb (void *data, struct t_config_file *config_file,
+config_weechat_key_read_cb (const void *pointer, void *data,
+ struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
@@ -2049,6 +2143,7 @@ config_weechat_key_read_cb (void *data, struct t_config_file *config_file,
char *pos;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
@@ -2083,7 +2178,8 @@ config_weechat_key_read_cb (void *data, struct t_config_file *config_file,
*/
int
-config_weechat_key_write_cb (void *data, struct t_config_file *config_file,
+config_weechat_key_write_cb (const void *pointer, void *data,
+ struct t_config_file *config_file,
const char *section_name)
{
struct t_gui_key *ptr_key;
@@ -2091,6 +2187,7 @@ config_weechat_key_write_cb (void *data, struct t_config_file *config_file,
int rc, context;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!config_file_write_line (config_file, section_name, NULL))
@@ -2138,18 +2235,20 @@ config_weechat_init_options ()
int i;
char section_name[128];
- weechat_config_file = config_file_new (NULL, WEECHAT_CONFIG_NAME,
- &config_weechat_reload_cb, NULL);
+ weechat_config_file = config_file_new (
+ NULL, WEECHAT_CONFIG_NAME, &config_weechat_reload_cb, NULL, NULL);
if (!weechat_config_file)
return 0;
/* debug */
- ptr_section = config_file_new_section (weechat_config_file, "debug",
- 1, 1,
- NULL, NULL, NULL, NULL,
- NULL, NULL,
- &config_weechat_debug_create_option_cb, NULL,
- &config_weechat_debug_delete_option_cb, NULL);
+ ptr_section = config_file_new_section (
+ weechat_config_file, "debug",
+ 1, 1,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &config_weechat_debug_create_option_cb, NULL, NULL,
+ &config_weechat_debug_delete_option_cb, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
@@ -2161,8 +2260,11 @@ config_weechat_init_options ()
/* startup */
ptr_section = config_file_new_section (weechat_config_file, "startup",
0, 0,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
@@ -2174,23 +2276,27 @@ config_weechat_init_options ()
"command_after_plugins", "string",
N_("command executed when WeeChat starts, after loading plugins "
"(note: content is evaluated, see /help eval)"),
- NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_startup_command_before_plugins = config_file_new_option (
weechat_config_file, ptr_section,
"command_before_plugins", "string",
N_("command executed when WeeChat starts, before loading plugins "
"(note: content is evaluated, see /help eval)"),
- NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_startup_display_logo = config_file_new_option (
weechat_config_file, ptr_section,
"display_logo", "boolean",
N_("display WeeChat logo at startup"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_startup_display_version = config_file_new_option (
weechat_config_file, ptr_section,
"display_version", "boolean",
N_("display WeeChat version at startup"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_startup_sys_rlimit = config_file_new_option (
weechat_config_file, ptr_section,
"sys_rlimit", "string",
@@ -2199,14 +2305,20 @@ config_weechat_init_options ()
"(RLIMIT_XXX) in lower case (see man setrlimit for values); limit "
"-1 means \"unlimited\"; example: set unlimited size for core file "
"and max 1GB of virtual memory: \"core:-1,as:1000000000\""),
- NULL, 0, 0, "", NULL, 0, NULL, NULL,
- &config_change_sys_rlimit, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_sys_rlimit, NULL, NULL,
+ NULL, NULL, NULL);
/* look */
- ptr_section = config_file_new_section (weechat_config_file, "look",
- 0, 0,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ ptr_section = config_file_new_section (
+ weechat_config_file, "look",
+ 0, 0,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
@@ -2219,50 +2331,71 @@ config_weechat_init_options ()
N_("alignment for end of lines (all lines after the first): they "
"are starting under this data (time, buffer, prefix, suffix, "
"message (default))"),
- "time|buffer|prefix|suffix|message", 0, 0, "message", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ "time|buffer|prefix|suffix|message", 0, 0, "message", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_bar_more_down = config_file_new_option (
weechat_config_file, ptr_section,
"bar_more_down", "string",
N_("string displayed when bar can be scrolled down "
"(for bars with filling different from \"horizontal\")"),
- NULL, 0, 0, "++", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 0, "++", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_bar_more_left = config_file_new_option (
weechat_config_file, ptr_section,
"bar_more_left", "string",
N_("string displayed when bar can be scrolled to the left "
"(for bars with filling \"horizontal\")"),
- NULL, 0, 0, "<<", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 0, "<<", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_bar_more_right = config_file_new_option (
weechat_config_file, ptr_section,
"bar_more_right", "string",
N_("string displayed when bar can be scrolled to the right "
"(for bars with filling \"horizontal\")"),
- NULL, 0, 0, ">>", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 0, ">>", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_bar_more_up = config_file_new_option (
weechat_config_file, ptr_section,
"bar_more_up", "string",
N_("string displayed when bar can be scrolled up "
"(for bars with filling different from \"horizontal\")"),
- NULL, 0, 0, "--", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 0, "--", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_bare_display_exit_on_input = config_file_new_option (
weechat_config_file, ptr_section,
"bare_display_exit_on_input", "boolean",
N_("exit the bare display mode on any changes in input"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_bare_display_time_format = config_file_new_option (
weechat_config_file, ptr_section,
"bare_display_time_format", "string",
N_("time format in bare display mode (see man strftime for date/time "
"specifiers)"),
- NULL, 0, 0, "%H:%M", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 0, "%H:%M", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_buffer_auto_renumber = config_file_new_option (
weechat_config_file, ptr_section,
"buffer_auto_renumber", "boolean",
N_("automatically renumber buffers to have only consecutive numbers "
"and start with number 1; if disabled, gaps between buffer numbers "
"are allowed and the first buffer can have a number greater than 1"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- &config_change_buffer_auto_renumber, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_auto_renumber, NULL, NULL,
+ NULL, NULL, NULL);
config_look_buffer_notify_default = config_file_new_option (
weechat_config_file, ptr_section,
"buffer_notify_default", "integer",
@@ -2272,7 +2405,9 @@ config_weechat_init_options ()
"message=messages+highlights, highlight=highlights only, "
"none=never display in hotlist"),
"none|highlight|message|all", 0, 0, "all", NULL, 0,
- NULL, NULL, &config_change_buffer_notify_default, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_buffer_notify_default, NULL, NULL,
+ NULL, NULL, NULL);
config_look_buffer_position = config_file_new_option (
weechat_config_file, ptr_section,
"buffer_position", "integer",
@@ -2281,31 +2416,36 @@ config_weechat_init_options ()
"number in the list (after the end of list if no number is "
"available); this option is used only if the buffer has no layout "
"number"),
- "end|first_gap", 0, 0, "end", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ "end|first_gap", 0, 0, "end", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_buffer_search_case_sensitive = config_file_new_option (
weechat_config_file, ptr_section,
"buffer_search_case_sensitive", "boolean",
N_("default text search in buffer: case sensitive or not"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_buffer_search_force_default = config_file_new_option (
weechat_config_file, ptr_section,
"buffer_search_force_default", "boolean",
N_("force default values for text search in buffer (instead of using "
"values from last search in buffer)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_buffer_search_regex = config_file_new_option (
weechat_config_file, ptr_section,
"buffer_search_regex", "boolean",
N_("default text search in buffer: if enabled, search POSIX extended "
"regular expression, otherwise search simple string"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_buffer_search_where = config_file_new_option (
weechat_config_file, ptr_section,
"buffer_search_where", "integer",
N_("default text search in buffer: in message, prefix, prefix and "
"message"),
"prefix|message|prefix_message", 0, 0, "prefix_message",
- NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_buffer_time_format = config_file_new_option (
weechat_config_file, ptr_section,
"buffer_time_format", "string",
@@ -2315,56 +2455,83 @@ config_weechat_init_options ()
"use colors with format \"${color:xxx}\", see /help eval); for "
"example time using grayscale (requires support of 256 colors): "
"\"${color:252}%H${color:245}%M${color:240}%S\""),
- NULL, 0, 0, "%H:%M:%S", NULL, 0, NULL, NULL, &config_change_buffer_time_format, NULL, NULL, NULL);
+ NULL, 0, 0, "%H:%M:%S", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_time_format, NULL, NULL,
+ NULL, NULL, NULL);
config_look_color_basic_force_bold = config_file_new_option (
weechat_config_file, ptr_section,
"color_basic_force_bold", "boolean",
N_("force \"bold\" attribute for light colors and \"darkgray\" in "
"basic colors (this option is disabled by default: bold is used "
"only if terminal has less than 16 colors)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_look_color_inactive_buffer = config_file_new_option (
weechat_config_file, ptr_section,
"color_inactive_buffer", "boolean",
N_("use a different color for lines in inactive buffer (when line is "
"from a merged buffer not selected)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_color_inactive_message = config_file_new_option (
weechat_config_file, ptr_section,
"color_inactive_message", "boolean",
N_("use a different color for inactive message (when window is not "
"current window, or if line is from a merged buffer not selected)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_color_inactive_prefix = config_file_new_option (
weechat_config_file, ptr_section,
"color_inactive_prefix", "boolean",
N_("use a different color for inactive prefix (when window is not "
"current window, or if line is from a merged buffer not selected)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_color_inactive_prefix_buffer = config_file_new_option (
weechat_config_file, ptr_section,
"color_inactive_prefix_buffer", "boolean",
N_("use a different color for inactive buffer name in prefix (when "
"window is not current window, or if line is from a merged buffer "
"not selected)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_color_inactive_time = config_file_new_option (
weechat_config_file, ptr_section,
"color_inactive_time", "boolean",
N_("use a different color for inactive time (when window is not "
"current window, or if line is from a merged buffer not selected)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_color_inactive_window = config_file_new_option (
weechat_config_file, ptr_section,
"color_inactive_window", "boolean",
N_("use a different color for lines in inactive window (when window "
"is not current window)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_color_nick_offline = config_file_new_option (
weechat_config_file, ptr_section,
"color_nick_offline", "boolean",
N_("use a different color for offline nicks (not in nicklist any more)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_color_pairs_auto_reset = config_file_new_option (
weechat_config_file, ptr_section,
"color_pairs_auto_reset", "integer",
@@ -2372,7 +2539,8 @@ config_weechat_init_options ()
"pairs is lower or equal to this number (-1 = disable automatic "
"reset, and then a manual \"/color reset\" is needed when table "
"is full)"),
- NULL, -1, 256, "5", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, -1, 256, "5", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_color_real_white = config_file_new_option (
weechat_config_file, ptr_section,
"color_real_white", "boolean",
@@ -2381,37 +2549,47 @@ config_weechat_init_options ()
"white background, you should turn on this option to "
"see real white instead of default term foreground "
"color)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_look_command_chars = config_file_new_option (
weechat_config_file, ptr_section,
"command_chars", "string",
N_("chars used to determine if input string is a command or not: "
"input must start with one of these chars; the slash (\"/\") is "
"always considered as command prefix (example: \".$\")"),
- NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_command_incomplete = config_file_new_option (
weechat_config_file, ptr_section,
"command_incomplete", "boolean",
N_("if set, incomplete and unambiguous commands are allowed, for "
"example /he for /help"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_confirm_quit = config_file_new_option (
weechat_config_file, ptr_section,
"confirm_quit", "boolean",
N_("if set, /quit command must be confirmed with extra argument "
"\"-yes\" (see /help quit)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_confirm_upgrade = config_file_new_option (
weechat_config_file, ptr_section,
"confirm_upgrade", "boolean",
N_("if set, /upgrade command must be confirmed with extra argument "
"\"-yes\" (see /help upgrade)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_day_change = config_file_new_option (
weechat_config_file, ptr_section,
"day_change", "boolean",
N_("display special message when day changes"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_day_change_message_1date = config_file_new_option (
weechat_config_file, ptr_section,
"day_change_message_1date", "string",
@@ -2420,7 +2598,10 @@ config_weechat_init_options ()
"(for example at beginning of buffer) (see man strftime for "
"date/time specifiers) (note: content is evaluated, so you can use "
"colors with format \"${color:xxx}\", see /help eval)"),
- NULL, 0, 0, "-- %a, %d %b %Y --", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, 0, 0, "-- %a, %d %b %Y --", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_day_change_message_2dates = config_file_new_option (
weechat_config_file, ptr_section,
"day_change_message_2dates", "string",
@@ -2431,8 +2612,10 @@ config_weechat_init_options ()
"(see man strftime for date/time specifiers) (note: content is "
"evaluated, so you can use colors with format \"${color:xxx}\", "
"see /help eval)"),
- NULL, 0, 0, "-- %%a, %%d %%b %%Y (%a, %d %b %Y) --", NULL, 0, NULL, NULL,
- &config_change_buffers, NULL, NULL, NULL);
+ NULL, 0, 0, "-- %%a, %%d %%b %%Y (%a, %d %b %Y) --", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_eat_newline_glitch = config_file_new_option (
weechat_config_file, ptr_section,
"eat_newline_glitch", "boolean",
@@ -2441,8 +2624,10 @@ config_weechat_init_options ()
"text when you copy/paste text from WeeChat to another application "
"(this option is disabled by default because it can cause serious "
"display bugs)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL,
- &config_change_eat_newline_glitch, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_eat_newline_glitch, NULL, NULL,
+ NULL, NULL, NULL);
config_look_emphasized_attributes = config_file_new_option (
weechat_config_file, ptr_section,
"emphasized_attributes", "string",
@@ -2450,7 +2635,10 @@ config_weechat_init_options ()
"\"*\" for bold, \"!\" for reverse, \"/\" for italic, \"_\" for "
"underline); if the string is empty, the colors "
"weechat.color.emphasized* are used"),
- NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_emphasized_attributes, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_emphasized_attributes, NULL, NULL,
+ NULL, NULL, NULL);
config_look_highlight = config_file_new_option (
weechat_config_file, ptr_section,
"highlight", "string",
@@ -2458,7 +2646,8 @@ config_weechat_init_options ()
"comparison (use \"(?-i)\" at beginning of words to make them case "
"sensitive), words may begin or end with \"*\" for partial match; "
"example: \"test,(?-i)*toto*,flash*\""),
- NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_highlight_regex = config_file_new_option (
weechat_config_file, ptr_section,
"highlight_regex", "string",
@@ -2468,7 +2657,10 @@ config_weechat_init_options ()
"and \"|\"), regular expression is case insensitive (use \"(?-i)\" "
"at beginning to make it case sensitive), examples: "
"\"flashcode|flashy\", \"(?-i)FlashCode|flashy\""),
- NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_highlight_regex, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_highlight_regex, NULL, NULL,
+ NULL, NULL, NULL);
config_look_highlight_tags = config_file_new_option (
weechat_config_file, ptr_section,
"highlight_tags", "string",
@@ -2478,7 +2670,10 @@ config_weechat_init_options ()
"examples: \"nick_flashcode\" for messages from nick \"FlashCode\", "
"\"irc_notice+nick_toto*\" for notices from a nick starting with "
"\"toto\""),
- NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_highlight_tags, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_highlight_tags, NULL, NULL,
+ NULL, NULL, NULL);
config_look_hotlist_add_conditions = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_add_conditions", "string",
@@ -2489,65 +2684,94 @@ config_weechat_init_options ()
"by default a buffer is added to hotlist if you are away, or if the "
"buffer is not visible on screen (not displayed in any window)"),
NULL, 0, 0, "${away} || ${buffer.num_displayed} == 0",
- NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_hotlist_buffer_separator = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_buffer_separator", "string",
N_("string displayed between buffers in hotlist"),
- NULL, 0, 0, ", ", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 0, ", ", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_hotlist_count_max = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_count_max", "integer",
N_("max number of messages count to display in hotlist for a buffer "
"(0 = never display messages count)"),
- NULL, 0, GUI_HOTLIST_NUM_PRIORITIES, "2", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, GUI_HOTLIST_NUM_PRIORITIES, "2", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_hotlist_count_min_msg = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_count_min_msg", "integer",
N_("display messages count if number of messages is greater or equal "
"to this value"),
- NULL, 1, 100, "2", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 1, 100, "2", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_hotlist_names_count = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_names_count", "integer",
N_("max number of names in hotlist (0 = no name displayed, only buffer "
"numbers)"),
- NULL, 0, GUI_BUFFERS_MAX, "3", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, GUI_BUFFERS_MAX, "3", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_hotlist_names_length = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_names_length", "integer",
N_("max length of names in hotlist (0 = no limit)"),
- NULL, 0, 32, "0", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 32, "0", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_hotlist_names_level = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_names_level", "integer",
N_("level for displaying names in hotlist (combination "
"of: 1=join/part, 2=message, 4=private, 8=highlight, "
"for example: 12=private+highlight)"),
- NULL, 1, 15, "12", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 1, 15, "12", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_hotlist_names_merged_buffers = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_names_merged_buffers", "boolean",
N_("if set, force display of names in hotlist for merged buffers"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_hotlist_prefix = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_prefix", "string",
N_("text displayed at the beginning of the hotlist"),
- NULL, 0, 0, "H: ", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 0, "H: ", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_hotlist_remove = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_remove", "integer",
N_("remove buffers in hotlist: buffer = remove buffer by buffer, "
"merged = remove all visible merged buffers at once"),
"buffer|merged",
- 0, 0, "merged", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ 0, 0, "merged", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_hotlist_short_names = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_short_names", "boolean",
N_("if set, uses short names to display buffer names in hotlist (start "
"after first '.' in name)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_hotlist_sort = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_sort", "integer",
@@ -2557,133 +2781,174 @@ config_weechat_init_options ()
"asc = ascending sort, desc = descending sort"),
"group_time_asc|group_time_desc|group_number_asc|"
"group_number_desc|number_asc|number_desc",
- 0, 0, "group_time_asc", NULL, 0, NULL, NULL, &config_change_hotlist_sort, NULL, NULL, NULL);
+ 0, 0, "group_time_asc", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_hotlist_sort, NULL, NULL,
+ NULL, NULL, NULL);
config_look_hotlist_suffix = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_suffix", "string",
N_("text displayed at the end of the hotlist"),
- NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_hotlist_unique_numbers = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_unique_numbers", "boolean",
N_("keep only unique numbers in hotlist (this applies only on hotlist "
"items where name is NOT displayed after number)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_input_cursor_scroll = config_file_new_option (
weechat_config_file, ptr_section,
"input_cursor_scroll", "integer",
N_("number of chars displayed after end of input line when scrolling "
"to display end of line"),
- NULL, 0, 100, "20", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 100, "20", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_input_share = config_file_new_option (
weechat_config_file, ptr_section,
"input_share", "integer",
N_("share commands, text, or both in input for all buffers (there is "
"still local history for each buffer)"),
"none|commands|text|all",
- 0, 0, "none", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ 0, 0, "none", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_input_share_overwrite = config_file_new_option (
weechat_config_file, ptr_section,
"input_share_overwrite", "boolean",
N_("if set and input is shared, always overwrite input in target "
"buffer"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_input_undo_max = config_file_new_option (
weechat_config_file, ptr_section,
"input_undo_max", "integer",
N_("max number of \"undo\" for command line, by buffer (0 = undo "
"disabled)"),
- NULL, 0, 65535, "32", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 65535, "32", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_item_away_message = config_file_new_option (
weechat_config_file, ptr_section,
"item_away_message", "boolean",
N_("display server away message in away bar item"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- &config_change_item_away, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_item_away, NULL, NULL,
+ NULL, NULL, NULL);
config_look_item_buffer_filter = config_file_new_option (
weechat_config_file, ptr_section,
"item_buffer_filter", "string",
N_("string used to show that some lines are filtered in current buffer "
"(bar item \"buffer_filter\")"),
- NULL, 0, 0, "*", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 0, "*", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_item_buffer_zoom = config_file_new_option (
weechat_config_file, ptr_section,
"item_buffer_zoom", "string",
N_("string used to show zoom on merged buffer "
"(bar item \"buffer_zoom\")"),
- NULL, 0, 0, "!", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 0, "!", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_item_mouse_status = config_file_new_option (
weechat_config_file, ptr_section,
"item_mouse_status", "string",
N_("string used to show if mouse is enabled "
"(bar item \"mouse_status\")"),
- NULL, 0, 0, "M", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 0, "M", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_item_time_format = config_file_new_option (
weechat_config_file, ptr_section,
"item_time_format", "string",
N_("time format for \"time\" bar item (see man strftime for date/time "
"specifiers)"),
- NULL, 0, 0, "%H:%M", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 0, 0, "%H:%M", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_jump_current_to_previous_buffer = config_file_new_option (
weechat_config_file, ptr_section,
"jump_current_to_previous_buffer", "boolean",
N_("jump to previous buffer displayed when jumping to current buffer "
"number with /buffer *N (where N is a buffer number), to easily "
"switch to another buffer, then come back to current buffer"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_jump_previous_buffer_when_closing = config_file_new_option (
weechat_config_file, ptr_section,
"jump_previous_buffer_when_closing", "boolean",
N_("jump to previously visited buffer when closing a buffer (if "
"disabled, then jump to buffer number - 1)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_jump_smart_back_to_buffer = config_file_new_option (
weechat_config_file, ptr_section,
"jump_smart_back_to_buffer", "boolean",
N_("jump back to initial buffer after reaching end of hotlist"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_key_bind_safe = config_file_new_option (
weechat_config_file, ptr_section,
"key_bind_safe", "boolean",
N_("allow only binding of \"safe\" keys (beginning with a ctrl or meta "
"code)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_key_grab_delay = config_file_new_option (
weechat_config_file, ptr_section,
"key_grab_delay", "integer",
N_("default delay (in milliseconds) to grab a key (using default key "
"alt-k); this delay can be overridden in the /input command (see "
"/help input)"),
- NULL, 1, 10000, "800", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 1, 10000, "800", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_mouse = config_file_new_option (
weechat_config_file, ptr_section,
"mouse", "boolean",
N_("enable mouse support"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, &config_change_mouse, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_mouse, NULL, NULL,
+ NULL, NULL, NULL);
config_look_mouse_timer_delay = config_file_new_option (
weechat_config_file, ptr_section,
"mouse_timer_delay", "integer",
N_("delay (in milliseconds) to grab a mouse event: WeeChat will "
"wait this delay before processing event"),
- NULL, 1, 10000, "100", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 1, 10000, "100", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_nick_prefix = config_file_new_option (
weechat_config_file, ptr_section,
"nick_prefix", "string",
N_("text to display before nick in prefix of message, example: \"<\""),
- NULL, 0, 0, "", NULL, 0, NULL, NULL,
- &config_change_nick_prefix_suffix, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_nick_prefix_suffix, NULL, NULL,
+ NULL, NULL, NULL);
config_look_nick_suffix = config_file_new_option (
weechat_config_file, ptr_section,
"nick_suffix", "string",
N_("text to display after nick in prefix of message, example: \">\""),
- NULL, 0, 0, "", NULL, 0, NULL, NULL,
- &config_change_nick_prefix_suffix, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_nick_prefix_suffix, NULL, NULL,
+ NULL, NULL, NULL);
config_look_paste_auto_add_newline = config_file_new_option (
weechat_config_file, ptr_section,
"paste_auto_add_newline", "boolean",
N_("automatically add a newline at the end of pasted text if there "
"are at least two lines and if a confirmation is asked"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_paste_bracketed = config_file_new_option (
weechat_config_file, ptr_section,
"paste_bracketed", "boolean",
@@ -2692,82 +2957,108 @@ config_weechat_init_options ()
"with control sequences so that WeeChat can differentiate pasted "
"text from typed-in text (\"ESC[200~\", followed by the pasted text, "
"followed by \"ESC[201~\")"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_paste_bracketed, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_paste_bracketed, NULL, NULL,
+ NULL, NULL, NULL);
config_look_paste_bracketed_timer_delay = config_file_new_option (
weechat_config_file, ptr_section,
"paste_bracketed_timer_delay", "integer",
N_("force end of bracketed paste after this delay (in seconds) if the "
"control sequence for end of bracketed paste (\"ESC[201~\") was not "
"received in time"),
- NULL, 1, 60, "10", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 1, 60, "10", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_paste_max_lines = config_file_new_option (
weechat_config_file, ptr_section,
"paste_max_lines", "integer",
N_("max number of lines for paste without asking user "
"(-1 = disable this feature)"),
- NULL, -1, INT_MAX, "1", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, -1, INT_MAX, "1", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_prefix[GUI_CHAT_PREFIX_ERROR] = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_error", "string",
/* TRANSLATORS: string "${color:xxx}" must NOT be translated */
N_("prefix for error messages (note: content is evaluated, so you can "
"use colors with format \"${color:xxx}\", see /help eval)"),
- NULL, 0, 0, GUI_CHAT_PREFIX_ERROR_DEFAULT,
- NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL);
+ NULL, 0, 0, GUI_CHAT_PREFIX_ERROR_DEFAULT, NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_prefix, NULL, NULL,
+ NULL, NULL, NULL);
config_look_prefix[GUI_CHAT_PREFIX_NETWORK] = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_network", "string",
/* TRANSLATORS: string "${color:xxx}" must NOT be translated */
N_("prefix for network messages (note: content is evaluated, so you can "
"use colors with format \"${color:xxx}\", see /help eval)"),
- NULL, 0, 0, GUI_CHAT_PREFIX_NETWORK_DEFAULT,
- NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL);
+ NULL, 0, 0, GUI_CHAT_PREFIX_NETWORK_DEFAULT, NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_prefix, NULL, NULL,
+ NULL, NULL, NULL);
config_look_prefix[GUI_CHAT_PREFIX_ACTION] = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_action", "string",
/* TRANSLATORS: string "${color:xxx}" must NOT be translated */
N_("prefix for action messages (note: content is evaluated, so you can "
"use colors with format \"${color:xxx}\", see /help eval)"),
- NULL, 0, 0, GUI_CHAT_PREFIX_ACTION_DEFAULT,
- NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL);
+ NULL, 0, 0, GUI_CHAT_PREFIX_ACTION_DEFAULT, NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_prefix, NULL, NULL,
+ NULL, NULL, NULL);
config_look_prefix[GUI_CHAT_PREFIX_JOIN] = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_join", "string",
/* TRANSLATORS: string "${color:xxx}" must NOT be translated */
N_("prefix for join messages (note: content is evaluated, so you can "
"use colors with format \"${color:xxx}\", see /help eval)"),
- NULL, 0, 0, GUI_CHAT_PREFIX_JOIN_DEFAULT,
- NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL);
+ NULL, 0, 0, GUI_CHAT_PREFIX_JOIN_DEFAULT, NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_prefix, NULL, NULL,
+ NULL, NULL, NULL);
config_look_prefix[GUI_CHAT_PREFIX_QUIT] = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_quit", "string",
/* TRANSLATORS: string "${color:xxx}" must NOT be translated */
N_("prefix for quit messages (note: content is evaluated, so you can "
"use colors with format \"${color:xxx}\", see /help eval)"),
- NULL, 0, 0, GUI_CHAT_PREFIX_QUIT_DEFAULT,
- NULL, 0, NULL, NULL, &config_change_prefix, NULL, NULL, NULL);
+ NULL, 0, 0, GUI_CHAT_PREFIX_QUIT_DEFAULT, NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_prefix, NULL, NULL,
+ NULL, NULL, NULL);
config_look_prefix_align = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_align", "integer",
N_("prefix alignment (none, left, right (default))"),
- "none|left|right", 0, 0, "right", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ "none|left|right", 0, 0, "right", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_prefix_align_max = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_align_max", "integer",
N_("max size for prefix (0 = no max size)"),
- NULL, 0, 128, "0", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, 0, 128, "0", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_prefix_align_min = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_align_min", "integer",
N_("min size for prefix"),
- NULL, 0, 128, "0", NULL, 0, NULL, NULL, &config_change_prefix_align_min, NULL, NULL, NULL);
+ NULL, 0, 128, "0", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_prefix_align_min, NULL, NULL,
+ NULL, NULL, NULL);
config_look_prefix_align_more = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_align_more", "string",
N_("char to display if prefix is truncated (must be exactly one char "
"on screen)"),
NULL, 0, 0, "+", NULL, 0,
- &config_check_prefix_align_more, NULL, &config_change_buffers, NULL, NULL, NULL);
+ &config_check_prefix_align_more, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_prefix_align_more_after = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_align_more_after", "boolean",
@@ -2775,26 +3066,36 @@ config_weechat_init_options ()
"replacing the space that should be displayed here); if disabled, "
"the truncature char replaces last char of text"),
NULL, 0, 0, "on", NULL, 0,
- NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_prefix_buffer_align = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_buffer_align", "integer",
N_("prefix alignment for buffer name, when many buffers are merged "
"with same number (none, left, right (default))"),
- "none|left|right", 0, 0, "right", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ "none|left|right", 0, 0, "right", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_prefix_buffer_align_max = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_buffer_align_max", "integer",
N_("max size for buffer name, when many buffers are merged with same "
"number (0 = no max size)"),
- NULL, 0, 128, "0", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, 0, 128, "0", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_prefix_buffer_align_more = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_buffer_align_more", "string",
N_("char to display if buffer name is truncated (when many buffers are "
"merged with same number) (must be exactly one char on screen)"),
NULL, 0, 0, "+", NULL, 0,
- &config_check_prefix_buffer_align_more, NULL, &config_change_buffers, NULL, NULL, NULL);
+ &config_check_prefix_buffer_align_more, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_prefix_buffer_align_more_after = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_buffer_align_more_after", "boolean",
@@ -2802,7 +3103,9 @@ config_weechat_init_options ()
"replacing the space that should be displayed here); if disabled, "
"the truncature char replaces last char of text"),
NULL, 0, 0, "on", NULL, 0,
- NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_prefix_same_nick = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_same_nick", "string",
@@ -2810,81 +3113,108 @@ config_weechat_init_options ()
"message: use a space \" \" to hide prefix, another string to "
"display this string instead of prefix, or an empty string to "
"disable feature (display prefix)"),
- NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_prefix_same_nick, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_prefix_same_nick, NULL, NULL,
+ NULL, NULL, NULL);
config_look_prefix_suffix = config_file_new_option (
weechat_config_file, ptr_section,
"prefix_suffix", "string",
N_("string displayed after prefix"),
- NULL, 0, 0, "|", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, 0, 0, "|", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_quote_nick_prefix = config_file_new_option (
weechat_config_file, ptr_section,
"quote_nick_prefix", "string",
N_("text to display before nick when quoting a message (see /help "
"cursor)"),
- NULL, 0, 0, "<", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "<", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_quote_nick_suffix = config_file_new_option (
weechat_config_file, ptr_section,
"quote_nick_suffix", "string",
N_("text to display after nick when quoting a message (see /help "
"cursor)"),
- NULL, 0, 0, ">", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, ">", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_quote_time_format = config_file_new_option (
weechat_config_file, ptr_section,
"quote_time_format", "string",
N_("time format when quoting a message (see /help cursor)"),
- NULL, 0, 0, "%H:%M:%S", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "%H:%M:%S", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_read_marker = config_file_new_option (
weechat_config_file, ptr_section,
"read_marker", "integer",
N_("use a marker (line or char) on buffers to show first unread line"),
"none|line|char",
- 0, 0, "line", NULL, 0, NULL, NULL, &config_change_read_marker, NULL, NULL, NULL);
+ 0, 0, "line", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_read_marker, NULL, NULL,
+ NULL, NULL, NULL);
config_look_read_marker_always_show = config_file_new_option (
weechat_config_file, ptr_section,
"read_marker_always_show", "boolean",
N_("always show read marker, even if it is after last buffer line"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_read_marker_string = config_file_new_option (
weechat_config_file, ptr_section,
"read_marker_string", "string",
N_("string used to draw read marker line (string is repeated until "
"end of line)"),
- NULL, 0, 0, "- ", NULL, 0, NULL, NULL, &config_change_read_marker, NULL, NULL, NULL);
+ NULL, 0, 0, "- ", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_read_marker, NULL, NULL,
+ NULL, NULL, NULL);
config_look_save_config_on_exit = config_file_new_option (
weechat_config_file, ptr_section,
"save_config_on_exit", "boolean",
N_("save configuration file on exit"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_save_config_on_exit, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_save_config_on_exit, NULL, NULL,
+ NULL, NULL, NULL);
config_look_save_layout_on_exit = config_file_new_option (
weechat_config_file, ptr_section,
"save_layout_on_exit", "integer",
N_("save layout on exit (buffers, windows, or both)"),
- "none|buffers|windows|all", 0, 0, "none", NULL, 0, NULL, NULL,
- &config_change_save_layout_on_exit, NULL, NULL, NULL);
+ "none|buffers|windows|all", 0, 0, "none", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_save_layout_on_exit, NULL, NULL,
+ NULL, NULL, NULL);
config_look_scroll_amount = config_file_new_option (
weechat_config_file, ptr_section,
"scroll_amount", "integer",
N_("how many lines to scroll by with scroll_up and "
"scroll_down"),
- NULL, 1, INT_MAX, "3", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ NULL, 1, INT_MAX, "3", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffer_content, NULL, NULL,
+ NULL, NULL, NULL);
config_look_scroll_bottom_after_switch = config_file_new_option (
weechat_config_file, ptr_section,
"scroll_bottom_after_switch", "boolean",
N_("scroll to bottom of window after switch to another buffer (do not "
"remember scroll position in windows); the scroll is done only for "
"buffers with formatted content (not free content)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_scroll_page_percent = config_file_new_option (
weechat_config_file, ptr_section,
"scroll_page_percent", "integer",
N_("percent of screen to scroll when scrolling one page up or down "
"(for example 100 means one page, 50 half-page)"),
- NULL, 1, 100, "100", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 1, 100, "100", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_search_text_not_found_alert = config_file_new_option (
weechat_config_file, ptr_section,
"search_text_not_found_alert", "boolean",
N_("alert user when text sought is not found in buffer"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_separator_horizontal = config_file_new_option (
weechat_config_file, ptr_section,
"separator_horizontal", "string",
@@ -2893,7 +3223,9 @@ config_weechat_init_options ()
"with URL selection under some terminals); "
"width on screen must be exactly one char"),
NULL, 0, 0, "-", NULL, 0,
- &config_check_separator, NULL, &config_change_buffers, NULL, NULL, NULL);
+ &config_check_separator, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_separator_vertical = config_file_new_option (
weechat_config_file, ptr_section,
"separator_vertical", "string",
@@ -2901,44 +3233,58 @@ config_weechat_init_options ()
"(empty value will draw a real line with ncurses); "
"width on screen must be exactly one char"),
NULL, 0, 0, "", NULL, 0,
- &config_check_separator, NULL, &config_change_buffers, NULL, NULL, NULL);
+ &config_check_separator, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_tab_width = config_file_new_option (
weechat_config_file, ptr_section,
"tab_width", "integer",
N_("number of spaces used to display tabs in messages"),
- NULL, 1, TAB_MAX_WIDTH, "1", NULL, 0, NULL, NULL,
- &config_change_tab_width, NULL, NULL, NULL);
+ NULL, 1, TAB_MAX_WIDTH, "1", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_tab_width, NULL, NULL,
+ NULL, NULL, NULL);
config_look_time_format = config_file_new_option (
weechat_config_file, ptr_section,
"time_format", "string",
N_("time format for dates converted to strings and displayed in "
"messages (see man strftime for date/time specifiers)"),
- NULL, 0, 0, "%a, %d %b %Y %T", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "%a, %d %b %Y %T", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_window_auto_zoom = config_file_new_option (
weechat_config_file, ptr_section,
"window_auto_zoom", "boolean",
N_("automatically zoom on current window if the terminal becomes too "
"small to display all windows (use alt-z to unzoom windows when the "
"terminal is big enough)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_window_separator_horizontal = config_file_new_option (
weechat_config_file, ptr_section,
"window_separator_horizontal", "boolean",
N_("display an horizontal separator between windows"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_window_separator_vertical = config_file_new_option (
weechat_config_file, ptr_section,
"window_separator_vertical", "boolean",
N_("display a vertical separator between windows"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_buffers, NULL, NULL,
+ NULL, NULL, NULL);
config_look_window_title = config_file_new_option (
weechat_config_file, ptr_section,
"window_title", "string",
N_("title for window (terminal for Curses GUI), set on startup; "
"an empty string will keep title unchanged "
"(note: content is evaluated, see /help eval)"),
- NULL, 0, 0, "WeeChat ${info:version}", NULL, 0, NULL, NULL,
- &config_change_window_title, NULL, NULL, NULL);
+ NULL, 0, 0, "WeeChat ${info:version}", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_window_title, NULL, NULL,
+ NULL, NULL, NULL);
config_look_word_chars_highlight = config_file_new_option (
weechat_config_file, ptr_section,
"word_chars_highlight", "string",
@@ -2951,8 +3297,10 @@ config_weechat_init_options ()
"matches any char; unicode chars are allowed with the format "
"\\u1234, for example \\u00A0 for unbreakable space "
"(see /help print for supported formats)"),
- NULL, 0, 0, "!\\u00A0,-,_,|,alnum", NULL, 0, NULL, NULL,
- &config_change_word_chars_highlight, NULL, NULL, NULL);
+ NULL, 0, 0, "!\\u00A0,-,_,|,alnum", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_word_chars_highlight, NULL, NULL,
+ NULL, NULL, NULL);
config_look_word_chars_input = config_file_new_option (
weechat_config_file, ptr_section,
"word_chars_input", "string",
@@ -2965,16 +3313,20 @@ config_weechat_init_options ()
"matches any char; unicode chars are allowed with the format "
"\\u1234, for example \\u00A0 for unbreakable space "
"(see /help print for supported formats)"),
- NULL, 0, 0, "!\\u00A0,-,_,|,alnum", NULL, 0, NULL, NULL,
- &config_change_word_chars_input, NULL, NULL, NULL);
+ NULL, 0, 0, "!\\u00A0,-,_,|,alnum", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_word_chars_input, NULL, NULL,
+ NULL, NULL, NULL);
/* palette */
- ptr_section = config_file_new_section (weechat_config_file, "palette",
- 1, 1,
- NULL, NULL, NULL, NULL,
- NULL, NULL,
- &config_weechat_palette_create_option_cb, NULL,
- &config_weechat_palette_delete_option_cb, NULL);
+ ptr_section = config_file_new_section (
+ weechat_config_file, "palette",
+ 1, 1,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &config_weechat_palette_create_option_cb, NULL, NULL,
+ &config_weechat_palette_delete_option_cb, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
@@ -2984,8 +3336,11 @@ config_weechat_init_options ()
/* colors */
ptr_section = config_file_new_section (weechat_config_file, "color",
0, 0,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
@@ -3000,82 +3355,108 @@ config_weechat_init_options ()
"bar_more", "color",
N_("text color for '+' when scrolling bars"),
NULL, -1, 0, "lightmagenta", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
/* chat area */
config_color_chat = config_file_new_option (
weechat_config_file, ptr_section,
"chat", "color",
N_("text color for chat"),
NULL, GUI_COLOR_CHAT, 0, "default", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_bg = config_file_new_option (
weechat_config_file, ptr_section,
"chat_bg", "color",
N_("background color for chat"),
NULL, -1, 0, "default", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_buffer = config_file_new_option (
weechat_config_file, ptr_section,
"chat_buffer", "color",
N_("text color for buffer names"),
NULL, GUI_COLOR_CHAT_BUFFER, 0, "white", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_channel = config_file_new_option (
weechat_config_file, ptr_section,
"chat_channel", "color",
N_("text color for channel names"),
NULL, GUI_COLOR_CHAT_CHANNEL, 0, "white", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_day_change = config_file_new_option (
weechat_config_file, ptr_section,
"chat_day_change", "color",
N_("text color for message displayed when the day has changed"),
NULL, GUI_COLOR_CHAT_DAY_CHANGE, 0, "cyan", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_delimiters = config_file_new_option (
weechat_config_file, ptr_section,
"chat_delimiters", "color",
N_("text color for delimiters"),
NULL, GUI_COLOR_CHAT_DELIMITERS, 0, "green", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_highlight = config_file_new_option (
weechat_config_file, ptr_section,
"chat_highlight", "color",
N_("text color for highlighted prefix"),
NULL, GUI_COLOR_CHAT_HIGHLIGHT, 0, "yellow", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_highlight_bg = config_file_new_option (
weechat_config_file, ptr_section,
"chat_highlight_bg", "color",
N_("background color for highlighted prefix"),
NULL, -1, 0, "magenta", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_host = config_file_new_option (
weechat_config_file, ptr_section,
"chat_host", "color",
N_("text color for hostnames"),
NULL, GUI_COLOR_CHAT_HOST, 0, "cyan", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_inactive_buffer = config_file_new_option (
weechat_config_file, ptr_section,
"chat_inactive_buffer", "color",
N_("text color for chat when line is inactive (buffer is merged with "
"other buffers and is not selected)"),
NULL, GUI_COLOR_CHAT_INACTIVE_BUFFER, 0, "default", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_inactive_window = config_file_new_option (
weechat_config_file, ptr_section,
"chat_inactive_window", "color",
N_("text color for chat when window is inactive (not current selected "
"window)"),
NULL, GUI_COLOR_CHAT_INACTIVE_WINDOW, 0, "default", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_nick = config_file_new_option (
weechat_config_file, ptr_section,
"chat_nick", "color",
N_("text color for nicks in chat window"),
NULL, GUI_COLOR_CHAT_NICK, 0, "lightcyan", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_nick_colors = config_file_new_option (
weechat_config_file, ptr_section,
"chat_nick_colors", "string",
@@ -3085,7 +3466,9 @@ config_weechat_init_options ()
"\"lightred:blue\")"),
NULL, 0, 0, "cyan,magenta,green,brown,lightblue,default,lightcyan,"
"lightmagenta,lightgreen,blue", NULL, 0,
- NULL, NULL, &config_change_nick_colors, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_nick_colors, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_nick_offline = config_file_new_option (
weechat_config_file, ptr_section,
"chat_nick_offline", "color",
@@ -3093,58 +3476,76 @@ config_weechat_init_options ()
"color is used only if option weechat.look.color_nick_offline is "
"enabled"),
NULL, GUI_COLOR_CHAT_NICK_OFFLINE, 0, "default", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_nick_offline_highlight = config_file_new_option (
weechat_config_file, ptr_section,
"chat_nick_offline_highlight", "color",
N_("text color for offline nick with highlight; this color is used "
"only if option weechat.look.color_nick_offline is enabled"),
NULL, -1, 0, "default", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_nick_offline_highlight_bg = config_file_new_option (
weechat_config_file, ptr_section,
"chat_nick_offline_highlight_bg", "color",
N_("background color for offline nick with highlight; this color is "
"used only if option weechat.look.color_nick_offline is enabled"),
NULL, -1, 0, "blue", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_nick_other = config_file_new_option (
weechat_config_file, ptr_section,
"chat_nick_other", "color",
N_("text color for other nick in private buffer"),
NULL, GUI_COLOR_CHAT_NICK_OTHER, 0, "cyan", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_nick_prefix = config_file_new_option (
weechat_config_file, ptr_section,
"chat_nick_prefix", "color",
N_("color for nick prefix (string displayed before nick in prefix)"),
- NULL, GUI_COLOR_CHAT_NICK_PREFIX, 0, "green", NULL, 0, NULL, NULL,
- &config_change_color, NULL, NULL, NULL);
+ NULL, GUI_COLOR_CHAT_NICK_PREFIX, 0, "green", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_nick_self = config_file_new_option (
weechat_config_file, ptr_section,
"chat_nick_self", "color",
N_("text color for local nick in chat window"),
NULL, GUI_COLOR_CHAT_NICK_SELF, 0, "white", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_nick_suffix = config_file_new_option (
weechat_config_file, ptr_section,
"chat_nick_suffix", "color",
N_("color for nick suffix (string displayed after nick in prefix)"),
- NULL, GUI_COLOR_CHAT_NICK_SUFFIX, 0, "green", NULL, 0, NULL, NULL,
- &config_change_color, NULL, NULL, NULL);
+ NULL, GUI_COLOR_CHAT_NICK_SUFFIX, 0, "green", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_prefix[GUI_CHAT_PREFIX_ERROR] = config_file_new_option (
weechat_config_file, ptr_section,
"chat_prefix_error", "color",
N_("text color for error prefix"),
NULL, GUI_COLOR_CHAT_PREFIX_ERROR, 0, "yellow", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_prefix_buffer = config_file_new_option (
weechat_config_file, ptr_section,
"chat_prefix_buffer", "color",
N_("text color for buffer name (before prefix, when many buffers are "
"merged with same number)"),
NULL, GUI_COLOR_CHAT_PREFIX_BUFFER, 0, "brown", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_prefix_buffer_inactive_buffer = config_file_new_option (
weechat_config_file, ptr_section,
"chat_prefix_buffer_inactive_buffer", "color",
@@ -3152,104 +3553,138 @@ config_weechat_init_options ()
"buffers are merged with same number and if buffer is not "
"selected)"),
NULL, GUI_COLOR_CHAT_PREFIX_BUFFER_INACTIVE_BUFFER, 0, "default", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_prefix[GUI_CHAT_PREFIX_NETWORK] = config_file_new_option (
weechat_config_file, ptr_section,
"chat_prefix_network", "color",
N_("text color for network prefix"),
NULL, GUI_COLOR_CHAT_PREFIX_NETWORK, 0, "magenta", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_prefix[GUI_CHAT_PREFIX_ACTION] = config_file_new_option (
weechat_config_file, ptr_section,
"chat_prefix_action", "color",
N_("text color for action prefix"),
NULL, GUI_COLOR_CHAT_PREFIX_ACTION, 0, "white", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_prefix[GUI_CHAT_PREFIX_JOIN] = config_file_new_option (
weechat_config_file, ptr_section,
"chat_prefix_join", "color",
N_("text color for join prefix"),
NULL, GUI_COLOR_CHAT_PREFIX_JOIN, 0, "lightgreen", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_prefix[GUI_CHAT_PREFIX_QUIT] = config_file_new_option (
weechat_config_file, ptr_section,
"chat_prefix_quit", "color",
N_("text color for quit prefix"),
NULL, GUI_COLOR_CHAT_PREFIX_QUIT, 0, "lightred", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_prefix_more = config_file_new_option (
weechat_config_file, ptr_section,
"chat_prefix_more", "color",
N_("text color for '+' when prefix is too long"),
NULL, GUI_COLOR_CHAT_PREFIX_MORE, 0, "lightmagenta", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_prefix_suffix = config_file_new_option (
weechat_config_file, ptr_section,
"chat_prefix_suffix", "color",
N_("text color for suffix (after prefix)"),
NULL, GUI_COLOR_CHAT_PREFIX_SUFFIX, 0, "green", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_read_marker = config_file_new_option (
weechat_config_file, ptr_section,
"chat_read_marker", "color",
N_("text color for unread data marker"),
NULL, GUI_COLOR_CHAT_READ_MARKER, 0, "magenta", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_read_marker_bg = config_file_new_option (
weechat_config_file, ptr_section,
"chat_read_marker_bg", "color",
N_("background color for unread data marker"),
NULL, -1, 0, "default", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_server = config_file_new_option (
weechat_config_file, ptr_section,
"chat_server", "color",
N_("text color for server names"),
NULL, GUI_COLOR_CHAT_SERVER, 0, "brown", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_tags = config_file_new_option (
weechat_config_file, ptr_section,
"chat_tags", "color",
N_("text color for tags after messages (displayed with command /debug "
"tags)"),
NULL, GUI_COLOR_CHAT_TAGS, 0, "red", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_text_found = config_file_new_option (
weechat_config_file, ptr_section,
"chat_text_found", "color",
N_("text color for marker on lines where text sought is found"),
NULL, GUI_COLOR_CHAT_TEXT_FOUND, 0, "yellow", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_text_found_bg = config_file_new_option (
weechat_config_file, ptr_section,
"chat_text_found_bg", "color",
N_("background color for marker on lines where text sought is found"),
NULL, -1, 0, "lightmagenta", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_time = config_file_new_option (
weechat_config_file, ptr_section,
"chat_time", "color",
N_("text color for time in chat window"),
NULL, GUI_COLOR_CHAT_TIME, 0, "default", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_time_delimiters = config_file_new_option (
weechat_config_file, ptr_section,
"chat_time_delimiters", "color",
N_("text color for time delimiters"),
NULL, GUI_COLOR_CHAT_TIME_DELIMITERS, 0, "brown", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_value = config_file_new_option (
weechat_config_file, ptr_section,
"chat_value", "color",
N_("text color for values"),
NULL, GUI_COLOR_CHAT_VALUE, 0, "cyan", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_chat_value_null = config_file_new_option (
weechat_config_file, ptr_section,
"chat_value_null", "color",
N_("text color for null values (undefined)"),
NULL, GUI_COLOR_CHAT_VALUE_NULL, 0, "blue", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
/* emphasis (chat/bars) */
config_color_emphasized = config_file_new_option (
weechat_config_file, ptr_section,
@@ -3258,7 +3693,9 @@ config_weechat_init_options ()
"this option is used only if option weechat.look.emphasized_attributes "
"is an empty string (default value)"),
NULL, GUI_COLOR_EMPHASIS, 0, "yellow", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_emphasized_bg = config_file_new_option (
weechat_config_file, ptr_section,
"emphasized_bg", "color",
@@ -3266,40 +3703,52 @@ config_weechat_init_options ()
"text); used only if option weechat.look.emphasized_attributes is an "
"empty string (default value)"),
NULL, -1, 0, "magenta", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
/* input bar */
config_color_input_actions = config_file_new_option (
weechat_config_file, ptr_section,
"input_actions", "color",
N_("text color for actions in input line"),
NULL, -1, 0, "lightgreen", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_input_text_not_found = config_file_new_option (
weechat_config_file, ptr_section,
"input_text_not_found", "color",
N_("text color for unsuccessful text search in input line"),
NULL, -1, 0, "red", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
/* items */
config_color_item_away = config_file_new_option (
weechat_config_file, ptr_section,
"item_away", "color",
N_("text color for away item"),
- NULL, -1, 0, "yellow", NULL, 0, NULL, NULL,
- &config_change_item_away, NULL, NULL, NULL);
+ NULL, -1, 0, "yellow", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_item_away, NULL, NULL,
+ NULL, NULL, NULL);
/* nicklist bar */
config_color_nicklist_away = config_file_new_option (
weechat_config_file, ptr_section,
"nicklist_away", "color",
N_("text color for away nicknames"),
NULL, -1, 0, "cyan", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_nicklist_group = config_file_new_option (
weechat_config_file, ptr_section,
"nicklist_group", "color",
N_("text color for groups in nicklist"),
NULL, -1, 0, "green", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
/* general color settings */
config_color_separator = config_file_new_option (
weechat_config_file, ptr_section,
@@ -3307,112 +3756,149 @@ config_weechat_init_options ()
N_("color for window separators (when split) and separators beside bars "
"(like nicklist)"),
NULL, GUI_COLOR_SEPARATOR, 0, "blue", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
/* status bar */
config_color_status_count_highlight = config_file_new_option (
weechat_config_file, ptr_section,
"status_count_highlight", "color",
N_("text color for count of highlight messages in hotlist (status bar)"),
NULL, -1, 0, "magenta", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_status_count_msg = config_file_new_option (
weechat_config_file, ptr_section,
"status_count_msg", "color",
N_("text color for count of messages in hotlist (status bar)"),
NULL, -1, 0, "brown", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_status_count_other = config_file_new_option (
weechat_config_file, ptr_section,
"status_count_other", "color",
N_("text color for count of other messages in hotlist (status bar)"),
NULL, -1, 0, "default", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_status_count_private = config_file_new_option (
weechat_config_file, ptr_section,
"status_count_private", "color",
N_("text color for count of private messages in hotlist (status bar)"),
NULL, -1, 0, "green", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_status_data_highlight = config_file_new_option (
weechat_config_file, ptr_section,
"status_data_highlight", "color",
N_("text color for buffer with highlight (status bar)"),
NULL, -1, 0, "lightmagenta", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_status_data_msg = config_file_new_option (
weechat_config_file, ptr_section,
"status_data_msg", "color",
N_("text color for buffer with new messages (status bar)"),
NULL, -1, 0, "yellow", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_status_data_other = config_file_new_option (
weechat_config_file, ptr_section,
"status_data_other", "color",
N_("text color for buffer with new data (not messages) "
"(status bar)"),
NULL, -1, 0, "default", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_status_data_private = config_file_new_option (
weechat_config_file, ptr_section,
"status_data_private", "color",
N_("text color for buffer with private message (status bar)"),
NULL, -1, 0, "lightgreen", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_status_filter = config_file_new_option (
weechat_config_file, ptr_section,
"status_filter", "color",
N_("text color for filter indicator in status bar"),
NULL, -1, 0, "green", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_status_more = config_file_new_option (
weechat_config_file, ptr_section,
"status_more", "color",
N_("text color for buffer with new data (status bar)"),
NULL, -1, 0, "yellow", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_status_mouse = config_file_new_option (
weechat_config_file, ptr_section,
"status_mouse", "color",
N_("text color for mouse indicator in status bar"),
NULL, -1, 0, "green", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_status_name = config_file_new_option (
weechat_config_file, ptr_section,
"status_name", "color",
N_("text color for current buffer name in status bar"),
NULL, -1, 0, "white", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_status_name_ssl = config_file_new_option (
weechat_config_file, ptr_section,
"status_name_ssl", "color",
N_("text color for current buffer name in status bar, if data are "
"secured with a protocol like SSL"),
NULL, -1, 0, "lightgreen", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_status_nicklist_count = config_file_new_option (
weechat_config_file, ptr_section,
"status_nicklist_count", "color",
N_("text color for number of nicks in nicklist (status bar)"),
NULL, -1, 0, "default", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_status_number = config_file_new_option (
weechat_config_file, ptr_section,
"status_number", "color",
N_("text color for current buffer number in status bar"),
NULL, -1, 0, "yellow", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
config_color_status_time = config_file_new_option (
weechat_config_file, ptr_section,
"status_time", "color",
N_("text color for time (status bar)"),
NULL, -1, 0, "default", NULL, 0,
- NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
/* completion */
ptr_section = config_file_new_section (weechat_config_file, "completion",
0, 0,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
@@ -3424,7 +3910,8 @@ config_weechat_init_options ()
"base_word_until_cursor", "boolean",
N_("if enabled, the base word to complete ends at char before cursor; "
"otherwise the base word ends at first space after cursor"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_command_inline = config_file_new_option (
weechat_config_file, ptr_section,
"command_inline", "boolean",
@@ -3433,7 +3920,8 @@ config_weechat_init_options ()
"first); note: when this option is enabled, there is no more "
"automatic completion of paths beginning with '/' (outside "
"commands arguments)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_default_template = config_file_new_option (
weechat_config_file, ptr_section,
"default_template", "string",
@@ -3441,63 +3929,75 @@ config_weechat_init_options ()
"codes and values: plugin API reference, function "
"\"weechat_hook_command\")"),
NULL, 0, 0, "%(nicks)|%(irc_channels)", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_nick_add_space = config_file_new_option (
weechat_config_file, ptr_section,
"nick_add_space", "boolean",
N_("add space after nick completion (when nick is not first word on "
"command line)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_nick_completer = config_file_new_option (
weechat_config_file, ptr_section,
"nick_completer", "string",
N_("string inserted after nick completion (when nick is first word on "
"command line)"),
- NULL, 0, 0, ":", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, ":", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_nick_first_only = config_file_new_option (
weechat_config_file, ptr_section,
"nick_first_only", "boolean",
N_("complete only with first nick found"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_nick_ignore_chars = config_file_new_option (
weechat_config_file, ptr_section,
"nick_ignore_chars", "string",
N_("chars ignored for nick completion"),
- NULL, 0, 0, "[]`_-^", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "[]`_-^", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_partial_completion_alert = config_file_new_option (
weechat_config_file, ptr_section,
"partial_completion_alert", "boolean",
N_("alert user when a partial completion occurs"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_partial_completion_command = config_file_new_option (
weechat_config_file, ptr_section,
"partial_completion_command", "boolean",
N_("partially complete command names (stop when many commands found "
"begin with same letters)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_partial_completion_command_arg = config_file_new_option (
weechat_config_file, ptr_section,
"partial_completion_command_arg", "boolean",
N_("partially complete command arguments (stop when many arguments "
"found begin with same prefix)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_partial_completion_count = config_file_new_option (
weechat_config_file, ptr_section,
"partial_completion_count", "boolean",
N_("display count for each partial completion in bar item"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_partial_completion_other = config_file_new_option (
weechat_config_file, ptr_section,
"partial_completion_other", "boolean",
N_("partially complete outside commands (stop when many words found "
"begin with same letters)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* history */
ptr_section = config_file_new_section (weechat_config_file, "history",
0, 0,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
@@ -3509,7 +4009,8 @@ config_weechat_init_options ()
"display_default", "integer",
N_("maximum number of commands to display by default in "
"history listing (0 = unlimited)"),
- NULL, 0, INT_MAX, "5", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, INT_MAX, "5", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_history_max_buffer_lines_minutes = config_file_new_option (
weechat_config_file, ptr_section,
"max_buffer_lines_minutes", "integer",
@@ -3517,32 +4018,39 @@ config_weechat_init_options ()
"(0 = unlimited); examples: 1440 = one day, 10080 = one week, "
"43200 = one month, 525600 = one year; use 0 ONLY if option "
"weechat.history.max_buffer_lines_number is NOT set to 0"),
- NULL, 0, INT_MAX, "0", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, INT_MAX, "0", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_history_max_buffer_lines_number = config_file_new_option (
weechat_config_file, ptr_section,
"max_buffer_lines_number", "integer",
N_("maximum number of lines in history per buffer "
"(0 = unlimited); use 0 ONLY if option "
"weechat.history.max_buffer_lines_minutes is NOT set to 0"),
- NULL, 0, INT_MAX, "4096", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, INT_MAX, "4096", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_history_max_commands = config_file_new_option (
weechat_config_file, ptr_section,
"max_commands", "integer",
N_("maximum number of user commands in history (0 = "
"unlimited, NOT RECOMMENDED: no limit in memory usage)"),
- NULL, 0, INT_MAX, "100", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, INT_MAX, "100", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_history_max_visited_buffers = config_file_new_option (
weechat_config_file, ptr_section,
"max_visited_buffers", "integer",
N_("maximum number of visited buffers to keep in memory"),
- NULL, 0, 1000, "50", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 1000, "50", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* proxies */
- ptr_section = config_file_new_section (weechat_config_file, "proxy",
- 0, 0,
- &config_weechat_proxy_read_cb, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL);
+ ptr_section = config_file_new_section (
+ weechat_config_file, "proxy",
+ 0, 0,
+ &config_weechat_proxy_read_cb, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
@@ -3554,8 +4062,11 @@ config_weechat_init_options ()
/* network */
ptr_section = config_file_new_section (weechat_config_file, "network",
0, 0,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
@@ -3567,19 +4078,23 @@ config_weechat_init_options ()
"connection_timeout", "integer",
N_("timeout (in seconds) for connection to a remote host (made in a "
"child process)"),
- NULL, 1, INT_MAX, "60", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 1, INT_MAX, "60", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_network_gnutls_ca_file = config_file_new_option (
weechat_config_file, ptr_section,
"gnutls_ca_file", "string",
N_("file containing the certificate authorities (\"%h\" will be "
"replaced by WeeChat home, \"~/.weechat\" by default)"),
- NULL, 0, 0, CA_FILE, NULL, 0, NULL, NULL,
- &config_change_network_gnutls_ca_file, NULL, NULL, NULL);
+ NULL, 0, 0, CA_FILE, NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_network_gnutls_ca_file, NULL, NULL,
+ NULL, NULL, NULL);
config_network_gnutls_handshake_timeout = config_file_new_option (
weechat_config_file, ptr_section,
"gnutls_handshake_timeout", "integer",
N_("timeout (in seconds) for gnutls handshake"),
- NULL, 1, INT_MAX, "30", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 1, INT_MAX, "30", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_network_proxy_curl = config_file_new_option (
weechat_config_file, ptr_section,
"proxy_curl", "string",
@@ -3587,13 +4102,18 @@ config_weechat_init_options ()
"list of scripts and in scripts calling function hook_process); the "
"proxy must be defined with command /proxy"),
NULL, 0, 0, "", NULL, 0,
- &config_check_proxy_curl, NULL, NULL, NULL, NULL, NULL);
+ &config_check_proxy_curl, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
/* plugin */
ptr_section = config_file_new_section (weechat_config_file, "plugin",
0, 0,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
@@ -3608,37 +4128,46 @@ config_weechat_init_options ()
"\"!\" is a negative value to prevent a plugin from being loaded, "
"wildcard \"*\" is allowed in names (examples: \"*\" or "
"\"*,!lua,!tcl\")"),
- NULL, 0, 0, "*", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "*", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_plugin_debug = config_file_new_option (
weechat_config_file, ptr_section,
"debug", "boolean",
N_("enable debug messages by default in all plugins (option disabled "
"by default, which is highly recommended)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_plugin_extension = config_file_new_option (
weechat_config_file, ptr_section,
"extension", "string",
N_("comma separated list of file name extensions for plugins"),
- NULL, 0, 0, ".so,.dll", NULL, 0, NULL, NULL,
- &config_change_plugin_extension, NULL, NULL, NULL);
+ NULL, 0, 0, ".so,.dll", NULL, 0,
+ NULL, NULL, NULL,
+ &config_change_plugin_extension, NULL, NULL,
+ NULL, NULL, NULL);
config_plugin_path = config_file_new_option (
weechat_config_file, ptr_section,
"path", "string",
N_("path for searching plugins (\"%h\" will be replaced by "
"WeeChat home, \"~/.weechat\" by default)"),
- NULL, 0, 0, "%h/plugins", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "%h/plugins", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_plugin_save_config_on_unload = config_file_new_option (
weechat_config_file, ptr_section,
"save_config_on_unload", "boolean",
N_("save configuration files when unloading plugins"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* bars */
- ptr_section = config_file_new_section (weechat_config_file, "bar",
- 0, 0,
- &config_weechat_bar_read_cb, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL);
+ ptr_section = config_file_new_section (
+ weechat_config_file, "bar",
+ 0, 0,
+ &config_weechat_bar_read_cb, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
@@ -3648,11 +4177,14 @@ config_weechat_init_options ()
weechat_config_section_bar = ptr_section;
/* layout */
- ptr_section = config_file_new_section (weechat_config_file, "layout",
- 0, 0,
- &config_weechat_layout_read_cb, NULL,
- &config_weechat_layout_write_cb, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ ptr_section = config_file_new_section (
+ weechat_config_file, "layout",
+ 0, 0,
+ &config_weechat_layout_read_cb, NULL, NULL,
+ &config_weechat_layout_write_cb, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
@@ -3660,13 +4192,14 @@ config_weechat_init_options ()
}
/* notify */
- ptr_section = config_file_new_section (weechat_config_file, "notify",
- 1, 1,
- NULL, NULL,
- NULL, NULL,
- NULL, NULL,
- &config_weechat_notify_create_option_cb, NULL,
- &config_weechat_notify_delete_option_cb, NULL);
+ ptr_section = config_file_new_section (
+ weechat_config_file, "notify",
+ 1, 1,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &config_weechat_notify_create_option_cb, NULL, NULL,
+ &config_weechat_notify_delete_option_cb, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
@@ -3676,12 +4209,14 @@ config_weechat_init_options ()
weechat_config_section_notify = ptr_section;
/* filters */
- ptr_section = config_file_new_section (weechat_config_file, "filter",
- 0, 0,
- &config_weechat_filter_read_cb, NULL,
- &config_weechat_filter_write_cb, NULL,
- &config_weechat_filter_write_cb, NULL,
- NULL, NULL, NULL, NULL);
+ ptr_section = config_file_new_section (
+ weechat_config_file, "filter",
+ 0, 0,
+ &config_weechat_filter_read_cb, NULL, NULL,
+ &config_weechat_filter_write_cb, NULL, NULL,
+ &config_weechat_filter_write_cb, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
@@ -3695,12 +4230,14 @@ config_weechat_init_options ()
"key%s%s",
(i == GUI_KEY_CONTEXT_DEFAULT) ? "" : "_",
(i == GUI_KEY_CONTEXT_DEFAULT) ? "" : gui_key_context_string[i]);
- ptr_section = config_file_new_section (weechat_config_file, section_name,
- 0, 0,
- &config_weechat_key_read_cb, NULL,
- &config_weechat_key_write_cb, NULL,
- &config_weechat_key_write_cb, NULL,
- NULL, NULL, NULL, NULL);
+ ptr_section = config_file_new_section (
+ weechat_config_file, section_name,
+ 0, 0,
+ &config_weechat_key_read_cb, NULL, NULL,
+ &config_weechat_key_write_cb, NULL, NULL,
+ &config_weechat_key_write_cb, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
@@ -3749,18 +4286,18 @@ config_weechat_init ()
60, /* when second is 00 */
0,
&config_day_change_timer_cb,
- NULL);
+ NULL, NULL);
}
if (!config_highlight_regex)
- config_change_highlight_regex (NULL, NULL);
+ config_change_highlight_regex (NULL, NULL, NULL);
if (!config_highlight_tags)
- config_change_highlight_tags (NULL, NULL);
+ config_change_highlight_tags (NULL, NULL, NULL);
if (!config_plugin_extensions)
- config_change_plugin_extension (NULL, NULL);
+ config_change_plugin_extension (NULL, NULL, NULL);
if (!config_word_chars_highlight)
- config_change_word_chars_highlight (NULL, NULL);
+ config_change_word_chars_highlight (NULL, NULL, NULL);
if (!config_word_chars_input)
- config_change_word_chars_input (NULL, NULL);
+ config_change_word_chars_input (NULL, NULL, NULL);
return rc;
}
diff --git a/src/core/wee-debug.c b/src/core/wee-debug.c
index 879c5cc6b..1aaa436a7 100644
--- a/src/core/wee-debug.c
+++ b/src/core/wee-debug.c
@@ -127,10 +127,12 @@ debug_dump (int crash)
*/
int
-debug_dump_cb (void *data, const char *signal, const char *type_data,
+debug_dump_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -324,7 +326,8 @@ debug_hdata_hash_list_map_cb (void *data,
*/
void
-debug_hdata_map_cb (void *data, struct t_hashtable *hashtable,
+debug_hdata_map_cb (void *data,
+ struct t_hashtable *hashtable,
const void *key, const void *value)
{
struct t_hdata *ptr_hdata;
@@ -345,13 +348,11 @@ debug_hdata_map_cb (void *data, struct t_hashtable *hashtable,
ptr_hdata->hash_list->items_count);
/* display lists */
- hashtable_map (ptr_hdata->hash_list,
- &debug_hdata_hash_list_map_cb, NULL);
+ hashtable_map (ptr_hdata->hash_list, &debug_hdata_hash_list_map_cb, NULL);
/* display vars */
list = weelist_new ();
- hashtable_map (ptr_hdata->hash_var,
- &debug_hdata_hash_var_map_cb, list);
+ hashtable_map (ptr_hdata->hash_var, &debug_hdata_hash_var_map_cb, list);
for (ptr_item = list->items; ptr_item;
ptr_item = ptr_item->next_item)
{
@@ -510,10 +511,12 @@ debug_infolists ()
*/
int
-debug_libs_cb (void *data, const char *signal, const char *type_data,
+debug_libs_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -648,8 +651,8 @@ debug_init ()
* plugins (they should anyway because this function is called before load
* of plugins)
*/
- hook_signal (NULL, "2000|debug_dump", &debug_dump_cb, NULL);
- hook_signal (NULL, "2000|debug_libs", &debug_libs_cb, NULL);
+ hook_signal (NULL, "2000|debug_dump", &debug_dump_cb, NULL, NULL);
+ hook_signal (NULL, "2000|debug_libs", &debug_libs_cb, NULL, NULL);
}
/*
diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c
index 4e0959b16..dd33e4bbb 100644
--- a/src/core/wee-hook.c
+++ b/src/core/wee-hook.c
@@ -364,7 +364,8 @@ hook_get_priority_and_name (const char *string,
void
hook_init_data (struct t_hook *hook, struct t_weechat_plugin *plugin,
- int type, int priority, void *callback_data)
+ int type, int priority,
+ const void *callback_pointer, void *callback_data)
{
hook->plugin = plugin;
hook->subplugin = NULL;
@@ -372,6 +373,7 @@ hook_init_data (struct t_hook *hook, struct t_weechat_plugin *plugin,
hook->deleted = 0;
hook->running = 0;
hook->priority = priority;
+ hook->callback_pointer = callback_pointer;
hook->callback_data = callback_data;
hook->hook_data = NULL;
@@ -648,7 +650,9 @@ hook_command (struct t_weechat_plugin *plugin, const char *command,
const char *description,
const char *args, const char *args_description,
const char *completion,
- t_hook_callback_command *callback, void *callback_data)
+ t_hook_callback_command *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_command *new_hook_command;
@@ -681,7 +685,7 @@ hook_command (struct t_weechat_plugin *plugin, const char *command,
hook_get_priority_and_name (command, &priority, &ptr_command);
hook_init_data (new_hook, plugin, HOOK_TYPE_COMMAND, priority,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_command;
new_hook_command->callback = callback;
@@ -859,7 +863,12 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin,
/* execute the command! */
ptr_hook->running++;
rc = (int) (HOOK_COMMAND(ptr_hook, callback))
- (ptr_hook->callback_data, buffer, argc, argv, argv_eol);
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
+ buffer,
+ argc,
+ argv,
+ argv_eol);
ptr_hook->running--;
if (rc == WEECHAT_RC_ERROR)
rc = HOOK_COMMAND_EXEC_ERROR;
@@ -883,8 +892,11 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin,
*/
struct t_hook *
-hook_command_run (struct t_weechat_plugin *plugin, const char *command,
- t_hook_callback_command_run *callback, void *callback_data)
+hook_command_run (struct t_weechat_plugin *plugin,
+ const char *command,
+ t_hook_callback_command_run *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_command_run *new_hook_command_run;
@@ -906,7 +918,7 @@ hook_command_run (struct t_weechat_plugin *plugin, const char *command,
hook_get_priority_and_name (command, &priority, &ptr_command);
hook_init_data (new_hook, plugin, HOOK_TYPE_COMMAND_RUN, priority,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_command_run;
new_hook_command_run->callback = callback;
@@ -968,9 +980,11 @@ hook_command_run_exec (struct t_gui_buffer *buffer, const char *command)
if (hook_matching)
{
ptr_hook->running = 1;
- rc = (HOOK_COMMAND_RUN(ptr_hook, callback)) (ptr_hook->callback_data,
- buffer,
- ptr_command);
+ rc = (HOOK_COMMAND_RUN(ptr_hook, callback)) (
+ ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
+ buffer,
+ ptr_command);
ptr_hook->running = 0;
if (rc == WEECHAT_RC_OK_EAT)
{
@@ -1055,6 +1069,7 @@ hook_timer_init (struct t_hook *hook)
struct t_hook *
hook_timer (struct t_weechat_plugin *plugin, long interval, int align_second,
int max_calls, t_hook_callback_timer *callback,
+ const void *callback_pointer,
void *callback_data)
{
struct t_hook *new_hook;
@@ -1074,7 +1089,7 @@ hook_timer (struct t_weechat_plugin *plugin, long interval, int align_second,
}
hook_init_data (new_hook, plugin, HOOK_TYPE_TIMER, HOOK_PRIORITY_DEFAULT,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_timer;
new_hook_timer->callback = callback;
@@ -1237,7 +1252,8 @@ hook_timer_exec ()
{
ptr_hook->running = 1;
(void) (HOOK_TIMER(ptr_hook, callback))
- (ptr_hook->callback_data,
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
(HOOK_TIMER(ptr_hook, remaining_calls) > 0) ?
HOOK_TIMER(ptr_hook, remaining_calls) - 1 : -1);
ptr_hook->running = 0;
@@ -1296,7 +1312,9 @@ hook_search_fd (int fd)
struct t_hook *
hook_fd (struct t_weechat_plugin *plugin, int fd, int flag_read,
int flag_write, int flag_exception,
- t_hook_callback_fd *callback, void *callback_data)
+ t_hook_callback_fd *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_fd *new_hook_fd;
@@ -1315,7 +1333,7 @@ hook_fd (struct t_weechat_plugin *plugin, int fd, int flag_read,
}
hook_init_data (new_hook, plugin, HOOK_TYPE_FD, HOOK_PRIORITY_DEFAULT,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_fd;
new_hook_fd->callback = callback;
@@ -1415,8 +1433,10 @@ hook_fd_exec ()
if (found)
{
ptr_hook->running = 1;
- (void) (HOOK_FD(ptr_hook, callback)) (ptr_hook->callback_data,
- HOOK_FD(ptr_hook, fd));
+ (void) (HOOK_FD(ptr_hook, callback)) (
+ ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
+ HOOK_FD(ptr_hook, fd));
ptr_hook->running = 0;
}
}
@@ -1435,9 +1455,12 @@ hook_fd_exec ()
struct t_hook *
hook_process_hashtable (struct t_weechat_plugin *plugin,
- const char *command, struct t_hashtable *options,
+ const char *command,
+ struct t_hashtable *options,
int timeout,
- t_hook_callback_process *callback, void *callback_data)
+ t_hook_callback_process *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_process *new_hook_process;
@@ -1470,7 +1493,7 @@ hook_process_hashtable (struct t_weechat_plugin *plugin,
goto error;
hook_init_data (new_hook, plugin, HOOK_TYPE_PROCESS, HOOK_PRIORITY_DEFAULT,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_process;
new_hook_process->callback = callback;
@@ -1548,11 +1571,14 @@ error:
struct t_hook *
hook_process (struct t_weechat_plugin *plugin,
- const char *command, int timeout,
- t_hook_callback_process *callback, void *callback_data)
+ const char *command,
+ int timeout,
+ t_hook_callback_process *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
return hook_process_hashtable (plugin, command, NULL, timeout,
- callback, callback_data);
+ callback, callback_pointer, callback_data);
}
/*
@@ -1733,7 +1759,8 @@ hook_process_send_buffers (struct t_hook *hook_process, int callback_rc)
/* send buffers to callback */
(void) (HOOK_PROCESS(hook_process, callback))
- (hook_process->callback_data,
+ (hook_process->callback_pointer,
+ hook_process->callback_data,
HOOK_PROCESS(hook_process, command),
callback_rc,
(HOOK_PROCESS(hook_process, buffer_size[HOOK_PROCESS_STDOUT]) > 0) ?
@@ -1801,11 +1828,15 @@ hook_process_child_read (struct t_hook *hook_process, int fd,
*/
int
-hook_process_child_read_stdout_cb (void *arg_hook_process, int fd)
+hook_process_child_read_stdout_cb (const void *pointer, void *data, int fd)
{
struct t_hook *hook_process;
- hook_process = (struct t_hook *)arg_hook_process;
+ /* make C compiler happy */
+ (void) data;
+
+ hook_process = (struct t_hook *)pointer;
+
hook_process_child_read (hook_process, fd, HOOK_PROCESS_STDOUT,
&(HOOK_PROCESS(hook_process, hook_fd[HOOK_PROCESS_STDOUT])));
return WEECHAT_RC_OK;
@@ -1816,11 +1847,15 @@ hook_process_child_read_stdout_cb (void *arg_hook_process, int fd)
*/
int
-hook_process_child_read_stderr_cb (void *arg_hook_process, int fd)
+hook_process_child_read_stderr_cb (const void *pointer, void *data, int fd)
{
struct t_hook *hook_process;
- hook_process = (struct t_hook *)arg_hook_process;
+ /* make C compiler happy */
+ (void) data;
+
+ hook_process = (struct t_hook *)pointer;
+
hook_process_child_read (hook_process, fd, HOOK_PROCESS_STDERR,
&(HOOK_PROCESS(hook_process, hook_fd[HOOK_PROCESS_STDERR])));
return WEECHAT_RC_OK;
@@ -1883,6 +1918,7 @@ hook_process_child_read_until_eof (struct t_hook *hook_process)
{
(void) hook_process_child_read_stdout_cb (
hook_process,
+ NULL,
HOOK_PROCESS(hook_process,
child_read[HOOK_PROCESS_STDOUT]));
}
@@ -1890,6 +1926,7 @@ hook_process_child_read_until_eof (struct t_hook *hook_process)
{
(void) hook_process_child_read_stderr_cb (
hook_process,
+ NULL,
HOOK_PROCESS(hook_process,
child_read[HOOK_PROCESS_STDERR]));
}
@@ -1905,15 +1942,16 @@ hook_process_child_read_until_eof (struct t_hook *hook_process)
*/
int
-hook_process_timer_cb (void *arg_hook_process, int remaining_calls)
+hook_process_timer_cb (const void *pointer, void *data, int remaining_calls)
{
struct t_hook *hook_process;
int status, rc;
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- hook_process = (struct t_hook *)arg_hook_process;
+ hook_process = (struct t_hook *)pointer;
if (hook_process->deleted)
return WEECHAT_RC_OK;
@@ -2007,7 +2045,8 @@ hook_process_run (struct t_hook *hook_process)
/* fork failed */
case -1:
(void) (HOOK_PROCESS(hook_process, callback))
- (hook_process->callback_data,
+ (hook_process->callback_pointer,
+ hook_process->callback_data,
HOOK_PROCESS(hook_process, command),
WEECHAT_HOOK_PROCESS_ERROR,
NULL, NULL);
@@ -2048,7 +2087,7 @@ hook_process_run (struct t_hook *hook_process)
HOOK_PROCESS(hook_process, child_read[HOOK_PROCESS_STDOUT]),
1, 0, 0,
&hook_process_child_read_stdout_cb,
- hook_process);
+ hook_process, NULL);
}
if (HOOK_PROCESS(hook_process, child_read[HOOK_PROCESS_STDERR]) >= 0)
@@ -2058,7 +2097,7 @@ hook_process_run (struct t_hook *hook_process)
HOOK_PROCESS(hook_process, child_read[HOOK_PROCESS_STDERR]),
1, 0, 0,
&hook_process_child_read_stderr_cb,
- hook_process);
+ hook_process, NULL);
}
timeout = HOOK_PROCESS(hook_process, timeout);
@@ -2082,7 +2121,8 @@ hook_process_run (struct t_hook *hook_process)
HOOK_PROCESS(hook_process, hook_timer) = hook_timer (hook_process->plugin,
interval, 0, max_calls,
&hook_process_timer_cb,
- hook_process);
+ hook_process,
+ NULL);
return;
error:
@@ -2094,7 +2134,8 @@ error:
close (pipes[i][1]);
}
(void) (HOOK_PROCESS(hook_process, callback))
- (hook_process->callback_data,
+ (hook_process->callback_pointer,
+ hook_process->callback_data,
HOOK_PROCESS(hook_process, command),
WEECHAT_HOOK_PROCESS_ERROR,
NULL, NULL);
@@ -2112,7 +2153,9 @@ hook_connect (struct t_weechat_plugin *plugin, const char *proxy,
const char *address, int port, int ipv6, int retry,
void *gnutls_sess, void *gnutls_cb, int gnutls_dhkey_size,
const char *gnutls_priorities, const char *local_hostname,
- t_hook_callback_connect *callback, void *callback_data)
+ t_hook_callback_connect *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_connect *new_hook_connect;
@@ -2142,7 +2185,7 @@ hook_connect (struct t_weechat_plugin *plugin, const char *proxy,
}
hook_init_data (new_hook, plugin, HOOK_TYPE_CONNECT, HOOK_PRIORITY_DEFAULT,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_connect;
new_hook_connect->callback = callback;
@@ -2208,7 +2251,9 @@ hook_connect_gnutls_verify_certificates (gnutls_session_t tls_session)
&& (*(HOOK_CONNECT(ptr_hook, gnutls_sess)) == tls_session))
{
rc = (int) (HOOK_CONNECT(ptr_hook, gnutls_cb))
- (ptr_hook->callback_data, tls_session, NULL, 0,
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
+ tls_session, NULL, 0,
NULL, 0, NULL,
WEECHAT_HOOK_CONNECT_GNUTLS_CB_VERIFY_CERT);
break;
@@ -2249,7 +2294,9 @@ hook_connect_gnutls_set_certificates (gnutls_session_t tls_session,
&& (*(HOOK_CONNECT(ptr_hook, gnutls_sess)) == tls_session))
{
rc = (int) (HOOK_CONNECT(ptr_hook, gnutls_cb))
- (ptr_hook->callback_data, tls_session, req_ca, nreq,
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
+ tls_session, req_ca, nreq,
pk_algos, pk_algos_len, answer,
WEECHAT_HOOK_CONNECT_GNUTLS_CB_SET_CERT);
break;
@@ -2270,7 +2317,9 @@ hook_connect_gnutls_set_certificates (gnutls_session_t tls_session,
struct t_hook *
hook_print (struct t_weechat_plugin *plugin, struct t_gui_buffer *buffer,
const char *tags, const char *message, int strip_colors,
- t_hook_callback_print *callback, void *callback_data)
+ t_hook_callback_print *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_print *new_hook_print;
@@ -2291,7 +2340,7 @@ hook_print (struct t_weechat_plugin *plugin, struct t_gui_buffer *buffer,
}
hook_init_data (new_hook, plugin, HOOK_TYPE_PRINT, HOOK_PRIORITY_DEFAULT,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_print;
new_hook_print->callback = callback;
@@ -2375,7 +2424,8 @@ hook_print_exec (struct t_gui_buffer *buffer, struct t_gui_line *line)
/* run callback */
ptr_hook->running = 1;
(void) (HOOK_PRINT(ptr_hook, callback))
- (ptr_hook->callback_data, buffer, line->data->date,
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data, buffer, line->data->date,
line->data->tags_count,
(const char **)line->data->tags_array,
(int)line->data->displayed, (int)line->data->highlight,
@@ -2404,7 +2454,9 @@ hook_print_exec (struct t_gui_buffer *buffer, struct t_gui_line *line)
struct t_hook *
hook_signal (struct t_weechat_plugin *plugin, const char *signal,
- t_hook_callback_signal *callback, void *callback_data)
+ t_hook_callback_signal *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_signal *new_hook_signal;
@@ -2426,7 +2478,7 @@ hook_signal (struct t_weechat_plugin *plugin, const char *signal,
hook_get_priority_and_name (signal, &priority, &ptr_signal);
hook_init_data (new_hook, plugin, HOOK_TYPE_SIGNAL, priority,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_signal;
new_hook_signal->callback = callback;
@@ -2462,7 +2514,11 @@ hook_signal_send (const char *signal, const char *type_data, void *signal_data)
{
ptr_hook->running = 1;
rc = (HOOK_SIGNAL(ptr_hook, callback))
- (ptr_hook->callback_data, signal, type_data, signal_data);
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
+ signal,
+ type_data,
+ signal_data);
ptr_hook->running = 0;
if (rc == WEECHAT_RC_OK_EAT)
@@ -2485,7 +2541,9 @@ hook_signal_send (const char *signal, const char *type_data, void *signal_data)
struct t_hook *
hook_hsignal (struct t_weechat_plugin *plugin, const char *signal,
- t_hook_callback_hsignal *callback, void *callback_data)
+ t_hook_callback_hsignal *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_hsignal *new_hook_hsignal;
@@ -2507,7 +2565,7 @@ hook_hsignal (struct t_weechat_plugin *plugin, const char *signal,
hook_get_priority_and_name (signal, &priority, &ptr_signal);
hook_init_data (new_hook, plugin, HOOK_TYPE_HSIGNAL, priority,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_hsignal;
new_hook_hsignal->callback = callback;
@@ -2543,7 +2601,10 @@ hook_hsignal_send (const char *signal, struct t_hashtable *hashtable)
{
ptr_hook->running = 1;
rc = (HOOK_HSIGNAL(ptr_hook, callback))
- (ptr_hook->callback_data, signal, hashtable);
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
+ signal,
+ hashtable);
ptr_hook->running = 0;
if (rc == WEECHAT_RC_OK_EAT)
@@ -2566,7 +2627,9 @@ hook_hsignal_send (const char *signal, struct t_hashtable *hashtable)
struct t_hook *
hook_config (struct t_weechat_plugin *plugin, const char *option,
- t_hook_callback_config *callback, void *callback_data)
+ t_hook_callback_config *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_config *new_hook_config;
@@ -2588,7 +2651,7 @@ hook_config (struct t_weechat_plugin *plugin, const char *option,
hook_get_priority_and_name (option, &priority, &ptr_option);
hook_init_data (new_hook, plugin, HOOK_TYPE_CONFIG, priority,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_config;
new_hook_config->callback = callback;
@@ -2623,7 +2686,10 @@ hook_config_exec (const char *option, const char *value)
{
ptr_hook->running = 1;
(void) (HOOK_CONFIG(ptr_hook, callback))
- (ptr_hook->callback_data, option, value);
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
+ option,
+ value);
ptr_hook->running = 0;
}
@@ -2642,7 +2708,9 @@ hook_config_exec (const char *option, const char *value)
struct t_hook *
hook_completion (struct t_weechat_plugin *plugin, const char *completion_item,
const char *description,
- t_hook_callback_completion *callback, void *callback_data)
+ t_hook_callback_completion *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_completion *new_hook_completion;
@@ -2665,7 +2733,7 @@ hook_completion (struct t_weechat_plugin *plugin, const char *completion_item,
hook_get_priority_and_name (completion_item, &priority, &ptr_completion_item);
hook_init_data (new_hook, plugin, HOOK_TYPE_COMPLETION, priority,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_completion;
new_hook_completion->callback = callback;
@@ -2731,7 +2799,11 @@ hook_completion_exec (struct t_weechat_plugin *plugin,
{
ptr_hook->running = 1;
(void) (HOOK_COMPLETION(ptr_hook, callback))
- (ptr_hook->callback_data, completion_item, buffer, completion);
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
+ completion_item,
+ buffer,
+ completion);
ptr_hook->running = 0;
}
@@ -2749,7 +2821,9 @@ hook_completion_exec (struct t_weechat_plugin *plugin,
struct t_hook *
hook_modifier (struct t_weechat_plugin *plugin, const char *modifier,
- t_hook_callback_modifier *callback, void *callback_data)
+ t_hook_callback_modifier *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_modifier *new_hook_modifier;
@@ -2771,7 +2845,7 @@ hook_modifier (struct t_weechat_plugin *plugin, const char *modifier,
hook_get_priority_and_name (modifier, &priority, &ptr_modifier);
hook_init_data (new_hook, plugin, HOOK_TYPE_MODIFIER, priority,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_modifier;
new_hook_modifier->callback = callback;
@@ -2820,7 +2894,10 @@ hook_modifier_exec (struct t_weechat_plugin *plugin, const char *modifier,
{
ptr_hook->running = 1;
new_msg = (HOOK_MODIFIER(ptr_hook, callback))
- (ptr_hook->callback_data, modifier, modifier_data,
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
+ modifier,
+ modifier_data,
message_modified);
ptr_hook->running = 0;
@@ -2857,7 +2934,9 @@ hook_modifier_exec (struct t_weechat_plugin *plugin, const char *modifier,
struct t_hook *
hook_info (struct t_weechat_plugin *plugin, const char *info_name,
const char *description, const char *args_description,
- t_hook_callback_info *callback, void *callback_data)
+ t_hook_callback_info *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_info *new_hook_info;
@@ -2878,7 +2957,8 @@ hook_info (struct t_weechat_plugin *plugin, const char *info_name,
}
hook_get_priority_and_name (info_name, &priority, &ptr_info_name);
- hook_init_data (new_hook, plugin, HOOK_TYPE_INFO, priority, callback_data);
+ hook_init_data (new_hook, plugin, HOOK_TYPE_INFO, priority,
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_info;
new_hook_info->callback = callback;
@@ -2924,7 +3004,10 @@ hook_info_get (struct t_weechat_plugin *plugin, const char *info_name,
{
ptr_hook->running = 1;
value = (HOOK_INFO(ptr_hook, callback))
- (ptr_hook->callback_data, info_name, arguments);
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
+ info_name,
+ arguments);
ptr_hook->running = 0;
hook_exec_end ();
@@ -2951,6 +3034,7 @@ hook_info_hashtable (struct t_weechat_plugin *plugin, const char *info_name,
const char *description, const char *args_description,
const char *output_description,
t_hook_callback_info_hashtable *callback,
+ const void *callback_pointer,
void *callback_data)
{
struct t_hook *new_hook;
@@ -2973,7 +3057,7 @@ hook_info_hashtable (struct t_weechat_plugin *plugin, const char *info_name,
hook_get_priority_and_name (info_name, &priority, &ptr_info_name);
hook_init_data (new_hook, plugin, HOOK_TYPE_INFO_HASHTABLE, priority,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_info_hashtable;
new_hook_info_hashtable->callback = callback;
@@ -3021,7 +3105,10 @@ hook_info_get_hashtable (struct t_weechat_plugin *plugin, const char *info_name,
{
ptr_hook->running = 1;
value = (HOOK_INFO_HASHTABLE(ptr_hook, callback))
- (ptr_hook->callback_data, info_name, hashtable);
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
+ info_name,
+ hashtable);
ptr_hook->running = 0;
hook_exec_end ();
@@ -3047,7 +3134,9 @@ struct t_hook *
hook_infolist (struct t_weechat_plugin *plugin, const char *infolist_name,
const char *description, const char *pointer_description,
const char *args_description,
- t_hook_callback_infolist *callback, void *callback_data)
+ t_hook_callback_infolist *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_infolist *new_hook_infolist;
@@ -3069,7 +3158,7 @@ hook_infolist (struct t_weechat_plugin *plugin, const char *infolist_name,
hook_get_priority_and_name (infolist_name, &priority, &ptr_infolist_name);
hook_init_data (new_hook, plugin, HOOK_TYPE_INFOLIST, priority,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_infolist;
new_hook_infolist->callback = callback;
@@ -3117,7 +3206,11 @@ hook_infolist_get (struct t_weechat_plugin *plugin, const char *infolist_name,
{
ptr_hook->running = 1;
value = (HOOK_INFOLIST(ptr_hook, callback))
- (ptr_hook->callback_data, infolist_name, pointer, arguments);
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
+ infolist_name,
+ pointer,
+ arguments);
ptr_hook->running = 0;
hook_exec_end ();
@@ -3142,7 +3235,9 @@ hook_infolist_get (struct t_weechat_plugin *plugin, const char *infolist_name,
struct t_hook *
hook_hdata (struct t_weechat_plugin *plugin, const char *hdata_name,
const char *description,
- t_hook_callback_hdata *callback, void *callback_data)
+ t_hook_callback_hdata *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_hdata *new_hook_hdata;
@@ -3164,7 +3259,7 @@ hook_hdata (struct t_weechat_plugin *plugin, const char *hdata_name,
hook_get_priority_and_name (hdata_name, &priority, &ptr_hdata_name);
hook_init_data (new_hook, plugin, HOOK_TYPE_HDATA, priority,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_hdata;
new_hook_hdata->callback = callback;
@@ -3213,7 +3308,8 @@ hook_hdata_get (struct t_weechat_plugin *plugin, const char *hdata_name)
{
ptr_hook->running = 1;
value = (HOOK_HDATA(ptr_hook, callback))
- (ptr_hook->callback_data,
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
HOOK_HDATA(ptr_hook, hdata_name));
ptr_hook->running = 0;
@@ -3237,8 +3333,11 @@ hook_hdata_get (struct t_weechat_plugin *plugin, const char *hdata_name)
*/
struct t_hook *
-hook_focus (struct t_weechat_plugin *plugin, const char *area,
- t_hook_callback_focus *callback, void *callback_data)
+hook_focus (struct t_weechat_plugin *plugin,
+ const char *area,
+ t_hook_callback_focus *callback,
+ const void *callback_pointer,
+ void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_focus *new_hook_focus;
@@ -3260,7 +3359,7 @@ hook_focus (struct t_weechat_plugin *plugin, const char *area,
hook_get_priority_and_name (area, &priority, &ptr_area);
hook_init_data (new_hook, plugin, HOOK_TYPE_FOCUS, priority,
- callback_data);
+ callback_pointer, callback_data);
new_hook->hook_data = new_hook_focus;
new_hook_focus->callback = callback;
@@ -3276,7 +3375,8 @@ hook_focus (struct t_weechat_plugin *plugin, const char *area,
*/
void
-hook_focus_hashtable_map_cb (void *data, struct t_hashtable *hashtable,
+hook_focus_hashtable_map_cb (void *data,
+ struct t_hashtable *hashtable,
const void *key, const void *value)
{
struct t_hashtable *hashtable1;
@@ -3295,7 +3395,8 @@ hook_focus_hashtable_map_cb (void *data, struct t_hashtable *hashtable,
*/
void
-hook_focus_hashtable_map2_cb (void *data, struct t_hashtable *hashtable,
+hook_focus_hashtable_map2_cb (void *data,
+ struct t_hashtable *hashtable,
const void *key, const void *value)
{
struct t_hashtable *hashtable1;
@@ -3364,7 +3465,9 @@ hook_focus_get_data (struct t_hashtable *hashtable_focus1,
/* run callback for focus #1 */
ptr_hook->running = 1;
hashtable_ret = (HOOK_FOCUS(ptr_hook, callback))
- (ptr_hook->callback_data, hashtable1);
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
+ hashtable1);
ptr_hook->running = 0;
if (hashtable_ret)
{
@@ -3386,7 +3489,9 @@ hook_focus_get_data (struct t_hashtable *hashtable_focus1,
{
ptr_hook->running = 1;
hashtable_ret = (HOOK_FOCUS(ptr_hook, callback))
- (ptr_hook->callback_data, hashtable2);
+ (ptr_hook->callback_pointer,
+ ptr_hook->callback_data,
+ hashtable2);
ptr_hook->running = 0;
if (hashtable_ret)
{
@@ -3410,7 +3515,8 @@ hook_focus_get_data (struct t_hashtable *hashtable_focus1,
if (hashtable2)
{
- hashtable_map (hashtable2, &hook_focus_hashtable_map2_cb, hashtable1);
+ hashtable_map (hashtable2,
+ &hook_focus_hashtable_map2_cb, hashtable1);
hashtable_free (hashtable2);
}
else
@@ -3545,12 +3651,7 @@ unhook (struct t_hook *hook)
plugin_get_name (hook->plugin));
}
- /* free data */
- if (hook->subplugin)
- {
- free (hook->subplugin);
- hook->subplugin = NULL;
- }
+ /* free data specific to the hook */
if (hook->hook_data)
{
switch (hook->type)
@@ -3951,6 +4052,18 @@ unhook (struct t_hook *hook)
hook->hook_data = NULL;
}
+ /* free data common to all hooks */
+ if (hook->subplugin)
+ {
+ free (hook->subplugin);
+ hook->subplugin = NULL;
+ }
+ if (hook->callback_data)
+ {
+ free (hook->callback_data);
+ hook->callback_data = NULL;
+ }
+
/* remove hook from list (if there's no hook exec pending) */
if (hook_exec_recursion == 0)
{
@@ -3965,11 +4078,11 @@ unhook (struct t_hook *hook)
}
/*
- * Unhooks everything for a plugin.
+ * Unhooks everything for a plugin/subplugin.
*/
void
-unhook_all_plugin (struct t_weechat_plugin *plugin)
+unhook_all_plugin (struct t_weechat_plugin *plugin, const char *subplugin)
{
int type;
struct t_hook *ptr_hook, *next_hook;
@@ -3981,7 +4094,14 @@ unhook_all_plugin (struct t_weechat_plugin *plugin)
{
next_hook = ptr_hook->next_hook;
if (ptr_hook->plugin == plugin)
- unhook (ptr_hook);
+ {
+ if (!subplugin
+ || (ptr_hook->subplugin &&
+ strcmp (ptr_hook->subplugin, subplugin) == 0))
+ {
+ unhook (ptr_hook);
+ }
+ }
ptr_hook = next_hook;
}
}
@@ -4045,6 +4165,10 @@ hook_add_to_infolist_pointer (struct t_infolist *infolist, struct t_hook *hook)
return 0;
if (!infolist_new_var_integer (ptr_item, "priority", hook->priority))
return 0;
+ if (!infolist_new_var_pointer (ptr_item, "callback_pointer", (void *)hook->callback_pointer))
+ return 0;
+ if (!infolist_new_var_pointer (ptr_item, "callback_data", (void *)hook->callback_data))
+ return 0;
switch (hook->type)
{
case HOOK_TYPE_COMMAND:
@@ -4521,6 +4645,7 @@ hook_print_log ()
log_printf (" deleted . . . . . . . . : %d", ptr_hook->deleted);
log_printf (" running . . . . . . . . : %d", ptr_hook->running);
log_printf (" priority. . . . . . . . : %d", ptr_hook->priority);
+ log_printf (" callback_pointer. . . . : 0x%lx", ptr_hook->callback_pointer);
log_printf (" callback_data . . . . . : 0x%lx", ptr_hook->callback_data);
if (ptr_hook->deleted)
continue;
diff --git a/src/core/wee-hook.h b/src/core/wee-hook.h
index d0fc10fc3..32e8e2947 100644
--- a/src/core/wee-hook.h
+++ b/src/core/wee-hook.h
@@ -133,6 +133,7 @@ struct t_hook
int deleted; /* hook marked for deletion ? */
int running; /* 1 if hook is currently running */
int priority; /* priority (to sort hooks) */
+ const void *callback_pointer; /* pointer sent to callback */
void *callback_data; /* data sent to callback */
/* hook data (depends on hook type) */
@@ -143,7 +144,8 @@ struct t_hook
/* hook command */
-typedef int (t_hook_callback_command)(void *data, struct t_gui_buffer *buffer,
+typedef int (t_hook_callback_command)(const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol);
struct t_hook_command
@@ -172,7 +174,7 @@ struct t_hook_command
/* hook command run */
-typedef int (t_hook_callback_command_run)(void *data,
+typedef int (t_hook_callback_command_run)(const void *pointer, void *data,
struct t_gui_buffer *buffer,
const char *command);
@@ -184,7 +186,8 @@ struct t_hook_command_run
/* hook timer */
-typedef int (t_hook_callback_timer)(void *data, int remaining_calls);
+typedef int (t_hook_callback_timer)(const void *pointer, void *data,
+ int remaining_calls);
struct t_hook_timer
{
@@ -199,7 +202,7 @@ struct t_hook_timer
/* hook fd */
-typedef int (t_hook_callback_fd)(void *data, int fd);
+typedef int (t_hook_callback_fd)(const void *pointer, void *data, int fd);
struct t_hook_fd
{
@@ -212,9 +215,10 @@ struct t_hook_fd
/* hook process */
-typedef int (t_hook_callback_process)(void *data, const char *command,
- int return_code, const char *out,
- const char *err);
+typedef int (t_hook_callback_process)(const void *pointer, void *data,
+ const char *command,
+ int return_code,
+ const char *out, const char *err);
struct t_hook_process
{
@@ -235,13 +239,14 @@ struct t_hook_process
/* hook connect */
-typedef int (t_hook_callback_connect)(void *data, int status,
- int gnutls_rc, int sock,
+typedef int (t_hook_callback_connect)(const void *pointer, void *data,
+ int status, int gnutls_rc, int sock,
const char *error,
const char *ip_address);
#ifdef HAVE_GNUTLS
-typedef int (gnutls_callback_t)(void *data, gnutls_session_t tls_session,
+typedef int (gnutls_callback_t)(const void *pointer, void *data,
+ gnutls_session_t tls_session,
const gnutls_datum_t *req_ca, int nreq,
const gnutls_pk_algorithm_t *pk_algos,
int pk_algos_len,
@@ -288,7 +293,8 @@ struct t_hook_connect
/* hook print */
-typedef int (t_hook_callback_print)(void *data, struct t_gui_buffer *buffer,
+typedef int (t_hook_callback_print)(const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
time_t date, int tags_count,
const char **tags, int displayed,
int highlight, const char *prefix,
@@ -306,8 +312,9 @@ struct t_hook_print
/* hook signal */
-typedef int (t_hook_callback_signal)(void *data, const char *signal,
- const char *type_data, void *signal_data);
+typedef int (t_hook_callback_signal)(const void *pointer, void *data,
+ const char *signal, const char *type_data,
+ void *signal_data);
struct t_hook_signal
{
@@ -318,7 +325,8 @@ struct t_hook_signal
/* hook hsignal */
-typedef int (t_hook_callback_hsignal)(void *data, const char *signal,
+typedef int (t_hook_callback_hsignal)(const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable);
struct t_hook_hsignal
@@ -330,8 +338,8 @@ struct t_hook_hsignal
/* hook config */
-typedef int (t_hook_callback_config)(void *data, const char *option,
- const char *value);
+typedef int (t_hook_callback_config)(const void *pointer, void *data,
+ const char *option, const char *value);
struct t_hook_config
{
@@ -342,7 +350,7 @@ struct t_hook_config
/* hook completion */
-typedef int (t_hook_callback_completion)(void *data,
+typedef int (t_hook_callback_completion)(const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion);
@@ -356,7 +364,8 @@ struct t_hook_completion
/* hook modifier */
-typedef char *(t_hook_callback_modifier)(void *data, const char *modifier,
+typedef char *(t_hook_callback_modifier)(const void *pointer, void *data,
+ const char *modifier,
const char *modifier_data,
const char *string);
@@ -368,7 +377,8 @@ struct t_hook_modifier
/* hook info */
-typedef const char *(t_hook_callback_info)(void *data, const char *info_name,
+typedef const char *(t_hook_callback_info)(const void *pointer, void *data,
+ const char *info_name,
const char *arguments);
struct t_hook_info
@@ -381,7 +391,8 @@ struct t_hook_info
/* hook info (hashtable) */
-typedef struct t_hashtable *(t_hook_callback_info_hashtable)(void *data,
+typedef struct t_hashtable *(t_hook_callback_info_hashtable)(const void *pointer,
+ void *data,
const char *info_name,
struct t_hashtable *hashtable);
@@ -396,9 +407,10 @@ struct t_hook_info_hashtable
/* hook infolist */
-typedef struct t_infolist *(t_hook_callback_infolist)(void *data,
+typedef struct t_infolist *(t_hook_callback_infolist)(const void *pointer,
+ void *data,
const char *infolist_name,
- void *pointer,
+ void *obj_pointer,
const char *arguments);
struct t_hook_infolist
@@ -412,7 +424,8 @@ struct t_hook_infolist
/* hook hdata */
-typedef struct t_hdata *(t_hook_callback_hdata)(void *data,
+typedef struct t_hdata *(t_hook_callback_hdata)(const void *pointer,
+ void *data,
const char *hdata_name);
struct t_hook_hdata
@@ -424,7 +437,8 @@ struct t_hook_hdata
/* hook focus */
-typedef struct t_hashtable *(t_hook_callback_focus)(void *data,
+typedef struct t_hashtable *(t_hook_callback_focus)(const void *pointer,
+ void *data,
struct t_hashtable *info);
struct t_hook_focus
@@ -452,6 +466,7 @@ extern struct t_hook *hook_command (struct t_weechat_plugin *plugin,
const char *args_description,
const char *completion,
t_hook_callback_command *callback,
+ const void *callback_pointer,
void *callback_data);
extern int hook_command_exec (struct t_gui_buffer *buffer, int any_plugin,
struct t_weechat_plugin *plugin,
@@ -459,6 +474,7 @@ extern int hook_command_exec (struct t_gui_buffer *buffer, int any_plugin,
extern struct t_hook *hook_command_run (struct t_weechat_plugin *plugin,
const char *command,
t_hook_callback_command_run *callback,
+ const void *callback_pointer,
void *callback_data);
extern int hook_command_run_exec (struct t_gui_buffer *buffer,
const char *command);
@@ -466,24 +482,28 @@ extern struct t_hook *hook_timer (struct t_weechat_plugin *plugin,
long interval, int align_second,
int max_calls,
t_hook_callback_timer *callback,
+ const void *callback_pointer,
void *callback_data);
extern void hook_timer_exec ();
extern struct t_hook *hook_fd (struct t_weechat_plugin *plugin, int fd,
int flag_read, int flag_write,
int flag_exception,
t_hook_callback_fd *callback,
+ const void *callback_pointer,
void *callback_data);
extern void hook_fd_exec ();
extern struct t_hook *hook_process (struct t_weechat_plugin *plugin,
const char *command,
int timeout,
t_hook_callback_process *callback,
+ const void *callback_pointer,
void *callback_data);
extern struct t_hook *hook_process_hashtable (struct t_weechat_plugin *plugin,
const char *command,
struct t_hashtable *options,
int timeout,
t_hook_callback_process *callback,
+ const void *callback_pointer,
void *callback_data);
extern struct t_hook *hook_connect (struct t_weechat_plugin *plugin,
const char *proxy, const char *address,
@@ -493,6 +513,7 @@ extern struct t_hook *hook_connect (struct t_weechat_plugin *plugin,
const char *gnutls_priorities,
const char *local_hostname,
t_hook_callback_connect *callback,
+ const void *callback_pointer,
void *callback_data);
#ifdef HAVE_GNUTLS
extern int hook_connect_gnutls_verify_certificates (gnutls_session_t tls_session);
@@ -511,30 +532,35 @@ extern struct t_hook *hook_print (struct t_weechat_plugin *plugin,
const char *tags, const char *message,
int strip_colors,
t_hook_callback_print *callback,
+ const void *callback_pointer,
void *callback_data);
extern void hook_print_exec (struct t_gui_buffer *buffer,
struct t_gui_line *line);
extern struct t_hook *hook_signal (struct t_weechat_plugin *plugin,
const char *signal,
t_hook_callback_signal *callback,
+ const void *callback_pointer,
void *callback_data);
extern int hook_signal_send (const char *signal, const char *type_data,
void *signal_data);
extern struct t_hook *hook_hsignal (struct t_weechat_plugin *plugin,
const char *signal,
t_hook_callback_hsignal *callback,
+ const void *callback_pointer,
void *callback_data);
extern int hook_hsignal_send (const char *signal,
struct t_hashtable *hashtable);
extern struct t_hook *hook_config (struct t_weechat_plugin *plugin,
const char *option,
t_hook_callback_config *callback,
+ const void *callback_pointer,
void *callback_data);
extern void hook_config_exec (const char *option, const char *value);
extern struct t_hook *hook_completion (struct t_weechat_plugin *plugin,
const char *completion_item,
const char *description,
t_hook_callback_completion *callback,
+ const void *callback_pointer,
void *callback_data);
extern const char *hook_completion_get_string (struct t_gui_completion *completion,
const char *property);
@@ -548,6 +574,7 @@ extern void hook_completion_exec (struct t_weechat_plugin *plugin,
extern struct t_hook *hook_modifier (struct t_weechat_plugin *plugin,
const char *modifier,
t_hook_callback_modifier *callback,
+ const void *callback_pointer,
void *callback_data);
extern char *hook_modifier_exec (struct t_weechat_plugin *plugin,
const char *modifier,
@@ -558,6 +585,7 @@ extern struct t_hook *hook_info (struct t_weechat_plugin *plugin,
const char *description,
const char *args_description,
t_hook_callback_info *callback,
+ const void *callback_pointer,
void *callback_data);
extern const char *hook_info_get (struct t_weechat_plugin *plugin,
const char *info_name,
@@ -568,6 +596,7 @@ extern struct t_hook *hook_info_hashtable (struct t_weechat_plugin *plugin,
const char *args_description,
const char *output_description,
t_hook_callback_info_hashtable *callback,
+ const void *callback_pointer,
void *callback_data);
extern struct t_hashtable *hook_info_get_hashtable (struct t_weechat_plugin *plugin,
const char *info_name,
@@ -578,6 +607,7 @@ extern struct t_hook *hook_infolist (struct t_weechat_plugin *plugin,
const char *pointer_description,
const char *args_description,
t_hook_callback_infolist *callback,
+ const void *callback_pointer,
void *callback_data);
extern struct t_infolist *hook_infolist_get (struct t_weechat_plugin *plugin,
const char *infolist_name,
@@ -587,19 +617,22 @@ extern struct t_hook *hook_hdata (struct t_weechat_plugin *plugin,
const char *hdata_name,
const char *description,
t_hook_callback_hdata *callback,
+ const void *callback_pointer,
void *callback_data);
extern struct t_hdata *hook_hdata_get (struct t_weechat_plugin *plugin,
const char *hdata_name);
extern struct t_hook *hook_focus (struct t_weechat_plugin *plugin,
const char *area,
t_hook_callback_focus *callback,
+ const void *callback_pointer,
void *callback_data);
extern struct t_hashtable *hook_focus_get_data (struct t_hashtable *hashtable_focus1,
struct t_hashtable *hashtable_focus2);
extern void hook_set (struct t_hook *hook, const char *property,
const char *value);
extern void unhook (struct t_hook *hook);
-extern void unhook_all_plugin (struct t_weechat_plugin *plugin);
+extern void unhook_all_plugin (struct t_weechat_plugin *plugin,
+ const char *subplugin);
extern void unhook_all ();
extern int hook_add_to_infolist (struct t_infolist *infolist,
struct t_hook *hook,
diff --git a/src/core/wee-input.c b/src/core/wee-input.c
index 8927d55d4..7be24b810 100644
--- a/src/core/wee-input.c
+++ b/src/core/wee-input.c
@@ -48,7 +48,8 @@ input_exec_data (struct t_gui_buffer *buffer, const char *data)
{
if (buffer->input_callback)
{
- (void)(buffer->input_callback) (buffer->input_callback_data,
+ (void)(buffer->input_callback) (buffer->input_callback_pointer,
+ buffer->input_callback_data,
buffer,
data);
}
diff --git a/src/core/wee-network.c b/src/core/wee-network.c
index d68bbefcd..f9ced9c03 100644
--- a/src/core/wee-network.c
+++ b/src/core/wee-network.c
@@ -1233,19 +1233,22 @@ end:
*/
int
-network_connect_child_timer_cb (void *arg_hook_connect, int remaining_calls)
+network_connect_child_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
struct t_hook *hook_connect;
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- hook_connect = (struct t_hook *)arg_hook_connect;
+ hook_connect = (struct t_hook *)pointer;
HOOK_CONNECT(hook_connect, hook_child_timer) = NULL;
(void) (HOOK_CONNECT(hook_connect, callback))
- (hook_connect->callback_data,
+ (hook_connect->callback_pointer,
+ hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_TIMEOUT,
0, -1, NULL, NULL);
unhook (hook_connect);
@@ -1262,15 +1265,17 @@ network_connect_child_timer_cb (void *arg_hook_connect, int remaining_calls)
#ifdef HAVE_GNUTLS
int
-network_connect_gnutls_handshake_fd_cb (void *arg_hook_connect, int fd)
+network_connect_gnutls_handshake_fd_cb (const void *pointer, void *data,
+ int fd)
{
struct t_hook *hook_connect;
int rc, direction, flags;
/* make C compiler happy */
+ (void) data;
(void) fd;
- hook_connect = (struct t_hook *)arg_hook_connect;
+ hook_connect = (struct t_hook *)pointer;
rc = gnutls_handshake (*HOOK_CONNECT(hook_connect, gnutls_sess));
@@ -1290,7 +1295,8 @@ network_connect_gnutls_handshake_fd_cb (void *arg_hook_connect, int fd)
else if (rc != GNUTLS_E_SUCCESS)
{
(void) (HOOK_CONNECT(hook_connect, callback))
- (hook_connect->callback_data,
+ (hook_connect->callback_pointer,
+ hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR, rc,
HOOK_CONNECT(hook_connect, sock),
gnutls_strerror (rc),
@@ -1321,10 +1327,11 @@ network_connect_gnutls_handshake_fd_cb (void *arg_hook_connect, int fd)
#endif /* LIBGNUTLS_VERSION_NUMBER < 0x02090a */
unhook (HOOK_CONNECT(hook_connect, handshake_hook_fd));
(void) (HOOK_CONNECT(hook_connect, callback))
- (hook_connect->callback_data,
- WEECHAT_HOOK_CONNECT_OK, 0,
- HOOK_CONNECT(hook_connect, sock),
- NULL, HOOK_CONNECT(hook_connect, handshake_ip_address));
+ (hook_connect->callback_pointer,
+ hook_connect->callback_data,
+ WEECHAT_HOOK_CONNECT_OK, 0,
+ HOOK_CONNECT(hook_connect, sock),
+ NULL, HOOK_CONNECT(hook_connect, handshake_ip_address));
unhook (hook_connect);
}
@@ -1338,25 +1345,28 @@ network_connect_gnutls_handshake_fd_cb (void *arg_hook_connect, int fd)
#ifdef HAVE_GNUTLS
int
-network_connect_gnutls_handshake_timer_cb (void *arg_hook_connect,
+network_connect_gnutls_handshake_timer_cb (const void *pointer,
+ void *data,
int remaining_calls)
{
struct t_hook *hook_connect;
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- hook_connect = (struct t_hook *)arg_hook_connect;
+ hook_connect = (struct t_hook *)pointer;
HOOK_CONNECT(hook_connect, handshake_hook_timer) = NULL;
(void) (HOOK_CONNECT(hook_connect, callback))
- (hook_connect->callback_data,
- WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR,
- GNUTLS_E_EXPIRED,
- HOOK_CONNECT(hook_connect, sock),
- gnutls_strerror (GNUTLS_E_EXPIRED),
- HOOK_CONNECT(hook_connect, handshake_ip_address));
+ (hook_connect->callback_pointer,
+ hook_connect->callback_data,
+ WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR,
+ GNUTLS_E_EXPIRED,
+ HOOK_CONNECT(hook_connect, sock),
+ gnutls_strerror (GNUTLS_E_EXPIRED),
+ HOOK_CONNECT(hook_connect, handshake_ip_address));
unhook (hook_connect);
return WEECHAT_RC_OK;
@@ -1368,7 +1378,7 @@ network_connect_gnutls_handshake_timer_cb (void *arg_hook_connect,
*/
int
-network_connect_child_read_cb (void *arg_hook_connect, int fd)
+network_connect_child_read_cb (const void *pointer, void *data, int fd)
{
struct t_hook *hook_connect;
char buffer[1], buf_size[6], *cb_error, *cb_ip_address, *error;
@@ -1389,9 +1399,10 @@ network_connect_child_read_cb (void *arg_hook_connect, int fd)
#endif /* HOOK_CONNECT_MAX_SOCKETS */
/* make C compiler happy */
+ (void) data;
(void) fd;
- hook_connect = (struct t_hook *)arg_hook_connect;
+ hook_connect = (struct t_hook *)pointer;
cb_error = NULL;
cb_ip_address = NULL;
@@ -1507,19 +1518,20 @@ network_connect_child_read_cb (void *arg_hook_connect, int fd)
HOOK_CONNECT(hook_connect, sock),
(!direction ? 1 : 0), (direction ? 1 : 0), 0,
&network_connect_gnutls_handshake_fd_cb,
- hook_connect);
+ hook_connect, NULL);
HOOK_CONNECT(hook_connect, handshake_hook_timer) =
hook_timer (hook_connect->plugin,
CONFIG_INTEGER(config_network_gnutls_handshake_timeout) * 1000,
0, 1,
&network_connect_gnutls_handshake_timer_cb,
- hook_connect);
+ hook_connect, NULL);
return WEECHAT_RC_OK;
}
else if (rc != GNUTLS_E_SUCCESS)
{
(void) (HOOK_CONNECT(hook_connect, callback))
- (hook_connect->callback_data,
+ (hook_connect->callback_pointer,
+ hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR,
rc, sock,
gnutls_strerror (rc),
@@ -1583,14 +1595,18 @@ network_connect_child_read_cb (void *arg_hook_connect, int fd)
}
}
(void) (HOOK_CONNECT(hook_connect, callback))
- (hook_connect->callback_data, buffer[0] - '0', 0,
+ (hook_connect->callback_pointer,
+ hook_connect->callback_data,
+ buffer[0] - '0', 0,
sock, cb_error, cb_ip_address);
unhook (hook_connect);
}
else
{
(void) (HOOK_CONNECT(hook_connect, callback))
- (hook_connect->callback_data, WEECHAT_HOOK_CONNECT_MEMORY_ERROR,
+ (hook_connect->callback_pointer,
+ hook_connect->callback_data,
+ WEECHAT_HOOK_CONNECT_MEMORY_ERROR,
0, sock, cb_error, cb_ip_address);
unhook (hook_connect);
}
@@ -1628,7 +1644,8 @@ network_connect_with_fork (struct t_hook *hook_connect)
if (gnutls_init (HOOK_CONNECT(hook_connect, gnutls_sess), GNUTLS_CLIENT) != GNUTLS_E_SUCCESS)
{
(void) (HOOK_CONNECT(hook_connect, callback))
- (hook_connect->callback_data,
+ (hook_connect->callback_pointer,
+ hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR,
0, -1, NULL, NULL);
unhook (hook_connect);
@@ -1641,7 +1658,8 @@ network_connect_with_fork (struct t_hook *hook_connect)
if (rc != GNUTLS_E_SUCCESS)
{
(void) (HOOK_CONNECT(hook_connect, callback))
- (hook_connect->callback_data,
+ (hook_connect->callback_pointer,
+ hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR,
0, -1, _("set server name indication (SNI) failed"), NULL);
unhook (hook_connect);
@@ -1653,7 +1671,8 @@ network_connect_with_fork (struct t_hook *hook_connect)
if (rc != GNUTLS_E_SUCCESS)
{
(void) (HOOK_CONNECT(hook_connect, callback))
- (hook_connect->callback_data,
+ (hook_connect->callback_pointer,
+ hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR,
0, -1, _("invalid priorities"), NULL);
unhook (hook_connect);
@@ -1671,7 +1690,8 @@ network_connect_with_fork (struct t_hook *hook_connect)
if (pipe (child_pipe) < 0)
{
(void) (HOOK_CONNECT(hook_connect, callback))
- (hook_connect->callback_data,
+ (hook_connect->callback_pointer,
+ hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_MEMORY_ERROR,
0, -1, NULL, NULL);
unhook (hook_connect);
@@ -1685,7 +1705,8 @@ network_connect_with_fork (struct t_hook *hook_connect)
if (socketpair (AF_LOCAL, SOCK_DGRAM, 0, child_socket) < 0)
{
(void) (HOOK_CONNECT(hook_connect, callback))
- (hook_connect->callback_data,
+ (hook_connect->callback_pointer,
+ hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_MEMORY_ERROR,
0, -1, NULL, NULL);
unhook (hook_connect);
@@ -1706,7 +1727,8 @@ network_connect_with_fork (struct t_hook *hook_connect)
/* fork failed */
case -1:
(void) (HOOK_CONNECT(hook_connect, callback))
- (hook_connect->callback_data,
+ (hook_connect->callback_pointer,
+ hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_MEMORY_ERROR,
0, -1, NULL, NULL);
unhook (hook_connect);
@@ -1734,10 +1756,11 @@ network_connect_with_fork (struct t_hook *hook_connect)
CONFIG_INTEGER(config_network_connection_timeout) * 1000,
0, 1,
&network_connect_child_timer_cb,
- hook_connect);
+ hook_connect,
+ NULL);
HOOK_CONNECT(hook_connect, hook_fd) = hook_fd (hook_connect->plugin,
HOOK_CONNECT(hook_connect, child_read),
1, 0, 0,
&network_connect_child_read_cb,
- hook_connect);
+ hook_connect, NULL);
}
diff --git a/src/core/wee-proxy.c b/src/core/wee-proxy.c
index d9aa3183b..df24dffb3 100644
--- a/src/core/wee-proxy.c
+++ b/src/core/wee-proxy.c
@@ -308,7 +308,7 @@ proxy_create_option (const char *proxy_name, int index_option,
option_name, "integer",
N_("proxy type (http (default), socks4, socks5)"),
"http|socks4|socks5", 0, 0, value, NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
break;
case PROXY_OPTION_IPV6:
ptr_option = config_file_new_option (
@@ -316,7 +316,7 @@ proxy_create_option (const char *proxy_name, int index_option,
option_name, "boolean",
N_("connect to proxy using ipv6"),
NULL, 0, 0, value, NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
break;
case PROXY_OPTION_ADDRESS:
ptr_option = config_file_new_option (
@@ -324,7 +324,7 @@ proxy_create_option (const char *proxy_name, int index_option,
option_name, "string",
N_("proxy server address (IP or hostname)"),
NULL, 0, 0, value, NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
break;
case PROXY_OPTION_PORT:
ptr_option = config_file_new_option (
@@ -332,7 +332,7 @@ proxy_create_option (const char *proxy_name, int index_option,
option_name, "integer",
N_("port for connecting to proxy server"),
NULL, 0, 65535, value, NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
break;
case PROXY_OPTION_USERNAME:
ptr_option = config_file_new_option (
@@ -341,7 +341,7 @@ proxy_create_option (const char *proxy_name, int index_option,
N_("username for proxy server "
"(note: content is evaluated, see /help eval)"),
NULL, 0, 0, value, NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
break;
case PROXY_OPTION_PASSWORD:
ptr_option = config_file_new_option (
@@ -350,7 +350,7 @@ proxy_create_option (const char *proxy_name, int index_option,
N_("password for proxy server "
"(note: content is evaluated, see /help eval)"),
NULL, 0, 0, value, NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
break;
case PROXY_NUM_OPTIONS:
break;
@@ -621,11 +621,13 @@ proxy_free_all ()
*/
struct t_hdata *
-proxy_hdata_proxy_cb (void *data, const char *hdata_name)
+proxy_hdata_proxy_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_proxy", "next_proxy",
diff --git a/src/core/wee-proxy.h b/src/core/wee-proxy.h
index 732d6d876..92574a400 100644
--- a/src/core/wee-proxy.h
+++ b/src/core/wee-proxy.h
@@ -82,7 +82,9 @@ extern struct t_proxy *proxy_new (const char *name,
extern void proxy_use_temp_proxies ();
extern void proxy_free (struct t_proxy *proxy);
extern void proxy_free_all ();
-extern struct t_hdata *proxy_hdata_proxy_cb (void *data, const char *hdata_name);
+extern struct t_hdata *proxy_hdata_proxy_cb (const void *pointer,
+ void *data,
+ const char *hdata_name);
extern int proxy_add_to_infolist (struct t_infolist *infolist,
struct t_proxy *proxy);
extern void proxy_print_log ();
diff --git a/src/core/wee-secure.c b/src/core/wee-secure.c
index 4931dd06d..d64e201ea 100644
--- a/src/core/wee-secure.c
+++ b/src/core/wee-secure.c
@@ -657,13 +657,14 @@ secure_get_passphrase_from_file (const char *filename)
*/
int
-secure_check_crypt_passphrase_file (void *data,
+secure_check_crypt_passphrase_file (const void *pointer, void *data,
struct t_config_option *option,
const char *value)
{
char *passphrase;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -696,9 +697,11 @@ secure_check_crypt_passphrase_file (void *data,
*/
int
-secure_reload_cb (void *data, struct t_config_file *config_file)
+secure_reload_cb (const void *pointer, void *data,
+ struct t_config_file *config_file)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (secure_hashtable_data_encrypted->items_count > 0)
@@ -724,7 +727,7 @@ secure_reload_cb (void *data, struct t_config_file *config_file)
*/
int
-secure_data_read_cb (void *data,
+secure_data_read_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
@@ -733,6 +736,7 @@ secure_data_read_cb (void *data,
int length_buffer, length_decrypted, rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -924,10 +928,12 @@ secure_data_write_map_encrypted_cb (void *data,
*/
int
-secure_data_write_cb (void *data, struct t_config_file *config_file,
+secure_data_write_cb (const void *pointer, void *data,
+ struct t_config_file *config_file,
const char *section_name)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
/* write name of section */
@@ -983,15 +989,18 @@ secure_init_options ()
struct t_config_section *ptr_section;
secure_config_file = config_file_new (NULL, SECURE_CONFIG_NAME,
- &secure_reload_cb, NULL);
+ &secure_reload_cb, NULL, NULL);
if (!secure_config_file)
return 0;
/* crypt */
ptr_section = config_file_new_section (secure_config_file, "crypt",
0, 0,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
config_file_free (secure_config_file);
@@ -1004,13 +1013,13 @@ secure_init_options ()
N_("cipher used to crypt data (the number after algorithm is the size "
"of the key in bits)"),
"aes128|aes192|aes256", 0, 0, "aes256", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
secure_config_crypt_hash_algo = config_file_new_option (
secure_config_file, ptr_section,
"hash_algo", "integer",
N_("hash algorithm used to check the decrypted data"),
"sha224|sha256|sha384|sha512", 0, 0, "sha256", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
secure_config_crypt_passphrase_file = config_file_new_option (
secure_config_file, ptr_section,
"passphrase_file", "string",
@@ -1023,7 +1032,9 @@ secure_init_options ()
"outside WeeChat home (for example in your home); example: "
"\"~/.weechat-passphrase\""),
NULL, 0, 0, "", NULL, 0,
- &secure_check_crypt_passphrase_file, NULL, NULL, NULL, NULL, NULL);
+ &secure_check_crypt_passphrase_file, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
secure_config_crypt_salt = config_file_new_option (
secure_config_file, ptr_section,
"salt", "boolean",
@@ -1032,15 +1043,18 @@ secure_init_options ()
"file sec.conf will be different on each write of the file; if you "
"put the file sec.conf in a version control system, then you "
"can turn off this option to have always same content in file"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* data */
- ptr_section = config_file_new_section (secure_config_file, "data",
- 0, 0,
- &secure_data_read_cb, NULL,
- &secure_data_write_cb, NULL,
- &secure_data_write_cb, NULL,
- NULL, NULL, NULL, NULL);
+ ptr_section = config_file_new_section (
+ secure_config_file, "data",
+ 0, 0,
+ &secure_data_read_cb, NULL, NULL,
+ &secure_data_write_cb, NULL, NULL,
+ &secure_data_write_cb, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
config_file_free (secure_config_file);
@@ -1079,16 +1093,14 @@ secure_init ()
secure_hashtable_data = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (!secure_hashtable_data)
return 0;
secure_hashtable_data_encrypted = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (!secure_hashtable_data_encrypted)
{
hashtable_free (secure_hashtable_data);
@@ -1264,10 +1276,12 @@ secure_buffer_display ()
*/
int
-secure_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
+secure_buffer_input_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (string_strcasecmp (input_data, "q") == 0)
@@ -1283,9 +1297,11 @@ secure_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-secure_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+secure_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -1322,8 +1338,8 @@ secure_buffer_open ()
if (!secure_buffer)
{
secure_buffer = gui_buffer_new (NULL, SECURE_BUFFER_NAME,
- &secure_buffer_input_cb, NULL,
- &secure_buffer_close_cb, NULL);
+ &secure_buffer_input_cb, NULL, NULL,
+ &secure_buffer_close_cb, NULL, NULL);
if (secure_buffer)
{
if (!secure_buffer->short_name)
diff --git a/src/core/wee-upgrade-file.c b/src/core/wee-upgrade-file.c
index 4623c340f..07b2d88d4 100644
--- a/src/core/wee-upgrade-file.c
+++ b/src/core/wee-upgrade-file.c
@@ -184,7 +184,14 @@ upgrade_file_write_buffer (struct t_upgrade_file *upgrade_file, void *pointer,
*/
struct t_upgrade_file *
-upgrade_file_new (const char *filename, int write)
+upgrade_file_new (const char *filename,
+ int (*callback_read)(const void *pointer,
+ void *data,
+ struct t_upgrade_file *upgrade_file,
+ int object_id,
+ struct t_infolist *infolist),
+ const void *callback_read_pointer,
+ void *callback_read_data)
{
int length;
struct t_upgrade_file *new_upgrade_file;
@@ -205,12 +212,15 @@ upgrade_file_new (const char *filename, int write)
}
snprintf (new_upgrade_file->filename, length, "%s/%s.upgrade",
weechat_home, filename);
+ new_upgrade_file->callback_read = callback_read;
+ new_upgrade_file->callback_read_pointer = callback_read_pointer;
+ new_upgrade_file->callback_read_data = callback_read_data;
/* open file in read or write mode */
- if (write)
- new_upgrade_file->file = fopen (new_upgrade_file->filename, "wb");
- else
+ if (callback_read)
new_upgrade_file->file = fopen (new_upgrade_file->filename, "rb");
+ else
+ new_upgrade_file->file = fopen (new_upgrade_file->filename, "wb");
if (!new_upgrade_file->file)
{
@@ -220,7 +230,7 @@ upgrade_file_new (const char *filename, int write)
}
/* change permissions if write mode */
- if (write)
+ if (!callback_read)
{
chmod (new_upgrade_file->filename, 0600);
@@ -241,6 +251,7 @@ upgrade_file_new (const char *filename, int write)
upgrade_files = new_upgrade_file;
last_upgrade_file = new_upgrade_file;
}
+
return new_upgrade_file;
}
@@ -704,11 +715,15 @@ upgrade_file_read_object (struct t_upgrade_file *upgrade_file)
if (upgrade_file->callback_read)
{
- if ((int)(upgrade_file->callback_read) (upgrade_file->callback_read_data,
- upgrade_file,
- object_id,
- infolist) == WEECHAT_RC_ERROR)
+ if ((int)(upgrade_file->callback_read) (
+ upgrade_file->callback_read_pointer,
+ upgrade_file->callback_read_data,
+ upgrade_file,
+ object_id,
+ infolist) == WEECHAT_RC_ERROR)
+ {
rc = 0;
+ }
}
end:
@@ -733,21 +748,13 @@ end:
*/
int
-upgrade_file_read (struct t_upgrade_file *upgrade_file,
- int (*callback_read)(void *data,
- struct t_upgrade_file *upgrade_file,
- int object_id,
- struct t_infolist *infolist),
- void *callback_read_data)
+upgrade_file_read (struct t_upgrade_file *upgrade_file)
{
char *signature;
- if (!upgrade_file)
+ if (!upgrade_file || !upgrade_file->callback_read)
return 0;
- upgrade_file->callback_read = callback_read;
- upgrade_file->callback_read_data = callback_read_data;
-
signature = NULL;
if (!upgrade_file_read_string (upgrade_file, &signature))
{
@@ -776,12 +783,31 @@ upgrade_file_read (struct t_upgrade_file *upgrade_file,
}
/*
- * Closes an upgrade file.
+ * Closes and frees an upgrade file.
*/
void
upgrade_file_close (struct t_upgrade_file *upgrade_file)
{
- if (upgrade_file && upgrade_file->file)
+ if (!upgrade_file)
+ return;
+
+ if (upgrade_file->filename)
+ free (upgrade_file->filename);
+ if (upgrade_file->file)
fclose (upgrade_file->file);
+ if (upgrade_file->callback_read_data)
+ free (upgrade_file->callback_read_data);
+
+ /* remove upgrade file list */
+ if (upgrade_file->prev_upgrade)
+ (upgrade_file->prev_upgrade)->next_upgrade = upgrade_file->next_upgrade;
+ if (upgrade_file->next_upgrade)
+ (upgrade_file->next_upgrade)->prev_upgrade = upgrade_file->prev_upgrade;
+ if (upgrade_files == upgrade_file)
+ upgrade_files = upgrade_file->next_upgrade;
+ if (last_upgrade_file == upgrade_file)
+ last_upgrade_file = upgrade_file->prev_upgrade;
+
+ free (upgrade_file);
}
diff --git a/src/core/wee-upgrade-file.h b/src/core/wee-upgrade-file.h
index 5ad2139b3..eb0cd7d14 100644
--- a/src/core/wee-upgrade-file.h
+++ b/src/core/wee-upgrade-file.h
@@ -41,26 +41,29 @@ struct t_upgrade_file
long last_read_pos; /* last read position */
int last_read_length; /* last read length */
int (*callback_read) /* callback called when reading */
- (void *data, /* file */
+ (const void *pointer, /* file */
+ void *data,
struct t_upgrade_file *upgrade_file,
int object_id,
struct t_infolist *infolist);
+ const void *callback_read_pointer; /* pointer sent to callback */
void *callback_read_data; /* data sent to callback */
struct t_upgrade_file *prev_upgrade; /* link to previous upgrade file */
struct t_upgrade_file *next_upgrade; /* link to next upgrade file */
};
extern struct t_upgrade_file *upgrade_file_new (const char *filename,
- int write);
+ int (*callback_read)(const void *pointer,
+ void *data,
+ struct t_upgrade_file *upgrade_file,
+ int object_id,
+ struct t_infolist *infolist),
+ const void *callback_read_pointer,
+ void *callback_read_data);
extern int upgrade_file_write_object (struct t_upgrade_file *upgrade_file,
int object_id,
struct t_infolist *infolist);
-extern int upgrade_file_read (struct t_upgrade_file *upgrade_file,
- int (*callback_read)(void *data,
- struct t_upgrade_file *upgrade_file,
- int object_id,
- struct t_infolist *infolist),
- void *callback_read_data);
+extern int upgrade_file_read (struct t_upgrade_file *upgrade_file);
extern void upgrade_file_close (struct t_upgrade_file *upgrade_file);
#endif /* WEECHAT_UPGRADE_FILE_H */
diff --git a/src/core/wee-upgrade.c b/src/core/wee-upgrade.c
index fb3a33b20..00776a63a 100644
--- a/src/core/wee-upgrade.c
+++ b/src/core/wee-upgrade.c
@@ -379,7 +379,8 @@ upgrade_weechat_save ()
int rc;
struct t_upgrade_file *upgrade_file;
- upgrade_file = upgrade_file_new (WEECHAT_UPGRADE_FILENAME, 1);
+ upgrade_file = upgrade_file_new (WEECHAT_UPGRADE_FILENAME,
+ NULL, NULL, NULL);
if (!upgrade_file)
return 0;
@@ -425,8 +426,8 @@ upgrade_weechat_read_buffer (struct t_infolist *infolist)
upgrade_current_buffer = gui_buffer_new (NULL,
infolist_string (infolist,
"name"),
- NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
}
if (!upgrade_current_buffer)
return;
@@ -760,12 +761,13 @@ upgrade_weechat_read_hotlist (struct t_infolist *infolist)
*/
int
-upgrade_weechat_read_cb (void *data,
+upgrade_weechat_read_cb (const void *pointer, void *data,
struct t_upgrade_file *upgrade_file,
int object_id,
struct t_infolist *infolist)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) upgrade_file;
@@ -834,10 +836,13 @@ upgrade_weechat_load ()
upgrade_layout = gui_layout_alloc (GUI_LAYOUT_UPGRADE);
- upgrade_file = upgrade_file_new (WEECHAT_UPGRADE_FILENAME, 0);
+ upgrade_file = upgrade_file_new (WEECHAT_UPGRADE_FILENAME,
+ &upgrade_weechat_read_cb, NULL, NULL);
if (!upgrade_file)
return 0;
- rc = upgrade_file_read (upgrade_file, &upgrade_weechat_read_cb, NULL);
+
+ rc = upgrade_file_read (upgrade_file);
+
upgrade_file_close (upgrade_file);
if (!hotlist_reset)
@@ -903,8 +908,7 @@ upgrade_weechat_end ()
/* remove .upgrade files */
util_exec_on_files (weechat_home,
0,
- NULL,
- &upgrade_weechat_remove_file_cb);
+ &upgrade_weechat_remove_file_cb, NULL);
/* display message for end of /upgrade with duration */
gettimeofday (&tv_now, NULL);
diff --git a/src/core/wee-util.c b/src/core/wee-util.c
index f3c6c7a88..51c553e81 100644
--- a/src/core/wee-util.c
+++ b/src/core/wee-util.c
@@ -484,8 +484,9 @@ util_mkdir_parents (const char *directory, int mode)
*/
void
-util_exec_on_files (const char *directory, int hidden_files, void *data,
- void (*callback)(void *data, const char *filename))
+util_exec_on_files (const char *directory, int hidden_files,
+ void (*callback)(void *data, const char *filename),
+ void *callback_data)
{
char complete_filename[1024];
DIR *dir;
@@ -507,7 +508,7 @@ util_exec_on_files (const char *directory, int hidden_files, void *data,
lstat (complete_filename, &statbuf);
if (!S_ISDIR(statbuf.st_mode))
{
- (*callback) (data, complete_filename);
+ (*callback) (callback_data, complete_filename);
}
}
}
diff --git a/src/core/wee-util.h b/src/core/wee-util.h
index ed4b8e042..47a24575f 100644
--- a/src/core/wee-util.h
+++ b/src/core/wee-util.h
@@ -45,9 +45,9 @@ extern int util_mkdir_home (const char *directory, int mode);
extern int util_mkdir (const char *directory, int mode);
extern int util_mkdir_parents (const char *directory, int mode);
extern void util_exec_on_files (const char *directory, int hidden_files,
- void *data,
void (*callback)(void *data,
- const char *filename));
+ const char *filename),
+ void *callback_data);
extern char *util_search_full_lib_name (const char *filename,
const char *sys_directory);
extern char *util_file_get_content (const char *filename);
diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c
index e6f9b86fc..340efccb0 100644
--- a/src/gui/curses/gui-curses-color.c
+++ b/src/gui/curses/gui-curses-color.c
@@ -351,9 +351,11 @@ error:
*/
int
-gui_color_timer_warning_pairs_full (void *data, int remaining_calls)
+gui_color_timer_warning_pairs_full (const void *pointer, void *data,
+ int remaining_calls)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) remaining_calls;
@@ -402,7 +404,7 @@ gui_color_get_pair (int fg, int bg)
{
/* display warning if auto reset of pairs is disabled */
hook_timer (NULL, 1, 0, 1,
- &gui_color_timer_warning_pairs_full, NULL);
+ &gui_color_timer_warning_pairs_full, NULL, NULL);
gui_color_warning_pairs_full = 1;
}
return 1;
@@ -1034,9 +1036,10 @@ gui_color_buffer_display ()
*/
int
-gui_color_timer_cb (void *data, int remaining_calls)
+gui_color_timer_cb (const void *pointer, void *data, int remaining_calls)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) remaining_calls;
@@ -1101,7 +1104,7 @@ gui_color_switch_colors ()
if (gui_color_use_term_colors)
{
gui_color_hook_timer = hook_timer (NULL, 1000, 0, 0,
- &gui_color_timer_cb, NULL);
+ &gui_color_timer_cb, NULL, NULL);
}
}
@@ -1132,10 +1135,12 @@ gui_color_reset_pairs ()
*/
int
-gui_color_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
+gui_color_buffer_input_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (string_strcasecmp (input_data, "e") == 0)
@@ -1164,9 +1169,11 @@ gui_color_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-gui_color_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+gui_color_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -1203,9 +1210,10 @@ gui_color_buffer_open ()
{
if (!gui_color_buffer)
{
- gui_color_buffer = gui_buffer_new (NULL, GUI_COLOR_BUFFER_NAME,
- &gui_color_buffer_input_cb, NULL,
- &gui_color_buffer_close_cb, NULL);
+ gui_color_buffer = gui_buffer_new (
+ NULL, GUI_COLOR_BUFFER_NAME,
+ &gui_color_buffer_input_cb, NULL, NULL,
+ &gui_color_buffer_close_cb, NULL, NULL);
if (gui_color_buffer)
{
if (!gui_color_buffer->short_name)
diff --git a/src/gui/curses/gui-curses-key.c b/src/gui/curses/gui-curses-key.c
index 263ac1661..cd267064a 100644
--- a/src/gui/curses/gui-curses-key.c
+++ b/src/gui/curses/gui-curses-key.c
@@ -507,12 +507,13 @@ gui_key_flush (int paste)
*/
int
-gui_key_read_cb (void *data, int fd)
+gui_key_read_cb (const void *pointer, void *data, int fd)
{
int ret, i, accept_paste, cancel_paste, text_added_to_buffer, pos;
unsigned char buffer[4096];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) fd;
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c
index 210e1e4f8..cc865666b 100644
--- a/src/gui/curses/gui-curses-main.c
+++ b/src/gui/curses/gui-curses-main.c
@@ -181,7 +181,8 @@ gui_main_init ()
/* create core buffer */
ptr_buffer = gui_buffer_new (NULL, GUI_BUFFER_MAIN,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (ptr_buffer)
{
gui_init_ok = 1;
@@ -388,7 +389,7 @@ gui_main_loop ()
/* hook stdin (read keyboard) */
hook_fd_keyboard = hook_fd (NULL, STDIN_FILENO, 1, 0, 0,
- &gui_key_read_cb, NULL);
+ &gui_key_read_cb, NULL, NULL);
gui_window_ask_refresh (1);
diff --git a/src/gui/curses/gui-curses-mouse.c b/src/gui/curses/gui-curses-mouse.c
index 945837137..8620bbeee 100644
--- a/src/gui/curses/gui-curses-mouse.c
+++ b/src/gui/curses/gui-curses-mouse.c
@@ -218,9 +218,10 @@ gui_mouse_grab_end (const char *mouse_key)
*/
int
-gui_mouse_event_timer_cb (void *data, int remaining_calls)
+gui_mouse_event_timer_cb (const void *pointer, void *data, int remaining_calls)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) remaining_calls;
@@ -244,7 +245,7 @@ gui_mouse_event_init ()
gui_mouse_event_timer = hook_timer (NULL,
CONFIG_INTEGER(config_look_mouse_timer_delay),
0, 1,
- &gui_mouse_event_timer_cb, NULL);
+ &gui_mouse_event_timer_cb, NULL, NULL);
}
/*
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index aa96c397c..3a8804998 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -2362,9 +2362,11 @@ gui_window_refresh_screen (int full_refresh)
*/
int
-gui_window_bare_display_timer_cb (void *data, int remaining_calls)
+gui_window_bare_display_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (gui_window_bare_display)
@@ -2408,7 +2410,7 @@ gui_window_bare_display_toggle (const char *delay)
gui_window_bare_display_timer = hook_timer (
NULL,
seconds * 1000, 0, 1,
- &gui_window_bare_display_timer_cb, NULL);
+ &gui_window_bare_display_timer_cb, NULL, NULL);
}
}
}
diff --git a/src/gui/curses/gui-curses.h b/src/gui/curses/gui-curses.h
index 43d80bfbb..cbf162c27 100644
--- a/src/gui/curses/gui-curses.h
+++ b/src/gui/curses/gui-curses.h
@@ -98,7 +98,7 @@ extern void gui_chat_calculate_line_diff (struct t_gui_window *window,
/* key functions */
extern void gui_key_default_bindings (int context);
-extern int gui_key_read_cb (void *data, int fd);
+extern int gui_key_read_cb (const void *pointer, void *data, int fd);
/* window functions */
extern void gui_window_read_terminal_size ();
diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c
index b45987ae3..980d9cbe1 100644
--- a/src/gui/gui-bar-item.c
+++ b/src/gui/gui-bar-item.c
@@ -399,9 +399,13 @@ gui_bar_item_get_value (struct t_gui_bar *bar, struct t_gui_window *window,
bar->items_name[item][subitem]);
if (ptr_item && ptr_item->build_callback)
{
- item_value = (ptr_item->build_callback) (ptr_item->build_callback_data,
- ptr_item, window, buffer,
- NULL);
+ item_value = (ptr_item->build_callback) (
+ ptr_item->build_callback_pointer,
+ ptr_item->build_callback_data,
+ ptr_item,
+ window,
+ buffer,
+ NULL);
}
if (item_value && !item_value[0])
{
@@ -526,11 +530,13 @@ gui_bar_item_count_lines (char *string)
struct t_gui_bar_item *
gui_bar_item_new (struct t_weechat_plugin *plugin, const char *name,
- char *(*build_callback)(void *data,
+ char *(*build_callback)(const void *pointer,
+ void *data,
struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info),
+ const void *build_callback_pointer,
void *build_callback_data)
{
struct t_gui_bar_item *new_bar_item;
@@ -549,6 +555,7 @@ gui_bar_item_new (struct t_weechat_plugin *plugin, const char *name,
new_bar_item->plugin = plugin;
new_bar_item->name = strdup (name);
new_bar_item->build_callback = build_callback;
+ new_bar_item->build_callback_pointer = build_callback_pointer;
new_bar_item->build_callback_data = build_callback_data;
/* add bar item to bar items queue */
@@ -685,6 +692,8 @@ gui_bar_item_free (struct t_gui_bar_item *item)
/* free data */
if (item->name)
free (item->name);
+ if (item->build_callback_data)
+ free (item->build_callback_data);
free (item);
}
@@ -728,7 +737,8 @@ gui_bar_item_free_all_plugin (struct t_weechat_plugin *plugin)
*/
char *
-gui_bar_item_input_paste_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_input_paste_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -737,6 +747,7 @@ gui_bar_item_input_paste_cb (void *data, struct t_gui_bar_item *item,
int lines;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) buffer;
@@ -763,7 +774,8 @@ gui_bar_item_input_paste_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_input_prompt_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_input_prompt_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -771,6 +783,7 @@ gui_bar_item_input_prompt_cb (void *data, struct t_gui_bar_item *item,
const char *nick;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -789,7 +802,8 @@ gui_bar_item_input_prompt_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_input_search_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_input_search_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -797,6 +811,7 @@ gui_bar_item_input_search_cb (void *data, struct t_gui_bar_item *item,
char str_search[1024];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -830,7 +845,8 @@ gui_bar_item_input_search_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_input_text_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_input_text_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -841,6 +857,7 @@ gui_bar_item_input_text_cb (void *data, struct t_gui_bar_item *item,
int length, length_cursor, length_start_input, buf_pos;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -957,7 +974,8 @@ gui_bar_item_input_text_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_time_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_time_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -967,6 +985,7 @@ gui_bar_item_time_cb (void *data, struct t_gui_bar_item *item,
char text_time[128], text_time2[128];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -992,7 +1011,8 @@ gui_bar_item_time_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_buffer_count_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_buffer_count_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -1000,6 +1020,7 @@ gui_bar_item_buffer_count_cb (void *data, struct t_gui_bar_item *item,
char buf[32];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1016,7 +1037,7 @@ gui_bar_item_buffer_count_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_buffer_last_number_cb (void *data,
+gui_bar_item_buffer_last_number_cb (const void *pointer, void *data,
struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
@@ -1025,6 +1046,7 @@ gui_bar_item_buffer_last_number_cb (void *data,
char buf[32];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1042,7 +1064,8 @@ gui_bar_item_buffer_last_number_cb (void *data,
*/
char *
-gui_bar_item_buffer_plugin_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_buffer_plugin_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -1050,6 +1073,7 @@ gui_bar_item_buffer_plugin_cb (void *data, struct t_gui_bar_item *item,
const char *plugin_name;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1068,7 +1092,8 @@ gui_bar_item_buffer_plugin_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_buffer_number_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_buffer_number_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -1076,6 +1101,7 @@ gui_bar_item_buffer_number_cb (void *data, struct t_gui_bar_item *item,
char str_number[64];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1096,7 +1122,8 @@ gui_bar_item_buffer_number_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_buffer_name_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_buffer_name_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -1104,6 +1131,7 @@ gui_bar_item_buffer_name_cb (void *data, struct t_gui_bar_item *item,
char str_name[256];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1125,7 +1153,7 @@ gui_bar_item_buffer_name_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_buffer_short_name_cb (void *data,
+gui_bar_item_buffer_short_name_cb (const void *pointer, void *data,
struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
@@ -1134,6 +1162,7 @@ gui_bar_item_buffer_short_name_cb (void *data,
char str_short_name[256];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1158,12 +1187,14 @@ gui_bar_item_buffer_short_name_cb (void *data,
*/
char *
-gui_bar_item_buffer_modes_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_buffer_modes_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1178,7 +1209,8 @@ gui_bar_item_buffer_modes_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_buffer_filter_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_buffer_filter_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -1186,6 +1218,7 @@ gui_bar_item_buffer_filter_cb (void *data, struct t_gui_bar_item *item,
char str_filter[512];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1213,7 +1246,7 @@ gui_bar_item_buffer_filter_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_buffer_nicklist_count_cb (void *data,
+gui_bar_item_buffer_nicklist_count_cb (const void *pointer, void *data,
struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
@@ -1222,6 +1255,7 @@ gui_bar_item_buffer_nicklist_count_cb (void *data,
char str_count[64];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1243,7 +1277,8 @@ gui_bar_item_buffer_nicklist_count_cb (void *data,
*/
char *
-gui_bar_item_buffer_zoom_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_buffer_zoom_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -1252,6 +1287,7 @@ gui_bar_item_buffer_zoom_cb (void *data, struct t_gui_bar_item *item,
char buf[512];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1275,7 +1311,8 @@ gui_bar_item_buffer_zoom_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_scroll_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_scroll_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -1283,6 +1320,7 @@ gui_bar_item_scroll_cb (void *data, struct t_gui_bar_item *item,
char str_scroll[512];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) buffer;
@@ -1306,7 +1344,8 @@ gui_bar_item_scroll_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_hotlist_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_hotlist_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -1318,6 +1357,7 @@ gui_bar_item_hotlist_cb (void *data, struct t_gui_bar_item *item,
int priority, priority_min, priority_min_displayed, private;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1542,7 +1582,8 @@ gui_bar_item_hotlist_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_completion_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_completion_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -1552,6 +1593,7 @@ gui_bar_item_completion_cb (void *data, struct t_gui_bar_item *item,
struct t_gui_completion_word *ptr_completion_word;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1603,12 +1645,14 @@ gui_bar_item_completion_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_buffer_title_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_buffer_title_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1625,7 +1669,8 @@ gui_bar_item_buffer_title_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_buffer_nicklist_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_buffer_nicklist_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -1637,6 +1682,7 @@ gui_bar_item_buffer_nicklist_cb (void *data, struct t_gui_bar_item *item,
char *str_nicklist;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1766,7 +1812,8 @@ gui_bar_item_buffer_nicklist_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_window_number_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_window_number_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -1774,6 +1821,7 @@ gui_bar_item_window_number_cb (void *data, struct t_gui_bar_item *item,
char str_number[64];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) buffer;
@@ -1792,7 +1840,8 @@ gui_bar_item_window_number_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_mouse_status_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_mouse_status_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -1800,6 +1849,7 @@ gui_bar_item_mouse_status_cb (void *data, struct t_gui_bar_item *item,
char str_mouse[512];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1821,7 +1871,8 @@ gui_bar_item_mouse_status_cb (void *data, struct t_gui_bar_item *item,
*/
char *
-gui_bar_item_away_cb (void *data, struct t_gui_bar_item *item,
+gui_bar_item_away_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -1831,6 +1882,7 @@ gui_bar_item_away_cb (void *data, struct t_gui_bar_item *item,
int length;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -1867,7 +1919,8 @@ gui_bar_item_away_cb (void *data, struct t_gui_bar_item *item,
*/
struct t_hashtable *
-gui_bar_item_focus_buffer_nicklist_cb (void *data,
+gui_bar_item_focus_buffer_nicklist_cb (const void *pointer,
+ void *data,
struct t_hashtable *info)
{
struct t_gui_nick_group *ptr_group;
@@ -1880,6 +1933,7 @@ gui_bar_item_focus_buffer_nicklist_cb (void *data,
char *error;
/* make C compiler happy */
+ (void) pointer;
(void) data;
str_bar_item_line = hashtable_get (info, "_bar_item_line");
@@ -1961,7 +2015,7 @@ gui_bar_item_focus_buffer_nicklist_cb (void *data,
*/
int
-gui_bar_item_timer_cb (void *data, int remaining_calls)
+gui_bar_item_timer_cb (const void *pointer, void *data, int remaining_calls)
{
time_t date;
struct tm *local_time;
@@ -1969,6 +2023,7 @@ gui_bar_item_timer_cb (void *data, int remaining_calls)
char new_item_time_text[128];
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
date = time (NULL);
@@ -1987,7 +2042,7 @@ gui_bar_item_timer_cb (void *data, int remaining_calls)
{
snprintf (item_time_text, sizeof (item_time_text),
"%s", new_item_time_text);
- gui_bar_item_update ((char *)data);
+ gui_bar_item_update ((char *)pointer);
}
return WEECHAT_RC_OK;
@@ -1998,15 +2053,17 @@ gui_bar_item_timer_cb (void *data, int remaining_calls)
*/
int
-gui_bar_item_signal_cb (void *data, const char *signal,
+gui_bar_item_signal_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) data;
(void) signal;
(void) type_data;
(void) signal_data;
- gui_bar_item_update ((char *)data);
+ gui_bar_item_update ((char *)pointer);
return WEECHAT_RC_OK;
}
@@ -2025,7 +2082,7 @@ gui_bar_item_hook_signal (const char *signal, const char *item)
{
bar_item_hook->hook = hook_signal (NULL, signal,
&gui_bar_item_signal_cb,
- (void *)item);
+ (void *)item, NULL);
bar_item_hook->next_hook = gui_bar_item_hooks;
gui_bar_item_hooks = bar_item_hook;
}
@@ -2043,14 +2100,14 @@ gui_bar_item_init ()
/* input paste */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_INPUT_PASTE],
- &gui_bar_item_input_paste_cb, NULL);
+ &gui_bar_item_input_paste_cb, NULL, NULL);
gui_bar_item_hook_signal ("input_paste_pending",
gui_bar_item_names[GUI_BAR_ITEM_INPUT_PASTE]);
/* input prompt */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_INPUT_PROMPT],
- &gui_bar_item_input_prompt_cb, NULL);
+ &gui_bar_item_input_prompt_cb, NULL, NULL);
gui_bar_item_hook_signal ("window_switch",
gui_bar_item_names[GUI_BAR_ITEM_INPUT_PROMPT]);
gui_bar_item_hook_signal ("buffer_switch",
@@ -2061,7 +2118,7 @@ gui_bar_item_init ()
/* input search */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_INPUT_SEARCH],
- &gui_bar_item_input_search_cb, NULL);
+ &gui_bar_item_input_search_cb, NULL, NULL);
gui_bar_item_hook_signal ("window_switch",
gui_bar_item_names[GUI_BAR_ITEM_INPUT_SEARCH]);
gui_bar_item_hook_signal ("input_search",
@@ -2072,7 +2129,7 @@ gui_bar_item_init ()
/* input text */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_INPUT_TEXT],
- &gui_bar_item_input_text_cb, NULL);
+ &gui_bar_item_input_text_cb, NULL, NULL);
gui_bar_item_hook_signal ("window_switch",
gui_bar_item_names[GUI_BAR_ITEM_INPUT_TEXT]);
gui_bar_item_hook_signal ("buffer_switch",
@@ -2083,14 +2140,16 @@ gui_bar_item_init ()
/* time */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_TIME],
- &gui_bar_item_time_cb, NULL);
- gui_bar_item_timer = hook_timer (NULL, 1000, 1, 0, &gui_bar_item_timer_cb,
- gui_bar_item_names[GUI_BAR_ITEM_TIME]);
+ &gui_bar_item_time_cb, NULL, NULL);
+ gui_bar_item_timer = hook_timer (NULL, 1000, 1, 0,
+ &gui_bar_item_timer_cb,
+ gui_bar_item_names[GUI_BAR_ITEM_TIME],
+ NULL);
/* buffer count */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_COUNT],
- &gui_bar_item_buffer_count_cb, NULL);
+ &gui_bar_item_buffer_count_cb, NULL, NULL);
gui_bar_item_hook_signal ("buffer_opened",
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_COUNT]);
gui_bar_item_hook_signal ("buffer_closed",
@@ -2099,7 +2158,7 @@ gui_bar_item_init ()
/* last buffer number */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_LAST_NUMBER],
- &gui_bar_item_buffer_last_number_cb, NULL);
+ &gui_bar_item_buffer_last_number_cb, NULL, NULL);
gui_bar_item_hook_signal ("buffer_opened",
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_LAST_NUMBER]);
gui_bar_item_hook_signal ("buffer_closed",
@@ -2114,7 +2173,7 @@ gui_bar_item_init ()
/* buffer plugin */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_PLUGIN],
- &gui_bar_item_buffer_plugin_cb, NULL);
+ &gui_bar_item_buffer_plugin_cb, NULL, NULL);
gui_bar_item_hook_signal ("window_switch",
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_PLUGIN]);
gui_bar_item_hook_signal ("buffer_switch",
@@ -2125,7 +2184,7 @@ gui_bar_item_init ()
/* buffer number */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NUMBER],
- &gui_bar_item_buffer_number_cb, NULL);
+ &gui_bar_item_buffer_number_cb, NULL, NULL);
gui_bar_item_hook_signal ("window_switch",
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NUMBER]);
gui_bar_item_hook_signal ("buffer_switch",
@@ -2142,7 +2201,7 @@ gui_bar_item_init ()
/* buffer name */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NAME],
- &gui_bar_item_buffer_name_cb, NULL);
+ &gui_bar_item_buffer_name_cb, NULL, NULL);
gui_bar_item_hook_signal ("window_switch",
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NAME]);
gui_bar_item_hook_signal ("buffer_switch",
@@ -2155,7 +2214,7 @@ gui_bar_item_init ()
/* buffer short name */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_SHORT_NAME],
- &gui_bar_item_buffer_short_name_cb, NULL);
+ &gui_bar_item_buffer_short_name_cb, NULL, NULL);
gui_bar_item_hook_signal ("window_switch",
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_SHORT_NAME]);
gui_bar_item_hook_signal ("buffer_switch",
@@ -2168,7 +2227,7 @@ gui_bar_item_init ()
/* buffer modes */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_MODES],
- &gui_bar_item_buffer_modes_cb, NULL);
+ &gui_bar_item_buffer_modes_cb, NULL, NULL);
gui_bar_item_hook_signal ("window_switch",
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_MODES]);
gui_bar_item_hook_signal ("buffer_switch",
@@ -2177,7 +2236,7 @@ gui_bar_item_init ()
/* buffer filter */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_FILTER],
- &gui_bar_item_buffer_filter_cb, NULL);
+ &gui_bar_item_buffer_filter_cb, NULL, NULL);
gui_bar_item_hook_signal ("window_switch",
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_FILTER]);
gui_bar_item_hook_signal ("buffer_switch",
@@ -2190,7 +2249,7 @@ gui_bar_item_init ()
/* buffer zoom */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_ZOOM],
- &gui_bar_item_buffer_zoom_cb, NULL);
+ &gui_bar_item_buffer_zoom_cb, NULL, NULL);
gui_bar_item_hook_signal ("buffer_zoomed",
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_ZOOM]);
gui_bar_item_hook_signal ("buffer_unzoomed",
@@ -2201,7 +2260,7 @@ gui_bar_item_init ()
/* buffer nicklist count */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NICKLIST_COUNT],
- &gui_bar_item_buffer_nicklist_count_cb, NULL);
+ &gui_bar_item_buffer_nicklist_count_cb, NULL, NULL);
gui_bar_item_hook_signal ("window_switch",
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NICKLIST_COUNT]);
gui_bar_item_hook_signal ("buffer_switch",
@@ -2212,7 +2271,7 @@ gui_bar_item_init ()
/* scroll indicator */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_SCROLL],
- &gui_bar_item_scroll_cb, NULL);
+ &gui_bar_item_scroll_cb, NULL, NULL);
gui_bar_item_hook_signal ("window_switch",
gui_bar_item_names[GUI_BAR_ITEM_SCROLL]);
gui_bar_item_hook_signal ("buffer_switch",
@@ -2223,7 +2282,7 @@ gui_bar_item_init ()
/* hotlist */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_HOTLIST],
- &gui_bar_item_hotlist_cb, NULL);
+ &gui_bar_item_hotlist_cb, NULL, NULL);
gui_bar_item_hook_signal ("hotlist_changed",
gui_bar_item_names[GUI_BAR_ITEM_HOTLIST]);
gui_bar_item_hook_signal ("buffer_moved",
@@ -2234,14 +2293,14 @@ gui_bar_item_init ()
/* completion (possible words when a partial completion occurs) */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_COMPLETION],
- &gui_bar_item_completion_cb, NULL);
+ &gui_bar_item_completion_cb, NULL, NULL);
gui_bar_item_hook_signal ("partial_completion",
gui_bar_item_names[GUI_BAR_ITEM_COMPLETION]);
/* buffer title */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_TITLE],
- &gui_bar_item_buffer_title_cb, NULL);
+ &gui_bar_item_buffer_title_cb, NULL, NULL);
gui_bar_item_hook_signal ("window_switch",
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_TITLE]);
gui_bar_item_hook_signal ("buffer_switch",
@@ -2252,7 +2311,7 @@ gui_bar_item_init ()
/* buffer nicklist */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NICKLIST],
- &gui_bar_item_buffer_nicklist_cb, NULL);
+ &gui_bar_item_buffer_nicklist_cb, NULL, NULL);
gui_bar_item_hook_signal ("nicklist_*",
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NICKLIST]);
gui_bar_item_hook_signal ("window_switch",
@@ -2261,12 +2320,13 @@ gui_bar_item_init ()
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NICKLIST]);
snprintf (name, sizeof (name), "2000|%s",
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NICKLIST]);
- hook_focus (NULL, name, &gui_bar_item_focus_buffer_nicklist_cb, NULL);
+ hook_focus (NULL, name,
+ &gui_bar_item_focus_buffer_nicklist_cb, NULL, NULL);
/* window number */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_WINDOW_NUMBER],
- &gui_bar_item_window_number_cb, NULL);
+ &gui_bar_item_window_number_cb, NULL, NULL);
gui_bar_item_hook_signal ("window_switch",
gui_bar_item_names[GUI_BAR_ITEM_WINDOW_NUMBER]);
gui_bar_item_hook_signal ("window_closed",
@@ -2275,7 +2335,7 @@ gui_bar_item_init ()
/* mouse status */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_MOUSE_STATUS],
- &gui_bar_item_mouse_status_cb, NULL);
+ &gui_bar_item_mouse_status_cb, NULL, NULL);
gui_bar_item_hook_signal ("mouse_enabled",
gui_bar_item_names[GUI_BAR_ITEM_MOUSE_STATUS]);
gui_bar_item_hook_signal ("mouse_disabled",
@@ -2284,7 +2344,7 @@ gui_bar_item_init ()
/* away message */
gui_bar_item_new (NULL,
gui_bar_item_names[GUI_BAR_ITEM_AWAY],
- &gui_bar_item_away_cb, NULL);
+ &gui_bar_item_away_cb, NULL, NULL);
gui_bar_item_hook_signal ("buffer_localvar_*",
gui_bar_item_names[GUI_BAR_ITEM_AWAY]);
}
@@ -2318,11 +2378,13 @@ gui_bar_item_end ()
*/
struct t_hdata *
-gui_bar_item_hdata_bar_item_cb (void *data, const char *hdata_name)
+gui_bar_item_hdata_bar_item_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_item", "next_item",
@@ -2332,6 +2394,7 @@ gui_bar_item_hdata_bar_item_cb (void *data, const char *hdata_name)
HDATA_VAR(struct t_gui_bar_item, plugin, POINTER, 0, NULL, "plugin");
HDATA_VAR(struct t_gui_bar_item, name, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_gui_bar_item, build_callback, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_bar_item, build_callback_pointer, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_bar_item, build_callback_data, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_bar_item, prev_item, POINTER, 0, NULL, hdata_name);
HDATA_VAR(struct t_gui_bar_item, next_item, POINTER, 0, NULL, hdata_name);
@@ -2368,6 +2431,8 @@ gui_bar_item_add_to_infolist (struct t_infolist *infolist,
return 0;
if (!infolist_new_var_pointer (ptr_item, "build_callback", bar_item->build_callback))
return 0;
+ if (!infolist_new_var_pointer (ptr_item, "build_callback_pointer", (void *)bar_item->build_callback_pointer))
+ return 0;
if (!infolist_new_var_pointer (ptr_item, "build_callback_data", bar_item->build_callback_data))
return 0;
@@ -2391,6 +2456,7 @@ gui_bar_item_print_log ()
ptr_item->plugin, plugin_get_name (ptr_item->plugin));
log_printf (" name . . . . . . . . . : '%s'", ptr_item->name);
log_printf (" build_callback . . . . : 0x%lx", ptr_item->build_callback);
+ log_printf (" build_callback_pointer : 0x%lx", ptr_item->build_callback_pointer);
log_printf (" build_callback_data. . : 0x%lx", ptr_item->build_callback_data);
log_printf (" prev_item. . . . . . . : 0x%lx", ptr_item->prev_item);
log_printf (" next_item. . . . . . . : 0x%lx", ptr_item->next_item);
diff --git a/src/gui/gui-bar-item.h b/src/gui/gui-bar-item.h
index e5223ca62..21bfc2ca7 100644
--- a/src/gui/gui-bar-item.h
+++ b/src/gui/gui-bar-item.h
@@ -55,13 +55,15 @@ struct t_gui_bar_item
{
struct t_weechat_plugin *plugin; /* plugin */
char *name; /* bar item name */
- char *(*build_callback)(void *data,
+ char *(*build_callback)(const void *pointer,
+ void *data,
struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info);
/* callback called for building item */
- void *build_callback_data; /* data for callback */
+ const void *build_callback_pointer; /* pointer for callback */
+ void *build_callback_data; /* data for callback */
struct t_gui_bar_item *prev_item; /* link to previous bar item */
struct t_gui_bar_item *next_item; /* link to next bar item */
};
@@ -98,11 +100,13 @@ extern char *gui_bar_item_get_value (struct t_gui_bar *bar,
extern int gui_bar_item_count_lines (char *string);
extern struct t_gui_bar_item *gui_bar_item_new (struct t_weechat_plugin *plugin,
const char *name,
- char *(*build_callback)(void *data,
+ char *(*build_callback)(const void *pointer,
+ void *data,
struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info),
+ const void *build_callback_pointer,
void *build_callback_data);
extern void gui_bar_item_update (const char *name);
extern void gui_bar_item_free (struct t_gui_bar_item *item);
@@ -110,7 +114,8 @@ extern void gui_bar_item_free_all ();
extern void gui_bar_item_free_all_plugin (struct t_weechat_plugin *plugin);
extern void gui_bar_item_init ();
extern void gui_bar_item_end ();
-extern struct t_hdata *gui_bar_item_hdata_bar_item_cb (void *data,
+extern struct t_hdata *gui_bar_item_hdata_bar_item_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int gui_bar_item_add_to_infolist (struct t_infolist *infolist,
struct t_gui_bar_item *bar_item);
diff --git a/src/gui/gui-bar-window.c b/src/gui/gui-bar-window.c
index f1fd037a1..e630565d1 100644
--- a/src/gui/gui-bar-window.c
+++ b/src/gui/gui-bar-window.c
@@ -1524,11 +1524,13 @@ gui_bar_window_scroll (struct t_gui_bar_window *bar_window,
*/
struct t_hdata *
-gui_bar_window_hdata_bar_window_cb (void *data, const char *hdata_name)
+gui_bar_window_hdata_bar_window_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_bar_window", "next_bar_window",
diff --git a/src/gui/gui-bar-window.h b/src/gui/gui-bar-window.h
index dff86ec56..1e625ee40 100644
--- a/src/gui/gui-bar-window.h
+++ b/src/gui/gui-bar-window.h
@@ -104,7 +104,8 @@ extern void gui_bar_window_scroll (struct t_gui_bar_window *bar_window,
int add_x, int scroll_beginning,
int scroll_end, int add, int percent,
int value);
-extern struct t_hdata *gui_bar_window_hdata_bar_window_cb (void *data,
+extern struct t_hdata *gui_bar_window_hdata_bar_window_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int gui_bar_window_add_to_infolist (struct t_infolist *infolist,
struct t_gui_bar_window *bar_window);
diff --git a/src/gui/gui-bar.c b/src/gui/gui-bar.c
index 31a7c2040..d656be48c 100644
--- a/src/gui/gui-bar.c
+++ b/src/gui/gui-bar.c
@@ -410,8 +410,7 @@ gui_bar_check_conditions (struct t_gui_bar *bar,
pointers = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_POINTER,
- NULL,
- NULL);
+ NULL, NULL);
if (pointers)
{
hashtable_set (pointers, "window", window);
@@ -421,8 +420,7 @@ gui_bar_check_conditions (struct t_gui_bar *bar,
extra_vars = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_POINTER,
- NULL,
- NULL);
+ NULL, NULL);
if (extra_vars)
{
hashtable_set (extra_vars, "active",
@@ -435,8 +433,7 @@ gui_bar_check_conditions (struct t_gui_bar *bar,
options = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_POINTER,
- NULL,
- NULL);
+ NULL, NULL);
if (options)
hashtable_set (options, "type", "condition");
@@ -827,10 +824,12 @@ gui_bar_set_items_array (struct t_gui_bar *bar, const char *items)
*/
int
-gui_bar_config_check_type (void *data, struct t_config_option *option,
+gui_bar_config_check_type (const void *pointer, void *data,
+ struct t_config_option *option,
const char *value)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
(void) value;
@@ -847,7 +846,8 @@ gui_bar_config_check_type (void *data, struct t_config_option *option,
*/
void
-gui_bar_config_change_hidden (void *data, struct t_config_option *option)
+gui_bar_config_change_hidden (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_gui_bar *ptr_bar;
struct t_gui_window *ptr_win;
@@ -855,6 +855,7 @@ gui_bar_config_change_hidden (void *data, struct t_config_option *option)
int bar_window_exists;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_bar = gui_bar_search_with_option_name (option->name);
@@ -909,13 +910,15 @@ gui_bar_config_change_hidden (void *data, struct t_config_option *option)
*/
void
-gui_bar_config_change_priority (void *data, struct t_config_option *option)
+gui_bar_config_change_priority (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_gui_bar *ptr_bar;
struct t_gui_window *ptr_win;
struct t_gui_bar_window *bar_windows, *ptr_bar_win, *next_bar_win;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_bar = gui_bar_search_with_option_name (option->name);
@@ -964,9 +967,11 @@ gui_bar_config_change_priority (void *data, struct t_config_option *option)
*/
void
-gui_bar_config_change_conditions (void *data, struct t_config_option *option)
+gui_bar_config_change_conditions (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -978,11 +983,13 @@ gui_bar_config_change_conditions (void *data, struct t_config_option *option)
*/
void
-gui_bar_config_change_position (void *data, struct t_config_option *option)
+gui_bar_config_change_position (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_gui_bar *ptr_bar;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_bar = gui_bar_search_with_option_name (option->name);
@@ -997,11 +1004,13 @@ gui_bar_config_change_position (void *data, struct t_config_option *option)
*/
void
-gui_bar_config_change_filling (void *data, struct t_config_option *option)
+gui_bar_config_change_filling (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_gui_bar *ptr_bar;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_bar = gui_bar_search_with_option_name (option->name);
@@ -1020,7 +1029,8 @@ gui_bar_config_change_filling (void *data, struct t_config_option *option)
*/
int
-gui_bar_config_check_size (void *data, struct t_config_option *option,
+gui_bar_config_check_size (const void *pointer, void *data,
+ struct t_config_option *option,
const char *value)
{
struct t_gui_bar *ptr_bar;
@@ -1029,6 +1039,7 @@ gui_bar_config_check_size (void *data, struct t_config_option *option,
int new_value;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_bar = gui_bar_search_with_option_name (option->name);
@@ -1086,11 +1097,13 @@ gui_bar_config_check_size (void *data, struct t_config_option *option,
*/
void
-gui_bar_config_change_size (void *data, struct t_config_option *option)
+gui_bar_config_change_size (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_gui_bar *ptr_bar;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_bar = gui_bar_search_with_option_name (option->name);
@@ -1106,12 +1119,14 @@ gui_bar_config_change_size (void *data, struct t_config_option *option)
*/
void
-gui_bar_config_change_size_max (void *data, struct t_config_option *option)
+gui_bar_config_change_size_max (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_gui_bar *ptr_bar;
char value[32];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -1135,11 +1150,13 @@ gui_bar_config_change_size_max (void *data, struct t_config_option *option)
*/
void
-gui_bar_config_change_color (void *data, struct t_config_option *option)
+gui_bar_config_change_color (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_gui_bar *ptr_bar;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_bar = gui_bar_search_with_option_name (option->name);
@@ -1152,11 +1169,13 @@ gui_bar_config_change_color (void *data, struct t_config_option *option)
*/
void
-gui_bar_config_change_separator (void *data, struct t_config_option *option)
+gui_bar_config_change_separator (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_gui_bar *ptr_bar;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_bar = gui_bar_search_with_option_name (option->name);
@@ -1169,11 +1188,13 @@ gui_bar_config_change_separator (void *data, struct t_config_option *option)
*/
void
-gui_bar_config_change_items (void *data, struct t_config_option *option)
+gui_bar_config_change_items (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_gui_bar *ptr_bar;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_bar = gui_bar_search_with_option_name (option->name);
@@ -1390,7 +1411,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value
option_name, "boolean",
N_("true if bar is hidden, false if it is displayed"),
NULL, 0, 0, value, NULL, 0,
- NULL, NULL, &gui_bar_config_change_hidden, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &gui_bar_config_change_hidden, NULL, NULL,
+ NULL, NULL, NULL);
break;
case GUI_BAR_OPTION_PRIORITY:
ptr_option = config_file_new_option (
@@ -1398,7 +1421,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value
option_name, "integer",
N_("bar priority (high number means bar displayed first)"),
NULL, 0, INT_MAX, value, NULL, 0,
- NULL, NULL, &gui_bar_config_change_priority, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &gui_bar_config_change_priority, NULL, NULL,
+ NULL, NULL, NULL);
break;
case GUI_BAR_OPTION_TYPE:
ptr_option = config_file_new_option (
@@ -1406,7 +1431,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value
option_name, "integer",
N_("bar type (root, window, window_active, window_inactive)"),
"root|window|window_active|window_inactive", 0, 0, value, NULL, 0,
- &gui_bar_config_check_type, NULL, NULL, NULL, NULL, NULL);
+ &gui_bar_config_check_type, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
break;
case GUI_BAR_OPTION_CONDITIONS:
ptr_option = config_file_new_option (
@@ -1420,7 +1447,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value
"(local variables for expression are ${active}, "
"${inactive} and ${nicklist})"),
NULL, 0, 0, value, NULL, 0,
- NULL, NULL, &gui_bar_config_change_conditions, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &gui_bar_config_change_conditions, NULL, NULL,
+ NULL, NULL, NULL);
break;
case GUI_BAR_OPTION_POSITION:
ptr_option = config_file_new_option (
@@ -1428,7 +1457,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value
option_name, "integer",
N_("bar position (bottom, top, left, right)"),
"bottom|top|left|right", 0, 0, value, NULL, 0,
- NULL, NULL, &gui_bar_config_change_position, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &gui_bar_config_change_position, NULL, NULL,
+ NULL, NULL, NULL);
break;
case GUI_BAR_OPTION_FILLING_TOP_BOTTOM:
ptr_option = config_file_new_option (
@@ -1439,7 +1470,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value
"top or bottom"),
"horizontal|vertical|columns_horizontal|columns_vertical",
0, 0, value, NULL, 0,
- NULL, NULL, &gui_bar_config_change_filling, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &gui_bar_config_change_filling, NULL, NULL,
+ NULL, NULL, NULL);
break;
case GUI_BAR_OPTION_FILLING_LEFT_RIGHT:
ptr_option = config_file_new_option (
@@ -1450,7 +1483,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value
"left or right"),
"horizontal|vertical|columns_horizontal|columns_vertical",
0, 0, value, NULL, 0,
- NULL, NULL, &gui_bar_config_change_filling, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &gui_bar_config_change_filling, NULL, NULL,
+ NULL, NULL, NULL);
break;
case GUI_BAR_OPTION_SIZE:
ptr_option = config_file_new_option (
@@ -1458,9 +1493,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value
option_name, "integer",
N_("bar size in chars (0 = auto size)"),
NULL, 0, INT_MAX, value, NULL, 0,
- &gui_bar_config_check_size, NULL,
- &gui_bar_config_change_size, NULL,
- NULL, NULL);
+ &gui_bar_config_check_size, NULL, NULL,
+ &gui_bar_config_change_size, NULL, NULL,
+ NULL, NULL, NULL);
break;
case GUI_BAR_OPTION_SIZE_MAX:
ptr_option = config_file_new_option (
@@ -1468,9 +1503,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value
option_name, "integer",
N_("max bar size in chars (0 = no limit)"),
NULL, 0, INT_MAX, value, NULL, 0,
- NULL, NULL,
- &gui_bar_config_change_size_max, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ &gui_bar_config_change_size_max, NULL, NULL,
+ NULL, NULL, NULL);
break;
case GUI_BAR_OPTION_COLOR_FG:
ptr_option = config_file_new_option (
@@ -1478,9 +1513,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value
option_name, "color",
N_("default text color for bar"),
NULL, 0, 0, value, NULL, 0,
- NULL, NULL,
- &gui_bar_config_change_color, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ &gui_bar_config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
break;
case GUI_BAR_OPTION_COLOR_DELIM:
ptr_option = config_file_new_option (
@@ -1488,9 +1523,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value
option_name, "color",
N_("default delimiter color for bar"),
NULL, 0, 0, value, NULL, 0,
- NULL, NULL,
- &gui_bar_config_change_color, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ &gui_bar_config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
break;
case GUI_BAR_OPTION_COLOR_BG:
ptr_option = config_file_new_option (
@@ -1498,9 +1533,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value
option_name, "color",
N_("default background color for bar"),
NULL, 0, 0, value, NULL, 0,
- NULL, NULL,
- &gui_bar_config_change_color, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ &gui_bar_config_change_color, NULL, NULL,
+ NULL, NULL, NULL);
break;
case GUI_BAR_OPTION_SEPARATOR:
ptr_option = config_file_new_option (
@@ -1508,7 +1543,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value
option_name, "boolean",
N_("separator line between bar and other bars/windows"),
NULL, 0, 0, value, NULL, 0,
- NULL, NULL, &gui_bar_config_change_separator, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &gui_bar_config_change_separator, NULL, NULL,
+ NULL, NULL, NULL);
break;
case GUI_BAR_OPTION_ITEMS:
ptr_option = config_file_new_option (
@@ -1519,7 +1556,9 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value
"\"@buffer:item\" can be used to force buffer used when "
"displaying the bar item"),
NULL, 0, 0, gui_bar_default_items (bar_name), value, 0,
- NULL, NULL, &gui_bar_config_change_items, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &gui_bar_config_change_items, NULL, NULL,
+ NULL, NULL, NULL);
break;
case GUI_BAR_NUM_OPTIONS:
break;
@@ -2263,11 +2302,12 @@ gui_bar_free_bar_windows (struct t_gui_bar *bar)
*/
struct t_hdata *
-gui_bar_hdata_bar_cb (void *data, const char *hdata_name)
+gui_bar_hdata_bar_cb (const void *pointer, void *data, const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_bar", "next_bar",
diff --git a/src/gui/gui-bar.h b/src/gui/gui-bar.h
index ff7e2a805..6a2af0fa3 100644
--- a/src/gui/gui-bar.h
+++ b/src/gui/gui-bar.h
@@ -153,7 +153,8 @@ extern int gui_bar_scroll (struct t_gui_bar *bar, struct t_gui_window *window,
const char *scroll);
extern void gui_bar_free (struct t_gui_bar *bar);
extern void gui_bar_free_all ();
-extern struct t_hdata *gui_bar_hdata_bar_cb (void *data,
+extern struct t_hdata *gui_bar_hdata_bar_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int gui_bar_add_to_infolist (struct t_infolist *infolist,
struct t_gui_bar *bar);
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c
index 60319c8d6..5a0d0c861 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -553,12 +553,16 @@ gui_buffer_input_buffer_init (struct t_gui_buffer *buffer)
struct t_gui_buffer *
gui_buffer_new (struct t_weechat_plugin *plugin,
const char *name,
- int (*input_callback)(void *data,
+ int (*input_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data),
+ const void *input_callback_pointer,
void *input_callback_data,
- int (*close_callback)(void *data,
+ int (*close_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer),
+ const void *close_callback_pointer,
void *close_callback_data)
{
struct t_gui_buffer *new_buffer;
@@ -620,6 +624,7 @@ gui_buffer_new (struct t_weechat_plugin *plugin,
/* close callback */
new_buffer->close_callback = close_callback;
+ new_buffer->close_callback_pointer = close_callback_pointer;
new_buffer->close_callback_data = close_callback_data;
new_buffer->closing = 0;
@@ -644,12 +649,14 @@ gui_buffer_new (struct t_weechat_plugin *plugin,
new_buffer->nicklist_nicks_count = 0;
new_buffer->nicklist_visible_count = 0;
new_buffer->nickcmp_callback = NULL;
+ new_buffer->nickcmp_callback_pointer = NULL;
new_buffer->nickcmp_callback_data = NULL;
gui_nicklist_add_group (new_buffer, NULL, "root", NULL, 0);
/* input */
new_buffer->input = 1;
new_buffer->input_callback = input_callback;
+ new_buffer->input_callback_pointer = input_callback_pointer;
new_buffer->input_callback_data = input_callback_data;
new_buffer->input_get_unknown_commands = 0;
gui_buffer_input_buffer_init (new_buffer);
@@ -700,11 +707,11 @@ gui_buffer_new (struct t_weechat_plugin *plugin,
new_buffer->highlight_tags_array = NULL;
/* hotlist */
- new_buffer->hotlist_max_level_nicks = hashtable_new (32,
- WEECHAT_HASHTABLE_STRING,
- WEECHAT_HASHTABLE_INTEGER,
- NULL,
- NULL);
+ new_buffer->hotlist_max_level_nicks = hashtable_new (
+ 32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_INTEGER,
+ NULL, NULL);
/* keys */
new_buffer->keys = NULL;
@@ -715,8 +722,7 @@ gui_buffer_new (struct t_weechat_plugin *plugin,
new_buffer->local_variables = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
hashtable_set (new_buffer->local_variables,
"plugin", plugin_get_name (plugin));
hashtable_set (new_buffer->local_variables, "name", name);
@@ -2034,6 +2040,10 @@ gui_buffer_set_pointer (struct t_gui_buffer *buffer, const char *property,
{
buffer->close_callback = pointer;
}
+ else if (string_strcasecmp (property, "close_callback_pointer") == 0)
+ {
+ buffer->close_callback_pointer = pointer;
+ }
else if (string_strcasecmp (property, "close_callback_data") == 0)
{
buffer->close_callback_data = pointer;
@@ -2042,6 +2052,10 @@ gui_buffer_set_pointer (struct t_gui_buffer *buffer, const char *property,
{
buffer->nickcmp_callback = pointer;
}
+ else if (string_strcasecmp (property, "nickcmp_callback_pointer") == 0)
+ {
+ buffer->nickcmp_callback_pointer = pointer;
+ }
else if (string_strcasecmp (property, "nickcmp_callback_data") == 0)
{
buffer->nickcmp_callback_data = pointer;
@@ -2050,6 +2064,10 @@ gui_buffer_set_pointer (struct t_gui_buffer *buffer, const char *property,
{
buffer->input_callback = pointer;
}
+ else if (string_strcasecmp (property, "input_callback_pointer") == 0)
+ {
+ buffer->input_callback_pointer = pointer;
+ }
else if (string_strcasecmp (property, "input_callback_data") == 0)
{
buffer->input_callback_data = pointer;
@@ -2581,7 +2599,9 @@ gui_buffer_close (struct t_gui_buffer *buffer)
if (buffer->close_callback)
{
- (void)(buffer->close_callback) (buffer->close_callback_data, buffer);
+ (void)(buffer->close_callback) (buffer->close_callback_pointer,
+ buffer->close_callback_data,
+ buffer);
}
ptr_back_to_buffer = NULL;
@@ -2743,6 +2763,12 @@ gui_buffer_close (struct t_gui_buffer *buffer)
}
free (buffer->highlight_tags_array);
}
+ if (buffer->input_callback_data)
+ free (buffer->input_callback_data);
+ if (buffer->close_callback_data)
+ free (buffer->close_callback_data);
+ if (buffer->nickcmp_callback_data)
+ free (buffer->nickcmp_callback_data);
/* remove buffer from buffers list */
if (buffer->prev_buffer)
@@ -4030,11 +4056,13 @@ gui_buffer_visited_get_index_next ()
*/
struct t_hdata *
-gui_buffer_hdata_buffer_cb (void *data, const char *hdata_name)
+gui_buffer_hdata_buffer_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_buffer", "next_buffer",
@@ -4060,6 +4088,7 @@ gui_buffer_hdata_buffer_cb (void *data, const char *hdata_name)
HDATA_VAR(struct t_gui_buffer, clear, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, filter, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, close_callback, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, close_callback_pointer, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, close_callback_data, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, closing, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, title, STRING, 0, NULL, NULL);
@@ -4078,9 +4107,11 @@ gui_buffer_hdata_buffer_cb (void *data, const char *hdata_name)
HDATA_VAR(struct t_gui_buffer, nicklist_nicks_count, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, nicklist_visible_count, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, nickcmp_callback, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, nickcmp_callback_pointer, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, nickcmp_callback_data, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, input, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, input_callback, POINTER, 0, NULL, NULL);
+ HDATA_VAR(struct t_gui_buffer, input_callback_pointer, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, input_callback_data, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, input_get_unknown_commands, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_buffer, input_buffer, STRING, 0, NULL, NULL);
@@ -4134,11 +4165,13 @@ gui_buffer_hdata_buffer_cb (void *data, const char *hdata_name)
*/
struct t_hdata *
-gui_buffer_hdata_input_undo_cb (void *data, const char *hdata_name)
+gui_buffer_hdata_input_undo_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_undo", "next_undo",
@@ -4158,11 +4191,13 @@ gui_buffer_hdata_input_undo_cb (void *data, const char *hdata_name)
*/
struct t_hdata *
-gui_buffer_hdata_buffer_visited_cb (void *data, const char *hdata_name)
+gui_buffer_hdata_buffer_visited_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_buffer", "next_buffer",
@@ -4457,6 +4492,7 @@ gui_buffer_print_log ()
log_printf (" clear . . . . . . . . . : %d", ptr_buffer->clear);
log_printf (" filter. . . . . . . . . : %d", ptr_buffer->filter);
log_printf (" close_callback. . . . . : 0x%lx", ptr_buffer->close_callback);
+ log_printf (" close_callback_pointer. : 0x%lx", ptr_buffer->close_callback_pointer);
log_printf (" close_callback_data . . : 0x%lx", ptr_buffer->close_callback_data);
log_printf (" closing . . . . . . . . : %d", ptr_buffer->closing);
log_printf (" title . . . . . . . . . : '%s'", ptr_buffer->title);
@@ -4477,9 +4513,11 @@ gui_buffer_print_log ()
log_printf (" nicklist_nicks_count. . : %d", ptr_buffer->nicklist_nicks_count);
log_printf (" nicklist_visible_count. : %d", ptr_buffer->nicklist_visible_count);
log_printf (" nickcmp_callback. . . . : 0x%lx", ptr_buffer->nickcmp_callback);
+ log_printf (" nickcmp_callback_pointer: 0x%lx", ptr_buffer->nickcmp_callback_pointer);
log_printf (" nickcmp_callback_data . : 0x%lx", ptr_buffer->nickcmp_callback_data);
log_printf (" input . . . . . . . . . : %d", ptr_buffer->input);
log_printf (" input_callback. . . . . : 0x%lx", ptr_buffer->input_callback);
+ log_printf (" input_callback_pointer. : 0x%lx", ptr_buffer->input_callback_pointer);
log_printf (" input_callback_data . . : 0x%lx", ptr_buffer->input_callback_data);
log_printf (" input_get_unknown_cmd . : %d", ptr_buffer->input_get_unknown_commands);
log_printf (" input_buffer. . . . . . : '%s'", ptr_buffer->input_buffer);
diff --git a/src/gui/gui-buffer.h b/src/gui/gui-buffer.h
index 8e6b90b14..6414978c5 100644
--- a/src/gui/gui-buffer.h
+++ b/src/gui/gui-buffer.h
@@ -106,8 +106,10 @@ struct t_gui_buffer
int filter; /* 1 if filters enabled for buffer */
/* close callback */
- int (*close_callback)(void *data, /* called when buffer is closed */
+ int (*close_callback)(const void *pointer, /* called when buffer is */
+ void *data, /* closed */
struct t_gui_buffer *buffer);
+ const void *close_callback_pointer; /* pointer for callback */
void *close_callback_data; /* data for callback */
int closing; /* 1 if the buffer is being closed */
@@ -133,17 +135,21 @@ struct t_gui_buffer
int nicklist_groups_count; /* number of groups */
int nicklist_nicks_count; /* number of nicks */
int nicklist_visible_count; /* number of nicks/groups to display */
- int (*nickcmp_callback)(void *data, /* called to compare nicks (search */
- struct t_gui_buffer *buffer, /* in nicklist) */
+ int (*nickcmp_callback)(const void *pointer, /* called to compare nicks */
+ void *data, /* (search in nicklist) */
+ struct t_gui_buffer *buffer,
const char *nick1,
const char *nick2);
+ const void *nickcmp_callback_pointer; /* pointer for callback */
void *nickcmp_callback_data; /* data for callback */
/* input */
int input; /* = 1 if input is enabled */
- int (*input_callback)(void *data, /* called when user send data */
+ int (*input_callback)(const void *pointer, /* called when user sends */
+ void *data, /* data */
struct t_gui_buffer *buffer,
const char *input_data);
+ const void *input_callback_pointer; /* pointer for callback */
void *input_callback_data; /* data for callback */
/* to this buffer */
int input_get_unknown_commands; /* 1 if unknown commands are sent to */
@@ -241,12 +247,16 @@ extern void gui_buffer_notify_set_all ();
extern void gui_buffer_input_buffer_init (struct t_gui_buffer *buffer);
extern struct t_gui_buffer *gui_buffer_new (struct t_weechat_plugin *plugin,
const char *name,
- int (*input_callback)(void *data,
+ int (*input_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data),
+ const void *input_callback_pointer,
void *input_callback_data,
- int (*close_callback)(void *data,
+ int (*close_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer),
+ const void *close_callback_pointer,
void *close_callback_data);
extern int gui_buffer_valid (struct t_gui_buffer *buffer);
extern char *gui_buffer_string_replace_local_var (struct t_gui_buffer *buffer,
@@ -333,11 +343,14 @@ extern void gui_buffer_visited_remove_by_buffer (struct t_gui_buffer *buffer);
extern struct t_gui_buffer_visited *gui_buffer_visited_add (struct t_gui_buffer *buffer);
extern int gui_buffer_visited_get_index_previous ();
extern int gui_buffer_visited_get_index_next ();
-extern struct t_hdata *gui_buffer_hdata_buffer_cb (void *data,
+extern struct t_hdata *gui_buffer_hdata_buffer_cb (const void *pointer,
+ void *data,
const char *hdata_name);
-extern struct t_hdata *gui_buffer_hdata_input_undo_cb (void *data,
+extern struct t_hdata *gui_buffer_hdata_input_undo_cb (const void *pointer,
+ void *data,
const char *hdata_name);
-extern struct t_hdata *gui_buffer_hdata_buffer_visited_cb (void *data,
+extern struct t_hdata *gui_buffer_hdata_buffer_visited_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int gui_buffer_add_to_infolist (struct t_infolist *infolist,
struct t_gui_buffer *buffer);
diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c
index d2dd538b2..d987c4c49 100644
--- a/src/gui/gui-chat.c
+++ b/src/gui/gui-chat.c
@@ -83,11 +83,11 @@ gui_chat_init ()
/* some hsignals */
hook_hsignal (NULL, "chat_quote_time_prefix_message",
- &gui_chat_hsignal_quote_line_cb, NULL);
+ &gui_chat_hsignal_quote_line_cb, NULL, NULL);
hook_hsignal (NULL, "chat_quote_prefix_message",
- &gui_chat_hsignal_quote_line_cb, NULL);
+ &gui_chat_hsignal_quote_line_cb, NULL, NULL);
hook_hsignal (NULL, "chat_quote_message",
- &gui_chat_hsignal_quote_line_cb, NULL);
+ &gui_chat_hsignal_quote_line_cb, NULL, NULL);
}
/*
@@ -980,7 +980,8 @@ gui_chat_print_lines_waiting_buffer (FILE *f)
*/
int
-gui_chat_hsignal_quote_line_cb (void *data, const char *signal,
+gui_chat_hsignal_quote_line_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable)
{
const char *date, *line, *prefix, *ptr_prefix, *message;
@@ -994,6 +995,7 @@ gui_chat_hsignal_quote_line_cb (void *data, const char *signal,
char str_time[128], *str, *error;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!gui_current_window->buffer->input)
diff --git a/src/gui/gui-chat.h b/src/gui/gui-chat.h
index e52cd5af2..db2a84908 100644
--- a/src/gui/gui-chat.h
+++ b/src/gui/gui-chat.h
@@ -89,7 +89,8 @@ extern void gui_chat_printf_date_tags (struct t_gui_buffer *buffer,
extern void gui_chat_printf_y (struct t_gui_buffer *buffer, int y,
const char *message, ...);
extern void gui_chat_print_lines_waiting_buffer (FILE *f);
-extern int gui_chat_hsignal_quote_line_cb (void *data, const char *signal,
+extern int gui_chat_hsignal_quote_line_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable);
extern void gui_chat_end ();
diff --git a/src/gui/gui-color.c b/src/gui/gui-color.c
index e2c9bb4c9..7ffd619a5 100644
--- a/src/gui/gui-color.c
+++ b/src/gui/gui-color.c
@@ -760,11 +760,10 @@ gui_color_decode (const char *string, const char *replacement)
char *
gui_color_decode_ansi_cb (void *data, const char *text)
{
- unsigned long keep_colors;
char *text2, **items, *output, str_color[128];
- int i, length, num_items, value;
+ int i, keep_colors, length, num_items, value;
- keep_colors = (unsigned long)data;
+ keep_colors = (data) ? 1 : 0;;
/* if we don't keep colors of if text is empty, just return empty string */
if (!keep_colors || !text || !text[0])
@@ -1186,20 +1185,20 @@ gui_color_palette_alloc_structs ()
{
if (!gui_color_hash_palette_color)
{
- gui_color_hash_palette_color = hashtable_new (32,
- WEECHAT_HASHTABLE_STRING,
- WEECHAT_HASHTABLE_POINTER,
- NULL,
- NULL);
+ gui_color_hash_palette_color = hashtable_new (
+ 32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_POINTER,
+ NULL, NULL);
gui_color_hash_palette_color->callback_free_value = &gui_color_palette_free_value_cb;
}
if (!gui_color_hash_palette_alias)
{
- gui_color_hash_palette_alias = hashtable_new (32,
- WEECHAT_HASHTABLE_STRING,
- WEECHAT_HASHTABLE_INTEGER,
- NULL,
- NULL);
+ gui_color_hash_palette_alias = hashtable_new (
+ 32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_INTEGER,
+ NULL, NULL);
}
if (!gui_color_list_with_alias)
{
diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c
index 4ef7d37c6..22af93fb5 100644
--- a/src/gui/gui-completion.c
+++ b/src/gui/gui-completion.c
@@ -56,7 +56,8 @@ int gui_completion_freeze = 0; /* 1 to freeze completions (do not */
*/
int
-gui_completion_word_compare_cb (void *data, struct t_arraylist *arraylist,
+gui_completion_word_compare_cb (void *data,
+ struct t_arraylist *arraylist,
void *pointer1, void *pointer2)
{
struct t_gui_completion_word *completion_word1, *completion_word2;
@@ -76,7 +77,8 @@ gui_completion_word_compare_cb (void *data, struct t_arraylist *arraylist,
*/
void
-gui_completion_word_free_cb (void *data, struct t_arraylist *arraylist,
+gui_completion_word_free_cb (void *data,
+ struct t_arraylist *arraylist,
void *pointer)
{
struct t_gui_completion_word *completion_word;
@@ -113,9 +115,10 @@ gui_completion_buffer_init (struct t_gui_completion *completion,
completion->add_space = 1;
completion->force_partial_completion = 0;
- completion->list = arraylist_new (32, 1, 0,
- &gui_completion_word_compare_cb, NULL,
- &gui_completion_word_free_cb, NULL);
+ completion->list = arraylist_new (
+ 32, 1, 0,
+ &gui_completion_word_compare_cb, NULL,
+ &gui_completion_word_free_cb, NULL);
completion->word_found = NULL;
completion->word_found_is_nick = 0;
@@ -1239,7 +1242,8 @@ gui_completion_auto (struct t_gui_completion *completion)
|| (completion->base_word[0] == '~'))
{
if (completion->list->size == 0)
- completion_list_add_filename_cb (NULL, NULL, NULL, completion);
+ completion_list_add_filename_cb (NULL, NULL, NULL, NULL,
+ completion);
gui_completion_complete (completion);
return;
}
@@ -1349,15 +1353,16 @@ gui_completion_get_string (struct t_gui_completion *completion,
*/
struct t_hdata *
-gui_completion_hdata_completion_cb (void *data, const char *hdata_name)
+gui_completion_hdata_completion_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
- hdata = hdata_new (NULL, hdata_name, NULL, NULL,
- 0, 0, NULL, NULL);
+ hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL);
if (hdata)
{
HDATA_VAR(struct t_gui_completion, buffer, POINTER, 0, NULL, "buffer");
@@ -1387,11 +1392,13 @@ gui_completion_hdata_completion_cb (void *data, const char *hdata_name)
*/
struct t_hdata *
-gui_completion_hdata_completion_word_cb (void *data, const char *hdata_name)
+gui_completion_hdata_completion_word_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_item", "next_item",
diff --git a/src/gui/gui-completion.h b/src/gui/gui-completion.h
index b80c8f1a3..1529e4dac 100644
--- a/src/gui/gui-completion.h
+++ b/src/gui/gui-completion.h
@@ -80,9 +80,11 @@ extern void gui_completion_search (struct t_gui_completion *completion,
int pos);
extern const char *gui_completion_get_string (struct t_gui_completion *completion,
const char *property);
-extern struct t_hdata *gui_completion_hdata_completion_cb (void *data,
+extern struct t_hdata *gui_completion_hdata_completion_cb (const void *pointer,
+ void *data,
const char *hdata_name);
-extern struct t_hdata *gui_completion_hdata_completion_partial_cb (void *data,
+extern struct t_hdata *gui_completion_hdata_completion_partial_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern void gui_completion_print_log (struct t_gui_completion *completion);
diff --git a/src/gui/gui-filter.c b/src/gui/gui-filter.c
index b2da42a16..ab279483d 100644
--- a/src/gui/gui-filter.c
+++ b/src/gui/gui-filter.c
@@ -533,11 +533,13 @@ gui_filter_free_all ()
*/
struct t_hdata *
-gui_filter_hdata_filter_cb (void *data, const char *hdata_name)
+gui_filter_hdata_filter_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_filter", "next_filter",
diff --git a/src/gui/gui-filter.h b/src/gui/gui-filter.h
index 0eb86bafc..9c383a263 100644
--- a/src/gui/gui-filter.h
+++ b/src/gui/gui-filter.h
@@ -69,7 +69,8 @@ extern int gui_filter_rename (struct t_gui_filter *filter,
const char *new_name);
extern void gui_filter_free (struct t_gui_filter *filter);
extern void gui_filter_free_all ();
-extern struct t_hdata *gui_filter_hdata_filter_cb (void *data,
+extern struct t_hdata *gui_filter_hdata_filter_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int gui_filter_add_to_infolist (struct t_infolist *infolist,
struct t_gui_filter *filter);
diff --git a/src/gui/gui-focus.c b/src/gui/gui-focus.c
index 321296762..a712886e2 100644
--- a/src/gui/gui-focus.c
+++ b/src/gui/gui-focus.c
@@ -134,7 +134,8 @@ gui_focus_free_info (struct t_gui_focus_info *focus_info)
*/
void
-gui_focus_buffer_localvar_map_cb (void *data, struct t_hashtable *hashtable,
+gui_focus_buffer_localvar_map_cb (void *data,
+ struct t_hashtable *hashtable,
const void *key, const void *value)
{
struct t_hashtable *hashtable_focus;
@@ -171,8 +172,7 @@ gui_focus_to_hashtable (struct t_gui_focus_info *focus_info, const char *key)
hashtable = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (!hashtable)
return NULL;
diff --git a/src/gui/gui-history.c b/src/gui/gui-history.c
index 7c72ec9e8..9f07c4fb4 100644
--- a/src/gui/gui-history.c
+++ b/src/gui/gui-history.c
@@ -277,11 +277,13 @@ gui_history_hdata_history_update_cb (void *data,
*/
struct t_hdata *
-gui_history_hdata_history_cb (void *data, const char *hdata_name)
+gui_history_hdata_history_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_history", "next_history",
diff --git a/src/gui/gui-history.h b/src/gui/gui-history.h
index d4d17d00b..dc7e86434 100644
--- a/src/gui/gui-history.h
+++ b/src/gui/gui-history.h
@@ -39,7 +39,8 @@ extern void gui_history_global_add (const char *string);
extern void gui_history_add (struct t_gui_buffer *buffer, const char *string);
extern void gui_history_global_free ();
extern void gui_history_buffer_free (struct t_gui_buffer *buffer);
-extern struct t_hdata *gui_history_hdata_history_cb (void *data,
+extern struct t_hdata *gui_history_hdata_history_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int gui_history_add_to_infolist (struct t_infolist *infolist,
struct t_gui_history *history);
diff --git a/src/gui/gui-hotlist.c b/src/gui/gui-hotlist.c
index 8c261ece6..e5ef86668 100644
--- a/src/gui/gui-hotlist.c
+++ b/src/gui/gui-hotlist.c
@@ -317,8 +317,7 @@ gui_hotlist_add (struct t_gui_buffer *buffer,
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_POINTER,
- NULL,
- NULL);
+ NULL, NULL);
if (!gui_hotlist_hashtable_add_conditions_pointers)
return NULL;
}
@@ -328,8 +327,7 @@ gui_hotlist_add (struct t_gui_buffer *buffer,
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (!gui_hotlist_hashtable_add_conditions_vars)
return NULL;
}
@@ -339,8 +337,7 @@ gui_hotlist_add (struct t_gui_buffer *buffer,
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (!gui_hotlist_hashtable_add_conditions_options)
return NULL;
hashtable_set (gui_hotlist_hashtable_add_conditions_options,
@@ -539,11 +536,13 @@ gui_hotlist_remove_buffer (struct t_gui_buffer *buffer,
*/
struct t_hdata *
-gui_hotlist_hdata_hotlist_cb (void *data, const char *hdata_name)
+gui_hotlist_hdata_hotlist_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_hotlist", "next_hotlist",
diff --git a/src/gui/gui-hotlist.h b/src/gui/gui-hotlist.h
index 79760908e..d3f9f58e4 100644
--- a/src/gui/gui-hotlist.h
+++ b/src/gui/gui-hotlist.h
@@ -61,7 +61,8 @@ extern void gui_hotlist_resort ();
extern void gui_hotlist_clear ();
extern void gui_hotlist_remove_buffer (struct t_gui_buffer *buffer,
int force_remove_buffer);
-extern struct t_hdata *gui_hotlist_hdata_hotlist_cb (void *data,
+extern struct t_hdata *gui_hotlist_hdata_hotlist_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int gui_hotlist_add_to_infolist (struct t_infolist *infolist,
struct t_gui_hotlist *hotlist);
diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c
index 436d878af..51ae755e5 100644
--- a/src/gui/gui-key.c
+++ b/src/gui/gui-key.c
@@ -196,12 +196,14 @@ gui_key_grab_init (int grab_command, const char *delay)
*/
int
-gui_key_grab_end_timer_cb (void *data, int remaining_calls)
+gui_key_grab_end_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
char *expanded_key, *expanded_key2;
struct t_gui_key *ptr_key;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) remaining_calls;
@@ -1292,7 +1294,7 @@ gui_key_pressed (const char *key_str)
if (gui_key_grab_count == 0)
{
hook_timer (NULL, gui_key_grab_delay, 0, 1,
- &gui_key_grab_end_timer_cb, NULL);
+ &gui_key_grab_end_timer_cb, NULL, NULL);
}
gui_key_grab_count++;
return 0;
@@ -1740,9 +1742,11 @@ gui_key_paste_check (int bracketed_paste)
*/
int
-gui_key_paste_bracketed_timer_cb (void *data, int remaining_calls)
+gui_key_paste_bracketed_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) remaining_calls;
@@ -1776,10 +1780,11 @@ void
gui_key_paste_bracketed_timer_add ()
{
gui_key_paste_bracketed_timer_remove ();
- gui_key_paste_bracketed_timer = hook_timer (NULL,
- CONFIG_INTEGER(config_look_paste_bracketed_timer_delay) * 1000,
- 0, 1,
- &gui_key_paste_bracketed_timer_cb, NULL);
+ gui_key_paste_bracketed_timer = hook_timer (
+ NULL,
+ CONFIG_INTEGER(config_look_paste_bracketed_timer_delay) * 1000,
+ 0, 1,
+ &gui_key_paste_bracketed_timer_cb, NULL, NULL);
}
/*
@@ -1870,13 +1875,15 @@ gui_key_end ()
*/
struct t_hdata *
-gui_key_hdata_key_cb (void *data, const char *hdata_name)
+gui_key_hdata_key_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
int i;
char str_list[128];
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_key", "next_key",
diff --git a/src/gui/gui-key.h b/src/gui/gui-key.h
index ccbfab515..acda6a991 100644
--- a/src/gui/gui-key.h
+++ b/src/gui/gui-key.h
@@ -129,7 +129,8 @@ extern void gui_key_paste_bracketed_stop ();
extern void gui_key_paste_accept ();
extern void gui_key_paste_cancel ();
extern void gui_key_end ();
-extern struct t_hdata *gui_key_hdata_key_cb (void *data,
+extern struct t_hdata *gui_key_hdata_key_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int gui_key_add_to_infolist (struct t_infolist *infolist,
struct t_gui_key *key);
diff --git a/src/gui/gui-layout.c b/src/gui/gui-layout.c
index 8f335c9ec..d0a957239 100644
--- a/src/gui/gui-layout.c
+++ b/src/gui/gui-layout.c
@@ -883,11 +883,13 @@ gui_layout_remove_all ()
*/
struct t_hdata *
-gui_layout_hdata_layout_buffer_cb (void *data, const char *hdata_name)
+gui_layout_hdata_layout_buffer_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_layout", "next_layout",
@@ -908,11 +910,13 @@ gui_layout_hdata_layout_buffer_cb (void *data, const char *hdata_name)
*/
struct t_hdata *
-gui_layout_hdata_layout_window_cb (void *data, const char *hdata_name)
+gui_layout_hdata_layout_window_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL);
@@ -935,11 +939,13 @@ gui_layout_hdata_layout_window_cb (void *data, const char *hdata_name)
*/
struct t_hdata *
-gui_layout_hdata_layout_cb (void *data, const char *hdata_name)
+gui_layout_hdata_layout_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_layout", "next_layout",
diff --git a/src/gui/gui-layout.h b/src/gui/gui-layout.h
index 968af3afb..24833a253 100644
--- a/src/gui/gui-layout.h
+++ b/src/gui/gui-layout.h
@@ -113,11 +113,14 @@ extern void gui_layout_store_on_exit ();
extern void gui_layout_free (struct t_gui_layout *layout);
extern void gui_layout_remove (struct t_gui_layout *layout);
extern void gui_layout_remove_all ();
-extern struct t_hdata *gui_layout_hdata_layout_buffer_cb (void *data,
+extern struct t_hdata *gui_layout_hdata_layout_buffer_cb (const void *pointer,
+ void *data,
const char *hdata_name);
-extern struct t_hdata *gui_layout_hdata_layout_window_cb (void *data,
+extern struct t_hdata *gui_layout_hdata_layout_window_cb (const void *pointer,
+ void *data,
const char *hdata_name);
-extern struct t_hdata *gui_layout_hdata_layout_cb (void *data,
+extern struct t_hdata *gui_layout_hdata_layout_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int gui_layout_buffer_add_to_infolist (struct t_infolist *infolist,
struct t_gui_layout_buffer *layout_buffer);
diff --git a/src/gui/gui-line.c b/src/gui/gui-line.c
index 14a529376..e5c1d30f7 100644
--- a/src/gui/gui-line.c
+++ b/src/gui/gui-line.c
@@ -1562,11 +1562,13 @@ gui_line_mix_buffers (struct t_gui_buffer *buffer)
*/
struct t_hdata *
-gui_line_hdata_lines_cb (void *data, const char *hdata_name)
+gui_line_hdata_lines_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL);
@@ -1591,11 +1593,13 @@ gui_line_hdata_lines_cb (void *data, const char *hdata_name)
*/
struct t_hdata *
-gui_line_hdata_line_cb (void *data, const char *hdata_name)
+gui_line_hdata_line_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_line", "next_line",
@@ -1704,11 +1708,13 @@ gui_line_hdata_line_data_update_cb (void *data,
*/
struct t_hdata *
-gui_line_hdata_line_data_cb (void *data, const char *hdata_name)
+gui_line_hdata_line_data_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, NULL, NULL,
diff --git a/src/gui/gui-line.h b/src/gui/gui-line.h
index 015be32e1..1089b9b3a 100644
--- a/src/gui/gui-line.h
+++ b/src/gui/gui-line.h
@@ -113,11 +113,14 @@ extern void gui_line_add_y (struct t_gui_buffer *buffer, int y,
const char *message);
extern void gui_line_clear (struct t_gui_line *line);
extern void gui_line_mix_buffers (struct t_gui_buffer *buffer);
-extern struct t_hdata *gui_line_hdata_lines_cb (void *data,
+extern struct t_hdata *gui_line_hdata_lines_cb (const void *pointer,
+ void *data,
const char *hdata_name);
-extern struct t_hdata *gui_line_hdata_line_cb (void *data,
+extern struct t_hdata *gui_line_hdata_line_cb (const void *pointer,
+ void *data,
const char *hdata_name);
-extern struct t_hdata *gui_line_hdata_line_data_cb (void *data,
+extern struct t_hdata *gui_line_hdata_line_data_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int gui_line_add_to_infolist (struct t_infolist *infolist,
struct t_gui_lines *lines,
diff --git a/src/gui/gui-nicklist.c b/src/gui/gui-nicklist.c
index 0c907ef6f..c81cd3c82 100644
--- a/src/gui/gui-nicklist.c
+++ b/src/gui/gui-nicklist.c
@@ -98,8 +98,7 @@ gui_nicklist_send_hsignal (const char *signal, struct t_gui_buffer *buffer,
gui_nicklist_hsignal = hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_POINTER,
- NULL,
- NULL);
+ NULL, NULL);
}
if (!gui_nicklist_hsignal)
@@ -394,7 +393,8 @@ gui_nicklist_search_nick (struct t_gui_buffer *buffer,
{
if (buffer->nickcmp_callback)
{
- if ((buffer->nickcmp_callback) (buffer->nickcmp_callback_data,
+ if ((buffer->nickcmp_callback) (buffer->nickcmp_callback_pointer,
+ buffer->nickcmp_callback_data,
buffer,
ptr_nick->name,
name) == 0)
@@ -1036,11 +1036,13 @@ gui_nicklist_nick_set (struct t_gui_buffer *buffer,
*/
struct t_hdata *
-gui_nicklist_hdata_nick_group_cb (void *data, const char *hdata_name)
+gui_nicklist_hdata_nick_group_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_group", "next_group",
@@ -1067,11 +1069,13 @@ gui_nicklist_hdata_nick_group_cb (void *data, const char *hdata_name)
*/
struct t_hdata *
-gui_nicklist_hdata_nick_cb (void *data, const char *hdata_name)
+gui_nicklist_hdata_nick_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_nick", "next_nick",
diff --git a/src/gui/gui-nicklist.h b/src/gui/gui-nicklist.h
index 03c8f59e3..1a2e316ca 100644
--- a/src/gui/gui-nicklist.h
+++ b/src/gui/gui-nicklist.h
@@ -108,9 +108,11 @@ extern void *gui_nicklist_nick_get_pointer (struct t_gui_buffer *buffer,
extern void gui_nicklist_nick_set (struct t_gui_buffer *buffer,
struct t_gui_nick *nick,
const char *property, const char *value);
-extern struct t_hdata *gui_nicklist_hdata_nick_group_cb (void *data,
+extern struct t_hdata *gui_nicklist_hdata_nick_group_cb (const void *pointer,
+ void *data,
const char *hdata_name);
-extern struct t_hdata *gui_nicklist_hdata_nick_cb (void *data,
+extern struct t_hdata *gui_nicklist_hdata_nick_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int gui_nicklist_add_to_infolist (struct t_infolist *infolist,
struct t_gui_buffer *buffer,
diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c
index 5d4e2270b..263fc938f 100644
--- a/src/gui/gui-window.c
+++ b/src/gui/gui-window.c
@@ -1797,11 +1797,13 @@ gui_window_zoom (struct t_gui_window *window)
*/
struct t_hdata *
-gui_window_hdata_window_cb (void *data, const char *hdata_name)
+gui_window_hdata_window_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_window", "next_window",
@@ -1844,11 +1846,13 @@ gui_window_hdata_window_cb (void *data, const char *hdata_name)
*/
struct t_hdata *
-gui_window_hdata_window_scroll_cb (void *data, const char *hdata_name)
+gui_window_hdata_window_scroll_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_scroll", "next_scroll",
@@ -1874,11 +1878,13 @@ gui_window_hdata_window_scroll_cb (void *data, const char *hdata_name)
*/
struct t_hdata *
-gui_window_hdata_window_tree_cb (void *data, const char *hdata_name)
+gui_window_hdata_window_tree_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL);
diff --git a/src/gui/gui-window.h b/src/gui/gui-window.h
index 87f957141..cea5c5a37 100644
--- a/src/gui/gui-window.h
+++ b/src/gui/gui-window.h
@@ -190,11 +190,14 @@ extern void gui_window_search_stop_here (struct t_gui_window *window);
extern void gui_window_search_stop (struct t_gui_window *window);
extern int gui_window_search_text (struct t_gui_window *window);
extern void gui_window_zoom (struct t_gui_window *window);
-extern struct t_hdata *gui_window_hdata_window_cb (void *data,
+extern struct t_hdata *gui_window_hdata_window_cb (const void *pointer,
+ void *data,
const char *hdata_name);
-extern struct t_hdata *gui_window_hdata_window_scroll_cb (void *data,
+extern struct t_hdata *gui_window_hdata_window_scroll_cb (const void *pointer,
+ void *data,
const char *hdata_name);
-extern struct t_hdata *gui_window_hdata_window_tree_cb (void *data,
+extern struct t_hdata *gui_window_hdata_window_tree_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int gui_window_add_to_infolist (struct t_infolist *infolist,
struct t_gui_window *window);
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index 40d73e10d..d10fd58f2 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -26,8 +26,7 @@ plugin-config.h plugin-config.c)
set(LIB_PLUGINS_SCRIPTS_SRC
plugin-script.c plugin-script.h
-plugin-script-api.c plugin-script-api.h
-plugin-script-callback.c plugin-script-callback.h)
+plugin-script-api.c plugin-script-api.h)
include_directories(${CMAKE_BINARY_DIR})
add_library(weechat_plugins STATIC ${LIB_PLUGINS_SRC})
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index aa46965f7..20a29cc19 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -34,8 +34,6 @@ noinst_LTLIBRARIES = lib_weechat_plugins_scripts.la
lib_weechat_plugins_scripts_la_SOURCES = plugin-script.c \
plugin-script.h \
- plugin-script-callback.c \
- plugin-script-callback.h \
plugin-script-api.c \
plugin-script-api.h
diff --git a/src/plugins/alias/alias-command.c b/src/plugins/alias/alias-command.c
index 59975387d..f492faaa5 100644
--- a/src/plugins/alias/alias-command.c
+++ b/src/plugins/alias/alias-command.c
@@ -76,7 +76,8 @@ alias_command_add (const char *alias_name, const char *command,
*/
int
-alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
+alias_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
char *ptr_alias_name;
@@ -85,6 +86,7 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
int alias_found, i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -287,5 +289,5 @@ alias_command_init ()
" || add %(alias) %(commands)|%(alias_value)"
" || addcompletion %- %(alias) %(commands)|%(alias_value)"
" || del %(alias)|%*",
- &alias_command_cb, NULL);
+ &alias_command_cb, NULL, NULL);
}
diff --git a/src/plugins/alias/alias-completion.c b/src/plugins/alias/alias-completion.c
index 42e3a553e..fd90b1c5d 100644
--- a/src/plugins/alias/alias-completion.c
+++ b/src/plugins/alias/alias-completion.c
@@ -32,13 +32,15 @@
*/
int
-alias_completion_alias_cb (void *data, const char *completion_item,
+alias_completion_alias_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
struct t_alias *ptr_alias;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -58,7 +60,8 @@ alias_completion_alias_cb (void *data, const char *completion_item,
*/
int
-alias_completion_alias_value_cb (void *data, const char *completion_item,
+alias_completion_alias_value_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -68,6 +71,7 @@ alias_completion_alias_value_cb (void *data, const char *completion_item,
struct t_alias *ptr_alias;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -110,7 +114,7 @@ void
alias_completion_init ()
{
weechat_hook_completion ("alias", N_("list of aliases"),
- &alias_completion_alias_cb, NULL);
+ &alias_completion_alias_cb, NULL, NULL);
weechat_hook_completion ("alias_value", N_("value of alias"),
- &alias_completion_alias_value_cb, NULL);
+ &alias_completion_alias_value_cb, NULL, NULL);
}
diff --git a/src/plugins/alias/alias-config.c b/src/plugins/alias/alias-config.c
index 9a2128b39..1ad8780c3 100644
--- a/src/plugins/alias/alias-config.c
+++ b/src/plugins/alias/alias-config.c
@@ -78,11 +78,13 @@ char *alias_default_completion[][2] =
*/
void
-alias_config_cmd_change_cb (void *data, struct t_config_option *option)
+alias_config_cmd_change_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_config_option *ptr_option_completion;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_option_completion = weechat_config_search_option (alias_config_file,
@@ -100,12 +102,14 @@ alias_config_cmd_change_cb (void *data, struct t_config_option *option)
*/
void
-alias_config_cmd_delete_cb (void *data, struct t_config_option *option)
+alias_config_cmd_delete_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_config_option *ptr_option_completion;
struct t_alias *ptr_alias;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_option_completion = weechat_config_search_option (alias_config_file,
@@ -125,11 +129,13 @@ alias_config_cmd_delete_cb (void *data, struct t_config_option *option)
*/
void
-alias_config_completion_change_cb (void *data, struct t_config_option *option)
+alias_config_completion_change_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_alias *ptr_alias;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_alias = alias_search (weechat_config_option_get_pointer (option, "name"));
@@ -145,11 +151,13 @@ alias_config_completion_change_cb (void *data, struct t_config_option *option)
*/
void
-alias_config_completion_delete_cb (void *data, struct t_config_option *option)
+alias_config_completion_delete_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_alias *ptr_alias;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_alias = alias_search (weechat_config_option_get_pointer (option, "name"));
@@ -164,9 +172,11 @@ alias_config_completion_delete_cb (void *data, struct t_config_option *option)
*/
int
-alias_config_reload (void *data, struct t_config_file *config_file)
+alias_config_reload (const void *pointer, void *data,
+ struct t_config_file *config_file)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
weechat_config_section_free_options (alias_config_section_cmd);
@@ -181,13 +191,14 @@ alias_config_reload (void *data, struct t_config_file *config_file)
*/
int
-alias_config_cmd_write_default_cb (void *data,
+alias_config_cmd_write_default_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!weechat_config_write_line (config_file, section_name, NULL))
@@ -214,9 +225,9 @@ alias_config_cmd_new_option (const char *name, const char *command)
weechat_config_new_option (alias_config_file, alias_config_section_cmd,
name, "string", NULL,
NULL, 0, 0, NULL, command, 0,
- NULL, NULL,
- &alias_config_cmd_change_cb, NULL,
- &alias_config_cmd_delete_cb, NULL);
+ NULL, NULL, NULL,
+ &alias_config_cmd_change_cb, NULL, NULL,
+ &alias_config_cmd_delete_cb, NULL, NULL);
}
/*
@@ -224,7 +235,7 @@ alias_config_cmd_new_option (const char *name, const char *command)
*/
int
-alias_config_cmd_create_option_cb (void *data,
+alias_config_cmd_create_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
@@ -233,6 +244,7 @@ alias_config_cmd_create_option_cb (void *data,
int rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -266,13 +278,14 @@ alias_config_cmd_create_option_cb (void *data,
*/
int
-alias_config_completion_write_default_cb (void *data,
+alias_config_completion_write_default_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!weechat_config_write_line (config_file, section_name, NULL))
@@ -300,9 +313,9 @@ alias_config_completion_new_option (const char *name, const char *completion)
alias_config_section_completion,
name, "string", NULL,
NULL, 0, 0, NULL, completion, 0,
- NULL, NULL,
- &alias_config_completion_change_cb, NULL,
- &alias_config_completion_delete_cb, NULL);
+ NULL, NULL, NULL,
+ &alias_config_completion_change_cb, NULL, NULL,
+ &alias_config_completion_delete_cb, NULL, NULL);
}
/*
@@ -310,7 +323,7 @@ alias_config_completion_new_option (const char *name, const char *completion)
*/
int
-alias_config_completion_create_option_cb (void *data,
+alias_config_completion_create_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
@@ -319,6 +332,7 @@ alias_config_completion_create_option_cb (void *data,
struct t_alias *ptr_alias;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -357,18 +371,19 @@ alias_config_init ()
struct t_config_section *ptr_section;
alias_config_file = weechat_config_new (ALIAS_CONFIG_NAME,
- &alias_config_reload, NULL);
+ &alias_config_reload, NULL, NULL);
if (!alias_config_file)
return 0;
/* cmd */
- ptr_section = weechat_config_new_section (alias_config_file, "cmd",
- 1, 1,
- NULL, NULL,
- NULL, NULL,
- &alias_config_cmd_write_default_cb, NULL,
- &alias_config_cmd_create_option_cb, NULL,
- NULL, NULL);
+ ptr_section = weechat_config_new_section (
+ alias_config_file, "cmd",
+ 1, 1,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &alias_config_cmd_write_default_cb, NULL, NULL,
+ &alias_config_cmd_create_option_cb, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (alias_config_file);
@@ -377,13 +392,14 @@ alias_config_init ()
alias_config_section_cmd = ptr_section;
/* completion */
- ptr_section = weechat_config_new_section (alias_config_file, "completion",
- 1, 1,
- NULL, NULL,
- NULL, NULL,
- &alias_config_completion_write_default_cb, NULL,
- &alias_config_completion_create_option_cb, NULL,
- NULL, NULL);
+ ptr_section = weechat_config_new_section (
+ alias_config_file, "completion",
+ 1, 1,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &alias_config_completion_write_default_cb, NULL, NULL,
+ &alias_config_completion_create_option_cb, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (alias_config_file);
diff --git a/src/plugins/alias/alias-info.c b/src/plugins/alias/alias-info.c
index 600f0c8c2..484c6082b 100644
--- a/src/plugins/alias/alias-info.c
+++ b/src/plugins/alias/alias-info.c
@@ -30,28 +30,30 @@
*/
struct t_infolist *
-alias_info_infolist_alias_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+alias_info_infolist_alias_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_alias *ptr_alias;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
(void) arguments;
- if (pointer && !alias_valid (pointer))
+ if (obj_pointer && !alias_valid (obj_pointer))
return NULL;
ptr_infolist = weechat_infolist_new ();
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one alias */
- if (!alias_add_to_infolist (ptr_infolist, pointer))
+ if (!alias_add_to_infolist (ptr_infolist, obj_pointer))
{
weechat_infolist_free (ptr_infolist);
return NULL;
@@ -90,5 +92,5 @@ alias_info_init ()
"alias", N_("list of aliases"),
N_("alias pointer (optional)"),
N_("alias name (wildcard \"*\" is allowed) (optional)"),
- &alias_info_infolist_alias_cb, NULL);
+ &alias_info_infolist_alias_cb, NULL, NULL);
}
diff --git a/src/plugins/alias/alias.c b/src/plugins/alias/alias.c
index db02f987c..961748757 100644
--- a/src/plugins/alias/alias.c
+++ b/src/plugins/alias/alias.c
@@ -337,7 +337,8 @@ alias_run_command (struct t_gui_buffer **buffer, const char *command)
*/
int
-alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv,
+alias_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, int argc, char **argv,
char **argv_eol)
{
struct t_alias *ptr_alias;
@@ -346,9 +347,10 @@ alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv,
int some_args_replaced, length1, length2;
/* make C compiler happy */
+ (void) data;
(void) argv;
- ptr_alias = (struct t_alias *)data;
+ ptr_alias = (struct t_alias *)pointer;
if (ptr_alias->running)
{
@@ -545,7 +547,7 @@ alias_hook_command (struct t_alias *alias)
alias->command,
NULL, NULL,
(str_completion) ? str_completion : alias->completion,
- &alias_cb, alias);
+ &alias_cb, alias, NULL);
if (str_priority_name)
free (str_priority_name);
diff --git a/src/plugins/aspell/weechat-aspell-bar-item.c b/src/plugins/aspell/weechat-aspell-bar-item.c
index c723ce782..efb73ae8c 100644
--- a/src/plugins/aspell/weechat-aspell-bar-item.c
+++ b/src/plugins/aspell/weechat-aspell-bar-item.c
@@ -35,7 +35,8 @@
*/
char *
-weechat_aspell_bar_item_dict (void *data, struct t_gui_bar_item *item,
+weechat_aspell_bar_item_dict (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -43,6 +44,7 @@ weechat_aspell_bar_item_dict (void *data, struct t_gui_bar_item *item,
const char *dict_list;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -61,7 +63,8 @@ weechat_aspell_bar_item_dict (void *data, struct t_gui_bar_item *item,
*/
char *
-weechat_aspell_bar_item_suggest (void *data, struct t_gui_bar_item *item,
+weechat_aspell_bar_item_suggest (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -71,6 +74,7 @@ weechat_aspell_bar_item_suggest (void *data, struct t_gui_bar_item *item,
int i, num_suggestions, length;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -132,6 +136,8 @@ weechat_aspell_bar_item_suggest (void *data, struct t_gui_bar_item *item,
void
weechat_aspell_bar_item_init ()
{
- weechat_bar_item_new ("aspell_dict", &weechat_aspell_bar_item_dict, NULL);
- weechat_bar_item_new ("aspell_suggest", &weechat_aspell_bar_item_suggest, NULL);
+ weechat_bar_item_new ("aspell_dict",
+ &weechat_aspell_bar_item_dict, NULL, NULL);
+ weechat_bar_item_new ("aspell_suggest",
+ &weechat_aspell_bar_item_suggest, NULL, NULL);
}
diff --git a/src/plugins/aspell/weechat-aspell-command.c b/src/plugins/aspell/weechat-aspell-command.c
index 36b06ece7..740f5aac4 100644
--- a/src/plugins/aspell/weechat-aspell-command.c
+++ b/src/plugins/aspell/weechat-aspell-command.c
@@ -330,7 +330,8 @@ end:
*/
int
-weechat_aspell_command_cb (void *data, struct t_gui_buffer *buffer,
+weechat_aspell_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
char *dicts;
@@ -339,6 +340,7 @@ weechat_aspell_command_cb (void *data, struct t_gui_buffer *buffer,
int number;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (argc == 1)
@@ -499,5 +501,5 @@ weechat_aspell_command_init ()
" || setdict %(aspell_dicts)"
" || deldict"
" || addword",
- &weechat_aspell_command_cb, NULL);
+ &weechat_aspell_command_cb, NULL, NULL);
}
diff --git a/src/plugins/aspell/weechat-aspell-completion.c b/src/plugins/aspell/weechat-aspell-completion.c
index c095a0091..30917a012 100644
--- a/src/plugins/aspell/weechat-aspell-completion.c
+++ b/src/plugins/aspell/weechat-aspell-completion.c
@@ -33,13 +33,15 @@
*/
int
-weechat_aspell_completion_langs_cb (void *data, const char *completion_item,
+weechat_aspell_completion_langs_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -81,7 +83,7 @@ weechat_aspell_completion_enchant_add_dict_cb (const char *lang_tag,
*/
int
-weechat_aspell_completion_dicts_cb (void *data,
+weechat_aspell_completion_dicts_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -94,6 +96,7 @@ weechat_aspell_completion_dicts_cb (void *data,
#endif /* USE_ENCHANT */
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -129,8 +132,8 @@ weechat_aspell_completion_init ()
{
weechat_hook_completion ("aspell_langs",
N_("list of all languages supported by aspell"),
- &weechat_aspell_completion_langs_cb, NULL);
+ &weechat_aspell_completion_langs_cb, NULL, NULL);
weechat_hook_completion ("aspell_dicts",
N_("list of aspell installed dictionaries"),
- &weechat_aspell_completion_dicts_cb, NULL);
+ &weechat_aspell_completion_dicts_cb, NULL, NULL);
}
diff --git a/src/plugins/aspell/weechat-aspell-config.c b/src/plugins/aspell/weechat-aspell-config.c
index ee46731be..b3a1bb11e 100644
--- a/src/plugins/aspell/weechat-aspell-config.c
+++ b/src/plugins/aspell/weechat-aspell-config.c
@@ -61,13 +61,14 @@ int *weechat_aspell_length_commands_to_check = NULL;
*/
void
-weechat_aspell_config_change_commands (void *data,
+weechat_aspell_config_change_commands (const void *pointer, void *data,
struct t_config_option *option)
{
const char *value;
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (weechat_aspell_commands_to_check)
@@ -106,10 +107,11 @@ weechat_aspell_config_change_commands (void *data,
*/
void
-weechat_aspell_config_change_default_dict (void *data,
+weechat_aspell_config_change_default_dict (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -123,9 +125,11 @@ weechat_aspell_config_change_default_dict (void *data,
*/
void
-weechat_aspell_config_change_enabled (void *data, struct t_config_option *option)
+weechat_aspell_config_change_enabled (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
aspell_enabled = weechat_config_boolean (option);
@@ -140,10 +144,11 @@ weechat_aspell_config_change_enabled (void *data, struct t_config_option *option
*/
void
-weechat_aspell_config_change_suggestions (void *data,
+weechat_aspell_config_change_suggestions (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -155,10 +160,11 @@ weechat_aspell_config_change_suggestions (void *data,
*/
void
-weechat_aspell_config_dict_change (void *data,
+weechat_aspell_config_dict_change (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -172,12 +178,13 @@ weechat_aspell_config_dict_change (void *data,
*/
int
-weechat_aspell_config_dict_delete_option (void *data,
+weechat_aspell_config_dict_delete_option (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -196,7 +203,7 @@ weechat_aspell_config_dict_delete_option (void *data,
*/
int
-weechat_aspell_config_dict_create_option (void *data,
+weechat_aspell_config_dict_create_option (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
@@ -206,6 +213,7 @@ weechat_aspell_config_dict_create_option (void *data,
int rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
rc = WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -236,9 +244,9 @@ weechat_aspell_config_dict_create_option (void *data,
option_name, "string",
_("comma separated list of dictionaries to use on this buffer"),
NULL, 0, 0, "", value, 0,
- NULL, NULL,
- &weechat_aspell_config_dict_change, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ &weechat_aspell_config_dict_change, NULL, NULL,
+ NULL, NULL, NULL);
rc = (ptr_option) ?
WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
}
@@ -269,10 +277,11 @@ weechat_aspell_config_dict_create_option (void *data,
*/
void
-weechat_aspell_config_option_change (void *data,
+weechat_aspell_config_option_change (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -286,12 +295,13 @@ weechat_aspell_config_option_change (void *data,
*/
int
-weechat_aspell_config_option_delete_option (void *data,
+weechat_aspell_config_option_delete_option (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -310,7 +320,7 @@ weechat_aspell_config_option_delete_option (void *data,
*/
int
-weechat_aspell_config_option_create_option (void *data,
+weechat_aspell_config_option_create_option (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
@@ -320,6 +330,7 @@ weechat_aspell_config_option_create_option (void *data,
int rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
rc = WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -348,9 +359,9 @@ weechat_aspell_config_option_create_option (void *data,
_("option for aspell (for list of available options and "
"format, run command \"aspell config\" in a shell)"),
NULL, 0, 0, "", value, 0,
- NULL, NULL,
- &weechat_aspell_config_option_change, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ &weechat_aspell_config_option_change, NULL, NULL,
+ NULL, NULL, NULL);
rc = (ptr_option) ?
WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
}
@@ -395,7 +406,7 @@ weechat_aspell_config_get_dict (const char *name)
int
weechat_aspell_config_set_dict (const char *name, const char *value)
{
- return weechat_aspell_config_dict_create_option (NULL,
+ return weechat_aspell_config_dict_create_option (NULL, NULL,
weechat_aspell_config_file,
weechat_aspell_config_section_dict,
name,
@@ -416,16 +427,19 @@ weechat_aspell_config_init ()
struct t_config_section *ptr_section;
weechat_aspell_config_file = weechat_config_new (ASPELL_CONFIG_NAME,
- NULL, NULL);
+ NULL, NULL, NULL);
if (!weechat_aspell_config_file)
return 0;
/* color */
- ptr_section = weechat_config_new_section (weechat_aspell_config_file, "color",
- 0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ ptr_section = weechat_config_new_section (
+ weechat_aspell_config_file, "color",
+ 0, 0,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (weechat_aspell_config_file);
@@ -436,19 +450,24 @@ weechat_aspell_config_init ()
weechat_aspell_config_file, ptr_section,
"misspelled", "color",
N_("text color for misspelled words (input bar)"),
- NULL, 0, 0, "lightred", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "lightred", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
weechat_aspell_config_color_suggestions = weechat_config_new_option (
weechat_aspell_config_file, ptr_section,
"suggestions", "color",
N_("text color for suggestions on a misspelled word (status bar)"),
- NULL, 0, 0, "default", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "default", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* check */
- ptr_section = weechat_config_new_section (weechat_aspell_config_file, "check",
- 0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ ptr_section = weechat_config_new_section (
+ weechat_aspell_config_file, "check",
+ 0, 0,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (weechat_aspell_config_file);
@@ -463,7 +482,9 @@ weechat_aspell_config_init ()
NULL, 0, 0,
"ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,"
"quit,topic", NULL, 0,
- NULL, NULL, &weechat_aspell_config_change_commands, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &weechat_aspell_config_change_commands, NULL, NULL,
+ NULL, NULL, NULL);
weechat_aspell_config_check_default_dict = weechat_config_new_option (
weechat_aspell_config_file, ptr_section,
"default_dict", "string",
@@ -471,24 +492,30 @@ weechat_aspell_config_init ()
"use when buffer has no dictionary defined (leave blank to disable "
"aspell on buffers for which you didn't explicitly enabled it)"),
NULL, 0, 0, "", NULL, 0,
- NULL, NULL, &weechat_aspell_config_change_default_dict, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &weechat_aspell_config_change_default_dict, NULL, NULL,
+ NULL, NULL, NULL);
weechat_aspell_config_check_during_search = weechat_config_new_option (
weechat_aspell_config_file, ptr_section,
"during_search", "boolean",
N_("check words during text search in buffer"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
weechat_aspell_config_check_enabled = weechat_config_new_option (
weechat_aspell_config_file, ptr_section,
"enabled", "boolean",
N_("enable aspell check for command line"),
NULL, 0, 0, "off", NULL, 0,
- NULL, NULL, &weechat_aspell_config_change_enabled, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &weechat_aspell_config_change_enabled, NULL, NULL,
+ NULL, NULL, NULL);
weechat_aspell_config_check_real_time = weechat_config_new_option (
weechat_aspell_config_file, ptr_section,
"real_time", "boolean",
N_("real-time spell checking of words (slower, disabled by default: "
"words are checked only if there's delimiter after)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
weechat_aspell_config_check_suggestions = weechat_config_new_option (
weechat_aspell_config_file, ptr_section,
"suggestions", "integer",
@@ -496,22 +523,26 @@ weechat_aspell_config_init ()
"for each dictionary set in buffer (-1 = disable suggestions, "
"0 = display all possible suggestions in all languages)"),
NULL, -1, INT_MAX, "-1", NULL, 0,
- NULL, NULL, &weechat_aspell_config_change_suggestions, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &weechat_aspell_config_change_suggestions, NULL, NULL,
+ NULL, NULL, NULL);
weechat_aspell_config_check_word_min_length = weechat_config_new_option (
weechat_aspell_config_file, ptr_section,
"word_min_length", "integer",
N_("minimum length for a word to be spell checked (use 0 to check all "
"words)"),
- NULL, 0, INT_MAX, "2", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, INT_MAX, "2", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* dict */
- ptr_section = weechat_config_new_section (weechat_aspell_config_file, "dict",
- 1, 1,
- NULL, NULL,
- NULL, NULL,
- NULL, NULL,
- &weechat_aspell_config_dict_create_option, NULL,
- &weechat_aspell_config_dict_delete_option, NULL);
+ ptr_section = weechat_config_new_section (
+ weechat_aspell_config_file, "dict",
+ 1, 1,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &weechat_aspell_config_dict_create_option, NULL, NULL,
+ &weechat_aspell_config_dict_delete_option, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (weechat_aspell_config_file);
@@ -521,13 +552,14 @@ weechat_aspell_config_init ()
weechat_aspell_config_section_dict = ptr_section;
/* option */
- ptr_section = weechat_config_new_section (weechat_aspell_config_file, "option",
- 1, 1,
- NULL, NULL,
- NULL, NULL,
- NULL, NULL,
- &weechat_aspell_config_option_create_option, NULL,
- &weechat_aspell_config_option_delete_option, NULL);
+ ptr_section = weechat_config_new_section (
+ weechat_aspell_config_file, "option",
+ 1, 1,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &weechat_aspell_config_option_create_option, NULL, NULL,
+ &weechat_aspell_config_option_delete_option, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (weechat_aspell_config_file);
@@ -551,8 +583,8 @@ weechat_aspell_config_read ()
weechat_aspell_config_loading = 0;
if (rc == WEECHAT_CONFIG_READ_OK)
{
- weechat_aspell_config_change_commands (NULL,
- weechat_aspell_config_check_commands);
+ weechat_aspell_config_change_commands (
+ NULL, NULL, weechat_aspell_config_check_commands);
}
weechat_aspell_speller_remove_unused ();
diff --git a/src/plugins/aspell/weechat-aspell-info.c b/src/plugins/aspell/weechat-aspell-info.c
index 33e6eed86..3e298c063 100644
--- a/src/plugins/aspell/weechat-aspell-info.c
+++ b/src/plugins/aspell/weechat-aspell-info.c
@@ -32,7 +32,8 @@
*/
const char *
-weechat_aspell_info_info_aspell_dict_cb (void *data, const char *info_name,
+weechat_aspell_info_info_aspell_dict_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
int rc;
@@ -41,6 +42,7 @@ weechat_aspell_info_info_aspell_dict_cb (void *data, const char *info_name,
const char *buffer_full_name;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
@@ -83,5 +85,5 @@ weechat_aspell_info_init ()
N_("comma-separated list of dictionaries used in buffer"),
N_("buffer pointer (\"0x12345678\") or buffer full name "
"(\"irc.freenode.#weechat\")"),
- &weechat_aspell_info_info_aspell_dict_cb, NULL);
+ &weechat_aspell_info_info_aspell_dict_cb, NULL, NULL);
}
diff --git a/src/plugins/aspell/weechat-aspell-speller.c b/src/plugins/aspell/weechat-aspell-speller.c
index fdaee28f5..65b236e3a 100644
--- a/src/plugins/aspell/weechat-aspell-speller.c
+++ b/src/plugins/aspell/weechat-aspell-speller.c
@@ -272,8 +272,7 @@ weechat_aspell_speller_remove_unused ()
used_spellers = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (!used_spellers)
return;
@@ -448,8 +447,7 @@ weechat_aspell_speller_init ()
weechat_aspell_spellers = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_POINTER,
- NULL,
- NULL);
+ NULL, NULL);
if (!weechat_aspell_spellers)
return 0;
weechat_hashtable_set_pointer (weechat_aspell_spellers,
@@ -459,8 +457,7 @@ weechat_aspell_speller_init ()
weechat_aspell_speller_buffer = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_POINTER,
WEECHAT_HASHTABLE_POINTER,
- NULL,
- NULL);
+ NULL, NULL);
if (!weechat_aspell_speller_buffer)
{
weechat_hashtable_free (weechat_aspell_spellers);
diff --git a/src/plugins/aspell/weechat-aspell.c b/src/plugins/aspell/weechat-aspell.c
index 961d2553d..1513e2f51 100644
--- a/src/plugins/aspell/weechat-aspell.c
+++ b/src/plugins/aspell/weechat-aspell.c
@@ -604,7 +604,8 @@ weechat_aspell_get_suggestions (struct t_aspell_speller_buffer *speller_buffer,
*/
char *
-weechat_aspell_modifier_cb (void *data, const char *modifier,
+weechat_aspell_modifier_cb (const void *pointer, void *data,
+ const char *modifier,
const char *modifier_data, const char *string)
{
long unsigned int value;
@@ -621,6 +622,7 @@ weechat_aspell_modifier_cb (void *data, const char *modifier,
int input_pos, current_pos, word_start_pos, word_end_pos, word_end_pos_valid;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) modifier;
@@ -932,10 +934,12 @@ weechat_aspell_modifier_cb (void *data, const char *modifier,
*/
int
-weechat_aspell_buffer_switch_cb (void *data, const char *signal,
- const char *type_data, void *signal_data)
+weechat_aspell_buffer_switch_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
+ void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -953,10 +957,12 @@ weechat_aspell_buffer_switch_cb (void *data, const char *signal,
*/
int
-weechat_aspell_window_switch_cb (void *data, const char *signal,
+weechat_aspell_window_switch_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -975,10 +981,12 @@ weechat_aspell_window_switch_cb (void *data, const char *signal,
*/
int
-weechat_aspell_buffer_closed_cb (void *data, const char *signal,
+weechat_aspell_buffer_closed_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -993,10 +1001,12 @@ weechat_aspell_buffer_closed_cb (void *data, const char *signal,
*/
int
-weechat_aspell_debug_libs_cb (void *data, const char *signal,
+weechat_aspell_debug_libs_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -1059,20 +1069,20 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
* (from other plugins) will be called before this one
*/
weechat_hook_modifier ("500|input_text_display",
- &weechat_aspell_modifier_cb, NULL);
+ &weechat_aspell_modifier_cb, NULL, NULL);
weechat_aspell_bar_item_init ();
weechat_aspell_info_init ();
weechat_hook_signal ("buffer_switch",
- &weechat_aspell_buffer_switch_cb, NULL);
+ &weechat_aspell_buffer_switch_cb, NULL, NULL);
weechat_hook_signal ("window_switch",
- &weechat_aspell_window_switch_cb, NULL);
+ &weechat_aspell_window_switch_cb, NULL, NULL);
weechat_hook_signal ("buffer_closed",
- &weechat_aspell_buffer_closed_cb, NULL);
+ &weechat_aspell_buffer_closed_cb, NULL, NULL);
weechat_hook_signal ("debug_libs",
- &weechat_aspell_debug_libs_cb, NULL);
+ &weechat_aspell_debug_libs_cb, NULL, NULL);
return WEECHAT_RC_OK;
}
diff --git a/src/plugins/charset/charset.c b/src/plugins/charset/charset.c
index 7e6a50baf..919f900eb 100644
--- a/src/plugins/charset/charset.c
+++ b/src/plugins/charset/charset.c
@@ -59,9 +59,11 @@ const char *charset_internal = NULL;
*/
int
-charset_config_reload (void *data, struct t_config_file *config_file)
+charset_config_reload (const void *pointer, void *data,
+ struct t_config_file *config_file)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
/* free all decode/encode charsets */
@@ -107,10 +109,12 @@ charset_decode_is_allowed (const char *charset)
*/
int
-charset_check_charset_decode_cb (void *data, struct t_config_option *option,
+charset_check_charset_decode_cb (const void *pointer, void *data,
+ struct t_config_option *option,
const char *value)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -122,7 +126,8 @@ charset_check_charset_decode_cb (void *data, struct t_config_option *option,
*/
int
-charset_config_create_option (void *data, struct t_config_file *config_file,
+charset_config_create_option (const void *pointer, void *data,
+ struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
@@ -130,6 +135,7 @@ charset_config_create_option (void *data, struct t_config_file *config_file,
int rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
rc = WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -159,8 +165,9 @@ charset_config_create_option (void *data, struct t_config_file *config_file,
config_file, section,
option_name, "string", NULL,
NULL, 0, 0, "", value, 0,
- (section == charset_config_section_decode) ? &charset_check_charset_decode_cb : NULL, NULL,
- NULL, NULL, NULL, NULL);
+ (section == charset_config_section_decode) ? &charset_check_charset_decode_cb : NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
rc = (ptr_option) ?
WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
}
@@ -195,15 +202,17 @@ charset_config_init ()
struct t_config_section *ptr_section;
charset_config_file = weechat_config_new (CHARSET_CONFIG_NAME,
- &charset_config_reload, NULL);
+ &charset_config_reload, NULL, NULL);
if (!charset_config_file)
return 0;
ptr_section = weechat_config_new_section (charset_config_file, "default",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (charset_config_file);
@@ -220,7 +229,9 @@ charset_config_init ()
&& (weechat_strcasecmp (charset_terminal,
charset_internal) != 0)) ?
charset_terminal : "iso-8859-1", NULL, 0,
- &charset_check_charset_decode_cb, NULL, NULL, NULL, NULL, NULL);
+ &charset_check_charset_decode_cb, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
charset_default_encode = weechat_config_new_option (
charset_config_file, ptr_section,
"encode", "string",
@@ -228,14 +239,16 @@ charset_config_init ()
"(if empty, default is UTF-8 because it is the WeeChat internal "
"charset)"),
NULL, 0, 0, "", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
-
- ptr_section = weechat_config_new_section (charset_config_file, "decode",
- 1, 1,
- NULL, NULL, NULL, NULL,
- NULL, NULL,
- &charset_config_create_option, NULL,
- NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+ ptr_section = weechat_config_new_section (
+ charset_config_file, "decode",
+ 1, 1,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &charset_config_create_option, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (charset_config_file);
@@ -244,12 +257,14 @@ charset_config_init ()
charset_config_section_decode = ptr_section;
- ptr_section = weechat_config_new_section (charset_config_file, "encode",
- 1, 1,
- NULL, NULL, NULL, NULL,
- NULL, NULL,
- &charset_config_create_option, NULL,
- NULL, NULL);
+ ptr_section = weechat_config_new_section (
+ charset_config_file, "encode",
+ 1, 1,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &charset_config_create_option, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (charset_config_file);
@@ -365,12 +380,14 @@ charset_get (struct t_config_section *section, const char *name,
*/
char *
-charset_decode_cb (void *data, const char *modifier, const char *modifier_data,
+charset_decode_cb (const void *pointer, void *data,
+ const char *modifier, const char *modifier_data,
const char *string)
{
const char *charset;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) modifier;
@@ -394,12 +411,14 @@ charset_decode_cb (void *data, const char *modifier, const char *modifier_data,
*/
char *
-charset_encode_cb (void *data, const char *modifier, const char *modifier_data,
+charset_encode_cb (const void *pointer, void *data,
+ const char *modifier, const char *modifier_data,
const char *string)
{
const char *charset;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) modifier;
@@ -426,7 +445,7 @@ void
charset_set (struct t_config_section *section, const char *type,
const char *name, const char *value)
{
- if (charset_config_create_option (NULL,
+ if (charset_config_create_option (NULL, NULL,
charset_config_file,
section,
name,
@@ -458,7 +477,8 @@ charset_display_charsets ()
*/
int
-charset_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
+charset_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
struct t_config_section *ptr_section;
@@ -467,6 +487,7 @@ charset_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
const char *plugin_name, *name, *charset_modifier;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (argc < 2)
@@ -594,11 +615,11 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
"charset: new charset for current buffer\n"
" reset: reset charsets for current buffer"),
"decode|encode|reset",
- &charset_command_cb, NULL);
+ &charset_command_cb, NULL, NULL);
/* modifiers hooks */
- weechat_hook_modifier ("charset_decode", &charset_decode_cb, NULL);
- weechat_hook_modifier ("charset_encode", &charset_encode_cb, NULL);
+ weechat_hook_modifier ("charset_decode", &charset_decode_cb, NULL, NULL);
+ weechat_hook_modifier ("charset_encode", &charset_encode_cb, NULL, NULL);
return WEECHAT_RC_OK;
}
diff --git a/src/plugins/exec/exec-buffer.c b/src/plugins/exec/exec-buffer.c
index 1339dbd5b..908d0d044 100644
--- a/src/plugins/exec/exec-buffer.c
+++ b/src/plugins/exec/exec-buffer.c
@@ -35,13 +35,15 @@
*/
int
-exec_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
+exec_buffer_input_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data)
{
char **argv, **argv_eol;
int argc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
/* close buffer */
@@ -70,12 +72,14 @@ exec_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-exec_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+exec_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
{
const char *full_name;
struct t_exec_cmd *ptr_exec_cmd;
/* make C compiler happy */
+ (void) pointer;
(void) data;
/* kill any command whose output is on this buffer */
@@ -153,8 +157,8 @@ exec_buffer_new (const char *name, int free_content, int clear_buffer,
}
new_buffer = weechat_buffer_new (name,
- &exec_buffer_input_cb, NULL,
- &exec_buffer_close_cb, NULL);
+ &exec_buffer_input_cb, NULL, NULL,
+ &exec_buffer_close_cb, NULL, NULL);
/* failed to create buffer ? then return */
if (!new_buffer)
diff --git a/src/plugins/exec/exec-command.c b/src/plugins/exec/exec-command.c
index 9a1e3cc76..91e8cbdcd 100644
--- a/src/plugins/exec/exec-command.c
+++ b/src/plugins/exec/exec-command.c
@@ -458,8 +458,7 @@ exec_command_run (struct t_gui_buffer *buffer,
process_options = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (!process_options)
{
exec_free (new_exec_cmd);
@@ -570,7 +569,8 @@ exec_command_run (struct t_gui_buffer *buffer,
process_options,
cmd_options.timeout * 1000,
&exec_process_cb,
- new_exec_cmd);
+ new_exec_cmd,
+ NULL);
if (new_exec_cmd->hook)
{
@@ -605,7 +605,8 @@ exec_command_run (struct t_gui_buffer *buffer,
*/
int
-exec_command_exec (void *data, struct t_gui_buffer *buffer, int argc,
+exec_command_exec (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
int i, length, count;
@@ -613,6 +614,7 @@ exec_command_exec (void *data, struct t_gui_buffer *buffer, int argc,
struct t_exec_cmd *ptr_exec_cmd, *ptr_next_exec_cmd;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -878,5 +880,5 @@ exec_command_init ()
" || -killall"
" || -set %(exec_commands_ids) stdin|stdin_close|signal"
" || -del %(exec_commands_ids)|-all %(exec_commands_ids)|%*",
- &exec_command_exec, NULL);
+ &exec_command_exec, NULL, NULL);
}
diff --git a/src/plugins/exec/exec-completion.c b/src/plugins/exec/exec-completion.c
index d243f6692..52475cfdf 100644
--- a/src/plugins/exec/exec-completion.c
+++ b/src/plugins/exec/exec-completion.c
@@ -32,7 +32,8 @@
*/
int
-exec_completion_commands_ids_cb (void *data, const char *completion_item,
+exec_completion_commands_ids_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -40,6 +41,7 @@ exec_completion_commands_ids_cb (void *data, const char *completion_item,
char str_number[32];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -69,5 +71,5 @@ exec_completion_init ()
{
weechat_hook_completion ("exec_commands_ids",
N_("ids (numbers and names) of executed commands"),
- &exec_completion_commands_ids_cb, NULL);
+ &exec_completion_commands_ids_cb, NULL, NULL);
}
diff --git a/src/plugins/exec/exec-config.c b/src/plugins/exec/exec-config.c
index 7ead68550..77c3152c6 100644
--- a/src/plugins/exec/exec-config.c
+++ b/src/plugins/exec/exec-config.c
@@ -49,10 +49,11 @@ int exec_config_cmd_num_options = 0;
*/
void
-exec_config_change_command_default_options (void *data,
+exec_config_change_command_default_options (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -69,9 +70,11 @@ exec_config_change_command_default_options (void *data,
*/
int
-exec_config_reload_cb (void *data, struct t_config_file *config_file)
+exec_config_reload_cb (const void *pointer, void *data,
+ struct t_config_file *config_file)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
return weechat_config_reload (config_file);
@@ -91,16 +94,18 @@ exec_config_init ()
struct t_config_section *ptr_section;
exec_config_file = weechat_config_new (EXEC_CONFIG_NAME,
- &exec_config_reload_cb, NULL);
+ &exec_config_reload_cb, NULL, NULL);
if (!exec_config_file)
return 0;
/* command */
ptr_section = weechat_config_new_section (exec_config_file, "command",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (exec_config_file);
@@ -113,22 +118,26 @@ exec_config_init ()
N_("default options for command /exec (see /help exec); example: "
"\"-nosh -bg\" to run all commands in background (no output), and "
"without using the shell"),
- NULL, 0, 0, "", NULL, 0, NULL, NULL,
- &exec_config_change_command_default_options, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL,
+ &exec_config_change_command_default_options, NULL, NULL,
+ NULL, NULL, NULL);
exec_config_command_purge_delay = weechat_config_new_option (
exec_config_file, ptr_section,
"purge_delay", "integer",
N_("delay for purging finished commands (in seconds, 0 = purge "
"commands immediately, -1 = never purge)"),
NULL, -1, 36000 * 24 * 30, "0", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* color */
ptr_section = weechat_config_new_section (exec_config_file, "color",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (exec_config_file);
@@ -140,13 +149,13 @@ exec_config_init ()
"flag_running", "color",
N_("text color for a running command flag in list of commands"),
NULL, 0, 0, "lightgreen", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
exec_config_color_flag_finished = weechat_config_new_option (
exec_config_file, ptr_section,
"flag_finished", "color",
N_("text color for a finished command flag in list of commands"),
NULL, 0, 0, "lightred", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
return 1;
}
diff --git a/src/plugins/exec/exec.c b/src/plugins/exec/exec.c
index 3922a1154..5589fd2b8 100644
--- a/src/plugins/exec/exec.c
+++ b/src/plugins/exec/exec.c
@@ -175,14 +175,15 @@ exec_add ()
*/
int
-exec_timer_delete_cb (void *data, int remaining_calls)
+exec_timer_delete_cb (const void *pointer, void *data, int remaining_calls)
{
struct t_exec_cmd *exec_cmd, *ptr_exec_cmd;
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- exec_cmd = (struct t_exec_cmd *)data;
+ exec_cmd = (struct t_exec_cmd *)pointer;
if (!exec_cmd)
return WEECHAT_RC_OK;
@@ -424,8 +425,7 @@ exec_end_command (struct t_exec_cmd *exec_cmd, int return_code)
hashtable = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (hashtable)
{
weechat_hashtable_set (hashtable, "command", exec_cmd->command);
@@ -526,7 +526,7 @@ exec_end_command (struct t_exec_cmd *exec_cmd, int return_code)
{
weechat_hook_timer (1 + (1000 * weechat_config_integer (exec_config_command_purge_delay)),
0, 1,
- &exec_timer_delete_cb, exec_cmd);
+ &exec_timer_delete_cb, exec_cmd, NULL);
}
}
@@ -535,16 +535,17 @@ exec_end_command (struct t_exec_cmd *exec_cmd, int return_code)
*/
int
-exec_process_cb (void *data, const char *command, int return_code,
- const char *out, const char *err)
+exec_process_cb (const void *pointer, void *data, const char *command,
+ int return_code, const char *out, const char *err)
{
struct t_exec_cmd *ptr_exec_cmd;
struct t_gui_buffer *ptr_buffer;
/* make C compiler happy */
+ (void) data;
(void) command;
- ptr_exec_cmd = (struct t_exec_cmd *)data;
+ ptr_exec_cmd = (struct t_exec_cmd *)pointer;
if (!ptr_exec_cmd)
return WEECHAT_RC_ERROR;
@@ -681,10 +682,12 @@ exec_print_log ()
*/
int
-exec_debug_dump_cb (void *data, const char *signal, const char *type_data,
+exec_debug_dump_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -725,7 +728,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
exec_config_read ();
/* hook some signals */
- weechat_hook_signal ("debug_dump", &exec_debug_dump_cb, NULL);
+ weechat_hook_signal ("debug_dump", &exec_debug_dump_cb, NULL, NULL);
/* hook completions */
exec_completion_init ();
diff --git a/src/plugins/exec/exec.h b/src/plugins/exec/exec.h
index e54187a73..2adb1435f 100644
--- a/src/plugins/exec/exec.h
+++ b/src/plugins/exec/exec.h
@@ -80,7 +80,8 @@ extern int exec_cmds_count;
extern int exec_search_color (const char *color);
extern struct t_exec_cmd *exec_search_by_id (const char *id);
extern struct t_exec_cmd *exec_add ();
-extern int exec_process_cb (void *data, const char *command, int return_code,
+extern int exec_process_cb (const void *pointer, void *data,
+ const char *command, int return_code,
const char *out, const char *err);
extern void exec_free (struct t_exec_cmd *exec_cmd);
extern void exec_free_all ();
diff --git a/src/plugins/fifo/fifo-command.c b/src/plugins/fifo/fifo-command.c
index ece6ea646..19ea553a5 100644
--- a/src/plugins/fifo/fifo-command.c
+++ b/src/plugins/fifo/fifo-command.c
@@ -30,10 +30,12 @@
*/
int
-fifo_command_fifo (void *data, struct t_gui_buffer *buffer, int argc,
+fifo_command_fifo (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
(void) argv_eol;
@@ -113,5 +115,5 @@ fifo_command_init ()
"Examples:\n"
" /fifo toggle"),
"enable|disable|toggle",
- &fifo_command_fifo, NULL);
+ &fifo_command_fifo, NULL, NULL);
}
diff --git a/src/plugins/fifo/fifo-info.c b/src/plugins/fifo/fifo-info.c
index dd709fb9f..8be53ff9c 100644
--- a/src/plugins/fifo/fifo-info.c
+++ b/src/plugins/fifo/fifo-info.c
@@ -30,10 +30,12 @@
*/
const char *
-fifo_info_info_fifo_filename_cb (void *data, const char *info_name,
+fifo_info_info_fifo_filename_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -49,5 +51,5 @@ void
fifo_info_init ()
{
weechat_hook_info ("fifo_filename", N_("name of FIFO pipe"), NULL,
- &fifo_info_info_fifo_filename_cb, NULL);
+ &fifo_info_info_fifo_filename_cb, NULL, NULL);
}
diff --git a/src/plugins/fifo/fifo.c b/src/plugins/fifo/fifo.c
index 4331eeafa..e438fc4a1 100644
--- a/src/plugins/fifo/fifo.c
+++ b/src/plugins/fifo/fifo.c
@@ -55,7 +55,7 @@ char *fifo_filename;
char *fifo_unterminated = NULL;
-int fifo_read();
+int fifo_fd_cb ();
/*
@@ -164,7 +164,7 @@ fifo_create ()
fifo_filename);
}
fifo_fd_hook = weechat_hook_fd (fifo_fd, 1, 0, 0,
- &fifo_read, NULL);
+ &fifo_fd_cb, NULL, NULL);
}
else
weechat_printf (NULL,
@@ -290,13 +290,14 @@ fifo_exec (const char *text)
*/
int
-fifo_read (void *data, int fd)
+fifo_fd_cb (const void *pointer, void *data, int fd)
{
static char buffer[4096 + 2];
char *buf2, *pos, *ptr_buf, *next_ptr_buf;
int num_read;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) fd;
@@ -386,8 +387,10 @@ fifo_read (void *data, int fd)
fifo_remove ();
}
else
+ {
fifo_fd_hook = weechat_hook_fd (fifo_fd, 1, 0, 0,
- &fifo_read, NULL);
+ &fifo_fd_cb, NULL, NULL);
+ }
}
}
@@ -399,9 +402,11 @@ fifo_read (void *data, int fd)
*/
int
-fifo_config_cb (void *data, const char *option, const char *value)
+fifo_config_cb (const void *pointer, void *data,
+ const char *option, const char *value)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -440,7 +445,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
snprintf (str_option, sizeof (str_option),
"plugins.var.fifo.%s", FIFO_OPTION_NAME);
- weechat_hook_config (str_option, &fifo_config_cb, NULL);
+ weechat_hook_config (str_option, &fifo_config_cb, NULL, NULL);
fifo_command_init ();
fifo_info_init ();
diff --git a/src/plugins/guile/weechat-guile-api.c b/src/plugins/guile/weechat-guile-api.c
index 3ac2b766a..3b475d7be 100644
--- a/src/plugins/guile/weechat-guile-api.c
+++ b/src/plugins/guile/weechat-guile-api.c
@@ -28,7 +28,6 @@
#include "../weechat-plugin.h"
#include "../plugin-script.h"
#include "../plugin-script-api.h"
-#include "../plugin-script-callback.h"
#include "weechat-guile.h"
@@ -773,24 +772,26 @@ weechat_guile_api_list_free (SCM weelist)
}
int
-weechat_guile_api_config_reload_cb (void *data,
+weechat_guile_api_config_reload_cb (const void *pointer, void *data,
struct t_config_file *config_file)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -831,29 +832,31 @@ weechat_guile_api_config_new (SCM name, SCM function, SCM data)
}
int
-weechat_guile_api_config_read_cb (void *data,
+weechat_guile_api_config_read_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = (option_name) ? (char *)option_name : empty_arg;
func_argv[4] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sssss", func_argv);
if (!rc)
@@ -875,26 +878,28 @@ weechat_guile_api_config_read_cb (void *data,
}
int
-weechat_guile_api_config_section_write_cb (void *data,
+weechat_guile_api_config_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = (section_name) ? (char *)section_name : empty_arg;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -914,26 +919,28 @@ weechat_guile_api_config_section_write_cb (void *data,
}
int
-weechat_guile_api_config_section_write_default_cb (void *data,
+weechat_guile_api_config_section_write_default_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = (section_name) ? (char *)section_name : empty_arg;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -953,30 +960,32 @@ weechat_guile_api_config_section_write_default_cb (void *data,
}
int
-weechat_guile_api_config_section_create_option_cb (void *data,
+weechat_guile_api_config_section_create_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = (option_name) ? (char *)option_name : empty_arg;
func_argv[4] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sssss", func_argv);
if (!rc)
@@ -998,28 +1007,30 @@ weechat_guile_api_config_section_create_option_cb (void *data,
}
int
-weechat_guile_api_config_section_delete_option_cb (void *data,
+weechat_guile_api_config_section_delete_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = API_PTR2STR(option);
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -1080,27 +1091,29 @@ weechat_guile_api_config_new_section (SCM args)
|| !scm_is_string (function_delete_option) || !scm_is_string (data_delete_option))
API_WRONG_ARGS(API_RETURN_EMPTY);
- result = API_PTR2STR(plugin_script_api_config_new_section (weechat_guile_plugin,
- guile_current_script,
- API_STR2PTR(API_SCM_TO_STRING(config_file)),
- API_SCM_TO_STRING(name),
- scm_to_int (user_can_add_options),
- scm_to_int (user_can_delete_options),
- &weechat_guile_api_config_read_cb,
- API_SCM_TO_STRING(function_read),
- API_SCM_TO_STRING(data_read),
- &weechat_guile_api_config_section_write_cb,
- API_SCM_TO_STRING(function_write),
- API_SCM_TO_STRING(data_write),
- &weechat_guile_api_config_section_write_default_cb,
- API_SCM_TO_STRING(function_write_default),
- API_SCM_TO_STRING(data_write_default),
- &weechat_guile_api_config_section_create_option_cb,
- API_SCM_TO_STRING(function_create_option),
- API_SCM_TO_STRING(data_create_option),
- &weechat_guile_api_config_section_delete_option_cb,
- API_SCM_TO_STRING(function_delete_option),
- API_SCM_TO_STRING(data_delete_option)));
+ result = API_PTR2STR(
+ plugin_script_api_config_new_section (
+ weechat_guile_plugin,
+ guile_current_script,
+ API_STR2PTR(API_SCM_TO_STRING(config_file)),
+ API_SCM_TO_STRING(name),
+ scm_to_int (user_can_add_options),
+ scm_to_int (user_can_delete_options),
+ &weechat_guile_api_config_read_cb,
+ API_SCM_TO_STRING(function_read),
+ API_SCM_TO_STRING(data_read),
+ &weechat_guile_api_config_section_write_cb,
+ API_SCM_TO_STRING(function_write),
+ API_SCM_TO_STRING(data_write),
+ &weechat_guile_api_config_section_write_default_cb,
+ API_SCM_TO_STRING(function_write_default),
+ API_SCM_TO_STRING(data_write_default),
+ &weechat_guile_api_config_section_create_option_cb,
+ API_SCM_TO_STRING(function_create_option),
+ API_SCM_TO_STRING(data_create_option),
+ &weechat_guile_api_config_section_delete_option_cb,
+ API_SCM_TO_STRING(function_delete_option),
+ API_SCM_TO_STRING(data_delete_option)));
API_RETURN_STRING_FREE(result);
}
@@ -1122,26 +1135,28 @@ weechat_guile_api_config_search_section (SCM config_file, SCM section_name)
}
int
-weechat_guile_api_config_option_check_value_cb (void *data,
+weechat_guile_api_config_option_check_value_cb (const void *pointer, void *data,
struct t_config_option *option,
const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
func_argv[2] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -1161,24 +1176,26 @@ weechat_guile_api_config_option_check_value_cb (void *data,
}
void
-weechat_guile_api_config_option_change_cb (void *data,
+weechat_guile_api_config_option_change_cb (const void *pointer, void *data,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (func_argv[1])
@@ -1190,24 +1207,26 @@ weechat_guile_api_config_option_change_cb (void *data,
}
void
-weechat_guile_api_config_option_delete_cb (void *data,
+weechat_guile_api_config_option_delete_cb (const void *pointer, void *data,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (func_argv[1])
@@ -1614,9 +1633,7 @@ weechat_guile_api_config_option_free (SCM option)
if (!scm_is_string (option))
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_option_free (weechat_guile_plugin,
- guile_current_script,
- API_STR2PTR(API_SCM_TO_STRING(option)));
+ weechat_config_option_free (API_STR2PTR(API_SCM_TO_STRING(option)));
API_RETURN_OK;
}
@@ -1628,9 +1645,8 @@ weechat_guile_api_config_section_free_options (SCM section)
if (!scm_is_string (section))
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_section_free_options (weechat_guile_plugin,
- guile_current_script,
- API_STR2PTR(API_SCM_TO_STRING(section)));
+ weechat_config_section_free_options (
+ API_STR2PTR(API_SCM_TO_STRING(section)));
API_RETURN_OK;
}
@@ -1642,9 +1658,7 @@ weechat_guile_api_config_section_free (SCM section)
if (!scm_is_string (section))
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_section_free (weechat_guile_plugin,
- guile_current_script,
- API_STR2PTR(API_SCM_TO_STRING(section)));
+ weechat_config_section_free (API_STR2PTR(API_SCM_TO_STRING(section)));
API_RETURN_OK;
}
@@ -1656,9 +1670,7 @@ weechat_guile_api_config_free (SCM config_file)
if (!scm_is_string (config_file))
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_free (weechat_guile_plugin,
- guile_current_script,
- API_STR2PTR(API_SCM_TO_STRING(config_file)));
+ weechat_config_free (API_STR2PTR(API_SCM_TO_STRING(config_file)));
API_RETURN_OK;
}
@@ -1889,28 +1901,31 @@ weechat_guile_api_log_print (SCM message)
}
int
-weechat_guile_api_hook_command_cb (void *data, struct t_gui_buffer *buffer,
+weechat_guile_api_hook_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
/* make C compiler happy */
(void) argv;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (argc > 1) ? argv_eol[1] : empty_arg;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -1959,25 +1974,28 @@ weechat_guile_api_hook_command (SCM command, SCM description, SCM args,
}
int
-weechat_guile_api_hook_command_run_cb (void *data, struct t_gui_buffer *buffer,
+weechat_guile_api_hook_command_run_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *command)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (command) ? (char *)command : empty_arg;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2018,26 +2036,29 @@ weechat_guile_api_hook_command_run (SCM command, SCM function, SCM data)
}
int
-weechat_guile_api_hook_timer_cb (void *data, int remaining_calls)
+weechat_guile_api_hook_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char str_remaining_calls[32], empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_remaining_calls, sizeof (str_remaining_calls),
"%d", remaining_calls);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_remaining_calls;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -2080,25 +2101,27 @@ weechat_guile_api_hook_timer (SCM interval, SCM align_second, SCM max_calls,
}
int
-weechat_guile_api_hook_fd_cb (void *data, int fd)
+weechat_guile_api_hook_fd_cb (const void *pointer, void *data, int fd)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char str_fd[32], empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_fd, sizeof (str_fd), "%d", fd);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_fd;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -2142,28 +2165,30 @@ weechat_guile_api_hook_fd (SCM fd, SCM read, SCM write, SCM exception,
}
int
-weechat_guile_api_hook_process_cb (void *data,
+weechat_guile_api_hook_process_cb (const void *pointer, void *data,
const char *command, int return_code,
const char *out, const char *err)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (command) ? (char *)command : empty_arg;
func_argv[2] = &return_code;
func_argv[3] = (out) ? (char *)out : empty_arg;
func_argv[4] = (err) ? (char *)err : empty_arg;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssiss", func_argv);
if (!rc)
@@ -2238,34 +2263,37 @@ weechat_guile_api_hook_process_hashtable (SCM command, SCM options, SCM timeout,
}
int
-weechat_guile_api_hook_connect_cb (void *data, int status, int gnutls_rc,
+weechat_guile_api_hook_connect_cb (const void *pointer, void *data,
+ int status, int gnutls_rc,
int sock, const char *error,
const char *ip_address)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[6];
char str_status[32], str_gnutls_rc[32], str_sock[32];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_status, sizeof (str_status), "%d", status);
snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc);
snprintf (str_sock, sizeof (str_sock), "%d", sock);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_status;
func_argv[2] = str_gnutls_rc;
func_argv[3] = str_sock;
func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg;
func_argv[5] = (error) ? (char *)error : empty_arg;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssssss", func_argv);
if (!rc)
@@ -2317,28 +2345,31 @@ weechat_guile_api_hook_connect (SCM proxy, SCM address, SCM port, SCM ipv6,
}
int
-weechat_guile_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
+weechat_guile_api_hook_print_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
time_t date,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[8];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
static char timebuffer[64];
int *rc, ret;
/* make C compiler happy */
(void) tags_count;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)date);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = timebuffer;
func_argv[3] = weechat_string_build_with_split_string (tags, ",");
@@ -2349,9 +2380,9 @@ weechat_guile_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
func_argv[6] = (prefix) ? (char *)prefix : empty_arg;
func_argv[7] = (message) ? (char *)message : empty_arg;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssssiiss", func_argv);
if (!rc)
@@ -2399,20 +2430,23 @@ weechat_guile_api_hook_print (SCM buffer, SCM tags, SCM message,
}
int
-weechat_guile_api_hook_signal_cb (void *data, const char *signal,
+weechat_guile_api_hook_signal_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
static char str_value[64];
int *rc, ret, free_needed;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (signal) ? (char *)signal : empty_arg;
free_needed = 0;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
@@ -2437,9 +2471,9 @@ weechat_guile_api_hook_signal_cb (void *data, const char *signal,
else
func_argv[2] = empty_arg;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2521,25 +2555,28 @@ weechat_guile_api_hook_signal_send (SCM signal, SCM type_data,
}
int
-weechat_guile_api_hook_hsignal_cb (void *data, const char *signal,
+weechat_guile_api_hook_hsignal_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (signal) ? (char *)signal : empty_arg;
func_argv[2] = hashtable;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssh", func_argv);
if (!rc)
@@ -2601,24 +2638,27 @@ weechat_guile_api_hook_hsignal_send (SCM signal, SCM hashtable)
}
int
-weechat_guile_api_hook_config_cb (void *data, const char *option, const char *value)
+weechat_guile_api_hook_config_cb (const void *pointer, void *data,
+ const char *option, const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (option) ? (char *)option : empty_arg;
func_argv[2] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2657,27 +2697,30 @@ weechat_guile_api_hook_config (SCM option, SCM function, SCM data)
}
int
-weechat_guile_api_hook_completion_cb (void *data, const char *completion_item,
+weechat_guile_api_hook_completion_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (completion_item) ? (char *)completion_item : empty_arg;
func_argv[2] = API_PTR2STR(buffer);
func_argv[3] = API_PTR2STR(completion);
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -2755,25 +2798,29 @@ weechat_guile_api_hook_completion_list_add (SCM completion, SCM word,
}
char *
-weechat_guile_api_hook_modifier_cb (void *data, const char *modifier,
- const char *modifier_data, const char *string)
+weechat_guile_api_hook_modifier_cb (const void *pointer, void *data,
+ const char *modifier,
+ const char *modifier_data,
+ const char *string)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (modifier) ? (char *)modifier : empty_arg;
func_argv[2] = (modifier_data) ? (char *)modifier_data : empty_arg;
func_argv[3] = (string) ? (char *)string : empty_arg;
- return (char *)weechat_guile_exec (script_callback->script,
+ return (char *)weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
}
@@ -2821,24 +2868,27 @@ weechat_guile_api_hook_modifier_exec (SCM modifier, SCM modifier_data,
}
const char *
-weechat_guile_api_hook_info_cb (void *data, const char *info_name,
+weechat_guile_api_hook_info_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (info_name) ? (char *)info_name : empty_arg;
func_argv[2] = (arguments) ? (char *)arguments : empty_arg;
- return (const char *)weechat_guile_exec (script_callback->script,
+ return (const char *)weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
}
@@ -2871,25 +2921,29 @@ weechat_guile_api_hook_info (SCM info_name, SCM description,
}
struct t_hashtable *
-weechat_guile_api_hook_info_hashtable_cb (void *data, const char *info_name,
+weechat_guile_api_hook_info_hashtable_cb (const void *pointer, void *data,
+ const char *info_name,
struct t_hashtable *hashtable)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (info_name) ? (char *)info_name : empty_arg;
func_argv[2] = hashtable;
- return (struct t_hashtable *)weechat_guile_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_HASHTABLE,
- script_callback->function,
- "ssh", func_argv);
+ return (struct t_hashtable *)weechat_guile_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_HASHTABLE,
+ ptr_function,
+ "ssh", func_argv);
}
return NULL;
@@ -2924,27 +2978,31 @@ weechat_guile_api_hook_info_hashtable (SCM info_name, SCM description,
}
struct t_infolist *
-weechat_guile_api_hook_infolist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+weechat_guile_api_hook_infolist_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
struct t_infolist *result;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (infolist_name) ? (char *)infolist_name : empty_arg;
- func_argv[2] = API_PTR2STR(pointer);
+ func_argv[2] = API_PTR2STR(obj_pointer);
func_argv[3] = (arguments) ? (char *)arguments : empty_arg;
- result = (struct t_infolist *)weechat_guile_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
- "ssss", func_argv);
+ result = (struct t_infolist *)weechat_guile_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_STRING,
+ ptr_function,
+ "ssss", func_argv);
if (func_argv[2])
free (func_argv[2]);
@@ -2983,23 +3041,27 @@ weechat_guile_api_hook_infolist (SCM infolist_name, SCM description,
}
struct t_hashtable *
-weechat_guile_api_hook_focus_cb (void *data, struct t_hashtable *info)
+weechat_guile_api_hook_focus_cb (const void *pointer, void *data,
+ struct t_hashtable *info)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = info;
- return (struct t_hashtable *)weechat_guile_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_HASHTABLE,
- script_callback->function,
- "sh", func_argv);
+ return (struct t_hashtable *)weechat_guile_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_HASHTABLE,
+ ptr_function,
+ "sh", func_argv);
}
return NULL;
@@ -3048,9 +3110,7 @@ weechat_guile_api_unhook (SCM hook)
if (!scm_is_string (hook))
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_unhook (weechat_guile_plugin,
- guile_current_script,
- API_STR2PTR(API_SCM_TO_STRING(hook)));
+ weechat_unhook (API_STR2PTR(API_SCM_TO_STRING(hook)));
API_RETURN_OK;
}
@@ -3060,31 +3120,34 @@ weechat_guile_api_unhook_all ()
{
API_INIT_FUNC(1, "unhook_all", API_RETURN_ERROR);
- plugin_script_api_unhook_all (weechat_guile_plugin, guile_current_script);
+ weechat_unhook_all_plugin (guile_current_script->name);
API_RETURN_OK;
}
int
-weechat_guile_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
+weechat_guile_api_buffer_input_data_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (input_data) ? (char *)input_data : empty_arg;
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -3104,23 +3167,26 @@ weechat_guile_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
}
int
-weechat_guile_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+weechat_guile_api_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -3226,9 +3292,7 @@ weechat_guile_api_buffer_close (SCM buffer)
if (!scm_is_string (buffer))
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_buffer_close (weechat_guile_plugin,
- guile_current_script,
- API_STR2PTR(API_SCM_TO_STRING(buffer)));
+ weechat_buffer_close (API_STR2PTR(API_SCM_TO_STRING(buffer)));
API_RETURN_OK;
}
@@ -3715,31 +3779,34 @@ weechat_guile_api_bar_item_search (SCM name)
}
char *
-weechat_guile_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
+weechat_guile_api_bar_item_build_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' }, *ret;
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- if (strncmp (script_callback->function, "(extra)", 7) == 0)
+ if (strncmp (ptr_function, "(extra)", 7) == 0)
{
/* new callback: data, item, window, buffer, extra_info */
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(item);
func_argv[2] = API_PTR2STR(window);
func_argv[3] = API_PTR2STR(buffer);
func_argv[4] = extra_info;
- ret = (char *)weechat_guile_exec (script_callback->script,
+ ret = (char *)weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function + 7,
+ ptr_function + 7,
"ssssh", func_argv);
if (func_argv[1])
@@ -3752,13 +3819,13 @@ weechat_guile_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
else
{
/* old callback: data, item, window */
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(item);
func_argv[2] = API_PTR2STR(window);
- ret = (char *)weechat_guile_exec (script_callback->script,
+ ret = (char *)weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (func_argv[1])
@@ -3813,9 +3880,7 @@ weechat_guile_api_bar_item_remove (SCM item)
if (!scm_is_string (item))
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_bar_item_remove (weechat_guile_plugin,
- guile_current_script,
- API_STR2PTR(API_SCM_TO_STRING(item)));
+ weechat_bar_item_remove (API_STR2PTR(API_SCM_TO_STRING(item)));
API_RETURN_OK;
}
@@ -4587,65 +4652,33 @@ weechat_guile_api_hdata_get_string (SCM hdata, SCM property)
API_RETURN_STRING(result);
}
-SCM
-weechat_guile_api_upgrade_new (SCM filename, SCM write)
-{
- char *result;
- SCM return_value;
-
- API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY);
- if (!scm_is_string (filename) || !scm_is_integer (write))
- API_WRONG_ARGS(API_RETURN_EMPTY);
-
- result = API_PTR2STR(weechat_upgrade_new (API_SCM_TO_STRING(filename),
- scm_to_int (write)));
-
- API_RETURN_STRING_FREE(result);
-}
-
-SCM
-weechat_guile_api_upgrade_write_object (SCM upgrade_file, SCM object_id,
- SCM infolist)
-{
- int rc;
-
- API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0));
- if (!scm_is_string (upgrade_file) || !scm_is_integer (object_id)
- || !scm_is_string (infolist))
- API_WRONG_ARGS(API_RETURN_INT(0));
-
- rc = weechat_upgrade_write_object (API_STR2PTR(API_SCM_TO_STRING(upgrade_file)),
- scm_to_int (object_id),
- API_STR2PTR(API_SCM_TO_STRING(infolist)));
-
- API_RETURN_INT(rc);
-}
-
int
-weechat_guile_api_upgrade_read_cb (void *data,
+weechat_guile_api_upgrade_read_cb (const void *pointer, void *data,
struct t_upgrade_file *upgrade_file,
int object_id,
struct t_infolist *infolist)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' }, str_object_id[32];
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_object_id, sizeof (str_object_id), "%d", object_id);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(upgrade_file);
func_argv[2] = str_object_id;
func_argv[3] = API_PTR2STR(infolist);
- rc = (int *) weechat_guile_exec (script_callback->script,
+ rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -4667,21 +4700,56 @@ weechat_guile_api_upgrade_read_cb (void *data,
}
SCM
-weechat_guile_api_upgrade_read (SCM upgrade_file, SCM function, SCM data)
+weechat_guile_api_upgrade_new (SCM filename, SCM function, SCM data)
+{
+ char *result;
+ SCM return_value;
+
+ API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY);
+ if (!scm_is_string (filename) || !scm_is_string (function)
+ || !scm_is_string (data))
+ API_WRONG_ARGS(API_RETURN_EMPTY);
+
+ result = API_PTR2STR(
+ plugin_script_api_upgrade_new (
+ weechat_guile_plugin,
+ guile_current_script,
+ API_SCM_TO_STRING(filename),
+ &weechat_guile_api_upgrade_read_cb,
+ API_SCM_TO_STRING(function),
+ API_SCM_TO_STRING(data)));
+
+ API_RETURN_STRING_FREE(result);
+}
+
+SCM
+weechat_guile_api_upgrade_write_object (SCM upgrade_file, SCM object_id,
+ SCM infolist)
+{
+ int rc;
+
+ API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0));
+ if (!scm_is_string (upgrade_file) || !scm_is_integer (object_id)
+ || !scm_is_string (infolist))
+ API_WRONG_ARGS(API_RETURN_INT(0));
+
+ rc = weechat_upgrade_write_object (API_STR2PTR(API_SCM_TO_STRING(upgrade_file)),
+ scm_to_int (object_id),
+ API_STR2PTR(API_SCM_TO_STRING(infolist)));
+
+ API_RETURN_INT(rc);
+}
+
+SCM
+weechat_guile_api_upgrade_read (SCM upgrade_file)
{
int rc;
API_INIT_FUNC(1, "upgrade_read", API_RETURN_INT(0));
- if (!scm_is_string (upgrade_file) || !scm_is_string (function)
- || !scm_is_string (data))
+ if (!scm_is_string (upgrade_file))
API_WRONG_ARGS(API_RETURN_INT(0));
- rc = plugin_script_api_upgrade_read (weechat_guile_plugin,
- guile_current_script,
- API_STR2PTR(API_SCM_TO_STRING(upgrade_file)),
- &weechat_guile_api_upgrade_read_cb,
- API_SCM_TO_STRING(function),
- API_SCM_TO_STRING(data));
+ rc = weechat_upgrade_read (API_STR2PTR(API_SCM_TO_STRING(upgrade_file)));
API_RETURN_INT(rc);
}
@@ -4906,9 +4974,9 @@ weechat_guile_api_module_init (void *data)
API_DEF_FUNC(hdata_hashtable, 3);
API_DEF_FUNC(hdata_update, 3);
API_DEF_FUNC(hdata_get_string, 2);
- API_DEF_FUNC(upgrade_new, 2);
+ API_DEF_FUNC(upgrade_new, 3);
API_DEF_FUNC(upgrade_write_object, 3);
- API_DEF_FUNC(upgrade_read, 3);
+ API_DEF_FUNC(upgrade_read, 1);
API_DEF_FUNC(upgrade_close, 1);
/* interface constants */
diff --git a/src/plugins/guile/weechat-guile-api.h b/src/plugins/guile/weechat-guile-api.h
index 91d05b6d2..bb0972677 100644
--- a/src/plugins/guile/weechat-guile-api.h
+++ b/src/plugins/guile/weechat-guile-api.h
@@ -20,10 +20,12 @@
#ifndef WEECHAT_GUILE_API_H
#define WEECHAT_GUILE_API_H 1
-extern int weechat_guile_api_buffer_input_data_cb (void *data,
+extern int weechat_guile_api_buffer_input_data_cb (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data);
-extern int weechat_guile_api_buffer_close_cb (void *data,
+extern int weechat_guile_api_buffer_close_cb (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer);
extern void weechat_guile_api_module_init (void *data);
diff --git a/src/plugins/guile/weechat-guile.c b/src/plugins/guile/weechat-guile.c
index 85d49e76d..b24cf7203 100644
--- a/src/plugins/guile/weechat-guile.c
+++ b/src/plugins/guile/weechat-guile.c
@@ -587,13 +587,15 @@ weechat_guile_reload_name (const char *name)
*/
int
-weechat_guile_command_cb (void *data, struct t_gui_buffer *buffer,
+weechat_guile_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
char *ptr_name, *path_script;
SCM value;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -700,11 +702,13 @@ weechat_guile_command_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-weechat_guile_completion_cb (void *data, const char *completion_item,
+weechat_guile_completion_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -719,9 +723,11 @@ weechat_guile_completion_cb (void *data, const char *completion_item,
*/
struct t_hdata *
-weechat_guile_hdata_cb (void *data, const char *hdata_name)
+weechat_guile_hdata_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
return plugin_script_hdata_script (weechat_plugin,
@@ -734,10 +740,12 @@ weechat_guile_hdata_cb (void *data, const char *hdata_name)
*/
struct t_infolist *
-weechat_guile_infolist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+weechat_guile_infolist_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!infolist_name || !infolist_name[0])
@@ -746,7 +754,7 @@ weechat_guile_infolist_cb (void *data, const char *infolist_name,
if (weechat_strcasecmp (infolist_name, "guile_script") == 0)
{
return plugin_script_infolist_list_scripts (weechat_guile_plugin,
- guile_scripts, pointer,
+ guile_scripts, obj_pointer,
arguments);
}
@@ -758,10 +766,12 @@ weechat_guile_infolist_cb (void *data, const char *infolist_name,
*/
int
-weechat_guile_signal_debug_dump_cb (void *data, const char *signal,
+weechat_guile_signal_debug_dump_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -780,10 +790,12 @@ weechat_guile_signal_debug_dump_cb (void *data, const char *signal,
*/
int
-weechat_guile_signal_debug_libs_cb (void *data, const char *signal,
+weechat_guile_signal_debug_libs_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -803,38 +815,20 @@ weechat_guile_signal_debug_libs_cb (void *data, const char *signal,
}
/*
- * Callback called when a buffer is closed.
- */
-
-int
-weechat_guile_signal_buffer_closed_cb (void *data, const char *signal,
- const char *type_data,
- void *signal_data)
-{
- /* make C compiler happy */
- (void) data;
- (void) signal;
- (void) type_data;
-
- if (signal_data)
- plugin_script_remove_buffer_callbacks (guile_scripts, signal_data);
-
- return WEECHAT_RC_OK;
-}
-
-/*
* Timer for executing actions.
*/
int
-weechat_guile_timer_action_cb (void *data, int remaining_calls)
+weechat_guile_timer_action_cb (const void *pointer, void *data,
+ int remaining_calls)
{
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- if (data)
+ if (pointer)
{
- if (data == &guile_action_install_list)
+ if (pointer == &guile_action_install_list)
{
plugin_script_action_install (weechat_guile_plugin,
guile_scripts,
@@ -843,7 +837,7 @@ weechat_guile_timer_action_cb (void *data, int remaining_calls)
&guile_quiet,
&guile_action_install_list);
}
- else if (data == &guile_action_remove_list)
+ else if (pointer == &guile_action_remove_list)
{
plugin_script_action_remove (weechat_guile_plugin,
guile_scripts,
@@ -851,7 +845,7 @@ weechat_guile_timer_action_cb (void *data, int remaining_calls)
&guile_quiet,
&guile_action_remove_list);
}
- else if (data == &guile_action_autoload_list)
+ else if (pointer == &guile_action_autoload_list)
{
plugin_script_action_autoload (weechat_guile_plugin,
&guile_quiet,
@@ -867,11 +861,13 @@ weechat_guile_timer_action_cb (void *data, int remaining_calls)
*/
int
-weechat_guile_signal_script_action_cb (void *data, const char *signal,
+weechat_guile_signal_script_action_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
@@ -882,7 +878,7 @@ weechat_guile_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_guile_timer_action_cb,
- &guile_action_install_list);
+ &guile_action_install_list, NULL);
}
else if (strcmp (signal, "guile_script_remove") == 0)
{
@@ -890,7 +886,7 @@ weechat_guile_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_guile_timer_action_cb,
- &guile_action_remove_list);
+ &guile_action_remove_list, NULL);
}
else if (strcmp (signal, "guile_script_autoload") == 0)
{
@@ -898,7 +894,7 @@ weechat_guile_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_guile_timer_action_cb,
- &guile_action_autoload_list);
+ &guile_action_autoload_list, NULL);
}
}
@@ -996,7 +992,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
init.callback_infolist = &weechat_guile_infolist_cb;
init.callback_signal_debug_dump = &weechat_guile_signal_debug_dump_cb;
init.callback_signal_debug_libs = &weechat_guile_signal_debug_libs_cb;
- init.callback_signal_buffer_closed = &weechat_guile_signal_buffer_closed_cb;
init.callback_signal_script_action = &weechat_guile_signal_script_action_cb;
init.callback_load_file = &weechat_guile_load_cb;
diff --git a/src/plugins/irc/irc-bar-item.c b/src/plugins/irc/irc-bar-item.c
index 4c8f96e2f..fb599fb02 100644
--- a/src/plugins/irc/irc-bar-item.c
+++ b/src/plugins/irc/irc-bar-item.c
@@ -38,7 +38,8 @@
*/
char *
-irc_bar_item_buffer_plugin (void *data, struct t_gui_bar_item *item,
+irc_bar_item_buffer_plugin (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -50,6 +51,7 @@ irc_bar_item_buffer_plugin (void *data, struct t_gui_bar_item *item,
struct t_irc_channel *channel;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -198,12 +200,14 @@ irc_bar_item_buffer_name_content (struct t_gui_buffer *buffer, int short_name)
*/
char *
-irc_bar_item_buffer_name (void *data, struct t_gui_bar_item *item,
+irc_bar_item_buffer_name (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -218,12 +222,14 @@ irc_bar_item_buffer_name (void *data, struct t_gui_bar_item *item,
*/
char *
-irc_bar_item_buffer_short_name (void *data, struct t_gui_bar_item *item,
+irc_bar_item_buffer_short_name (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -237,7 +243,8 @@ irc_bar_item_buffer_short_name (void *data, struct t_gui_bar_item *item,
*/
char *
-irc_bar_item_buffer_modes (void *data, struct t_gui_bar_item *item,
+irc_bar_item_buffer_modes (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -249,6 +256,7 @@ irc_bar_item_buffer_modes (void *data, struct t_gui_bar_item *item,
struct t_irc_channel *channel;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -297,7 +305,8 @@ irc_bar_item_buffer_modes (void *data, struct t_gui_bar_item *item,
*/
char *
-irc_bar_item_channel (void *data, struct t_gui_bar_item *item,
+irc_bar_item_channel (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window, struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
{
@@ -308,6 +317,7 @@ irc_bar_item_channel (void *data, struct t_gui_bar_item *item,
struct t_irc_channel *channel;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -374,7 +384,8 @@ irc_bar_item_channel (void *data, struct t_gui_bar_item *item,
*/
char *
-irc_bar_item_lag (void *data, struct t_gui_bar_item *item,
+irc_bar_item_lag (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window, struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
{
@@ -382,6 +393,7 @@ irc_bar_item_lag (void *data, struct t_gui_bar_item *item,
struct t_irc_server *server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -413,7 +425,8 @@ irc_bar_item_lag (void *data, struct t_gui_bar_item *item,
*/
char *
-irc_bar_item_input_prompt (void *data, struct t_gui_bar_item *item,
+irc_bar_item_input_prompt (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -425,6 +438,7 @@ irc_bar_item_input_prompt (void *data, struct t_gui_bar_item *item,
int length;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -494,7 +508,8 @@ irc_bar_item_input_prompt (void *data, struct t_gui_bar_item *item,
*/
char *
-irc_bar_item_nick_modes (void *data, struct t_gui_bar_item *item,
+irc_bar_item_nick_modes (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
@@ -504,6 +519,7 @@ irc_bar_item_nick_modes (void *data, struct t_gui_bar_item *item,
int length;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) item;
(void) window;
@@ -533,7 +549,7 @@ irc_bar_item_nick_modes (void *data, struct t_gui_bar_item *item,
*/
struct t_hashtable *
-irc_bar_item_focus_buffer_nicklist (void *data,
+irc_bar_item_focus_buffer_nicklist (const void *pointer, void *data,
struct t_hashtable *info)
{
long unsigned int value;
@@ -555,6 +571,7 @@ irc_bar_item_focus_buffer_nicklist (void *data,
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (ptr_server && ptr_channel)
@@ -579,10 +596,12 @@ irc_bar_item_focus_buffer_nicklist (void *data,
*/
int
-irc_bar_item_buffer_switch (void *data, const char *signal,
+irc_bar_item_buffer_switch (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -619,16 +638,26 @@ irc_bar_item_update_channel ()
void
irc_bar_item_init ()
{
- weechat_bar_item_new ("buffer_plugin", &irc_bar_item_buffer_plugin, NULL);
- weechat_bar_item_new ("buffer_name", &irc_bar_item_buffer_name, NULL);
- weechat_bar_item_new ("buffer_short_name", &irc_bar_item_buffer_short_name, NULL);
- weechat_bar_item_new ("buffer_modes", &irc_bar_item_buffer_modes, NULL);
- weechat_bar_item_new ("irc_channel", &irc_bar_item_channel, NULL);
- weechat_bar_item_new ("lag", &irc_bar_item_lag, NULL);
- weechat_bar_item_new ("input_prompt", &irc_bar_item_input_prompt, NULL);
- weechat_bar_item_new ("irc_nick_modes", &irc_bar_item_nick_modes, NULL);
+ weechat_bar_item_new ("buffer_plugin",
+ &irc_bar_item_buffer_plugin, NULL, NULL);
+ weechat_bar_item_new ("buffer_name",
+ &irc_bar_item_buffer_name, NULL, NULL);
+ weechat_bar_item_new ("buffer_short_name",
+ &irc_bar_item_buffer_short_name, NULL, NULL);
+ weechat_bar_item_new ("buffer_modes",
+ &irc_bar_item_buffer_modes, NULL, NULL);
+ weechat_bar_item_new ("irc_channel",
+ &irc_bar_item_channel, NULL, NULL);
+ weechat_bar_item_new ("lag",
+ &irc_bar_item_lag, NULL, NULL);
+ weechat_bar_item_new ("input_prompt",
+ &irc_bar_item_input_prompt, NULL, NULL);
+ weechat_bar_item_new ("irc_nick_modes",
+ &irc_bar_item_nick_modes, NULL, NULL);
+
weechat_hook_focus ("buffer_nicklist",
- &irc_bar_item_focus_buffer_nicklist, NULL);
+ &irc_bar_item_focus_buffer_nicklist, NULL, NULL);
+
weechat_hook_signal ("buffer_switch",
- &irc_bar_item_buffer_switch, NULL);
+ &irc_bar_item_buffer_switch, NULL, NULL);
}
diff --git a/src/plugins/irc/irc-buffer.c b/src/plugins/irc/irc-buffer.c
index f7df9d267..bee87ed56 100644
--- a/src/plugins/irc/irc-buffer.c
+++ b/src/plugins/irc/irc-buffer.c
@@ -112,13 +112,15 @@ irc_buffer_build_name (const char *server, const char *channel)
*/
int
-irc_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+irc_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
{
struct t_irc_channel *next_channel;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (buffer == irc_raw_buffer)
@@ -175,15 +177,18 @@ irc_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
*/
int
-irc_buffer_nickcmp_cb (void *data,
+irc_buffer_nickcmp_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
const char *nick1,
const char *nick2)
{
struct t_irc_server *server;
- if (data)
- server = (struct t_irc_server *)data;
+ /* make C compiler happy */
+ (void) data;
+
+ if (pointer)
+ server = (struct t_irc_server *)pointer;
else
irc_buffer_get_server_and_channel (buffer, &server, NULL);
diff --git a/src/plugins/irc/irc-buffer.h b/src/plugins/irc/irc-buffer.h
index b31a5c2bb..c58dfe73e 100644
--- a/src/plugins/irc/irc-buffer.h
+++ b/src/plugins/irc/irc-buffer.h
@@ -53,11 +53,11 @@ extern void irc_buffer_get_server_and_channel (struct t_gui_buffer *buffer,
struct t_irc_channel **channel);
extern const char *irc_buffer_build_name (const char *server,
const char *channel);
-extern int irc_buffer_close_cb (void *data, struct t_gui_buffer *buffer);
-extern int irc_buffer_nickcmp_cb (void *data,
+extern int irc_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer);
+extern int irc_buffer_nickcmp_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
- const char *nick1,
- const char *nick2);
+ const char *nick1, const char *nick2);
extern struct t_gui_buffer *irc_buffer_search_server_lowest_number ();
extern struct t_gui_buffer *irc_buffer_search_private_lowest_number (struct t_irc_server *server);
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c
index fe7b92863..20c912360 100644
--- a/src/plugins/irc/irc-channel.c
+++ b/src/plugins/irc/irc-channel.c
@@ -270,8 +270,8 @@ irc_channel_create_buffer (struct t_irc_server *server,
weechat_current_buffer (), "number");
ptr_buffer = weechat_buffer_new (buffer_name,
- &irc_input_data_cb, NULL,
- &irc_buffer_close_cb, NULL);
+ &irc_input_data_cb, NULL, NULL,
+ &irc_buffer_close_cb, NULL, NULL);
if (!ptr_buffer)
return NULL;
@@ -351,7 +351,7 @@ irc_channel_create_buffer (struct t_irc_server *server,
weechat_buffer_set (ptr_buffer, "nicklist_display_groups", "0");
weechat_buffer_set_pointer (ptr_buffer, "nickcmp_callback",
&irc_buffer_nickcmp_cb);
- weechat_buffer_set_pointer (ptr_buffer, "nickcmp_callback_data",
+ weechat_buffer_set_pointer (ptr_buffer, "nickcmp_callback_pointer",
server);
}
@@ -463,8 +463,7 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
new_channel->checking_whox = 0;
new_channel->away_message = NULL;
new_channel->has_quit_server = 0;
@@ -1024,8 +1023,7 @@ irc_channel_join_smart_filtered_add (struct t_irc_channel *channel,
64,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_TIME,
- NULL,
- NULL);
+ NULL, NULL);
}
if (!channel->join_smart_filtered)
return;
@@ -1224,8 +1222,7 @@ irc_channel_join_smart_filtered_unmask (struct t_irc_channel *channel,
hashtable = weechat_hashtable_new (4,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (hashtable)
{
/* update tags in line (remove tag "irc_smart_filter") */
@@ -1280,15 +1277,17 @@ irc_channel_rejoin (struct t_irc_server *server, struct t_irc_channel *channel)
*/
int
-irc_channel_autorejoin_cb (void *data, int remaining_calls)
+irc_channel_autorejoin_cb (const void *pointer, void *data,
+ int remaining_calls)
{
struct t_irc_server *ptr_server, *ptr_server_found;
struct t_irc_channel *ptr_channel_arg, *ptr_channel;
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- ptr_channel_arg = (struct t_irc_channel *)data;
+ ptr_channel_arg = (struct t_irc_channel *)pointer;
ptr_server_found = NULL;
for (ptr_server = irc_servers; ptr_server;
@@ -1435,11 +1434,13 @@ irc_channel_free_all (struct t_irc_server *server)
*/
struct t_hdata *
-irc_channel_hdata_channel_cb (void *data, const char *hdata_name)
+irc_channel_hdata_channel_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = weechat_hdata_new (hdata_name, "prev_channel", "next_channel",
@@ -1481,11 +1482,13 @@ irc_channel_hdata_channel_cb (void *data, const char *hdata_name)
*/
struct t_hdata *
-irc_channel_hdata_channel_speaking_cb (void *data, const char *hdata_name)
+irc_channel_hdata_channel_speaking_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = weechat_hdata_new (hdata_name, "prev_nick", "next_nick",
diff --git a/src/plugins/irc/irc-channel.h b/src/plugins/irc/irc-channel.h
index 479dbba45..5c8dd6a9e 100644
--- a/src/plugins/irc/irc-channel.h
+++ b/src/plugins/irc/irc-channel.h
@@ -151,13 +151,16 @@ extern void irc_channel_join_smart_filtered_unmask (struct t_irc_channel *channe
const char *nick);
extern void irc_channel_rejoin (struct t_irc_server *server,
struct t_irc_channel *channel);
-extern int irc_channel_autorejoin_cb (void *data, int remaining_calls);
+extern int irc_channel_autorejoin_cb (const void *pointer, void *data,
+ int remaining_calls);
extern void irc_channel_display_nick_back_in_pv (struct t_irc_server *server,
struct t_irc_nick *nick,
const char *nickname);
-extern struct t_hdata *irc_channel_hdata_channel_cb (void *data,
+extern struct t_hdata *irc_channel_hdata_channel_cb (const void *pointer,
+ void *data,
const char *hdata_name);
-extern struct t_hdata *irc_channel_hdata_channel_speaking_cb (void *data,
+extern struct t_hdata *irc_channel_hdata_channel_speaking_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int irc_channel_add_to_infolist (struct t_infolist *infolist,
struct t_irc_channel *channel);
diff --git a/src/plugins/irc/irc-color.c b/src/plugins/irc/irc-color.c
index 194a32ac3..5f9c1e52e 100644
--- a/src/plugins/irc/irc-color.c
+++ b/src/plugins/irc/irc-color.c
@@ -767,12 +767,14 @@ irc_color_decode_ansi (const char *string, int keep_colors)
*/
char *
-irc_color_modifier_cb (void *data, const char *modifier,
- const char *modifier_data, const char *string)
+irc_color_modifier_cb (const void *pointer, void *data,
+ const char *modifier, const char *modifier_data,
+ const char *string)
{
int keep_colors;
/* make C compiler happy */
+ (void) pointer;
(void) data;
keep_colors = (modifier_data && (strcmp (modifier_data, "1") == 0)) ? 1 : 0;
diff --git a/src/plugins/irc/irc-color.h b/src/plugins/irc/irc-color.h
index 9425db0ac..4bc9ffb8f 100644
--- a/src/plugins/irc/irc-color.h
+++ b/src/plugins/irc/irc-color.h
@@ -106,7 +106,8 @@ struct t_irc_color_ansi_state
extern char *irc_color_decode (const char *string, int keep_colors);
extern char *irc_color_encode (const char *string, int keep_colors);
-extern char *irc_color_modifier_cb (void *data, const char *modifier,
+extern char *irc_color_modifier_cb (const void *pointer, void *data,
+ const char *modifier,
const char *modifier_data,
const char *string);
extern char *irc_color_for_tags (const char *color);
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index d3fa3becf..5fa524513 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -142,8 +142,7 @@ irc_command_mode_nicks (struct t_irc_server *server,
nicks_sent = weechat_hashtable_new (128,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (!nicks_sent)
return;
@@ -241,14 +240,13 @@ irc_command_mode_nicks (struct t_irc_server *server,
* the server.
*/
-int
-irc_command_admin (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(admin)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("admin", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -390,9 +388,7 @@ irc_command_exec_all_channels (struct t_irc_server *server,
* connected servers.
*/
-int
-irc_command_allchan (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(allchan)
{
int i, current_server;
const char *ptr_exclude_channels, *ptr_command;
@@ -400,6 +396,7 @@ irc_command_allchan (void *data, struct t_gui_buffer *buffer, int argc,
IRC_BUFFER_GET_SERVER(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(2, "");
@@ -441,9 +438,7 @@ irc_command_allchan (void *data, struct t_gui_buffer *buffer, int argc,
* connected servers.
*/
-int
-irc_command_allpv (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(allpv)
{
int i, current_server;
const char *ptr_exclude_channels, *ptr_command;
@@ -451,6 +446,7 @@ irc_command_allpv (void *data, struct t_gui_buffer *buffer, int argc,
IRC_BUFFER_GET_SERVER(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(2, "");
@@ -593,14 +589,13 @@ irc_command_exec_all_servers (const char *exclude_servers, const char *command)
* Callback for command "/allserv": executes a command on all connected servers.
*/
-int
-irc_command_allserv (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(allserv)
{
int i;
const char *ptr_exclude_servers, *ptr_command;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -889,13 +884,12 @@ irc_command_away_server (struct t_irc_server *server, const char *arguments,
* Callback for command "/away": toggles away status.
*/
-int
-irc_command_away (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(away)
{
IRC_BUFFER_GET_SERVER(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
if ((argc >= 2) && (weechat_strcasecmp (argv[1], "-all") == 0))
@@ -928,7 +922,8 @@ irc_command_away (void *data, struct t_gui_buffer *buffer, int argc,
*/
int
-irc_command_run_away (void *data, struct t_gui_buffer *buffer,
+irc_command_run_away (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *command)
{
int argc;
@@ -939,7 +934,7 @@ irc_command_run_away (void *data, struct t_gui_buffer *buffer,
if (argv && argv_eol)
{
- irc_command_away (data, buffer, argc, argv, argv_eol);
+ irc_command_away (pointer, data, buffer, argc, argv, argv_eol);
}
if (argv)
@@ -993,9 +988,7 @@ irc_command_send_ban (struct t_irc_server *server,
* Callback for command "/ban": bans nicks or hosts.
*/
-int
-irc_command_ban (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(ban)
{
char *pos_channel;
int pos_args;
@@ -1004,6 +997,7 @@ irc_command_ban (void *data, struct t_gui_buffer *buffer, int argc,
IRC_COMMAND_CHECK_SERVER("ban", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -1080,14 +1074,13 @@ irc_command_ban (void *data, struct t_gui_buffer *buffer, int argc,
* http://ircv3.net/specs/core/capability-negotiation-3.2.html
*/
-int
-irc_command_cap (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(cap)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("cap", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (argc > 1)
@@ -1165,9 +1158,7 @@ irc_command_connect_one_server (struct t_irc_server *server,
* Callback for command "/connect": connects to server(s).
*/
-int
-irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(connect)
{
int i, nb_connect, connect_ok, all_servers, all_opened, switch_address;
int no_join, autoconnect;
@@ -1176,6 +1167,7 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc,
IRC_BUFFER_GET_SERVER(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -1362,9 +1354,7 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/ctcp": sends a CTCP message.
*/
-int
-irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(ctcp)
{
char **targets, *ctcp_type, str_time[512];
const char *ctcp_target, *ctcp_args;
@@ -1374,6 +1364,7 @@ irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc,
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(3, "");
@@ -1474,9 +1465,7 @@ irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/cycle": leaves and rejoins a channel.
*/
-int
-irc_command_cycle (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(cycle)
{
char *channel_name, *pos_args, *buf;
const char *version, *ptr_arg, *msg_part;
@@ -1487,6 +1476,7 @@ irc_command_cycle (void *data, struct t_gui_buffer *buffer, int argc,
IRC_COMMAND_CHECK_SERVER("cycle", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -1579,9 +1569,7 @@ irc_command_cycle (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/dcc": DCC control (file or chat).
*/
-int
-irc_command_dcc (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(dcc)
{
struct sockaddr_storage addr;
socklen_t length;
@@ -1594,6 +1582,7 @@ irc_command_dcc (void *data, struct t_gui_buffer *buffer, int argc,
IRC_COMMAND_CHECK_SERVER("dcc", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(3, "");
@@ -1678,14 +1667,13 @@ irc_command_dcc (void *data, struct t_gui_buffer *buffer, int argc,
* nickname(s).
*/
-int
-irc_command_dehalfop (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(dehalfop)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("dehalfop", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -1718,14 +1706,13 @@ irc_command_dehalfop (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/deop": removes operator privileges from nickname(s).
*/
-int
-irc_command_deop (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(deop)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("deop", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -1758,14 +1745,13 @@ irc_command_deop (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/devoice": removes voice from nickname(s).
*/
-int
-irc_command_devoice (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(devoice)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("devoice", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -1798,14 +1784,13 @@ irc_command_devoice (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/die": shutdowns the server.
*/
-int
-irc_command_die (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(die)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("die", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -1900,9 +1885,7 @@ irc_command_disconnect_one_server (struct t_irc_server *server,
* Callback for command "/disconnect": disconnects from server(s).
*/
-int
-irc_command_disconnect (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(disconnect)
{
int disconnect_ok;
const char *reason;
@@ -1910,6 +1893,7 @@ irc_command_disconnect (void *data, struct t_gui_buffer *buffer, int argc,
IRC_BUFFER_GET_SERVER(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
reason = (argc > 2) ? argv_eol[2] : NULL;
@@ -1976,14 +1960,13 @@ irc_command_disconnect (void *data, struct t_gui_buffer *buffer, int argc,
* nickname(s).
*/
-int
-irc_command_halfop (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(halfop)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("halfop", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -2043,9 +2026,7 @@ irc_command_ignore_display (struct t_irc_ignore *ignore)
* Callback for command "/ignore": adds or removes ignore.
*/
-int
-irc_command_ignore (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(ignore)
{
struct t_irc_ignore *ptr_ignore;
char *mask, *regex, *regex2, *ptr_regex, *server, *channel, *error;
@@ -2053,6 +2034,7 @@ irc_command_ignore (void *data, struct t_gui_buffer *buffer, int argc,
long number;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
(void) argv_eol;
@@ -2205,14 +2187,13 @@ irc_command_ignore (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/info": gets information describing the server.
*/
-int
-irc_command_info (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(info)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("info", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -2234,9 +2215,7 @@ irc_command_info (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/invite": invites a nick on a channel.
*/
-int
-irc_command_invite (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(invite)
{
int i, arg_last_nick;
char *ptr_channel_name;
@@ -2245,6 +2224,7 @@ irc_command_invite (void *data, struct t_gui_buffer *buffer, int argc,
IRC_COMMAND_CHECK_SERVER("invite", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -2299,14 +2279,13 @@ error:
* Callback for command "/ison": checks if a nickname is currently on IRC.
*/
-int
-irc_command_ison (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(ison)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("ison", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -2463,9 +2442,7 @@ irc_command_join_server (struct t_irc_server *server, const char *arguments,
* Callback for command "/join": joins a new channel.
*/
-int
-irc_command_join (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(join)
{
int i, arg_channels, noswitch;
const char *ptr_type, *ptr_server_name, *ptr_channel_name;
@@ -2473,6 +2450,7 @@ irc_command_join (void *data, struct t_gui_buffer *buffer, int argc,
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
noswitch = 0;
@@ -2589,9 +2567,7 @@ irc_command_kick_channel (struct t_irc_server *server,
* Callback for command "/kick": forcibly removes a user from a channel.
*/
-int
-irc_command_kick (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(kick)
{
char *pos_channel, *pos_nick, *pos_comment;
@@ -2599,6 +2575,7 @@ irc_command_kick (void *data, struct t_gui_buffer *buffer, int argc,
IRC_COMMAND_CHECK_SERVER("kick", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(2, "");
@@ -2637,9 +2614,7 @@ irc_command_kick (void *data, struct t_gui_buffer *buffer, int argc,
* bans it.
*/
-int
-irc_command_kickban (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(kickban)
{
char *pos_channel, *pos_nick, *nick_only, *pos_comment, *pos, *mask;
int length;
@@ -2648,6 +2623,7 @@ irc_command_kickban (void *data, struct t_gui_buffer *buffer, int argc,
IRC_COMMAND_CHECK_SERVER("kickban", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(2, "");
@@ -2732,14 +2708,13 @@ irc_command_kickban (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/kill": closes client-server connection.
*/
-int
-irc_command_kill (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(kill)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("kill", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(2, "");
@@ -2763,14 +2738,13 @@ irc_command_kill (void *data, struct t_gui_buffer *buffer, int argc,
* server answering the query.
*/
-int
-irc_command_links (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(links)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("links", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -2792,9 +2766,7 @@ irc_command_links (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/list": lists channels and their topic.
*/
-int
-irc_command_list (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(list)
{
char buf[512], *ptr_channel_name, *ptr_server_name, *ptr_regex;
int i, ret;
@@ -2803,6 +2775,7 @@ irc_command_list (void *data, struct t_gui_buffer *buffer, int argc,
IRC_COMMAND_CHECK_SERVER("list", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (ptr_server->cmd_list_regexp)
@@ -2896,14 +2869,13 @@ irc_command_list (void *data, struct t_gui_buffer *buffer, int argc,
* network.
*/
-int
-irc_command_lusers (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(lusers)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("lusers", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -2925,14 +2897,13 @@ irc_command_lusers (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/map": shows a graphical map of the IRC network.
*/
-int
-irc_command_map (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(map)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("map", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -2954,14 +2925,13 @@ irc_command_map (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/me": sends a ctcp action to the current channel.
*/
-int
-irc_command_me (void *data, struct t_gui_buffer *buffer, int argc, char **argv,
- char **argv_eol)
+IRC_COMMAND_CALLBACK(me)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("me", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -3013,14 +2983,13 @@ irc_command_mode_server (struct t_irc_server *server,
* Callback for command "/mode": changes mode for channel/nickname.
*/
-int
-irc_command_mode (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(mode)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("mode", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (argc > 1)
@@ -3070,14 +3039,13 @@ irc_command_mode (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/motd": gets the "Message Of The Day".
*/
-int
-irc_command_motd (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(motd)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("motd", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -3099,9 +3067,7 @@ irc_command_motd (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/msg": sends a message to a nick or channel.
*/
-int
-irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(msg)
{
char **targets, *msg_pwd_hidden, *string;
int num_targets, i, j, arg_target, arg_text, is_channel, status_msg;
@@ -3111,6 +3077,7 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc,
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(3, "");
@@ -3319,14 +3286,13 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/names": lists nicknames on channels.
*/
-int
-irc_command_names (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(names)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("names", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -3376,14 +3342,13 @@ irc_send_nick_server (struct t_irc_server *server, const char *nickname)
* Callback for command "/nick": changes nickname.
*/
-int
-irc_command_nick (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(nick)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("nick", 0);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -3409,9 +3374,7 @@ irc_command_nick (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/notice": sends notice message.
*/
-int
-irc_command_notice (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(notice)
{
char *string, hash_key[32], *str_args;
int arg_target, arg_text, number, is_channel;
@@ -3421,6 +3384,7 @@ irc_command_notice (void *data, struct t_gui_buffer *buffer, int argc,
IRC_BUFFER_GET_SERVER(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(3, "");
@@ -3495,9 +3459,7 @@ irc_command_notice (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/notify": adds or removes notify.
*/
-int
-irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(notify)
{
struct t_irc_notify *ptr_notify;
int i, check_away;
@@ -3505,6 +3467,7 @@ irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc,
IRC_BUFFER_GET_SERVER(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
(void) argv_eol;
@@ -3682,14 +3645,13 @@ irc_command_notify (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/op": gives operator privileges to nickname(s).
*/
-int
-irc_command_op (void *data, struct t_gui_buffer *buffer, int argc, char **argv,
- char **argv_eol)
+IRC_COMMAND_CALLBACK(op)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("op", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -3722,14 +3684,13 @@ irc_command_op (void *data, struct t_gui_buffer *buffer, int argc, char **argv,
* Callback for command "/oper": gets oper privileges.
*/
-int
-irc_command_oper (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(oper)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("oper", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -3779,9 +3740,7 @@ irc_command_part_channel (struct t_irc_server *server, const char *channel_name,
* Callback for command "/part": leaves a channel or close a private window.
*/
-int
-irc_command_part (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(part)
{
char *channel_name, *pos_args;
@@ -3789,6 +3748,7 @@ irc_command_part (void *data, struct t_gui_buffer *buffer, int argc,
IRC_COMMAND_CHECK_SERVER("part", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (argc > 1)
@@ -3848,14 +3808,13 @@ irc_command_part (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/ping": pings a server.
*/
-int
-irc_command_ping (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(ping)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("ping", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -3871,14 +3830,13 @@ irc_command_ping (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/pong": sends pong answer to a daemon.
*/
-int
-irc_command_pong (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(pong)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("pong", 0);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -3894,9 +3852,7 @@ irc_command_pong (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/query": starts private conversation with a nick.
*/
-int
-irc_command_query (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(query)
{
char *string, **nicks;
int i, arg_nick, arg_text, num_nicks, noswitch;
@@ -3904,6 +3860,7 @@ irc_command_query (void *data, struct t_gui_buffer *buffer, int argc,
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(2, "");
@@ -4012,9 +3969,7 @@ irc_command_query (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/quiet": quiets nicks or hosts.
*/
-int
-irc_command_quiet (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(quiet)
{
char *pos_channel;
int pos_args;
@@ -4023,6 +3978,7 @@ irc_command_quiet (void *data, struct t_gui_buffer *buffer, int argc,
IRC_COMMAND_CHECK_SERVER("quiet", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -4095,13 +4051,12 @@ irc_command_quiet (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/quote": sends raw data to server.
*/
-int
-irc_command_quote (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(quote)
{
IRC_BUFFER_GET_SERVER(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(2, "");
@@ -4172,15 +4127,14 @@ irc_command_reconnect_one_server (struct t_irc_server *server,
* Callback for command "/reconnect": reconnects to server(s).
*/
-int
-irc_command_reconnect (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(reconnect)
{
int i, nb_reconnect, reconnect_ok, all_servers, switch_address, no_join;
IRC_BUFFER_GET_SERVER(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -4261,14 +4215,13 @@ irc_command_reconnect (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/rehash": tells the server to reload its config file.
*/
-int
-irc_command_rehash (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(rehash)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("rehash", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -4290,9 +4243,7 @@ irc_command_rehash (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/remove": remove a user from a channel.
*/
-int
-irc_command_remove (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(remove)
{
const char *ptr_channel_name;
char *msg_vars_replaced;
@@ -4302,6 +4253,7 @@ irc_command_remove (void *data, struct t_gui_buffer *buffer, int argc,
IRC_COMMAND_CHECK_SERVER("remove", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(2, "");
@@ -4353,14 +4305,13 @@ irc_command_remove (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/restart": tells the server to restart itself.
*/
-int
-irc_command_restart (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(restart)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("restart", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -4382,14 +4333,13 @@ irc_command_restart (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/sajoin": forces a user to join channel(s).
*/
-int
-irc_command_sajoin (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(sajoin)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("sajoin", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(3, "");
@@ -4405,14 +4355,13 @@ irc_command_sajoin (void *data, struct t_gui_buffer *buffer, int argc,
* operator status.
*/
-int
-irc_command_samode (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(samode)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("samode", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (argc > 1)
@@ -4465,14 +4414,13 @@ irc_command_samode (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/sanick": forces a user to use another nick.
*/
-int
-irc_command_sanick (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(sanick)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("sanick", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(3, "");
@@ -4487,14 +4435,13 @@ irc_command_sanick (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/sapart": forces a user to leave channel(s).
*/
-int
-irc_command_sapart (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(sapart)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("sapart", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(3, "");
@@ -4509,14 +4456,13 @@ irc_command_sapart (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/saquit": forces a user to quit server with a reason.
*/
-int
-irc_command_saquit (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(saquit)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("saquit", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(3, "");
@@ -4947,9 +4893,7 @@ irc_command_display_server (struct t_irc_server *server, int with_detail)
* Callback for command "/server": manages IRC servers.
*/
-int
-irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(server)
{
int i, detailed_list, one_server_found, length, count;
struct t_irc_server *ptr_server2, *server_found, *new_server;
@@ -4958,6 +4902,7 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -5313,14 +5258,13 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/service": registers a new service.
*/
-int
-irc_command_service (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(service)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("service", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -5337,14 +5281,13 @@ irc_command_service (void *data, struct t_gui_buffer *buffer, int argc,
* network.
*/
-int
-irc_command_servlist (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(servlist)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("servlist", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -5366,14 +5309,13 @@ irc_command_servlist (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/squery": delivers a message to a service.
*/
-int
-irc_command_squery (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(squery)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("squery", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(2, "");
@@ -5396,14 +5338,13 @@ irc_command_squery (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/squit": disconnects server links.
*/
-int
-irc_command_squit (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(squit)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("squit", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -5418,14 +5359,13 @@ irc_command_squit (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/stats": queries statistics about server.
*/
-int
-irc_command_stats (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(stats)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("stats", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -5448,14 +5388,13 @@ irc_command_stats (void *data, struct t_gui_buffer *buffer, int argc,
* server a message asking them to please join IRC.
*/
-int
-irc_command_summon (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(summon)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("summon", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -5471,14 +5410,13 @@ irc_command_summon (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/time": queries local time from server.
*/
-int
-irc_command_time (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(time)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("time", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -5500,9 +5438,7 @@ irc_command_time (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/topic": gets/sets topic for a channel.
*/
-int
-irc_command_topic (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(topic)
{
char *channel_name, *new_topic, *new_topic_color;
@@ -5510,6 +5446,7 @@ irc_command_topic (void *data, struct t_gui_buffer *buffer, int argc,
IRC_COMMAND_CHECK_SERVER("topic", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -5578,14 +5515,13 @@ irc_command_topic (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/trace": finds the route to specific server.
*/
-int
-irc_command_trace (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(trace)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("trace", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -5607,9 +5543,7 @@ irc_command_trace (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/unban": unbans nicks or hosts.
*/
-int
-irc_command_unban (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(unban)
{
char *pos_channel;
int pos_args;
@@ -5618,6 +5552,7 @@ irc_command_unban (void *data, struct t_gui_buffer *buffer, int argc,
IRC_COMMAND_CHECK_SERVER("unban", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -5665,9 +5600,7 @@ irc_command_unban (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/unquiet": unquiets nicks or hosts.
*/
-int
-irc_command_unquiet (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(unquiet)
{
char *pos_channel;
int pos_args;
@@ -5676,6 +5609,7 @@ irc_command_unquiet (void *data, struct t_gui_buffer *buffer, int argc,
IRC_COMMAND_CHECK_SERVER("unquiet", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -5734,14 +5668,13 @@ irc_command_unquiet (void *data, struct t_gui_buffer *buffer, int argc,
* nicknames.
*/
-int
-irc_command_userhost (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(userhost)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("userhost", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -5757,14 +5690,13 @@ irc_command_userhost (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/users": list of users logged into the server.
*/
-int
-irc_command_users (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(users)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("users", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -5787,14 +5719,13 @@ irc_command_users (void *data, struct t_gui_buffer *buffer, int argc,
* (current or specified).
*/
-int
-irc_command_version (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(version)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("version", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -5825,14 +5756,13 @@ irc_command_version (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/voice": gives voice to nickname(s).
*/
-int
-irc_command_voice (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(voice)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
IRC_COMMAND_CHECK_SERVER("voice", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -5865,9 +5795,7 @@ irc_command_voice (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/wallchops": sends a notice to channel ops.
*/
-int
-irc_command_wallchops (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(wallchops)
{
char *pos_channel;
int pos_args;
@@ -5878,6 +5806,7 @@ irc_command_wallchops (void *data, struct t_gui_buffer *buffer, int argc,
IRC_COMMAND_CHECK_SERVER("wallchops", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
WEECHAT_COMMAND_MIN_ARGS(2, "");
@@ -5977,14 +5906,13 @@ irc_command_wallchops (void *data, struct t_gui_buffer *buffer, int argc,
* users who have set the 'w' user mode for themselves.
*/
-int
-irc_command_wallops (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(wallops)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("wallops", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -6001,14 +5929,13 @@ irc_command_wallops (void *data, struct t_gui_buffer *buffer, int argc,
* information.
*/
-int
-irc_command_who (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(who)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("who", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -6030,9 +5957,7 @@ irc_command_who (void *data, struct t_gui_buffer *buffer, int argc,
* Callback for command "/whois": queries information about user(s).
*/
-int
-irc_command_whois (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(whois)
{
int double_nick;
const char *ptr_nick;
@@ -6041,6 +5966,7 @@ irc_command_whois (void *data, struct t_gui_buffer *buffer, int argc,
IRC_COMMAND_CHECK_SERVER("whois", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
double_nick = weechat_config_boolean (irc_config_network_whois_double_nick);
@@ -6082,14 +6008,13 @@ irc_command_whois (void *data, struct t_gui_buffer *buffer, int argc,
* no longer exists.
*/
-int
-irc_command_whowas (void *data, struct t_gui_buffer *buffer, int argc,
- char **argv, char **argv_eol)
+IRC_COMMAND_CALLBACK(whowas)
{
IRC_BUFFER_GET_SERVER(buffer);
IRC_COMMAND_CHECK_SERVER("whowas", 1);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv;
@@ -6113,7 +6038,7 @@ irc_command_init ()
N_("find information about the administrator of the server"),
N_("[<target>]"),
N_("target: server name"),
- NULL, &irc_command_admin, NULL);
+ NULL, &irc_command_admin, NULL, NULL);
weechat_hook_command (
"allchan",
N_("execute a command on all channels of all connected servers"),
@@ -6133,7 +6058,7 @@ irc_command_init ()
" say 'hello' everywhere but not on #weechat and channels beginning "
"with #linux:\n"
" /allchan -exclude=#weechat,#linux* msg * hello"),
- "-current", &irc_command_allchan, NULL);
+ "-current", &irc_command_allchan, NULL, NULL);
weechat_hook_command (
"allpv",
N_("execute a command on all private buffers of all connected servers"),
@@ -6156,7 +6081,7 @@ irc_command_init ()
" /allpv -exclude=foo,bar* msg * hello\n"
" close all private buffers:\n"
" /allpv close"),
- "-current", &irc_command_allpv, NULL);
+ "-current", &irc_command_allpv, NULL, NULL);
weechat_hook_command (
"allserv",
N_("execute a command on all connected servers"),
@@ -6174,8 +6099,8 @@ irc_command_init ()
" /allserv away I'm away\n"
" do a whois on my nick on all servers:\n"
" /allserv whois $nick"),
- NULL, &irc_command_allserv, NULL);
- weechat_hook_command_run ("/away", &irc_command_run_away, NULL);
+ NULL, &irc_command_allserv, NULL, NULL);
+ weechat_hook_command_run ("/away", &irc_command_run_away, NULL, NULL);
weechat_hook_command (
"ban",
N_("ban nicks or hosts"),
@@ -6185,7 +6110,7 @@ irc_command_init ()
"\n"
"Without argument, this command displays the ban list for current "
"channel."),
- "%(irc_channel_nicks_hosts)", &irc_command_ban, NULL);
+ "%(irc_channel_nicks_hosts)", &irc_command_ban, NULL, NULL);
weechat_hook_command (
"cap",
N_("client capability negotiation"),
@@ -6216,7 +6141,7 @@ irc_command_init ()
" || req " IRC_COMMAND_CAP_SUPPORTED_COMPLETION
" || ack " IRC_COMMAND_CAP_SUPPORTED_COMPLETION
" || end",
- &irc_command_cap, NULL);
+ &irc_command_cap, NULL, NULL);
weechat_hook_command (
"connect",
N_("connect to IRC server(s)"),
@@ -6254,7 +6179,7 @@ irc_command_init ()
" /connect irc://nick@irc.oftc.net/#channel\n"
" /connect -switch"),
"%(irc_servers)|-all|-auto|-open|-nojoin|-switch|%*",
- &irc_command_connect, NULL);
+ &irc_command_connect, NULL, NULL);
weechat_hook_command (
"ctcp",
N_("send a CTCP message (Client-To-Client Protocol)"),
@@ -6272,14 +6197,14 @@ irc_command_init ()
IRC_COMMAND_CTCP_SUPPORTED_COMPLETION
" || %(irc_channel)|%(nicks)|* "
IRC_COMMAND_CTCP_SUPPORTED_COMPLETION,
- &irc_command_ctcp, NULL);
+ &irc_command_ctcp, NULL, NULL);
weechat_hook_command (
"cycle",
N_("leave and rejoin a channel"),
N_("[<channel>[,<channel>...]] [<message>]"),
N_("channel: channel name\n"
"message: part message (displayed to other users)"),
- "%(irc_msg_part)", &irc_command_cycle, NULL);
+ "%(irc_msg_part)", &irc_command_cycle, NULL, NULL);
weechat_hook_command (
"dcc",
N_("start a DCC (file transfer or direct chat)"),
@@ -6294,7 +6219,7 @@ irc_command_init ()
" /dcc send toto /home/foo/bar.txt"),
"chat %(nicks)"
" || send %(nicks) %(filename)",
- &irc_command_dcc, NULL);
+ &irc_command_dcc, NULL, NULL);
weechat_hook_command (
"dehalfop",
N_("remove channel half-operator status from nick(s)"),
@@ -6302,7 +6227,7 @@ irc_command_init ()
N_("nick: nick or mask (wildcard \"*\" is allowed)\n"
" *: remove channel half-operator status from everybody on channel "
"except yourself"),
- "%(nicks)", &irc_command_dehalfop, NULL);
+ "%(nicks)", &irc_command_dehalfop, NULL, NULL);
weechat_hook_command (
"deop",
N_("remove channel operator status from nick(s)"),
@@ -6310,20 +6235,20 @@ irc_command_init ()
N_("nick: nick or mask (wildcard \"*\" is allowed)\n"
" *: remove channel operator status from everybody on channel "
"except yourself"),
- "%(nicks)|%*", &irc_command_deop, NULL);
+ "%(nicks)|%*", &irc_command_deop, NULL, NULL);
weechat_hook_command (
"devoice",
N_("remove voice from nick(s)"),
N_("<nick> [<nick>...] || * -yes"),
N_("nick: nick or mask (wildcard \"*\" is allowed)\n"
" *: remove voice from everybody on channel"),
- "%(nicks)|%*", &irc_command_devoice, NULL);
+ "%(nicks)|%*", &irc_command_devoice, NULL, NULL);
weechat_hook_command (
"die",
N_("shutdown the server"),
N_("[<target>]"),
N_("target: server name"),
- NULL, &irc_command_die, NULL);
+ NULL, &irc_command_die, NULL, NULL);
weechat_hook_command (
"disconnect",
N_("disconnect from one or all IRC servers"),
@@ -6334,14 +6259,14 @@ irc_command_init ()
"reconnecting\n"
" reason: reason for the \"quit\""),
"%(irc_servers)|-all|-pending",
- &irc_command_disconnect, NULL);
+ &irc_command_disconnect, NULL, NULL);
weechat_hook_command (
"halfop",
N_("give channel half-operator status to nick(s)"),
N_("<nick> [<nick>...] || * -yes"),
N_("nick: nick or mask (wildcard \"*\" is allowed)\n"
" *: give channel half-operator status to everybody on channel"),
- "%(nicks)", &irc_command_halfop, NULL);
+ "%(nicks)", &irc_command_halfop, NULL, NULL);
weechat_hook_command (
"ignore",
N_("ignore nicks/hosts from servers or channels"),
@@ -6372,26 +6297,26 @@ irc_command_init ()
"list"
" || add %(irc_channel_nicks_hosts) %(irc_servers) %(irc_channels) %-"
" || del -all|%(irc_ignores_numbers) %-",
- &irc_command_ignore, NULL);
+ &irc_command_ignore, NULL, NULL);
weechat_hook_command (
"info",
N_("get information describing the server"),
N_("[<target>]"),
N_("target: server name"),
- NULL, &irc_command_info, NULL);
+ NULL, &irc_command_info, NULL, NULL);
weechat_hook_command (
"invite",
N_("invite a nick on a channel"),
N_("<nick> [<nick>...] [<channel>]"),
N_(" nick: nick\n"
"channel: channel name"),
- "%(nicks) %(irc_server_channels)", &irc_command_invite, NULL);
+ "%(nicks) %(irc_server_channels)", &irc_command_invite, NULL, NULL);
weechat_hook_command (
"ison",
N_("check if a nick is currently on IRC"),
N_("<nick> [<nick>...]"),
N_("nick: nick"),
- "%(nicks)|%*", &irc_command_ison, NULL);
+ "%(nicks)|%*", &irc_command_ison, NULL, NULL);
weechat_hook_command (
"join",
N_("join a channel"),
@@ -6409,7 +6334,7 @@ irc_command_init ()
" /join -server freenode #weechat\n"
" /join -noswitch #weechat"),
"%(irc_channels)|-noswitch|-server|%(irc_servers)|%*",
- &irc_command_join, NULL);
+ &irc_command_join, NULL, NULL);
weechat_hook_command (
"kick",
N_("kick a user out of a channel"),
@@ -6418,7 +6343,7 @@ irc_command_init ()
" nick: nick\n"
" reason: reason (special variables $nick, $channel and $server are "
"replaced by their value)"),
- "%(nicks) %(irc_msg_kick) %-", &irc_command_kick, NULL);
+ "%(nicks) %(irc_msg_kick) %-", &irc_command_kick, NULL, NULL);
weechat_hook_command (
"kickban",
N_("kick a user out of a channel and ban the host"),
@@ -6435,14 +6360,14 @@ irc_command_init ()
" ban \"*!*@host.com\" and then kick \"toto\":\n"
" /kickban toto!*@host.com"),
"%(irc_channel_nicks_hosts) %(irc_msg_kick) %-",
- &irc_command_kickban, NULL);
+ &irc_command_kickban, NULL, NULL);
weechat_hook_command (
"kill",
N_("close client-server connection"),
N_("<nick> [<reason>]"),
N_(" nick: nick\n"
"reason: reason"),
- "%(nicks) %-", &irc_command_kill, NULL);
+ "%(nicks) %-", &irc_command_kill, NULL, NULL);
weechat_hook_command (
"links",
N_("list all servernames which are known by the server answering the "
@@ -6450,7 +6375,7 @@ irc_command_init ()
N_("[[<server>] <server_mask>]"),
N_(" server: this server should answer the query\n"
"server_mask: list of servers must match this mask"),
- NULL, &irc_command_links, NULL);
+ NULL, &irc_command_links, NULL, NULL);
weechat_hook_command (
"list",
N_("list channels and their topic"),
@@ -6470,26 +6395,26 @@ irc_command_init ()
" list all channels beginning with \"#weechat\" (can be very slow "
"on large networks):\n"
" /list -re #weechat.*"),
- NULL, &irc_command_list, NULL);
+ NULL, &irc_command_list, NULL, NULL);
weechat_hook_command (
"lusers",
N_("get statistics about the size of the IRC network"),
N_("[<mask> [<target>]]"),
N_(" mask: servers matching the mask only\n"
"target: server for forwarding request"),
- NULL, &irc_command_lusers, NULL);
+ NULL, &irc_command_lusers, NULL, NULL);
weechat_hook_command (
"map",
N_("show a graphical map of the IRC network"),
"",
"",
- NULL, &irc_command_map, NULL);
+ NULL, &irc_command_map, NULL, NULL);
weechat_hook_command (
"me",
N_("send a CTCP action to the current channel"),
N_("<message>"),
N_("message: message to send"),
- NULL, &irc_command_me, NULL);
+ NULL, &irc_command_me, NULL, NULL);
weechat_hook_command (
"mode",
N_("change channel or user mode"),
@@ -6524,13 +6449,13 @@ irc_command_init ()
" /mode #weechat +t\n"
" become invisible on server:\n"
" /mode nick +i"),
- "%(irc_channel)|%(irc_server_nick)", &irc_command_mode, NULL);
+ "%(irc_channel)|%(irc_server_nick)", &irc_command_mode, NULL, NULL);
weechat_hook_command (
"motd",
N_("get the \"Message Of The Day\""),
N_("[<target>]"),
N_("target: server name"),
- NULL, &irc_command_motd, NULL);
+ NULL, &irc_command_motd, NULL, NULL);
weechat_hook_command (
"msg",
N_("send message to a nick or channel"),
@@ -6540,13 +6465,13 @@ irc_command_init ()
" text: text to send"),
"-server %(irc_servers) %(nicks)|*"
" || %(nicks)|*",
- &irc_command_msg, NULL);
+ &irc_command_msg, NULL, NULL);
weechat_hook_command (
"names",
N_("list nicks on channels"),
N_("[<channel>[,<channel>...]]"),
N_("channel: channel name"),
- "%(irc_channels)", &irc_command_names, NULL);
+ "%(irc_channels)", &irc_command_names, NULL, NULL);
weechat_hook_command (
"nick",
N_("change current nick"),
@@ -6555,7 +6480,7 @@ irc_command_init ()
"nick: new nick"),
"-all %(irc_server_nick)"
" || %(irc_server_nick)",
- &irc_command_nick, NULL);
+ &irc_command_nick, NULL, NULL);
weechat_hook_command (
"notice",
N_("send notice message to user"),
@@ -6565,7 +6490,7 @@ irc_command_init ()
" text: text to send"),
"-server %(irc_servers) %(nicks)"
" || %(nicks)",
- &irc_command_notice, NULL);
+ &irc_command_notice, NULL, NULL);
weechat_hook_command (
"notify",
N_("add a notification for presence or away status of nicks on servers"),
@@ -6591,42 +6516,42 @@ irc_command_init ()
" /notify add toto freenode -away"),
"add %(irc_channel_nicks) %(irc_servers) -away %-"
" || del -all|%(irc_notify_nicks) %(irc_servers) %-",
- &irc_command_notify, NULL);
+ &irc_command_notify, NULL, NULL);
weechat_hook_command (
"op",
N_("give channel operator status to nick(s)"),
N_("<nick> [<nick>...] || * -yes"),
N_("nick: nick or mask (wildcard \"*\" is allowed)\n"
" *: give channel operator status to everybody on channel"),
- "%(nicks)|%*", &irc_command_op, NULL);
+ "%(nicks)|%*", &irc_command_op, NULL, NULL);
weechat_hook_command (
"oper",
N_("get operator privileges"),
N_("<user> <password>"),
N_(" user: user\n"
"password: password"),
- NULL, &irc_command_oper, NULL);
+ NULL, &irc_command_oper, NULL, NULL);
weechat_hook_command (
"part",
N_("leave a channel"),
N_("[<channel>[,<channel>...]] [<message>]"),
N_("channel: channel name to leave\n"
"message: part message (displayed to other users)"),
- "%(irc_msg_part)", &irc_command_part, NULL);
+ "%(irc_msg_part)", &irc_command_part, NULL, NULL);
weechat_hook_command (
"ping",
N_("send a ping to server"),
N_("<server1> [<server2>]"),
N_("server1: server\n"
"server2: forward ping to this server"),
- NULL, &irc_command_ping, NULL);
+ NULL, &irc_command_ping, NULL, NULL);
weechat_hook_command (
"pong",
N_("answer to a ping message"),
N_("<daemon> [<daemon2>]"),
N_(" daemon: daemon who has responded to Ping message\n"
"daemon2: forward message to this daemon"),
- NULL, &irc_command_pong, NULL);
+ NULL, &irc_command_pong, NULL, NULL);
weechat_hook_command (
"query",
N_("send a private message to a nick"),
@@ -6637,7 +6562,7 @@ irc_command_init ()
" text: text to send"),
"-noswitch|-server %(irc_servers) %(nicks)"
" || %(nicks)",
- &irc_command_query, NULL);
+ &irc_command_query, NULL, NULL);
weechat_hook_command (
"quiet",
N_("quiet nicks or hosts"),
@@ -6647,14 +6572,14 @@ irc_command_init ()
"\n"
"Without argument, this command displays the quiet list for "
"current channel."),
- "%(irc_channel_nicks_hosts)", &irc_command_quiet, NULL);
+ "%(irc_channel_nicks_hosts)", &irc_command_quiet, NULL, NULL);
weechat_hook_command (
"quote",
N_("send raw data to server without parsing"),
N_("[-server <server>] <data>"),
N_("server: send to this server (internal name)\n"
" data: raw data to send"),
- "-server %(irc_servers)", &irc_command_quote, NULL);
+ "-server %(irc_servers)", &irc_command_quote, NULL, NULL);
weechat_hook_command (
"reconnect",
N_("reconnect to server(s)"),
@@ -6666,13 +6591,13 @@ irc_command_init ()
"server)\n"
"-switch: switch to next server address"),
"%(irc_servers)|-all|-nojoin|-switch|%*",
- &irc_command_reconnect, NULL);
+ &irc_command_reconnect, NULL, NULL);
weechat_hook_command (
"rehash",
N_("tell the server to reload its config file"),
N_("[<option>]"),
N_("option: extra option, for some servers"),
- NULL, &irc_command_rehash, NULL);
+ NULL, &irc_command_rehash, NULL, NULL);
weechat_hook_command (
"remove",
N_("force a user to leave a channel"),
@@ -6681,55 +6606,55 @@ irc_command_init ()
" nick: nick\n"
" reason: reason (special variables $nick, $channel and $server are "
"replaced by their value)"),
- "%(irc_channel)|%(nicks) %(nicks)", &irc_command_remove, NULL);
+ "%(irc_channel)|%(nicks) %(nicks)", &irc_command_remove, NULL, NULL);
weechat_hook_command (
"restart",
N_("tell the server to restart itself"),
N_("[<target>]"),
N_("target: server name"),
- NULL, &irc_command_restart, NULL);
+ NULL, &irc_command_restart, NULL, NULL);
weechat_hook_command (
"sajoin",
N_("force a user to join channel(s)"),
N_("<nick> <channel>[,<channel>...]"),
N_(" nick: nick\n"
"channel: channel name"),
- "%(nicks) %(irc_server_channels)", &irc_command_sajoin, NULL);
+ "%(nicks) %(irc_server_channels)", &irc_command_sajoin, NULL, NULL);
weechat_hook_command (
"samode",
N_("change mode on channel, without having operator status"),
N_("[<channel>] <mode>"),
N_("channel: channel name\n"
" mode: mode for channel"),
- "%(irc_server_channels)", &irc_command_samode, NULL);
+ "%(irc_server_channels)", &irc_command_samode, NULL, NULL);
weechat_hook_command (
"sanick",
N_("force a user to use another nick"),
N_("<nick> <new_nick>"),
N_(" nick: nick\n"
"new_nick: new nick"),
- "%(nicks) %(nicks)", &irc_command_sanick, NULL);
+ "%(nicks) %(nicks)", &irc_command_sanick, NULL, NULL);
weechat_hook_command (
"sapart",
N_("force a user to leave channel(s)"),
N_("<nick> <channel>[,<channel>...]"),
N_(" nick: nick\n"
"channel: channel name"),
- "%(nicks) %(irc_server_channels)", &irc_command_sapart, NULL);
+ "%(nicks) %(irc_server_channels)", &irc_command_sapart, NULL, NULL);
weechat_hook_command (
"saquit",
N_("force a user to quit server with a reason"),
N_("<nick> <reason>"),
N_(" nick: nick\n"
"reason: reason"),
- "%(nicks)", &irc_command_saquit, NULL);
+ "%(nicks)", &irc_command_saquit, NULL, NULL);
weechat_hook_command (
"service",
N_("register a new service"),
N_("<nick> <reserved> <distribution> <type> <reserved> <info>"),
N_("distribution: visibility of service\n"
" type: reserved for future usage"),
- NULL, &irc_command_service, NULL);
+ NULL, &irc_command_service, NULL, NULL);
weechat_hook_command (
"server",
N_("list, add or remove IRC servers"),
@@ -6782,35 +6707,35 @@ irc_command_init ()
" || deloutq"
" || jump"
" || raw",
- &irc_command_server, NULL);
+ &irc_command_server, NULL, NULL);
weechat_hook_command (
"servlist",
N_("list services currently connected to the network"),
N_("[<mask> [<type>]]"),
N_("mask: list only services matching this mask\n"
"type: list only services of this type"),
- NULL, &irc_command_servlist, NULL);
+ NULL, &irc_command_servlist, NULL, NULL);
weechat_hook_command (
"squery",
N_("deliver a message to a service"),
N_("<service> <text>"),
N_("service: name of service\n"
" text: text to send"),
- NULL, &irc_command_squery, NULL);
+ NULL, &irc_command_squery, NULL, NULL);
weechat_hook_command (
"squit",
N_("disconnect server links"),
N_("<server> <comment>"),
N_( " server: server name\n"
"comment: comment"),
- NULL, &irc_command_squit, NULL);
+ NULL, &irc_command_squit, NULL, NULL);
weechat_hook_command (
"stats",
N_("query statistics about server"),
N_("[<query> [<server>]]"),
N_(" query: c/h/i/k/l/m/o/y/u (see RFC1459)\n"
"server: server name"),
- NULL, &irc_command_stats, NULL);
+ NULL, &irc_command_stats, NULL, NULL);
weechat_hook_command (
"summon",
N_("give users who are on a host running an IRC "
@@ -6820,13 +6745,13 @@ irc_command_init ()
N_(" user: username\n"
" target: server name\n"
"channel: channel name"),
- NULL, &irc_command_summon, NULL);
+ NULL, &irc_command_summon, NULL, NULL);
weechat_hook_command (
"time",
N_("query local time from server"),
N_("[<target>]"),
N_("target: query time from specified server"),
- NULL, &irc_command_time, NULL);
+ NULL, &irc_command_time, NULL, NULL);
weechat_hook_command (
"topic",
N_("get/set channel topic"),
@@ -6834,74 +6759,74 @@ irc_command_init ()
N_("channel: channel name\n"
" topic: new topic\n"
"-delete: delete channel topic"),
- "%(irc_channel_topic)|-delete", &irc_command_topic, NULL);
+ "%(irc_channel_topic)|-delete", &irc_command_topic, NULL, NULL);
weechat_hook_command (
"trace",
N_("find the route to specific server"),
N_("[<target>]"),
N_("target: server name"),
- NULL, &irc_command_trace, NULL);
+ NULL, &irc_command_trace, NULL, NULL);
weechat_hook_command (
"unban",
N_("unban nicks or hosts"),
N_("[<channel>] <nick> [<nick>...]"),
N_("channel: channel name\n"
" nick: nick or host"),
- NULL, &irc_command_unban, NULL);
+ NULL, &irc_command_unban, NULL, NULL);
weechat_hook_command (
"unquiet",
N_("unquiet nicks or hosts"),
N_("[<channel>] <nick> [<nick>...]"),
N_("channel: channel name\n"
" nick: nick or host"),
- "%(irc_channel_nicks_hosts)", &irc_command_unquiet, NULL);
+ "%(irc_channel_nicks_hosts)", &irc_command_unquiet, NULL, NULL);
weechat_hook_command (
"userhost",
N_("return a list of information about nicks"),
N_("<nick> [<nick>...]"),
N_("nick: nick"),
- "%(nicks)", &irc_command_userhost, NULL);
+ "%(nicks)", &irc_command_userhost, NULL, NULL);
weechat_hook_command (
"users",
N_("list of users logged into the server"),
N_("[<target>]"),
N_("target: server name"),
- NULL, &irc_command_users, NULL);
+ NULL, &irc_command_users, NULL, NULL);
weechat_hook_command (
"version",
N_("give the version info of nick or server (current or specified)"),
N_("[<server>|<nick>]"),
N_("server: server name\n"
" nick: nick"),
- "%(nicks)", &irc_command_version, NULL);
+ "%(nicks)", &irc_command_version, NULL, NULL);
weechat_hook_command (
"voice",
N_("give voice to nick(s)"),
N_("<nick> [<nick>...]"),
N_("nick: nick or mask (wildcard \"*\" is allowed)\n"
" *: give voice to everybody on channel"),
- "%(nicks)|%*", &irc_command_voice, NULL);
+ "%(nicks)|%*", &irc_command_voice, NULL, NULL);
weechat_hook_command (
"wallchops",
N_("send a notice to channel ops"),
N_("[<channel>] <text>"),
N_("channel: channel name\n"
" text: text to send"),
- NULL, &irc_command_wallchops, NULL);
+ NULL, &irc_command_wallchops, NULL, NULL);
weechat_hook_command (
"wallops",
N_("send a message to all currently connected users who have set the "
"'w' user mode for themselves"),
N_("<text>"),
N_("text: text to send"),
- NULL, &irc_command_wallops, NULL);
+ NULL, &irc_command_wallops, NULL, NULL);
weechat_hook_command (
"who",
N_("generate a query which returns a list of information"),
N_("[<mask> [o]]"),
N_("mask: only information which match this mask\n"
" o: only operators are returned according to the mask supplied"),
- "%(irc_channels)", &irc_command_who, NULL);
+ "%(irc_channels)", &irc_command_who, NULL, NULL);
weechat_hook_command (
"whois",
N_("query information about user(s)"),
@@ -6915,7 +6840,7 @@ irc_command_init ()
"\n"
"If option irc.network.whois_double_nick is enabled, two nicks are "
"sent (if only one nick is given), to get idle time in answer."),
- "%(nicks)", &irc_command_whois, NULL);
+ "%(nicks)", &irc_command_whois, NULL, NULL);
weechat_hook_command (
"whowas",
N_("ask for information about a nick which no longer exists"),
@@ -6924,5 +6849,5 @@ irc_command_init ()
" count: number of replies to return (full search if negative "
"number)\n"
"target: reply should match this mask"),
- "%(nicks)", &irc_command_whowas, NULL);
+ "%(nicks)", &irc_command_whowas, NULL, NULL);
}
diff --git a/src/plugins/irc/irc-command.h b/src/plugins/irc/irc-command.h
index ac48c941f..196394755 100644
--- a/src/plugins/irc/irc-command.h
+++ b/src/plugins/irc/irc-command.h
@@ -23,6 +23,12 @@
struct t_irc_server;
struct t_irc_channel;
+#define IRC_COMMAND_CALLBACK(__command) \
+ int \
+ irc_command_##__command (const void *pointer, void *data, \
+ struct t_gui_buffer *buffer, \
+ int argc, char **argv, char **argv_eol)
+
#define IRC_COMMAND_CHECK_SERVER(__command, __check_connection) \
if (!ptr_server) \
{ \
diff --git a/src/plugins/irc/irc-completion.c b/src/plugins/irc/irc-completion.c
index 153bad8d6..b0140496e 100644
--- a/src/plugins/irc/irc-completion.c
+++ b/src/plugins/irc/irc-completion.c
@@ -41,13 +41,15 @@
*/
int
-irc_completion_server_cb (void *data, const char *completion_item,
+irc_completion_server_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
IRC_BUFFER_GET_SERVER(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
@@ -65,13 +67,15 @@ irc_completion_server_cb (void *data, const char *completion_item,
*/
int
-irc_completion_server_nick_cb (void *data, const char *completion_item,
+irc_completion_server_nick_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
IRC_BUFFER_GET_SERVER(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
@@ -89,7 +93,8 @@ irc_completion_server_nick_cb (void *data, const char *completion_item,
*/
int
-irc_completion_server_channels_cb (void *data, const char *completion_item,
+irc_completion_server_channels_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -98,6 +103,7 @@ irc_completion_server_channels_cb (void *data, const char *completion_item,
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
@@ -129,7 +135,8 @@ irc_completion_server_channels_cb (void *data, const char *completion_item,
*/
int
-irc_completion_server_privates_cb (void *data, const char *completion_item,
+irc_completion_server_privates_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -138,6 +145,7 @@ irc_completion_server_privates_cb (void *data, const char *completion_item,
IRC_BUFFER_GET_SERVER(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
@@ -162,7 +170,8 @@ irc_completion_server_privates_cb (void *data, const char *completion_item,
*/
int
-irc_completion_server_nicks_cb (void *data, const char *completion_item,
+irc_completion_server_nicks_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -172,6 +181,7 @@ irc_completion_server_nicks_cb (void *data, const char *completion_item,
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
@@ -204,13 +214,15 @@ irc_completion_server_nicks_cb (void *data, const char *completion_item,
*/
int
-irc_completion_servers_cb (void *data, const char *completion_item,
+irc_completion_servers_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
struct t_irc_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -230,13 +242,15 @@ irc_completion_servers_cb (void *data, const char *completion_item,
*/
int
-irc_completion_channel_cb (void *data, const char *completion_item,
+irc_completion_channel_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
@@ -285,7 +299,8 @@ irc_completion_channel_nicks_add_speakers (struct t_gui_completion *completion,
*/
int
-irc_completion_channel_nicks_cb (void *data, const char *completion_item,
+irc_completion_channel_nicks_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -294,6 +309,7 @@ irc_completion_channel_nicks_cb (void *data, const char *completion_item,
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
@@ -350,7 +366,8 @@ irc_completion_channel_nicks_cb (void *data, const char *completion_item,
*/
int
-irc_completion_channel_nicks_hosts_cb (void *data, const char *completion_item,
+irc_completion_channel_nicks_hosts_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -361,6 +378,7 @@ irc_completion_channel_nicks_hosts_cb (void *data, const char *completion_item,
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
@@ -407,7 +425,8 @@ irc_completion_channel_nicks_hosts_cb (void *data, const char *completion_item,
*/
int
-irc_completion_channel_topic_cb (void *data, const char *completion_item,
+irc_completion_channel_topic_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -417,6 +436,7 @@ irc_completion_channel_topic_cb (void *data, const char *completion_item,
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
@@ -459,7 +479,8 @@ irc_completion_channel_topic_cb (void *data, const char *completion_item,
*/
int
-irc_completion_channels_cb (void *data, const char *completion_item,
+irc_completion_channels_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -471,6 +492,7 @@ irc_completion_channels_cb (void *data, const char *completion_item,
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
@@ -530,7 +552,8 @@ irc_completion_channels_cb (void *data, const char *completion_item,
*/
int
-irc_completion_privates_cb (void *data, const char *completion_item,
+irc_completion_privates_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -538,6 +561,7 @@ irc_completion_privates_cb (void *data, const char *completion_item,
struct t_irc_channel *ptr_channel;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -564,7 +588,8 @@ irc_completion_privates_cb (void *data, const char *completion_item,
*/
int
-irc_completion_msg_kick_cb (void *data, const char *completion_item,
+irc_completion_msg_kick_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -573,6 +598,7 @@ irc_completion_msg_kick_cb (void *data, const char *completion_item,
IRC_BUFFER_GET_SERVER(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
@@ -595,7 +621,8 @@ irc_completion_msg_kick_cb (void *data, const char *completion_item,
*/
int
-irc_completion_msg_part_cb (void *data, const char *completion_item,
+irc_completion_msg_part_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -604,6 +631,7 @@ irc_completion_msg_part_cb (void *data, const char *completion_item,
IRC_BUFFER_GET_SERVER(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
@@ -626,7 +654,8 @@ irc_completion_msg_part_cb (void *data, const char *completion_item,
*/
int
-irc_completion_ignores_numbers_cb (void *data, const char *completion_item,
+irc_completion_ignores_numbers_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -634,6 +663,7 @@ irc_completion_ignores_numbers_cb (void *data, const char *completion_item,
char str_number[32];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -654,7 +684,8 @@ irc_completion_ignores_numbers_cb (void *data, const char *completion_item,
*/
int
-irc_completion_notify_nicks_cb (void *data, const char *completion_item,
+irc_completion_notify_nicks_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -663,6 +694,7 @@ irc_completion_notify_nicks_cb (void *data, const char *completion_item,
IRC_BUFFER_GET_SERVER(buffer);
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
@@ -701,50 +733,50 @@ irc_completion_init ()
{
weechat_hook_completion ("irc_server",
N_("current IRC server"),
- &irc_completion_server_cb, NULL);
+ &irc_completion_server_cb, NULL, NULL);
weechat_hook_completion ("irc_server_nick",
N_("nick on current IRC server"),
- &irc_completion_server_nick_cb, NULL);
+ &irc_completion_server_nick_cb, NULL, NULL);
weechat_hook_completion ("irc_server_channels",
N_("channels on current IRC server"),
- &irc_completion_server_channels_cb, NULL);
+ &irc_completion_server_channels_cb, NULL, NULL);
weechat_hook_completion ("irc_server_privates",
N_("privates on current IRC server"),
- &irc_completion_server_privates_cb, NULL);
+ &irc_completion_server_privates_cb, NULL, NULL);
weechat_hook_completion ("irc_server_nicks",
N_("nicks on all channels of current IRC server"),
- &irc_completion_server_nicks_cb, NULL);
+ &irc_completion_server_nicks_cb, NULL, NULL);
weechat_hook_completion ("irc_servers",
N_("IRC servers (internal names)"),
- &irc_completion_servers_cb, NULL);
+ &irc_completion_servers_cb, NULL, NULL);
weechat_hook_completion ("irc_channel",
N_("current IRC channel"),
- &irc_completion_channel_cb, NULL);
+ &irc_completion_channel_cb, NULL, NULL);
weechat_hook_completion ("nick",
N_("nicks of current IRC channel"),
- &irc_completion_channel_nicks_cb, NULL);
+ &irc_completion_channel_nicks_cb, NULL, NULL);
weechat_hook_completion ("irc_channel_nicks_hosts",
N_("nicks and hostnames of current IRC channel"),
- &irc_completion_channel_nicks_hosts_cb, NULL);
+ &irc_completion_channel_nicks_hosts_cb, NULL, NULL);
weechat_hook_completion ("irc_channel_topic",
N_("topic of current IRC channel"),
- &irc_completion_channel_topic_cb, NULL);
+ &irc_completion_channel_topic_cb, NULL, NULL);
weechat_hook_completion ("irc_channels",
N_("channels on all IRC servers"),
- &irc_completion_channels_cb, NULL);
+ &irc_completion_channels_cb, NULL, NULL);
weechat_hook_completion ("irc_privates",
N_("privates on all IRC servers"),
- &irc_completion_privates_cb, NULL);
+ &irc_completion_privates_cb, NULL, NULL);
weechat_hook_completion ("irc_msg_kick",
N_("default kick message"),
- &irc_completion_msg_kick_cb, NULL);
+ &irc_completion_msg_kick_cb, NULL, NULL);
weechat_hook_completion ("irc_msg_part",
N_("default part message for IRC channel"),
- &irc_completion_msg_part_cb, NULL);
+ &irc_completion_msg_part_cb, NULL, NULL);
weechat_hook_completion ("irc_ignores_numbers",
N_("numbers for defined ignores"),
- &irc_completion_ignores_numbers_cb, NULL);
+ &irc_completion_ignores_numbers_cb, NULL, NULL);
weechat_hook_completion ("irc_notify_nicks",
N_("nicks in notify list"),
- &irc_completion_notify_nicks_cb, NULL);
+ &irc_completion_notify_nicks_cb, NULL, NULL);
}
diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c
index 3c590fedd..5365bfe9e 100644
--- a/src/plugins/irc/irc-config.c
+++ b/src/plugins/irc/irc-config.c
@@ -299,10 +299,11 @@ irc_config_display_channel_modes_arguments (const char *modes)
*/
int
-irc_config_change_nick_colors_cb (void *data, const char *option,
- const char *value)
+irc_config_change_nick_colors_cb (const void *pointer, void *data,
+ const char *option, const char *value)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
(void) value;
@@ -318,10 +319,12 @@ irc_config_change_nick_colors_cb (void *data, const char *option,
*/
void
-irc_config_change_look_color_nicks_in_nicklist (void *data,
+irc_config_change_look_color_nicks_in_nicklist (const void *pointer,
+ void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -333,10 +336,11 @@ irc_config_change_look_color_nicks_in_nicklist (void *data,
*/
void
-irc_config_change_look_display_away (void *data,
+irc_config_change_look_display_away (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -358,13 +362,14 @@ irc_config_change_look_display_away (void *data,
*/
void
-irc_config_change_look_display_join_message (void *data,
+irc_config_change_look_display_join_message (const void *pointer, void *data,
struct t_config_option *option)
{
char **items;
int num_items, i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -374,8 +379,7 @@ irc_config_change_look_display_join_message (void *data,
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
}
else
weechat_hashtable_remove_all (irc_config_hashtable_display_join_message);
@@ -399,13 +403,14 @@ irc_config_change_look_display_join_message (void *data,
*/
void
-irc_config_change_look_server_buffer (void *data,
+irc_config_change_look_server_buffer (const void *pointer, void *data,
struct t_config_option *option)
{
struct t_irc_server *ptr_server;
struct t_gui_buffer *ptr_buffer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -445,7 +450,7 @@ irc_config_change_look_server_buffer (void *data,
*/
void
-irc_config_change_look_pv_buffer (void *data,
+irc_config_change_look_pv_buffer (const void *pointer, void *data,
struct t_config_option *option)
{
struct t_irc_server *ptr_server;
@@ -453,6 +458,7 @@ irc_config_change_look_pv_buffer (void *data,
struct t_gui_buffer *ptr_buffer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -509,10 +515,12 @@ irc_config_change_look_pv_buffer (void *data,
*/
void
-irc_config_change_look_item_channel_modes_hide_args (void *data,
+irc_config_change_look_item_channel_modes_hide_args (const void *pointer,
+ void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -524,13 +532,14 @@ irc_config_change_look_item_channel_modes_hide_args (void *data,
*/
void
-irc_config_change_look_highlight_tags_restrict (void *data,
+irc_config_change_look_highlight_tags_restrict (const void *pointer, void *data,
struct t_config_option *option)
{
struct t_irc_server *ptr_server;
struct t_irc_channel *ptr_channel;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -561,13 +570,14 @@ irc_config_change_look_highlight_tags_restrict (void *data,
*/
void
-irc_config_change_look_nick_color_force (void *data,
+irc_config_change_look_nick_color_force (const void *pointer, void *data,
struct t_config_option *option)
{
char **items, *pos;
int num_items, i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -577,8 +587,7 @@ irc_config_change_look_nick_color_force (void *data,
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
}
else
weechat_hashtable_remove_all (irc_config_hashtable_nick_color_force);
@@ -610,10 +619,11 @@ irc_config_change_look_nick_color_force (void *data,
*/
void
-irc_config_change_look_nick_colors (void *data,
+irc_config_change_look_nick_colors (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -625,10 +635,11 @@ irc_config_change_look_nick_colors (void *data,
*/
void
-irc_config_change_look_item_display_server (void *data,
+irc_config_change_look_item_display_server (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -642,12 +653,13 @@ irc_config_change_look_item_display_server (void *data,
*/
void
-irc_config_change_look_nicks_hide_password (void *data,
+irc_config_change_look_nicks_hide_password (const void *pointer, void *data,
struct t_config_option *option)
{
const char *nicks_hide_password;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -672,13 +684,14 @@ irc_config_change_look_nicks_hide_password (void *data,
*/
void
-irc_config_change_look_topic_strip_colors (void *data,
+irc_config_change_look_topic_strip_colors (const void *pointer, void *data,
struct t_config_option *option)
{
struct t_irc_server *ptr_server;
struct t_irc_channel *ptr_channel;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -699,10 +712,11 @@ irc_config_change_look_topic_strip_colors (void *data,
*/
void
-irc_config_change_bar_item_input_prompt (void *data,
+irc_config_change_bar_item_input_prompt (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -714,10 +728,11 @@ irc_config_change_bar_item_input_prompt (void *data,
*/
void
-irc_config_change_color_item_channel_modes (void *data,
+irc_config_change_color_item_channel_modes (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -730,10 +745,11 @@ irc_config_change_color_item_channel_modes (void *data,
*/
void
-irc_config_change_color_item_lag (void *data,
+irc_config_change_color_item_lag (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -745,10 +761,11 @@ irc_config_change_color_item_lag (void *data,
*/
void
-irc_config_change_color_item_nick_modes (void *data,
+irc_config_change_color_item_nick_modes (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -761,12 +778,14 @@ irc_config_change_color_item_nick_modes (void *data,
*/
void
-irc_config_change_color_mirc_remap (void *data, struct t_config_option *option)
+irc_config_change_color_mirc_remap (const void *pointer, void *data,
+ struct t_config_option *option)
{
char **items, *pos;
int num_items, i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -776,8 +795,7 @@ irc_config_change_color_mirc_remap (void *data, struct t_config_option *option)
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
}
else
weechat_hashtable_remove_all (irc_config_hashtable_color_mirc_remap);
@@ -807,13 +825,14 @@ irc_config_change_color_mirc_remap (void *data, struct t_config_option *option)
*/
void
-irc_config_change_color_nick_prefixes (void *data,
+irc_config_change_color_nick_prefixes (const void *pointer, void *data,
struct t_config_option *option)
{
char **items, *pos;
int num_items, i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -823,8 +842,7 @@ irc_config_change_color_nick_prefixes (void *data,
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
}
else
weechat_hashtable_remove_all (irc_config_hashtable_nick_prefixes);
@@ -858,13 +876,14 @@ irc_config_change_color_nick_prefixes (void *data,
*/
void
-irc_config_change_network_lag_check (void *data,
+irc_config_change_network_lag_check (const void *pointer, void *data,
struct t_config_option *option)
{
time_t time_next_check;
struct t_irc_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -884,10 +903,11 @@ irc_config_change_network_lag_check (void *data,
*/
void
-irc_config_change_network_lag_min_show (void *data,
+irc_config_change_network_lag_min_show (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -899,10 +919,11 @@ irc_config_change_network_lag_min_show (void *data,
*/
void
-irc_config_change_network_notify_check_ison (void *data,
+irc_config_change_network_notify_check_ison (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -914,10 +935,11 @@ irc_config_change_network_notify_check_ison (void *data,
*/
void
-irc_config_change_network_notify_check_whois (void *data,
- struct t_config_option *option)
+irc_config_change_network_notify_check_whois (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -929,7 +951,8 @@ irc_config_change_network_notify_check_whois (void *data,
*/
void
-irc_config_change_network_send_unknown_commands (void *data,
+irc_config_change_network_send_unknown_commands (const void *pointer,
+ void *data,
struct t_config_option *option)
{
char value[2];
@@ -937,6 +960,7 @@ irc_config_change_network_send_unknown_commands (void *data,
struct t_irc_channel *ptr_channel;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -974,12 +998,16 @@ irc_config_change_network_send_unknown_commands (void *data,
*/
void
-irc_config_server_default_change_cb (void *data, struct t_config_option *option)
+irc_config_server_default_change_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
int index_option;
struct t_irc_server *ptr_server;
- index_option = irc_server_search_option (data);
+ /* make C compiler happy */
+ (void) data;
+
+ index_option = irc_server_search_option (pointer);
if (index_option >= 0)
{
for (ptr_server = irc_servers; ptr_server;
@@ -1054,7 +1082,7 @@ irc_config_check_gnutls_priorities (const char *priorities)
*/
int
-irc_config_server_check_value_cb (void *data,
+irc_config_server_check_value_cb (const void *pointer, void *data,
struct t_config_option *option,
const char *value)
{
@@ -1067,9 +1095,10 @@ irc_config_server_check_value_cb (void *data,
#endif /* HAVE_GNUTLS */
/* make C compiler happy */
+ (void) data;
(void) option;
- index_option = irc_server_search_option (data);
+ index_option = irc_server_search_option (pointer);
if (index_option >= 0)
{
switch (index_option)
@@ -1185,13 +1214,17 @@ irc_config_server_check_value_cb (void *data,
*/
void
-irc_config_server_change_cb (void *data, struct t_config_option *option)
+irc_config_server_change_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
int index_option;
char *name;
struct t_irc_server *ptr_server;
- index_option = irc_server_search_option (data);
+ /* make C compiler happy */
+ (void) data;
+
+ index_option = irc_server_search_option (pointer);
if (index_option >= 0)
{
name = weechat_config_option_get_pointer (option, "name");
@@ -1240,11 +1273,12 @@ irc_config_server_change_cb (void *data, struct t_config_option *option)
*/
int
-irc_config_server_default_check_notify (void *data,
+irc_config_server_default_check_notify (const void *pointer, void *data,
struct t_config_option *option,
const char *value)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -1259,12 +1293,14 @@ irc_config_server_default_check_notify (void *data,
*/
int
-irc_config_reload (void *data, struct t_config_file *config_file)
+irc_config_reload (const void *pointer, void *data,
+ struct t_config_file *config_file)
{
int rc;
struct t_irc_server *ptr_server, *next_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
for (ptr_server = irc_servers; ptr_server;
@@ -1318,7 +1354,7 @@ irc_config_reload (void *data, struct t_config_file *config_file)
*/
int
-irc_config_msgbuffer_create_option (void *data,
+irc_config_msgbuffer_create_option (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
@@ -1327,6 +1363,7 @@ irc_config_msgbuffer_create_option (void *data,
int rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
rc = WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -1355,7 +1392,7 @@ irc_config_msgbuffer_create_option (void *data,
_("buffer used to display message received from IRC "
"server"),
"weechat|server|current|private", 0, 0, value, value, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
rc = (ptr_option) ?
WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE :
WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -1381,7 +1418,8 @@ irc_config_msgbuffer_create_option (void *data,
*/
int
-irc_config_ctcp_create_option (void *data, struct t_config_file *config_file,
+irc_config_ctcp_create_option (const void *pointer, void *data,
+ struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
@@ -1392,6 +1430,7 @@ irc_config_ctcp_create_option (void *data, struct t_config_file *config_file,
const char *pos_name;
/* make C compiler happy */
+ (void) pointer;
(void) data;
rc = WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -1435,7 +1474,7 @@ irc_config_ctcp_create_option (void *data, struct t_config_file *config_file,
"$username (username on server), "
"$realname (realname on server)"),
NULL, 0, 0, default_value, value, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
rc = (ptr_option) ?
WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE :
WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -1465,7 +1504,7 @@ irc_config_ctcp_create_option (void *data, struct t_config_file *config_file,
*/
int
-irc_config_ignore_read_cb (void *data,
+irc_config_ignore_read_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
@@ -1474,6 +1513,7 @@ irc_config_ignore_read_cb (void *data,
int argc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -1503,12 +1543,14 @@ irc_config_ignore_read_cb (void *data,
*/
int
-irc_config_ignore_write_cb (void *data, struct t_config_file *config_file,
+irc_config_ignore_write_cb (const void *pointer, void *data,
+ struct t_config_file *config_file,
const char *section_name)
{
struct t_irc_ignore *ptr_ignore;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!weechat_config_write_line (config_file, section_name, NULL))
@@ -1543,12 +1585,16 @@ irc_config_server_new_option (struct t_config_file *config_file,
const char *default_value,
const char *value,
int null_value_allowed,
- int (*callback_check_value)(void *data,
+ int (*callback_check_value)(const void *pointer,
+ void *data,
struct t_config_option *option,
const char *value),
+ const void *callback_check_value_pointer,
void *callback_check_value_data,
- void (*callback_change)(void *data,
+ void (*callback_change)(const void *pointer,
+ void *data,
struct t_config_option *option),
+ const void *callback_change_pointer,
void *callback_change_data)
{
struct t_config_option *new_option;
@@ -1567,9 +1613,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_PROXY:
new_option = weechat_config_new_option (
@@ -1580,9 +1630,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_IPV6:
new_option = weechat_config_new_option (
@@ -1593,9 +1647,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_SSL:
new_option = weechat_config_new_option (
@@ -1605,9 +1663,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_SSL_CERT:
new_option = weechat_config_new_option (
@@ -1619,9 +1681,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_SSL_PRIORITIES:
new_option = weechat_config_new_option (
@@ -1634,9 +1700,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_SSL_DHKEY_SIZE:
new_option = weechat_config_new_option (
@@ -1647,9 +1717,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, INT_MAX,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_SSL_FINGERPRINT:
new_option = weechat_config_new_option (
@@ -1665,9 +1739,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_SSL_VERIFY:
new_option = weechat_config_new_option (
@@ -1677,9 +1755,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_PASSWORD:
new_option = weechat_config_new_option (
@@ -1690,9 +1772,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_CAPABILITIES:
new_option = weechat_config_new_option (
@@ -1706,9 +1792,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_SASL_MECHANISM:
new_option = weechat_config_new_option (
@@ -1728,9 +1818,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_SASL_USERNAME:
new_option = weechat_config_new_option (
@@ -1742,9 +1836,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_SASL_PASSWORD:
new_option = weechat_config_new_option (
@@ -1757,9 +1855,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_SASL_KEY:
new_option = weechat_config_new_option (
@@ -1772,9 +1874,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_SASL_TIMEOUT:
new_option = weechat_config_new_option (
@@ -1785,9 +1891,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 1, 3600,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_SASL_FAIL:
new_option = weechat_config_new_option (
@@ -1801,9 +1911,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
"continue|reconnect|disconnect", 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_AUTOCONNECT:
new_option = weechat_config_new_option (
@@ -1813,9 +1927,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_AUTORECONNECT:
new_option = weechat_config_new_option (
@@ -1825,9 +1943,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_AUTORECONNECT_DELAY:
new_option = weechat_config_new_option (
@@ -1838,9 +1960,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 1, 65535,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_NICKS:
new_option = weechat_config_new_option (
@@ -1851,9 +1977,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_NICKS_ALTERNATE:
new_option = weechat_config_new_option (
@@ -1867,9 +1997,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_USERNAME:
new_option = weechat_config_new_option (
@@ -1880,9 +2014,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_REALNAME:
new_option = weechat_config_new_option (
@@ -1893,9 +2031,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_LOCAL_HOSTNAME:
new_option = weechat_config_new_option (
@@ -1906,9 +2048,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_COMMAND:
new_option = weechat_config_new_option (
@@ -1922,9 +2068,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_COMMAND_DELAY:
new_option = weechat_config_new_option (
@@ -1936,9 +2086,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 3600,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_AUTOJOIN:
new_option = weechat_config_new_option (
@@ -1955,9 +2109,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_AUTOREJOIN:
new_option = weechat_config_new_option (
@@ -1970,9 +2128,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_AUTOREJOIN_DELAY:
new_option = weechat_config_new_option (
@@ -1982,9 +2144,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 3600*24,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_CONNECTION_TIMEOUT:
new_option = weechat_config_new_option (
@@ -1997,9 +2163,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 1, 3600,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_ANTI_FLOOD_PRIO_HIGH:
new_option = weechat_config_new_option (
@@ -2011,9 +2181,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 60,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_ANTI_FLOOD_PRIO_LOW:
new_option = weechat_config_new_option (
@@ -2025,9 +2199,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 60,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_AWAY_CHECK:
new_option = weechat_config_new_option (
@@ -2038,9 +2216,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 60 * 24 * 7,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_AWAY_CHECK_MAX_NICKS:
new_option = weechat_config_new_option (
@@ -2051,9 +2233,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 1000000,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_DEFAULT_MSG_KICK:
new_option = weechat_config_new_option (
@@ -2065,9 +2251,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_DEFAULT_MSG_PART:
new_option = weechat_config_new_option (
@@ -2078,9 +2268,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_DEFAULT_MSG_QUIT:
new_option = weechat_config_new_option (
@@ -2091,9 +2285,13 @@ irc_config_server_new_option (struct t_config_file *config_file,
NULL, 0, 0,
default_value, value,
null_value_allowed,
- callback_check_value, callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_check_value,
+ callback_check_value_pointer,
+ callback_check_value_data,
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_OPTION_NOTIFY:
new_option = weechat_config_new_option (
@@ -2106,9 +2304,12 @@ irc_config_server_new_option (struct t_config_file *config_file,
null_value_allowed,
(section == irc_config_section_server_default) ?
&irc_config_server_default_check_notify : callback_check_value,
+ callback_check_value_pointer,
callback_check_value_data,
- callback_change, callback_change_data,
- NULL, NULL);
+ callback_change,
+ callback_change_pointer,
+ callback_change_data,
+ NULL, NULL, NULL);
break;
case IRC_SERVER_NUM_OPTIONS:
break;
@@ -2122,7 +2323,8 @@ irc_config_server_new_option (struct t_config_file *config_file,
*/
int
-irc_config_server_read_cb (void *data, struct t_config_file *config_file,
+irc_config_server_read_cb (const void *pointer, void *data,
+ struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
@@ -2131,6 +2333,7 @@ irc_config_server_read_cb (void *data, struct t_config_file *config_file,
char *pos_option, *server_name;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -2198,13 +2401,15 @@ irc_config_server_read_cb (void *data, struct t_config_file *config_file,
*/
int
-irc_config_server_write_cb (void *data, struct t_config_file *config_file,
+irc_config_server_write_cb (const void *pointer, void *data,
+ struct t_config_file *config_file,
const char *section_name)
{
struct t_irc_server *ptr_server;
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!weechat_config_write_line (config_file, section_name, NULL))
@@ -2293,8 +2498,10 @@ irc_config_server_create_default_options (struct t_config_section *section)
0,
&irc_config_server_check_value_cb,
irc_server_options[i][0],
+ NULL,
&irc_config_server_default_change_cb,
- irc_server_options[i][0]);
+ irc_server_options[i][0],
+ NULL);
}
if (nicks)
@@ -2322,38 +2529,36 @@ irc_config_init ()
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
irc_config_hashtable_nick_color_force = weechat_hashtable_new (
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
irc_config_hashtable_nick_prefixes = weechat_hashtable_new (
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
irc_config_hashtable_color_mirc_remap = weechat_hashtable_new (
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
irc_config_file = weechat_config_new (IRC_CONFIG_NAME,
- &irc_config_reload, NULL);
+ &irc_config_reload, NULL, NULL);
if (!irc_config_file)
return 0;
/* look */
ptr_section = weechat_config_new_section (irc_config_file, "look",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (irc_config_file);
@@ -2367,104 +2572,108 @@ irc_config_init ()
"when it is auto joined (with server option \"autojoin\"); "
"this is useful to open channels with always the same buffer "
"numbers on startup"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_buffer_open_before_join = weechat_config_new_option (
irc_config_file, ptr_section,
"buffer_open_before_join", "boolean",
N_("open channel buffer before the JOIN is received from server "
"when it is manually joined (with /join command)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_buffer_switch_autojoin = weechat_config_new_option (
irc_config_file, ptr_section,
"buffer_switch_autojoin", "boolean",
N_("auto switch to channel buffer when it is auto joined (with "
"server option \"autojoin\")"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_buffer_switch_join = weechat_config_new_option (
irc_config_file, ptr_section,
"buffer_switch_join", "boolean",
N_("auto switch to channel buffer when it is manually joined "
"(with /join command)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_color_nicks_in_names = weechat_config_new_option (
irc_config_file, ptr_section,
"color_nicks_in_names", "boolean",
N_("use nick color in output of /names (or list of nicks displayed "
"when joining a channel)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_color_nicks_in_nicklist = weechat_config_new_option (
irc_config_file, ptr_section,
"color_nicks_in_nicklist", "boolean",
N_("use nick color in nicklist"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL,
- &irc_config_change_look_color_nicks_in_nicklist, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_look_color_nicks_in_nicklist, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_color_nicks_in_server_messages = weechat_config_new_option (
irc_config_file, ptr_section,
"color_nicks_in_server_messages", "boolean",
N_("use nick color in messages from server"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_color_pv_nick_like_channel = weechat_config_new_option (
irc_config_file, ptr_section,
"color_pv_nick_like_channel", "boolean",
N_("use same nick color for channel and private"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_ctcp_time_format = weechat_config_new_option (
irc_config_file, ptr_section,
"ctcp_time_format", "string",
N_("time format used in answer to message CTCP TIME (see man strftime "
"for date/time specifiers)"),
- NULL, 0, 0, "%a, %d %b %Y %T %z", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "%a, %d %b %Y %T %z", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_display_away = weechat_config_new_option (
irc_config_file, ptr_section,
"display_away", "integer",
N_("display message when (un)marking as away (off: do not display/send "
"anything, local: display locally, channel: send action to channels)"),
- "off|local|channel", 0, 0, "local", NULL, 0, NULL, NULL,
- &irc_config_change_look_display_away, NULL,
- NULL, NULL);
+ "off|local|channel", 0, 0, "local", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_look_display_away, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_display_ctcp_blocked = weechat_config_new_option (
irc_config_file, ptr_section,
"display_ctcp_blocked", "boolean",
N_("display CTCP message even if it is blocked"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_display_ctcp_reply = weechat_config_new_option (
irc_config_file, ptr_section,
"display_ctcp_reply", "boolean",
N_("display CTCP reply sent by WeeChat"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_display_ctcp_unknown = weechat_config_new_option (
irc_config_file, ptr_section,
"display_ctcp_unknown", "boolean",
N_("display CTCP message even if it is unknown CTCP"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_display_host_join = weechat_config_new_option (
irc_config_file, ptr_section,
"display_host_join", "boolean",
N_("display host in join messages"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_display_host_join_local = weechat_config_new_option (
irc_config_file, ptr_section,
"display_host_join_local", "boolean",
N_("display host in join messages from local client"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_display_host_quit = weechat_config_new_option (
irc_config_file, ptr_section,
"display_host_quit", "boolean",
N_("display host in part/quit messages"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_display_join_message = weechat_config_new_option (
irc_config_file, ptr_section,
"display_join_message", "string",
@@ -2472,25 +2681,29 @@ irc_config_init ()
"channel: 324 = channel modes, 329 = channel creation date, "
"332 = topic, 333 = nick/date for topic, 353 = names on channel, "
"366 = names count"),
- NULL, 0, 0, "329,332,333,366", NULL, 0, NULL, NULL,
- &irc_config_change_look_display_join_message, NULL, NULL, NULL);
+ NULL, 0, 0, "329,332,333,366", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_look_display_join_message, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_display_old_topic = weechat_config_new_option (
irc_config_file, ptr_section,
"display_old_topic", "boolean",
N_("display old topic when channel topic is changed"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_display_pv_away_once = weechat_config_new_option (
irc_config_file, ptr_section,
"display_pv_away_once", "boolean",
N_("display remote away message only once in private"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_display_pv_back = weechat_config_new_option (
irc_config_file, ptr_section,
"display_pv_back", "boolean",
N_("display a message in private when user is back (after quit on "
"server)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_highlight_channel = weechat_config_new_option (
irc_config_file, ptr_section,
"highlight_channel", "string",
@@ -2501,7 +2714,8 @@ irc_config_init ()
"buffer property \"highlight_words\" only when buffer is created "
"(it does not affect current buffers), an empty string disables "
"default highlight on nick, examples: \"$nick\", \"(?-i)$nick\""),
- NULL, 0, 0, "$nick", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "$nick", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_highlight_pv = weechat_config_new_option (
irc_config_file, ptr_section,
"highlight_pv", "string",
@@ -2512,7 +2726,8 @@ irc_config_init ()
"buffer property \"highlight_words\" only when buffer is created "
"(it does not affect current buffers), an empty string disables "
"default highlight on nick, examples: \"$nick\", \"(?-i)$nick\""),
- NULL, 0, 0, "$nick", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "$nick", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_highlight_server = weechat_config_new_option (
irc_config_file, ptr_section,
"highlight_server", "string",
@@ -2523,7 +2738,8 @@ irc_config_init ()
"buffer property \"highlight_words\" only when buffer is created "
"(it does not affect current buffers), an empty string disables "
"default highlight on nick, examples: \"$nick\", \"(?-i)$nick\""),
- NULL, 0, 0, "$nick", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "$nick", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_highlight_tags_restrict = weechat_config_new_option (
irc_config_file, ptr_section,
"highlight_tags_restrict", "string",
@@ -2532,8 +2748,10 @@ irc_config_init ()
"must be separated by a comma and \"+\" can be used to make a "
"logical \"and\" between tags; wildcard \"*\" is allowed in tags; "
"an empty value allows highlight on any tag"),
- NULL, 0, 0, "irc_privmsg,irc_notice", NULL, 0, NULL, NULL,
- &irc_config_change_look_highlight_tags_restrict, NULL, NULL, NULL);
+ NULL, 0, 0, "irc_privmsg,irc_notice", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_look_highlight_tags_restrict, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_item_channel_modes_hide_args = weechat_config_new_option (
irc_config_file, ptr_section,
"item_channel_modes_hide_args", "string",
@@ -2541,26 +2759,34 @@ irc_config_init ()
"channel modes (\"*\" to always hide all arguments, empty value to "
"never hide arguments); example: \"kf\" to hide arguments if \"k\" "
"or \"f\" are in channel modes"),
- NULL, 0, 0, "k", NULL, 0, NULL, NULL,
- &irc_config_change_look_item_channel_modes_hide_args, NULL, NULL, NULL);
+ NULL, 0, 0, "k", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_look_item_channel_modes_hide_args, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_item_display_server = weechat_config_new_option (
irc_config_file, ptr_section,
"item_display_server", "integer",
N_("name of bar item where IRC server is displayed (for status bar)"),
- "buffer_plugin|buffer_name", 0, 0, "buffer_plugin", NULL, 0, NULL, NULL,
- &irc_config_change_look_item_display_server, NULL, NULL, NULL);
+ "buffer_plugin|buffer_name", 0, 0, "buffer_plugin", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_look_item_display_server, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_item_nick_modes = weechat_config_new_option (
irc_config_file, ptr_section,
"item_nick_modes", "boolean",
N_("display nick modes in bar item \"input_prompt\""),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- &irc_config_change_bar_item_input_prompt, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_bar_item_input_prompt, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_item_nick_prefix = weechat_config_new_option (
irc_config_file, ptr_section,
"item_nick_prefix", "boolean",
N_("display nick prefix in bar item \"input_prompt\""),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- &irc_config_change_bar_item_input_prompt, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_bar_item_input_prompt, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_join_auto_add_chantype = weechat_config_new_option (
irc_config_file, ptr_section,
"join_auto_add_chantype", "boolean",
@@ -2568,15 +2794,15 @@ irc_config_init ()
"command /join if the channel name does not start with a valid "
"channel type for the server; for example: \"/join weechat\" will "
"in fact send: \"/join #weechat\""),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_msgbuffer_fallback = weechat_config_new_option (
irc_config_file, ptr_section,
"msgbuffer_fallback", "integer",
N_("default target buffer for msgbuffer options when target is "
"private and that private buffer is not found"),
- "current|server", 0, 0, "current", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ "current|server", 0, 0, "current", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_new_channel_position = weechat_config_new_option (
irc_config_file, ptr_section,
"new_channel_position", "integer",
@@ -2584,8 +2810,8 @@ irc_config_init ()
"(none = default position (should be last buffer), "
"next = current buffer + 1, near_server = after last channel/pv "
"of server)"),
- "none|next|near_server", 0, 0, "none",
- NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ "none|next|near_server", 0, 0, "none", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_new_pv_position = weechat_config_new_option (
irc_config_file, ptr_section,
"new_pv_position", "integer",
@@ -2593,8 +2819,8 @@ irc_config_init ()
"(none = default position (should be last buffer), "
"next = current buffer + 1, near_server = after last channel/pv "
"of server)"),
- "none|next|near_server", 0, 0, "none",
- NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ "none|next|near_server", 0, 0, "none", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_nick_color_force = weechat_config_new_option (
irc_config_file, ptr_section,
"nick_color_force", "string",
@@ -2603,16 +2829,20 @@ irc_config_init ()
"\"nick1:color1;nick2:color2\"); look up for nicks is with "
"exact case then lower case, so it's possible to use only lower "
"case for nicks in this option"),
- NULL, 0, 0, "", NULL, 0, NULL, NULL,
- &irc_config_change_look_nick_color_force, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_look_nick_color_force, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_nick_color_hash = weechat_config_new_option (
irc_config_file, ptr_section,
"nick_color_hash", "integer",
N_("hash algorithm used to find the color for a nick: djb2 = variant "
"of djb2 (position of letters matters: anagrams of a nick have "
"different color), sum = sum of letters"),
- "djb2|sum", 0, 0, "sum", NULL, 0, NULL, NULL,
- &irc_config_change_look_nick_colors, NULL, NULL, NULL);
+ "djb2|sum", 0, 0, "sum", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_look_nick_colors, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_nick_color_stop_chars = weechat_config_new_option (
irc_config_file, ptr_section,
"nick_color_stop_chars", "string",
@@ -2620,31 +2850,35 @@ irc_config_init ()
"nick (at least one char outside this list must be in string before "
"stopping) (example: nick \"|nick|away\" with \"|\" in chars will "
"return color of nick \"|nick\")"),
- NULL, 0, 0, "_|[", NULL, 0, NULL, NULL,
- &irc_config_change_look_nick_colors, NULL, NULL, NULL);
+ NULL, 0, 0, "_|[", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_look_nick_colors, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_nick_completion_smart = weechat_config_new_option (
irc_config_file, ptr_section,
"nick_completion_smart", "integer",
N_("smart completion for nicks (completes first with last speakers): "
"speakers = all speakers (including highlights), "
"speakers_highlights = only speakers with highlight"),
- "off|speakers|speakers_highlights", 0, 0, "speakers", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ "off|speakers|speakers_highlights", 0, 0, "speakers", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_nick_mode = weechat_config_new_option (
irc_config_file, ptr_section,
"nick_mode", "integer",
N_("display nick mode (op, voice, ...) before nick (none = never, "
"prefix = in prefix only (default), action = in action messages "
"only, both = prefix + action messages)"),
- "none|prefix|action|both", 0, 0, "prefix",
- NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ "none|prefix|action|both", 0, 0, "prefix", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_nick_mode_empty = weechat_config_new_option (
irc_config_file, ptr_section,
"nick_mode_empty", "boolean",
N_("display a space if nick mode is enabled but nick has no mode (not "
"op, voice, ...)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL,
- &irc_config_change_bar_item_input_prompt, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_bar_item_input_prompt, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_nicks_hide_password = weechat_config_new_option (
irc_config_file, ptr_section,
"nicks_hide_password", "string",
@@ -2652,14 +2886,17 @@ irc_config_init ()
"when a message is sent, for example to hide password in message "
"displayed by \"/msg nickserv identify password\", example: "
"\"nickserv,nickbot\""),
- NULL, 0, 0, "nickserv", NULL, 0, NULL, NULL,
- &irc_config_change_look_nicks_hide_password, NULL, NULL, NULL);
+ NULL, 0, 0, "nickserv", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_look_nicks_hide_password, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_notice_as_pv = weechat_config_new_option (
irc_config_file, ptr_section,
"notice_as_pv", "integer",
N_("display notices as private messages (if auto, use private buffer "
"if found)"),
- "auto|never|always", 0, 0, "auto", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ "auto|never|always", 0, 0, "auto", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_notice_welcome_redirect = weechat_config_new_option (
irc_config_file, ptr_section,
"notice_welcome_redirect", "boolean",
@@ -2667,14 +2904,15 @@ irc_config_init ()
"buffer; such notices have the nick as target but a channel name in "
"beginning of notice message, for example notices sent by freenode "
"server which look like: \"[#channel] Welcome to this channel...\""),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_notice_welcome_tags = weechat_config_new_option (
irc_config_file, ptr_section,
"notice_welcome_tags", "string",
N_("comma separated list of tags used in a welcome notices redirected "
"to a channel, for example: \"notify_private\""),
- NULL, 0, 0, "", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_notify_tags_ison = weechat_config_new_option (
irc_config_file, ptr_section,
"notify_tags_ison", "string",
@@ -2682,8 +2920,8 @@ irc_config_init ()
"when a nick joins or quits server (result of command ison or "
"monitor), for example: \"notify_message\", \"notify_private\" or "
"\"notify_highlight\""),
- NULL, 0, 0, "notify_message", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "notify_message", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_notify_tags_whois = weechat_config_new_option (
irc_config_file, ptr_section,
"notify_tags_whois", "string",
@@ -2691,60 +2929,68 @@ irc_config_init ()
"when a nick away status changes (result of command whois), "
"for example: \"notify_message\", \"notify_private\" or "
"\"notify_highlight\""),
- NULL, 0, 0, "notify_message", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "notify_message", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_part_closes_buffer = weechat_config_new_option (
irc_config_file, ptr_section,
"part_closes_buffer", "boolean",
N_("close buffer when /part is issued on a channel"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_pv_buffer = weechat_config_new_option (
irc_config_file, ptr_section,
"pv_buffer", "integer",
N_("merge private buffers"),
- "independent|merge_by_server|merge_all", 0, 0, "independent",
- NULL, 0, NULL, NULL,
- &irc_config_change_look_pv_buffer, NULL, NULL, NULL);
+ "independent|merge_by_server|merge_all", 0, 0, "independent", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_look_pv_buffer, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_pv_tags = weechat_config_new_option (
irc_config_file, ptr_section,
"pv_tags", "string",
N_("comma separated list of tags used in private messages, for example: "
"\"notify_message\", \"notify_private\" or \"notify_highlight\""),
- NULL, 0, 0, "notify_private", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "notify_private", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_raw_messages = weechat_config_new_option (
irc_config_file, ptr_section,
"raw_messages", "integer",
N_("number of raw messages to save in memory when raw data buffer is "
"closed (messages will be displayed when opening raw data buffer)"),
- NULL, 0, 65535, "256", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 65535, "256", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_server_buffer = weechat_config_new_option (
irc_config_file, ptr_section,
"server_buffer", "integer",
N_("merge server buffers"),
"merge_with_core|merge_without_core|independent", 0, 0, "merge_with_core",
- NULL, 0, NULL, NULL,
- &irc_config_change_look_server_buffer, NULL, NULL, NULL);
+ NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_look_server_buffer, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_look_smart_filter = weechat_config_new_option (
irc_config_file, ptr_section,
"smart_filter", "boolean",
N_("filter join/part/quit/nick messages for a nick if not speaking "
"for some minutes on channel (you must create a filter on tag "
"\"irc_smart_filter\")"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_smart_filter_delay = weechat_config_new_option (
irc_config_file, ptr_section,
"smart_filter_delay", "integer",
N_("delay for filtering join/part/quit messages (in minutes): if the "
"nick did not speak during the last N minutes, the join/part/quit is "
"filtered"),
- NULL, 1, 60*24*7, "5", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 1, 60*24*7, "5", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_smart_filter_join = weechat_config_new_option (
irc_config_file, ptr_section,
"smart_filter_join", "boolean",
/* TRANSLATORS: please do not translate "join" */
N_("enable smart filter for \"join\" messages"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_smart_filter_join_unmask = weechat_config_new_option (
irc_config_file, ptr_section,
"smart_filter_join_unmask", "integer",
@@ -2753,7 +2999,8 @@ irc_config_init ()
"minutes ago and then says something on channel (message, notice or "
"update on topic), the join is unmasked, as well as nick changes "
"after this join (0 = disable: never unmask a join)"),
- NULL, 0, 60*24*7, "30", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 60*24*7, "30", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_smart_filter_mode = weechat_config_new_option (
irc_config_file, ptr_section,
"smart_filter_mode", "string",
@@ -2763,38 +3010,46 @@ irc_config_init ()
"\"ovh\"), \"xyz\" to filter only modes x/y/z, \"-xyz\" to filter "
"all modes but not x/y/z; examples: \"ovh\": filter modes o/v/h, "
"\"-bkl\": filter all modes but not b/k/l"),
- NULL, 0, 0, "+", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "+", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_smart_filter_nick = weechat_config_new_option (
irc_config_file, ptr_section,
"smart_filter_nick", "boolean",
/* TRANSLATORS: please do not translate "nick" */
N_("enable smart filter for \"nick\" messages (nick changes)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_smart_filter_quit = weechat_config_new_option (
irc_config_file, ptr_section,
"smart_filter_quit", "boolean",
/* TRANSLATORS: please do not translate "part" and "quit" */
N_("enable smart filter for \"part\" and \"quit\" messages"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_temporary_servers = weechat_config_new_option (
irc_config_file, ptr_section,
"temporary_servers", "boolean",
N_("enable automatic addition of temporary servers with command "
"/connect"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_topic_strip_colors = weechat_config_new_option (
irc_config_file, ptr_section,
"topic_strip_colors", "boolean",
N_("strip colors in topic (used only when displaying buffer title)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL,
- &irc_config_change_look_topic_strip_colors, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_look_topic_strip_colors, NULL, NULL,
+ NULL, NULL, NULL);
/* color */
ptr_section = weechat_config_new_section (irc_config_file, "color",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (irc_config_file);
@@ -2805,45 +3060,55 @@ irc_config_init ()
irc_config_file, ptr_section,
"input_nick", "color",
N_("color for nick in input bar"),
- NULL, -1, 0, "lightcyan", NULL, 0, NULL, NULL,
- &irc_config_change_bar_item_input_prompt, NULL, NULL, NULL);
+ NULL, -1, 0, "lightcyan", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_bar_item_input_prompt, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_color_item_channel_modes = weechat_config_new_option (
irc_config_file, ptr_section,
"item_channel_modes", "color",
N_("color for channel modes, near channel name"),
- NULL, -1, 0, "default", NULL, 0, NULL, NULL,
- &irc_config_change_color_item_channel_modes, NULL, NULL, NULL);
+ NULL, -1, 0, "default", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_color_item_channel_modes, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_color_item_lag_counting = weechat_config_new_option (
irc_config_file, ptr_section,
"item_lag_counting", "color",
N_("color for lag indicator, when counting (pong not received from "
"server, lag is increasing)"),
- NULL, -1, 0, "default", NULL, 0, NULL, NULL,
- &irc_config_change_color_item_lag, NULL, NULL, NULL);
+ NULL, -1, 0, "default", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_color_item_lag, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_color_item_lag_finished = weechat_config_new_option (
irc_config_file, ptr_section,
"item_lag_finished", "color",
N_("color for lag indicator, when pong has been received from server"),
- NULL, -1, 0, "yellow", NULL, 0, NULL, NULL,
- &irc_config_change_color_item_lag, NULL, NULL, NULL);
+ NULL, -1, 0, "yellow", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_color_item_lag, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_color_item_nick_modes = weechat_config_new_option (
irc_config_file, ptr_section,
"item_nick_modes", "color",
N_("color for nick modes in bar item \"input_prompt\""),
- NULL, -1, 0, "default", NULL, 0, NULL, NULL,
- &irc_config_change_color_item_nick_modes, NULL, NULL, NULL);
+ NULL, -1, 0, "default", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_color_item_nick_modes, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_color_message_join = weechat_config_new_option (
irc_config_file, ptr_section,
"message_join", "color",
N_("color for text in join messages"),
- NULL, -1, 0, "green", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, -1, 0, "green", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_color_message_quit = weechat_config_new_option (
irc_config_file, ptr_section,
"message_quit", "color",
N_("color for text in part/quit messages"),
- NULL, -1, 0, "red", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, -1, 0, "red", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_color_mirc_remap = weechat_config_new_option (
irc_config_file, ptr_section,
"mirc_remap", "string",
@@ -2857,8 +3122,10 @@ irc_config_init ()
"4=lightred, 5=red, 6=magenta, 7=brown, 8=yellow, 9=lightgreen, "
"10=cyan, 11=lightcyan, 12=lightblue, 13=lightmagenta, 14=gray, "
"15=white"),
- NULL, 0, 0, "1,-1:darkgray", NULL, 0, NULL, NULL,
- &irc_config_change_color_mirc_remap, NULL, NULL, NULL);
+ NULL, 0, 0, "1,-1:darkgray", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_color_mirc_remap, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_color_nick_prefixes = weechat_config_new_option (
irc_config_file, ptr_section,
"nick_prefixes", "string",
@@ -2868,46 +3135,50 @@ irc_config_init ()
"(\"PREFIX\"); a special mode \"*\" can be used as default color "
"if no mode has been found in list)"),
NULL, 0, 0, "y:lightred;q:lightred;a:lightcyan;o:lightgreen;"
- "h:lightmagenta;v:yellow;*:lightblue", NULL, 0, NULL, NULL,
- &irc_config_change_color_nick_prefixes, NULL, NULL, NULL);
+ "h:lightmagenta;v:yellow;*:lightblue", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_color_nick_prefixes, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_color_notice = weechat_config_new_option (
irc_config_file, ptr_section,
"notice", "color",
N_("color for text \"Notice\" in notices"),
- NULL, -1, 0, "green", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, -1, 0, "green", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_color_reason_quit = weechat_config_new_option (
irc_config_file, ptr_section,
"reason_quit", "color",
N_("color for reason in part/quit messages"),
- NULL, -1, 0, "default", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, -1, 0, "default", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_color_topic_current = weechat_config_new_option (
irc_config_file, ptr_section,
"topic_current", "color",
N_("color for current channel topic (when joining a channel or "
"using /topic)"),
- NULL, -1, 0, "default", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, -1, 0, "default", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_color_topic_new = weechat_config_new_option (
irc_config_file, ptr_section,
"topic_new", "color",
N_("color for new channel topic (when topic is changed)"),
- NULL, -1, 0, "white", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, -1, 0, "white", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_color_topic_old = weechat_config_new_option (
irc_config_file, ptr_section,
"topic_old", "color",
N_("color for old channel topic (when topic is changed)"),
- NULL, -1, 0, "default", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, -1, 0, "default", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* network */
ptr_section = weechat_config_new_section (irc_config_file, "network",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (irc_config_file);
@@ -2919,14 +3190,14 @@ irc_config_init ()
"autoreconnect_delay_growing", "integer",
N_("growing factor for autoreconnect delay to server (1 = always same "
"delay, 2 = delay*2 for each retry, ..)"),
- NULL, 1, 100, "2", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 1, 100, "2", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_network_autoreconnect_delay_max = weechat_config_new_option (
irc_config_file, ptr_section,
"autoreconnect_delay_max", "integer",
N_("maximum autoreconnect delay to server (in seconds, 0 = no maximum)"),
- NULL, 0, 3600 * 24 * 7, "600", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 3600 * 24 * 7, "600", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_network_ban_mask_default = weechat_config_new_option (
irc_config_file, ptr_section,
"ban_mask_default", "string",
@@ -2935,8 +3206,8 @@ irc_config_init ()
"(extracted from \"nick!user@host\"); $ident is the same as $user if "
"$user does not start with \"~\", otherwise it is set to \"*\"; this "
"default mask is used only if WeeChat knows the host for the nick"),
- NULL, 0, 0, "*!$ident@$host", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "*!$ident@$host", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_network_channel_encode = weechat_config_new_option (
irc_config_file, ptr_section,
"channel_encode", "boolean",
@@ -2944,68 +3215,80 @@ irc_config_init ()
"it is recommended to keep that off if you use only UTF-8 in "
"channel names; you can enable this option if you are using an "
"exotic charset like ISO in channel names"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_network_colors_receive = weechat_config_new_option (
irc_config_file, ptr_section,
"colors_receive", "boolean",
N_("when off, colors codes are ignored in incoming messages"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_network_colors_send = weechat_config_new_option (
irc_config_file, ptr_section,
"colors_send", "boolean",
N_("allow user to send colors with special codes (ctrl-c + a code and "
"optional color: b=bold, cxx=color, cxx,yy=color+background, "
"i=italic, o=disable color/attributes, r=reverse, u=underline)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_network_lag_check = weechat_config_new_option (
irc_config_file, ptr_section,
"lag_check", "integer",
N_("interval between two checks for lag (in seconds, 0 = never "
"check)"),
- NULL, 0, 3600 * 24 * 7, "60", NULL, 0, NULL, NULL,
- &irc_config_change_network_lag_check, NULL, NULL, NULL);
+ NULL, 0, 3600 * 24 * 7, "60", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_network_lag_check, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_network_lag_max = weechat_config_new_option (
irc_config_file, ptr_section,
"lag_max", "integer",
N_("maximum lag (in seconds): if this lag is reached, WeeChat will "
"consider that the answer from server (pong) will never be received "
"and will give up counting the lag (0 = never give up)"),
- NULL, 0, 3600 * 24 * 7, "1800", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 3600 * 24 * 7, "1800", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_network_lag_min_show = weechat_config_new_option (
irc_config_file, ptr_section,
"lag_min_show", "integer",
N_("minimum lag to show (in milliseconds)"),
- NULL, 0, 1000 * 3600 * 24, "500", NULL, 0, NULL, NULL,
- &irc_config_change_network_lag_min_show, NULL, NULL, NULL);
+ NULL, 0, 1000 * 3600 * 24, "500", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_network_lag_min_show, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_network_lag_reconnect = weechat_config_new_option (
irc_config_file, ptr_section,
"lag_reconnect", "integer",
N_("reconnect to server if lag is greater than or equal to this value "
"(in seconds, 0 = never reconnect); this value must be less than or "
"equal to irc.network.lag_max"),
- NULL, 0, 3600 * 24 * 7, "0", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 3600 * 24 * 7, "0", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_network_lag_refresh_interval = weechat_config_new_option (
irc_config_file, ptr_section,
"lag_refresh_interval", "integer",
N_("interval between two refreshs of lag item, when lag is increasing "
"(in seconds)"),
- NULL, 1, 3600, "1", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 1, 3600, "1", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_network_notify_check_ison = weechat_config_new_option (
irc_config_file, ptr_section,
"notify_check_ison", "integer",
N_("interval between two checks for notify with IRC command \"ison\" "
"(in minutes)"),
- NULL, 1, 60 * 24 * 7, "1", NULL, 0, NULL, NULL,
- &irc_config_change_network_notify_check_ison, NULL, NULL, NULL);
+ NULL, 1, 60 * 24 * 7, "1", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_network_notify_check_ison, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_network_notify_check_whois = weechat_config_new_option (
irc_config_file, ptr_section,
"notify_check_whois", "integer",
N_("interval between two checks for notify with IRC command \"whois\" "
"(in minutes)"),
- NULL, 1, 60 * 24 * 7, "5", NULL, 0, NULL, NULL,
- &irc_config_change_network_notify_check_whois, NULL, NULL, NULL);
+ NULL, 1, 60 * 24 * 7, "5", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_network_notify_check_whois, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_network_sasl_fail_unavailable = weechat_config_new_option (
irc_config_file, ptr_section,
"sasl_fail_unavailable", "boolean",
@@ -3013,28 +3296,34 @@ irc_config_init ()
"unavailable on the server; when this option is enabled, it has "
"effect only if option \"sasl_fail\" is set to \"reconnect\" or "
"\"disconnect\" in the server"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_network_send_unknown_commands = weechat_config_new_option (
irc_config_file, ptr_section,
"send_unknown_commands", "boolean",
N_("send unknown commands to server"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL,
- &irc_config_change_network_send_unknown_commands, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL,
+ &irc_config_change_network_send_unknown_commands, NULL, NULL,
+ NULL, NULL, NULL);
irc_config_network_whois_double_nick = weechat_config_new_option (
irc_config_file, ptr_section,
"whois_double_nick", "boolean",
N_("double the nick in /whois command (if only one nick is given), to "
"get idle time in answer; for example: \"/whois nick\" will send "
"\"whois nick nick\""),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* msgbuffer */
- ptr_section = weechat_config_new_section (irc_config_file, "msgbuffer",
- 1, 1,
- NULL, NULL, NULL, NULL,
- NULL, NULL,
- &irc_config_msgbuffer_create_option, NULL,
- NULL, NULL);
+ ptr_section = weechat_config_new_section (
+ irc_config_file, "msgbuffer",
+ 1, 1,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &irc_config_msgbuffer_create_option, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (irc_config_file);
@@ -3043,12 +3332,14 @@ irc_config_init ()
irc_config_section_msgbuffer = ptr_section;
/* CTCP */
- ptr_section = weechat_config_new_section (irc_config_file, "ctcp",
- 1, 1,
- NULL, NULL, NULL, NULL,
- NULL, NULL,
- &irc_config_ctcp_create_option, NULL,
- NULL, NULL);
+ ptr_section = weechat_config_new_section (
+ irc_config_file, "ctcp",
+ 1, 1,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &irc_config_ctcp_create_option, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (irc_config_file);
@@ -3057,12 +3348,14 @@ irc_config_init ()
irc_config_section_ctcp = ptr_section;
/* ignore */
- ptr_section = weechat_config_new_section (irc_config_file, "ignore",
- 0, 0,
- &irc_config_ignore_read_cb, NULL,
- &irc_config_ignore_write_cb, NULL,
- &irc_config_ignore_write_cb, NULL,
- NULL, NULL, NULL, NULL);
+ ptr_section = weechat_config_new_section (
+ irc_config_file, "ignore",
+ 0, 0,
+ &irc_config_ignore_read_cb, NULL, NULL,
+ &irc_config_ignore_write_cb, NULL, NULL,
+ &irc_config_ignore_write_cb, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (irc_config_file);
@@ -3070,11 +3363,14 @@ irc_config_init ()
}
/* server_default */
- ptr_section = weechat_config_new_section (irc_config_file, "server_default",
- 0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ ptr_section = weechat_config_new_section (
+ irc_config_file, "server_default",
+ 0, 0,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (irc_config_file);
@@ -3085,13 +3381,14 @@ irc_config_init ()
irc_config_server_create_default_options (ptr_section);
/* server */
- ptr_section = weechat_config_new_section (irc_config_file, "server",
- 0, 0,
- &irc_config_server_read_cb, NULL,
- &irc_config_server_write_cb, NULL,
- NULL, NULL,
- NULL, NULL,
- NULL, NULL);
+ ptr_section = weechat_config_new_section (
+ irc_config_file, "server",
+ 0, 0,
+ &irc_config_server_read_cb, NULL, NULL,
+ &irc_config_server_write_cb, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (irc_config_file);
@@ -3101,7 +3398,7 @@ irc_config_init ()
irc_config_hook_config_nick_colors = weechat_hook_config (
"weechat.color.chat_nick_colors",
- &irc_config_change_nick_colors_cb, NULL);
+ &irc_config_change_nick_colors_cb, NULL, NULL);
return 1;
}
@@ -3122,13 +3419,13 @@ irc_config_read ()
if (rc == WEECHAT_CONFIG_READ_OK)
{
irc_notify_new_for_all_servers ();
- irc_config_change_look_display_join_message (NULL, NULL);
- irc_config_change_look_nick_color_force (NULL, NULL);
- irc_config_change_look_nicks_hide_password (NULL, NULL);
- irc_config_change_color_nick_prefixes (NULL, NULL);
- irc_config_change_color_mirc_remap (NULL, NULL);
- irc_config_change_network_notify_check_ison (NULL, NULL);
- irc_config_change_network_notify_check_whois (NULL, NULL);
+ irc_config_change_look_display_join_message (NULL, NULL, NULL);
+ irc_config_change_look_nick_color_force (NULL, NULL, NULL);
+ irc_config_change_look_nicks_hide_password (NULL, NULL, NULL);
+ irc_config_change_color_nick_prefixes (NULL, NULL, NULL);
+ irc_config_change_color_mirc_remap (NULL, NULL, NULL);
+ irc_config_change_network_notify_check_ison (NULL, NULL, NULL);
+ irc_config_change_network_notify_check_whois (NULL, NULL, NULL);
}
return rc;
diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h
index 91d9b6bfe..dc75af49e 100644
--- a/src/plugins/irc/irc-config.h
+++ b/src/plugins/irc/irc-config.h
@@ -201,10 +201,10 @@ extern int irc_config_num_nicks_hide_password;
extern void irc_config_set_nick_colors ();
extern int irc_config_display_channel_modes_arguments (const char *modes);
-extern int irc_config_server_check_value_cb (void *data,
+extern int irc_config_server_check_value_cb (const void *pointer, void *data,
struct t_config_option *option,
const char *value);
-extern void irc_config_server_change_cb (void *data,
+extern void irc_config_server_change_cb (const void *pointer, void *data,
struct t_config_option *option);
struct t_config_option *irc_config_server_new_option (struct t_config_file *config_file,
struct t_config_section *section,
@@ -213,12 +213,16 @@ struct t_config_option *irc_config_server_new_option (struct t_config_file *conf
const char *default_value,
const char *value,
int null_value_allowed,
- int (*callback_check_value)(void *data,
+ int (*callback_check_value)(const void *pointer,
+ void *data,
struct t_config_option *option,
const char *value),
+ const void *callback_check_value_pointer,
void *callback_check_value_data,
- void (*callback_change)(void *data,
+ void (*callback_change)(const void *pointer,
+ void *data,
struct t_config_option *option),
+ const void *callback_change_pointer,
void *callback_change_data);
extern int irc_config_init ();
extern int irc_config_read ();
diff --git a/src/plugins/irc/irc-debug.c b/src/plugins/irc/irc-debug.c
index 9e8ffca6d..22e1c255c 100644
--- a/src/plugins/irc/irc-debug.c
+++ b/src/plugins/irc/irc-debug.c
@@ -35,10 +35,12 @@
*/
int
-irc_debug_signal_debug_dump_cb (void *data, const char *signal,
+irc_debug_signal_debug_dump_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -69,5 +71,6 @@ irc_debug_signal_debug_dump_cb (void *data, const char *signal,
void
irc_debug_init ()
{
- weechat_hook_signal ("debug_dump", &irc_debug_signal_debug_dump_cb, NULL);
+ weechat_hook_signal ("debug_dump",
+ &irc_debug_signal_debug_dump_cb, NULL, NULL);
}
diff --git a/src/plugins/irc/irc-ignore.c b/src/plugins/irc/irc-ignore.c
index 4ef33d3ad..0d69a9dfc 100644
--- a/src/plugins/irc/irc-ignore.c
+++ b/src/plugins/irc/irc-ignore.c
@@ -308,11 +308,13 @@ irc_ignore_free_all ()
*/
struct t_hdata *
-irc_ignore_hdata_ignore_cb (void *data, const char *hdata_name)
+irc_ignore_hdata_ignore_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = weechat_hdata_new (hdata_name, "prev_ignore", "next_ignore",
diff --git a/src/plugins/irc/irc-ignore.h b/src/plugins/irc/irc-ignore.h
index 9a8284903..0c6335e49 100644
--- a/src/plugins/irc/irc-ignore.h
+++ b/src/plugins/irc/irc-ignore.h
@@ -51,7 +51,8 @@ extern int irc_ignore_check (struct t_irc_server *server,
const char *host);
extern void irc_ignore_free (struct t_irc_ignore *ignore);
extern void irc_ignore_free_all ();
-extern struct t_hdata *irc_ignore_hdata_ignore_cb (void *data,
+extern struct t_hdata *irc_ignore_hdata_ignore_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int irc_ignore_add_to_infolist (struct t_infolist *infolist,
struct t_irc_ignore *ignore);
diff --git a/src/plugins/irc/irc-info.c b/src/plugins/irc/irc-info.c
index 46c9c1a8f..7133b21a1 100644
--- a/src/plugins/irc/irc-info.c
+++ b/src/plugins/irc/irc-info.c
@@ -64,7 +64,8 @@ irc_info_create_string_with_pointer (char **string, void *pointer)
*/
const char *
-irc_info_info_irc_is_channel_cb (void *data, const char *info_name,
+irc_info_info_irc_is_channel_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
char *pos_comma, *server;
@@ -73,6 +74,7 @@ irc_info_info_irc_is_channel_cb (void *data, const char *info_name,
struct t_irc_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
@@ -99,12 +101,14 @@ irc_info_info_irc_is_channel_cb (void *data, const char *info_name,
*/
const char *
-irc_info_info_irc_is_nick_cb (void *data, const char *info_name,
+irc_info_info_irc_is_nick_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
static char str_true[2] = "1";
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
@@ -118,12 +122,14 @@ irc_info_info_irc_is_nick_cb (void *data, const char *info_name,
*/
const char *
-irc_info_info_irc_nick_cb (void *data, const char *info_name,
+irc_info_info_irc_nick_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
struct t_irc_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
@@ -142,10 +148,12 @@ irc_info_info_irc_nick_cb (void *data, const char *info_name,
*/
const char *
-irc_info_info_irc_nick_from_host_cb (void *data, const char *info_name,
+irc_info_info_irc_nick_from_host_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
@@ -158,10 +166,12 @@ irc_info_info_irc_nick_from_host_cb (void *data, const char *info_name,
*/
const char *
-irc_info_info_irc_nick_color_cb (void *data, const char *info_name,
+irc_info_info_irc_nick_color_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
@@ -174,10 +184,12 @@ irc_info_info_irc_nick_color_cb (void *data, const char *info_name,
*/
const char *
-irc_info_info_irc_nick_color_name_cb (void *data, const char *info_name,
+irc_info_info_irc_nick_color_name_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
@@ -190,7 +202,8 @@ irc_info_info_irc_nick_color_name_cb (void *data, const char *info_name,
*/
const char *
-irc_info_info_irc_buffer_cb (void *data, const char *info_name,
+irc_info_info_irc_buffer_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
char *pos_comma, *pos_comma2, *server, *channel, *host;
@@ -199,6 +212,7 @@ irc_info_info_irc_buffer_cb (void *data, const char *info_name,
struct t_irc_channel *ptr_channel;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
@@ -282,7 +296,8 @@ irc_info_info_irc_buffer_cb (void *data, const char *info_name,
*/
const char *
-irc_info_info_irc_server_isupport_cb (void *data, const char *info_name,
+irc_info_info_irc_server_isupport_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
char *pos_comma, *server;
@@ -291,6 +306,7 @@ irc_info_info_irc_server_isupport_cb (void *data, const char *info_name,
struct t_irc_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
@@ -317,7 +333,8 @@ irc_info_info_irc_server_isupport_cb (void *data, const char *info_name,
*/
const char *
-irc_info_info_irc_server_isupport_value_cb (void *data, const char *info_name,
+irc_info_info_irc_server_isupport_value_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
char *pos_comma, *server;
@@ -325,6 +342,7 @@ irc_info_info_irc_server_isupport_value_cb (void *data, const char *info_name,
struct t_irc_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
@@ -351,7 +369,7 @@ irc_info_info_irc_server_isupport_value_cb (void *data, const char *info_name,
*/
struct t_hashtable *
-irc_info_info_hashtable_irc_message_parse_cb (void *data,
+irc_info_info_hashtable_irc_message_parse_cb (const void *pointer, void *data,
const char *info_name,
struct t_hashtable *hashtable)
{
@@ -360,6 +378,7 @@ irc_info_info_hashtable_irc_message_parse_cb (void *data,
struct t_hashtable *value;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
@@ -383,7 +402,7 @@ irc_info_info_hashtable_irc_message_parse_cb (void *data,
*/
struct t_hashtable *
-irc_info_info_hashtable_irc_message_split_cb (void *data,
+irc_info_info_hashtable_irc_message_split_cb (const void *pointer, void *data,
const char *info_name,
struct t_hashtable *hashtable)
{
@@ -392,6 +411,7 @@ irc_info_info_hashtable_irc_message_split_cb (void *data,
struct t_hashtable *value;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
@@ -415,27 +435,29 @@ irc_info_info_hashtable_irc_message_split_cb (void *data,
*/
struct t_infolist *
-irc_info_infolist_irc_server_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+irc_info_infolist_irc_server_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_irc_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
- if (pointer && !irc_server_valid (pointer))
+ if (obj_pointer && !irc_server_valid (obj_pointer))
return NULL;
ptr_infolist = weechat_infolist_new ();
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one server */
- if (!irc_server_add_to_infolist (ptr_infolist, pointer))
+ if (!irc_server_add_to_infolist (ptr_infolist, obj_pointer))
{
weechat_infolist_free (ptr_infolist);
return NULL;
@@ -469,8 +491,9 @@ irc_info_infolist_irc_server_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-irc_info_infolist_irc_channel_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+irc_info_infolist_irc_channel_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_irc_server *ptr_server;
@@ -479,6 +502,7 @@ irc_info_infolist_irc_channel_cb (void *data, const char *infolist_name,
int argc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
@@ -499,10 +523,10 @@ irc_info_infolist_irc_channel_cb (void *data, const char *infolist_name,
weechat_string_free_split (argv);
return NULL;
}
- if (!pointer && (argc >= 2))
+ if (!obj_pointer && (argc >= 2))
{
- pointer = irc_channel_search (ptr_server, argv[1]);
- if (!pointer)
+ obj_pointer = irc_channel_search (ptr_server, argv[1]);
+ if (!obj_pointer)
{
weechat_string_free_split (argv);
return NULL;
@@ -514,17 +538,17 @@ irc_info_infolist_irc_channel_cb (void *data, const char *infolist_name,
if (!ptr_server)
return NULL;
- if (pointer && !irc_channel_valid (ptr_server, pointer))
+ if (obj_pointer && !irc_channel_valid (ptr_server, obj_pointer))
return NULL;
ptr_infolist = weechat_infolist_new ();
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one channel */
- if (!irc_channel_add_to_infolist (ptr_infolist, pointer))
+ if (!irc_channel_add_to_infolist (ptr_infolist, obj_pointer))
{
weechat_infolist_free (ptr_infolist);
return NULL;
@@ -554,8 +578,9 @@ irc_info_infolist_irc_channel_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-irc_info_infolist_irc_nick_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+irc_info_infolist_irc_nick_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_irc_server *ptr_server;
@@ -565,6 +590,7 @@ irc_info_infolist_irc_nick_cb (void *data, const char *infolist_name,
int argc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
@@ -591,11 +617,11 @@ irc_info_infolist_irc_nick_cb (void *data, const char *infolist_name,
weechat_string_free_split (argv);
return NULL;
}
- if (!pointer && (argc >= 3))
+ if (!obj_pointer && (argc >= 3))
{
- pointer = irc_nick_search (ptr_server, ptr_channel,
+ obj_pointer = irc_nick_search (ptr_server, ptr_channel,
argv[2]);
- if (!pointer)
+ if (!obj_pointer)
{
weechat_string_free_split (argv);
return NULL;
@@ -607,18 +633,18 @@ irc_info_infolist_irc_nick_cb (void *data, const char *infolist_name,
if (!ptr_server || !ptr_channel)
return NULL;
- if (pointer && !irc_nick_valid (ptr_channel, pointer))
+ if (obj_pointer && !irc_nick_valid (ptr_channel, obj_pointer))
return NULL;
ptr_infolist = weechat_infolist_new ();
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one nick */
if (!irc_nick_add_to_infolist (ptr_infolist,
- pointer))
+ obj_pointer))
{
weechat_infolist_free (ptr_infolist);
return NULL;
@@ -649,28 +675,30 @@ irc_info_infolist_irc_nick_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-irc_info_infolist_irc_ignore_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+irc_info_infolist_irc_ignore_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_irc_ignore *ptr_ignore;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
(void) arguments;
- if (pointer && !irc_ignore_valid (pointer))
+ if (obj_pointer && !irc_ignore_valid (obj_pointer))
return NULL;
ptr_infolist = weechat_infolist_new ();
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one ignore */
- if (!irc_ignore_add_to_infolist (ptr_infolist, pointer))
+ if (!irc_ignore_add_to_infolist (ptr_infolist, obj_pointer))
{
weechat_infolist_free (ptr_infolist);
return NULL;
@@ -700,28 +728,30 @@ irc_info_infolist_irc_ignore_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-irc_info_infolist_irc_notify_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+irc_info_infolist_irc_notify_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_irc_server *ptr_server;
struct t_irc_notify *ptr_notify;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
- if (pointer && !irc_notify_valid (NULL, pointer))
+ if (obj_pointer && !irc_notify_valid (NULL, obj_pointer))
return NULL;
ptr_infolist = weechat_infolist_new ();
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one notify */
- if (!irc_notify_add_to_infolist (ptr_infolist, pointer))
+ if (!irc_notify_add_to_infolist (ptr_infolist, obj_pointer))
{
weechat_infolist_free (ptr_infolist);
return NULL;
@@ -760,15 +790,18 @@ irc_info_infolist_irc_notify_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-irc_info_infolist_irc_color_weechat_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+irc_info_infolist_irc_color_weechat_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer,
+ const char *arguments)
{
struct t_infolist *ptr_infolist;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
- (void) pointer;
+ (void) obj_pointer;
(void) arguments;
ptr_infolist = weechat_infolist_new ();
@@ -796,47 +829,47 @@ irc_info_init ()
"irc_is_channel",
N_("1 if string is a valid IRC channel name for server"),
N_("server,channel (server is optional)"),
- &irc_info_info_irc_is_channel_cb, NULL);
+ &irc_info_info_irc_is_channel_cb, NULL, NULL);
weechat_hook_info (
"irc_is_nick",
N_("1 if string is a valid IRC nick name"),
N_("nickname"),
- &irc_info_info_irc_is_nick_cb, NULL);
+ &irc_info_info_irc_is_nick_cb, NULL, NULL);
weechat_hook_info (
"irc_nick",
N_("get current nick on a server"),
N_("server name"),
- &irc_info_info_irc_nick_cb, NULL);
+ &irc_info_info_irc_nick_cb, NULL, NULL);
weechat_hook_info (
"irc_nick_from_host",
N_("get nick from IRC host"),
N_("IRC host (like `:nick!name@server.com`)"),
- &irc_info_info_irc_nick_from_host_cb, NULL);
+ &irc_info_info_irc_nick_from_host_cb, NULL, NULL);
weechat_hook_info (
"irc_nick_color",
N_("get nick color code"),
N_("nickname"),
- &irc_info_info_irc_nick_color_cb, NULL);
+ &irc_info_info_irc_nick_color_cb, NULL, NULL);
weechat_hook_info (
"irc_nick_color_name",
N_("get nick color name"),
N_("nickname"),
- &irc_info_info_irc_nick_color_name_cb, NULL);
+ &irc_info_info_irc_nick_color_name_cb, NULL, NULL);
weechat_hook_info (
"irc_buffer",
N_("get buffer pointer for an IRC server/channel/nick"),
N_("server,channel,nick (channel and nicks are optional)"),
- &irc_info_info_irc_buffer_cb, NULL);
+ &irc_info_info_irc_buffer_cb, NULL, NULL);
weechat_hook_info (
"irc_server_isupport",
N_("1 if server supports this feature (from IRC message 005)"),
N_("server,feature"),
- &irc_info_info_irc_server_isupport_cb, NULL);
+ &irc_info_info_irc_server_isupport_cb, NULL, NULL);
weechat_hook_info (
"irc_server_isupport_value",
N_("value of feature, if supported by server (from IRC message 005)"),
N_("server,feature"),
- &irc_info_info_irc_server_isupport_value_cb, NULL);
+ &irc_info_info_irc_server_isupport_value_cb, NULL, NULL);
/* info_hashtable hooks */
weechat_hook_info_hashtable (
@@ -860,7 +893,7 @@ irc_info_init ()
"\"channel\" was not found), "
"\"pos_text\": index of \"text\" message (\"-1\" if "
"\"text\" was not found)"),
- &irc_info_info_hashtable_irc_message_parse_cb, NULL);
+ &irc_info_info_hashtable_irc_message_parse_cb, NULL, NULL);
weechat_hook_info_hashtable (
"irc_message_split",
N_("split an IRC message (to fit in 512 bytes)"),
@@ -869,7 +902,7 @@ irc_info_init ()
N_("\"msg1\" ... \"msgN\": messages to send (without final \"\\r\\n\"), "
"\"args1\" ... \"argsN\": arguments of messages, \"count\": number "
"of messages"),
- &irc_info_info_hashtable_irc_message_split_cb, NULL);
+ &irc_info_info_hashtable_irc_message_split_cb, NULL, NULL);
/* infolist hooks */
weechat_hook_infolist (
@@ -877,61 +910,61 @@ irc_info_init ()
N_("list of IRC servers"),
N_("server pointer (optional)"),
N_("server name (wildcard \"*\" is allowed) (optional)"),
- &irc_info_infolist_irc_server_cb, NULL);
+ &irc_info_infolist_irc_server_cb, NULL, NULL);
weechat_hook_infolist (
"irc_channel",
N_("list of channels for an IRC server"),
N_("channel pointer (optional)"),
N_("server,channel (channel is optional)"),
- &irc_info_infolist_irc_channel_cb, NULL);
+ &irc_info_infolist_irc_channel_cb, NULL, NULL);
weechat_hook_infolist (
"irc_nick",
N_("list of nicks for an IRC channel"),
N_("nick pointer (optional)"),
N_("server,channel,nick (nick is optional)"),
- &irc_info_infolist_irc_nick_cb, NULL);
+ &irc_info_infolist_irc_nick_cb, NULL, NULL);
weechat_hook_infolist (
"irc_ignore",
N_("list of IRC ignores"),
N_("ignore pointer (optional)"),
NULL,
- &irc_info_infolist_irc_ignore_cb, NULL);
+ &irc_info_infolist_irc_ignore_cb, NULL, NULL);
weechat_hook_infolist (
"irc_notify",
N_("list of notify"),
N_("notify pointer (optional)"),
N_("server name (wildcard \"*\" is allowed) (optional)"),
- &irc_info_infolist_irc_notify_cb, NULL);
+ &irc_info_infolist_irc_notify_cb, NULL, NULL);
weechat_hook_infolist (
"irc_color_weechat",
N_("mapping between IRC color codes and WeeChat color names"),
NULL,
NULL,
- &irc_info_infolist_irc_color_weechat_cb, NULL);
+ &irc_info_infolist_irc_color_weechat_cb, NULL, NULL);
/* hdata hooks */
weechat_hook_hdata (
"irc_nick", N_("irc nick"),
- &irc_nick_hdata_nick_cb, NULL);
+ &irc_nick_hdata_nick_cb, NULL, NULL);
weechat_hook_hdata (
"irc_channel", N_("irc channel"),
- &irc_channel_hdata_channel_cb, NULL);
+ &irc_channel_hdata_channel_cb, NULL, NULL);
weechat_hook_hdata (
"irc_channel_speaking", N_("irc channel_speaking"),
- &irc_channel_hdata_channel_speaking_cb, NULL);
+ &irc_channel_hdata_channel_speaking_cb, NULL, NULL);
weechat_hook_hdata (
"irc_ignore", N_("irc ignore"),
- &irc_ignore_hdata_ignore_cb, NULL);
+ &irc_ignore_hdata_ignore_cb, NULL, NULL);
weechat_hook_hdata (
"irc_notify", N_("irc notify"),
- &irc_notify_hdata_notify_cb, NULL);
+ &irc_notify_hdata_notify_cb, NULL, NULL);
weechat_hook_hdata (
"irc_redirect_pattern", N_("pattern for irc redirect"),
- &irc_redirect_hdata_redirect_pattern_cb, NULL);
+ &irc_redirect_hdata_redirect_pattern_cb, NULL, NULL);
weechat_hook_hdata (
"irc_redirect", N_("irc redirect"),
- &irc_redirect_hdata_redirect_cb, NULL);
+ &irc_redirect_hdata_redirect_cb, NULL, NULL);
weechat_hook_hdata (
"irc_server", N_("irc server"),
- &irc_server_hdata_server_cb, NULL);
+ &irc_server_hdata_server_cb, NULL, NULL);
}
diff --git a/src/plugins/irc/irc-input.c b/src/plugins/irc/irc-input.c
index caa330474..bd6e2c655 100644
--- a/src/plugins/irc/irc-input.c
+++ b/src/plugins/irc/irc-input.c
@@ -259,10 +259,12 @@ irc_input_data (struct t_gui_buffer *buffer, const char *input_data, int flags,
*/
int
-irc_input_data_cb (void *data, struct t_gui_buffer *buffer,
+irc_input_data_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
return irc_input_data (buffer, input_data,
@@ -287,7 +289,8 @@ irc_input_data_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-irc_input_send_cb (void *data, const char *signal,
+irc_input_send_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
const char *ptr_string, *ptr_message;
@@ -299,6 +302,7 @@ irc_input_send_cb (void *data, const char *signal,
struct t_gui_buffer *ptr_buffer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
diff --git a/src/plugins/irc/irc-input.h b/src/plugins/irc/irc-input.h
index 9a7988102..4d8315992 100644
--- a/src/plugins/irc/irc-input.h
+++ b/src/plugins/irc/irc-input.h
@@ -24,9 +24,11 @@ struct t_gui_buffer;
extern void irc_input_user_message_display (struct t_gui_buffer *buffer,
int action, const char *text);
-extern int irc_input_data_cb (void *data, struct t_gui_buffer *buffer,
+extern int irc_input_data_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data);
-extern int irc_input_send_cb (void *data, const char *signal,
- const char *type_data, void *signal_data);
+extern int irc_input_send_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
+ void *signal_data);
#endif /* WEECHAT_IRC_INPUT_H */
diff --git a/src/plugins/irc/irc-message.c b/src/plugins/irc/irc-message.c
index 1524a9f3b..5e1e1b604 100644
--- a/src/plugins/irc/irc-message.c
+++ b/src/plugins/irc/irc-message.c
@@ -362,8 +362,7 @@ irc_message_parse_to_hashtable (struct t_irc_server *server,
hashtable = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (!hashtable)
return NULL;
@@ -1008,8 +1007,7 @@ irc_message_split (struct t_irc_server *server, const char *message)
hashtable = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (!hashtable)
return NULL;
diff --git a/src/plugins/irc/irc-nick.c b/src/plugins/irc/irc-nick.c
index 98b470641..308181c76 100644
--- a/src/plugins/irc/irc-nick.c
+++ b/src/plugins/irc/irc-nick.c
@@ -1128,11 +1128,13 @@ irc_nick_default_ban_mask (struct t_irc_nick *nick)
*/
struct t_hdata *
-irc_nick_hdata_nick_cb (void *data, const char *hdata_name)
+irc_nick_hdata_nick_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = weechat_hdata_new (hdata_name, "prev_nick", "next_nick",
diff --git a/src/plugins/irc/irc-nick.h b/src/plugins/irc/irc-nick.h
index d723db180..b8109a7cc 100644
--- a/src/plugins/irc/irc-nick.h
+++ b/src/plugins/irc/irc-nick.h
@@ -48,8 +48,6 @@ struct t_irc_nick
extern int irc_nick_valid (struct t_irc_channel *channel,
struct t_irc_nick *nick);
extern int irc_nick_is_nick (const char *string);
-extern int irc_nick_config_colors_cb (void *data, const char *option,
- const char *value);
extern const char *irc_nick_find_color (const char *nickname);
extern const char *irc_nick_find_color_name (const char *nickname);
extern int irc_nick_is_op (struct t_irc_server *server,
@@ -104,7 +102,8 @@ extern const char *irc_nick_color_for_msg (struct t_irc_server *server,
extern const char * irc_nick_color_for_pv (struct t_irc_channel *channel,
const char *nickname);
extern char *irc_nick_default_ban_mask (struct t_irc_nick *nick);
-extern struct t_hdata *irc_nick_hdata_nick_cb (void *data,
+extern struct t_hdata *irc_nick_hdata_nick_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int irc_nick_add_to_infolist (struct t_infolist *infolist,
struct t_irc_nick *nick);
diff --git a/src/plugins/irc/irc-notify.c b/src/plugins/irc/irc-notify.c
index 2d39250ca..3ca5b9e25 100644
--- a/src/plugins/irc/irc-notify.c
+++ b/src/plugins/irc/irc-notify.c
@@ -769,7 +769,7 @@ irc_notify_set_away_message (struct t_irc_notify *notify,
*/
int
-irc_notify_hsignal_cb (void *data, const char *signal,
+irc_notify_hsignal_cb (const void *pointer, void *data, const char *signal,
struct t_hashtable *hashtable)
{
const char *error, *server, *pattern, *command, *output;
@@ -781,6 +781,7 @@ irc_notify_hsignal_cb (void *data, const char *signal,
struct t_irc_notify *ptr_notify;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
@@ -962,7 +963,7 @@ irc_notify_hsignal_cb (void *data, const char *signal,
*/
int
-irc_notify_timer_ison_cb (void *data, int remaining_calls)
+irc_notify_timer_ison_cb (const void *pointer, void *data, int remaining_calls)
{
char *message, hash_key[32];
const char *str_message;
@@ -971,6 +972,7 @@ irc_notify_timer_ison_cb (void *data, int remaining_calls)
struct t_hashtable *hashtable;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) remaining_calls;
@@ -1021,12 +1023,14 @@ irc_notify_timer_ison_cb (void *data, int remaining_calls)
*/
int
-irc_notify_timer_whois_cb (void *data, int remaining_calls)
+irc_notify_timer_whois_cb (const void *pointer, void *data,
+ int remaining_calls)
{
struct t_irc_server *ptr_server;
struct t_irc_notify *ptr_notify, *ptr_next_notify;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) remaining_calls;
@@ -1067,11 +1071,13 @@ irc_notify_timer_whois_cb (void *data, int remaining_calls)
*/
struct t_hdata *
-irc_notify_hdata_notify_cb (void *data, const char *hdata_name)
+irc_notify_hdata_notify_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = weechat_hdata_new (hdata_name, "prev_notify", "next_notify",
@@ -1164,7 +1170,7 @@ irc_notify_hook_timer_ison ()
irc_notify_timer_ison = weechat_hook_timer (
60 * 1000 * weechat_config_integer (irc_config_network_notify_check_ison),
- 0, 0, &irc_notify_timer_ison_cb, NULL);
+ 0, 0, &irc_notify_timer_ison_cb, NULL, NULL);
}
/*
@@ -1179,7 +1185,7 @@ irc_notify_hook_timer_whois ()
irc_notify_timer_whois = weechat_hook_timer (
60 * 1000 * weechat_config_integer (irc_config_network_notify_check_whois),
- 0, 0, &irc_notify_timer_whois_cb, NULL);
+ 0, 0, &irc_notify_timer_whois_cb, NULL, NULL);
}
/*
@@ -1194,7 +1200,7 @@ irc_notify_init ()
irc_notify_hsignal = weechat_hook_hsignal ("irc_redirection_notify_*",
&irc_notify_hsignal_cb,
- NULL);
+ NULL, NULL);
}
/*
diff --git a/src/plugins/irc/irc-notify.h b/src/plugins/irc/irc-notify.h
index 63bd96347..f290cd0b0 100644
--- a/src/plugins/irc/irc-notify.h
+++ b/src/plugins/irc/irc-notify.h
@@ -60,9 +60,12 @@ extern void irc_notify_set_is_on_server (struct t_irc_notify *notify,
extern void irc_notify_free_all (struct t_irc_server *server);
extern void irc_notify_display_list (struct t_irc_server *server);
extern void irc_notify_send_monitor (struct t_irc_server *server);
-extern int irc_notify_timer_ison_cb (void *data, int remaining_calls);
-extern int irc_notify_timer_whois_cb (void *data, int remaining_calls);
-extern struct t_hdata *irc_notify_hdata_notify_cb (void *data,
+extern int irc_notify_timer_ison_cb (const void *pointer, void *data,
+ int remaining_calls);
+extern int irc_notify_timer_whois_cb (const void *pointer, void *data,
+ int remaining_calls);
+extern struct t_hdata *irc_notify_hdata_notify_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int irc_notify_add_to_infolist (struct t_infolist *infolist,
struct t_irc_notify *notify);
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 23afad170..b6a9cae24 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -518,7 +518,7 @@ IRC_PROTOCOL_CALLBACK(cap)
timeout * 1000,
0, 1,
&irc_server_timer_sasl_cb,
- server);
+ server, NULL);
}
}
}
@@ -1035,7 +1035,7 @@ IRC_PROTOCOL_CALLBACK(kick)
IRC_SERVER_OPTION_AUTOREJOIN_DELAY) * 1000,
0, 1,
&irc_channel_autorejoin_cb,
- ptr_channel);
+ ptr_channel, NULL);
}
}
@@ -5531,8 +5531,7 @@ irc_protocol_get_message_tags (const char *tags)
hashtable = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (!hashtable)
return NULL;
diff --git a/src/plugins/irc/irc-raw.c b/src/plugins/irc/irc-raw.c
index 4e5155090..fb560eea6 100644
--- a/src/plugins/irc/irc-raw.c
+++ b/src/plugins/irc/irc-raw.c
@@ -72,9 +72,10 @@ irc_raw_open (int switch_to_buffer)
IRC_RAW_BUFFER_NAME);
if (!irc_raw_buffer)
{
- irc_raw_buffer = weechat_buffer_new (IRC_RAW_BUFFER_NAME,
- &irc_input_data_cb, NULL,
- &irc_buffer_close_cb, NULL);
+ irc_raw_buffer = weechat_buffer_new (
+ IRC_RAW_BUFFER_NAME,
+ &irc_input_data_cb, NULL, NULL,
+ &irc_buffer_close_cb, NULL, NULL);
/* failed to create buffer ? then return */
if (!irc_raw_buffer)
diff --git a/src/plugins/irc/irc-redirect.c b/src/plugins/irc/irc-redirect.c
index de1c71ee5..ab88a4469 100644
--- a/src/plugins/irc/irc-redirect.c
+++ b/src/plugins/irc/irc-redirect.c
@@ -436,8 +436,7 @@ irc_redirect_new_with_commands (struct t_irc_server *server,
hash_cmd[i] = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_INTEGER,
- NULL,
- NULL);
+ NULL, NULL);
for (j = 0; j < num_items[i]; j++)
{
if (i < 3)
@@ -732,8 +731,7 @@ irc_redirect_stop (struct t_irc_redirect *redirect, const char *error)
hashtable = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (hashtable)
{
/* set error and output (main fields) */
@@ -993,11 +991,13 @@ irc_redirect_free_all (struct t_irc_server *server)
*/
struct t_hdata *
-irc_redirect_hdata_redirect_pattern_cb (void *data, const char *hdata_name)
+irc_redirect_hdata_redirect_pattern_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = weechat_hdata_new (hdata_name, "prev_redirect", "next_redirect",
@@ -1023,11 +1023,13 @@ irc_redirect_hdata_redirect_pattern_cb (void *data, const char *hdata_name)
*/
struct t_hdata *
-irc_redirect_hdata_redirect_cb (void *data, const char *hdata_name)
+irc_redirect_hdata_redirect_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = weechat_hdata_new (hdata_name, "prev_redirect", "next_redirect",
@@ -1237,7 +1239,8 @@ irc_redirect_print_log (struct t_irc_server *server)
*/
int
-irc_redirect_pattern_hsignal_cb (void *data, const char *signal,
+irc_redirect_pattern_hsignal_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable)
{
const char *pattern, *str_timeout, *cmd_start, *cmd_stop, *cmd_extra;
@@ -1245,6 +1248,7 @@ irc_redirect_pattern_hsignal_cb (void *data, const char *signal,
int number, timeout;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
@@ -1301,7 +1305,8 @@ irc_redirect_pattern_hsignal_cb (void *data, const char *signal,
*/
int
-irc_redirect_command_hsignal_cb (void *data, const char *signal,
+irc_redirect_command_hsignal_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable)
{
const char *server, *pattern, *redirect_signal, *str_count, *string;
@@ -1311,6 +1316,7 @@ irc_redirect_command_hsignal_cb (void *data, const char *signal,
int number, count, timeout;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
diff --git a/src/plugins/irc/irc-redirect.h b/src/plugins/irc/irc-redirect.h
index 7fd841621..632e4e840 100644
--- a/src/plugins/irc/irc-redirect.h
+++ b/src/plugins/irc/irc-redirect.h
@@ -109,9 +109,11 @@ extern int irc_redirect_message (struct t_irc_server *server,
const char *arguments);
extern void irc_redirect_free (struct t_irc_redirect *redirect);
extern void irc_redirect_free_all (struct t_irc_server *server);
-extern struct t_hdata *irc_redirect_hdata_redirect_pattern_cb (void *data,
+extern struct t_hdata *irc_redirect_hdata_redirect_pattern_cb (const void *pointer,
+ void *data,
const char *hdata_name);
-extern struct t_hdata *irc_redirect_hdata_redirect_cb (void *data,
+extern struct t_hdata *irc_redirect_hdata_redirect_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int irc_redirect_pattern_add_to_infolist (struct t_infolist *infolist,
struct t_irc_redirect_pattern *redirect_pattern);
@@ -119,9 +121,11 @@ extern int irc_redirect_add_to_infolist (struct t_infolist *infolist,
struct t_irc_redirect *redirect);
extern void irc_redirect_pattern_print_log ();
extern void irc_redirect_print_log (struct t_irc_server *server);
-extern int irc_redirect_pattern_hsignal_cb (void *data, const char *signal,
+extern int irc_redirect_pattern_hsignal_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable);
-extern int irc_redirect_command_hsignal_cb (void *data, const char *signal,
+extern int irc_redirect_command_hsignal_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable);
extern void irc_redirect_init ();
extern void irc_redirect_end ();
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c
index 6f7b4fc33..cd18494a1 100644
--- a/src/plugins/irc/irc-server.c
+++ b/src/plugins/irc/irc-server.c
@@ -1056,21 +1056,21 @@ irc_server_alloc (const char *name)
new_server->notify_list = NULL;
new_server->last_notify = NULL;
new_server->notify_count = 0;
- new_server->join_manual = weechat_hashtable_new (32,
- WEECHAT_HASHTABLE_STRING,
- WEECHAT_HASHTABLE_TIME,
- NULL,
- NULL);
- new_server->join_channel_key = weechat_hashtable_new (32,
- WEECHAT_HASHTABLE_STRING,
- WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
- new_server->join_noswitch = weechat_hashtable_new (32,
- WEECHAT_HASHTABLE_STRING,
- WEECHAT_HASHTABLE_TIME,
- NULL,
- NULL);
+ new_server->join_manual = weechat_hashtable_new (
+ 32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_TIME,
+ NULL, NULL);
+ new_server->join_channel_key = weechat_hashtable_new (
+ 32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING,
+ NULL, NULL);
+ new_server->join_noswitch = weechat_hashtable_new (
+ 32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_TIME,
+ NULL, NULL);
new_server->buffer = NULL;
new_server->buffer_as_string = NULL;
new_server->channels = NULL;
@@ -1100,9 +1100,11 @@ irc_server_alloc (const char *name)
1,
&irc_config_server_check_value_cb,
irc_server_options[i][0],
+ NULL,
&irc_config_server_change_cb,
- irc_server_options[i][0]);
- irc_config_server_change_cb (irc_server_options[i][0],
+ irc_server_options[i][0],
+ NULL);
+ irc_config_server_change_cb (irc_server_options[i][0], NULL,
new_server->options[i]);
free (option_name);
}
@@ -2289,8 +2291,7 @@ irc_server_sendf (struct t_irc_server *server, int flags, const char *tags,
ret_hashtable = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
}
rc = 1;
@@ -2762,16 +2763,17 @@ irc_server_msgq_flush ()
*/
int
-irc_server_recv_cb (void *data, int fd)
+irc_server_recv_cb (const void *pointer, void *data, int fd)
{
struct t_irc_server *server;
static char buffer[4096 + 2];
int num_read, msgq_flush, end_recv;
/* make C compiler happy */
+ (void) data;
(void) fd;
- server = (struct t_irc_server *)data;
+ server = (struct t_irc_server *)pointer;
if (!server)
return WEECHAT_RC_ERROR;
@@ -2865,14 +2867,16 @@ irc_server_recv_cb (void *data, int fd)
*/
int
-irc_server_timer_connection_cb (void *data, int remaining_calls)
+irc_server_timer_connection_cb (const void *pointer, void *data,
+ int remaining_calls)
{
struct t_irc_server *server;
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- server = (struct t_irc_server *)data;
+ server = (struct t_irc_server *)pointer;
if (!server)
return WEECHAT_RC_ERROR;
@@ -2898,15 +2902,16 @@ irc_server_timer_connection_cb (void *data, int remaining_calls)
*/
int
-irc_server_timer_sasl_cb (void *data, int remaining_calls)
+irc_server_timer_sasl_cb (const void *pointer, void *data, int remaining_calls)
{
struct t_irc_server *server;
int sasl_fail;
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- server = (struct t_irc_server *)data;
+ server = (struct t_irc_server *)pointer;
if (!server)
return WEECHAT_RC_ERROR;
@@ -2940,7 +2945,8 @@ irc_server_timer_sasl_cb (void *data, int remaining_calls)
*/
void
-irc_server_check_join_manual_cb (void *data, struct t_hashtable *hashtable,
+irc_server_check_join_manual_cb (void *data,
+ struct t_hashtable *hashtable,
const void *key, const void *value)
{
/* make C compiler happy */
@@ -2956,7 +2962,8 @@ irc_server_check_join_manual_cb (void *data, struct t_hashtable *hashtable,
*/
void
-irc_server_check_join_noswitch_cb (void *data, struct t_hashtable *hashtable,
+irc_server_check_join_noswitch_cb (void *data,
+ struct t_hashtable *hashtable,
const void *key, const void *value)
{
/* make C compiler happy */
@@ -2994,7 +3001,7 @@ irc_server_check_join_smart_filtered_cb (void *data,
*/
int
-irc_server_timer_cb (void *data, int remaining_calls)
+irc_server_timer_cb (const void *pointer, void *data, int remaining_calls)
{
struct t_irc_server *ptr_server;
struct t_irc_channel *ptr_channel;
@@ -3004,6 +3011,7 @@ irc_server_timer_cb (void *data, int remaining_calls)
int away_check;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) remaining_calls;
@@ -3381,7 +3389,7 @@ irc_server_login (struct t_irc_server *server)
IRC_SERVER_OPTION_INTEGER (server, IRC_SERVER_OPTION_CONNECTION_TIMEOUT) * 1000,
0, 1,
&irc_server_timer_connection_cb,
- server);
+ server, NULL);
if (password)
free (password);
@@ -3431,13 +3439,17 @@ irc_server_switch_address (struct t_irc_server *server, int connection)
*/
int
-irc_server_connect_cb (void *data, int status, int gnutls_rc, int sock,
+irc_server_connect_cb (const void *pointer, void *data,
+ int status, int gnutls_rc, int sock,
const char *error, const char *ip_address)
{
struct t_irc_server *server;
const char *proxy;
- server = (struct t_irc_server *)data;
+ /* make C compiler happy */
+ (void) data;
+
+ server = (struct t_irc_server *)pointer;
proxy = IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_PROXY);
@@ -3462,7 +3474,7 @@ irc_server_connect_cb (void *data, int status, int gnutls_rc, int sock,
server->hook_fd = weechat_hook_fd (server->sock,
1, 0, 0,
&irc_server_recv_cb,
- server);
+ server, NULL);
/* login to server */
irc_server_login (server);
break;
@@ -3719,8 +3731,8 @@ irc_server_create_buffer (struct t_irc_server *server)
snprintf (buffer_name, sizeof (buffer_name),
"server.%s", server->name);
server->buffer = weechat_buffer_new (buffer_name,
- &irc_input_data_cb, NULL,
- &irc_buffer_close_cb, NULL);
+ &irc_input_data_cb, NULL, NULL,
+ &irc_buffer_close_cb, NULL, NULL);
if (!server->buffer)
return NULL;
@@ -4549,7 +4561,8 @@ irc_server_connect (struct t_irc_server *server)
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_SSL_PRIORITIES),
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_LOCAL_HOSTNAME),
&irc_server_connect_cb,
- server);
+ server,
+ NULL);
#else
server->hook_connect = weechat_hook_connect (
proxy,
@@ -4560,7 +4573,8 @@ irc_server_connect (struct t_irc_server *server)
NULL, NULL, 0, NULL,
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_LOCAL_HOSTNAME),
&irc_server_connect_cb,
- server);
+ server,
+ NULL);
#endif /* HAVE_GNUTLS */
/* send signal "irc_server_connecting" with server name */
@@ -4595,15 +4609,17 @@ irc_server_reconnect (struct t_irc_server *server)
*/
int
-irc_server_auto_connect_timer_cb (void *data, int remaining_calls)
+irc_server_auto_connect_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
struct t_irc_server *ptr_server;
- void *auto_connect;
+ int auto_connect;
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- auto_connect = data;
+ auto_connect = (pointer) ? 1 : 0;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
@@ -4629,8 +4645,10 @@ irc_server_auto_connect_timer_cb (void *data, int remaining_calls)
void
irc_server_auto_connect (int auto_connect)
{
- weechat_hook_timer (1, 0, 1, &irc_server_auto_connect_timer_cb,
- (auto_connect) ? (void *)1 : (void *)0);
+ weechat_hook_timer (1, 0, 1,
+ &irc_server_auto_connect_timer_cb,
+ (auto_connect) ? (void *)1 : (void *)0,
+ NULL);
}
/*
@@ -5026,7 +5044,8 @@ irc_server_set_away (struct t_irc_server *server, const char *nick, int is_away)
*/
int
-irc_server_xfer_send_ready_cb (void *data, const char *signal,
+irc_server_xfer_send_ready_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
struct t_infolist *infolist;
@@ -5038,6 +5057,7 @@ irc_server_xfer_send_ready_cb (void *data, const char *signal,
int spaces_in_name, rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -5127,7 +5147,8 @@ irc_server_xfer_send_ready_cb (void *data, const char *signal,
*/
int
-irc_server_xfer_resume_ready_cb (void *data, const char *signal,
+irc_server_xfer_resume_ready_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
struct t_infolist *infolist;
@@ -5136,6 +5157,7 @@ irc_server_xfer_resume_ready_cb (void *data, const char *signal,
int spaces_in_name;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -5180,7 +5202,8 @@ irc_server_xfer_resume_ready_cb (void *data, const char *signal,
*/
int
-irc_server_xfer_send_accept_resume_cb (void *data, const char *signal,
+irc_server_xfer_send_accept_resume_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data)
{
@@ -5190,6 +5213,7 @@ irc_server_xfer_send_accept_resume_cb (void *data, const char *signal,
int spaces_in_name;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -5231,11 +5255,13 @@ irc_server_xfer_send_accept_resume_cb (void *data, const char *signal,
*/
struct t_hdata *
-irc_server_hdata_server_cb (void *data, const char *hdata_name)
+irc_server_hdata_server_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = weechat_hdata_new (hdata_name, "prev_server", "next_server",
diff --git a/src/plugins/irc/irc-server.h b/src/plugins/irc/irc-server.h
index 8ba3d96e6..1d14957d8 100644
--- a/src/plugins/irc/irc-server.h
+++ b/src/plugins/irc/irc-server.h
@@ -330,9 +330,11 @@ char *irc_server_fingerprint_str_sizes ();
extern int irc_server_connect (struct t_irc_server *server);
extern void irc_server_auto_connect (int auto_connect);
extern void irc_server_autojoin_channels ();
-extern int irc_server_recv_cb (void *data, int fd);
-extern int irc_server_timer_sasl_cb (void *data, int remaining_calls);
-extern int irc_server_timer_cb (void *data, int remaining_calls);
+extern int irc_server_recv_cb (const void *pointer, void *data, int fd);
+extern int irc_server_timer_sasl_cb (const void *pointer, void *data,
+ int remaining_calls);
+extern int irc_server_timer_cb (const void *pointer, void *data,
+ int remaining_calls);
extern void irc_server_outqueue_free_all (struct t_irc_server *server,
int priority);
extern int irc_server_get_channel_count (struct t_irc_server *server);
@@ -347,14 +349,21 @@ extern void irc_server_disconnect (struct t_irc_server *server,
int switch_address, int reconnect);
extern void irc_server_disconnect_all ();
extern void irc_server_free (struct t_irc_server *server);
-extern int irc_server_xfer_send_ready_cb (void *data, const char *signal,
- const char *type_data, void *signal_data);
-extern int irc_server_xfer_resume_ready_cb (void *data, const char *signal,
- const char *type_data, void *signal_data);
-extern int irc_server_xfer_send_accept_resume_cb (void *data, const char *signal,
+extern int irc_server_xfer_send_ready_cb (const void *pointer, void *data,
+ const char *signal,
+ const char *type_data,
+ void *signal_data);
+extern int irc_server_xfer_resume_ready_cb (const void *pointer, void *data,
+ const char *signal,
+ const char *type_data,
+ void *signal_data);
+extern int irc_server_xfer_send_accept_resume_cb (const void *pointer,
+ void *data,
+ const char *signal,
const char *type_data,
void *signal_data);
-extern struct t_hdata *irc_server_hdata_server_cb (void *data,
+extern struct t_hdata *irc_server_hdata_server_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int irc_server_add_to_infolist (struct t_infolist *infolist,
struct t_irc_server *server);
diff --git a/src/plugins/irc/irc-upgrade.c b/src/plugins/irc/irc-upgrade.c
index 458bf0204..e5623eccf 100644
--- a/src/plugins/irc/irc-upgrade.c
+++ b/src/plugins/irc/irc-upgrade.c
@@ -224,7 +224,8 @@ irc_upgrade_save ()
int rc;
struct t_upgrade_file *upgrade_file;
- upgrade_file = weechat_upgrade_new (IRC_UPGRADE_FILENAME, 1);
+ upgrade_file = weechat_upgrade_new (IRC_UPGRADE_FILENAME,
+ NULL, NULL, NULL);
if (!upgrade_file)
return 0;
@@ -269,7 +270,7 @@ irc_upgrade_set_buffer_callbacks ()
if (ptr_server)
{
weechat_buffer_set_pointer (ptr_buffer,
- "nickcmp_callback_data",
+ "nickcmp_callback_pointer",
ptr_server);
}
}
@@ -289,7 +290,7 @@ irc_upgrade_set_buffer_callbacks ()
*/
int
-irc_upgrade_read_cb (void *data,
+irc_upgrade_read_cb (const void *pointer, void *data,
struct t_upgrade_file *upgrade_file,
int object_id,
struct t_infolist *infolist)
@@ -306,6 +307,7 @@ irc_upgrade_read_cb (void *data,
struct t_gui_buffer *ptr_buffer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) upgrade_file;
@@ -354,10 +356,12 @@ irc_upgrade_read_cb (void *data,
if (sock >= 0)
{
irc_upgrade_current_server->sock = sock;
- irc_upgrade_current_server->hook_fd = weechat_hook_fd (irc_upgrade_current_server->sock,
- 1, 0, 0,
- &irc_server_recv_cb,
- irc_upgrade_current_server);
+ irc_upgrade_current_server->hook_fd = weechat_hook_fd (
+ irc_upgrade_current_server->sock,
+ 1, 0, 0,
+ &irc_server_recv_cb,
+ irc_upgrade_current_server,
+ NULL);
}
irc_upgrade_current_server->is_connected = weechat_infolist_integer (infolist, "is_connected");
irc_upgrade_current_server->ssl_connected = weechat_infolist_integer (infolist, "ssl_connected");
@@ -734,10 +738,13 @@ irc_upgrade_load ()
irc_upgrade_set_buffer_callbacks ();
- upgrade_file = weechat_upgrade_new (IRC_UPGRADE_FILENAME, 0);
+ upgrade_file = weechat_upgrade_new (IRC_UPGRADE_FILENAME,
+ &irc_upgrade_read_cb, NULL, NULL);
if (!upgrade_file)
return 0;
- rc = weechat_upgrade_read (upgrade_file, &irc_upgrade_read_cb, NULL);
+
+ rc = weechat_upgrade_read (upgrade_file);
+
weechat_upgrade_close (upgrade_file);
return rc;
diff --git a/src/plugins/irc/irc.c b/src/plugins/irc/irc.c
index 934df21ce..a75c9b48a 100644
--- a/src/plugins/irc/irc.c
+++ b/src/plugins/irc/irc.c
@@ -64,12 +64,14 @@ int irc_signal_upgrade_received = 0; /* signal "upgrade" received ? */
*/
int
-irc_signal_quit_cb (void *data, const char *signal, const char *type_data,
+irc_signal_quit_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
struct t_irc_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
@@ -92,13 +94,15 @@ irc_signal_quit_cb (void *data, const char *signal, const char *type_data,
*/
int
-irc_signal_upgrade_cb (void *data, const char *signal, const char *type_data,
+irc_signal_upgrade_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
struct t_irc_server *ptr_server;
int quit, ssl_disconnected;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -179,21 +183,32 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
/* hook some signals */
irc_debug_init ();
- weechat_hook_signal ("quit", &irc_signal_quit_cb, NULL);
- weechat_hook_signal ("upgrade", &irc_signal_upgrade_cb, NULL);
- weechat_hook_signal ("xfer_send_ready", &irc_server_xfer_send_ready_cb, NULL);
- weechat_hook_signal ("xfer_resume_ready", &irc_server_xfer_resume_ready_cb, NULL);
- weechat_hook_signal ("xfer_send_accept_resume", &irc_server_xfer_send_accept_resume_cb, NULL);
- weechat_hook_signal ("irc_input_send", &irc_input_send_cb, NULL);
+ weechat_hook_signal ("quit",
+ &irc_signal_quit_cb, NULL, NULL);
+ weechat_hook_signal ("upgrade",
+ &irc_signal_upgrade_cb, NULL, NULL);
+ weechat_hook_signal ("xfer_send_ready",
+ &irc_server_xfer_send_ready_cb, NULL, NULL);
+ weechat_hook_signal ("xfer_resume_ready",
+ &irc_server_xfer_resume_ready_cb, NULL, NULL);
+ weechat_hook_signal ("xfer_send_accept_resume",
+ &irc_server_xfer_send_accept_resume_cb, NULL, NULL);
+ weechat_hook_signal ("irc_input_send",
+ &irc_input_send_cb, NULL, NULL);
/* hook hsignals for redirection */
- weechat_hook_hsignal ("irc_redirect_pattern", &irc_redirect_pattern_hsignal_cb, NULL);
- weechat_hook_hsignal ("irc_redirect_command", &irc_redirect_command_hsignal_cb, NULL);
+ weechat_hook_hsignal ("irc_redirect_pattern",
+ &irc_redirect_pattern_hsignal_cb, NULL, NULL);
+ weechat_hook_hsignal ("irc_redirect_command",
+ &irc_redirect_command_hsignal_cb, NULL, NULL);
/* modifiers */
- weechat_hook_modifier ("irc_color_decode", &irc_color_modifier_cb, NULL);
- weechat_hook_modifier ("irc_color_encode", &irc_color_modifier_cb, NULL);
- weechat_hook_modifier ("irc_color_decode_ansi", &irc_color_modifier_cb, NULL);
+ weechat_hook_modifier ("irc_color_decode",
+ &irc_color_modifier_cb, NULL, NULL);
+ weechat_hook_modifier ("irc_color_encode",
+ &irc_color_modifier_cb, NULL, NULL);
+ weechat_hook_modifier ("irc_color_decode_ansi",
+ &irc_color_modifier_cb, NULL, NULL);
/* hook completions */
irc_completion_init ();
@@ -245,7 +260,8 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
}
irc_hook_timer = weechat_hook_timer (1 * 1000, 0, 0,
- &irc_server_timer_cb, NULL);
+ &irc_server_timer_cb,
+ NULL, NULL);
return WEECHAT_RC_OK;
}
diff --git a/src/plugins/javascript/weechat-js-api.cpp b/src/plugins/javascript/weechat-js-api.cpp
index 67f4471b3..a95259ff1 100644
--- a/src/plugins/javascript/weechat-js-api.cpp
+++ b/src/plugins/javascript/weechat-js-api.cpp
@@ -32,7 +32,6 @@ extern "C"
#include "../weechat-plugin.h"
#include "../plugin-script.h"
#include "../plugin-script-api.h"
-#include "../plugin-script-callback.h"
}
#include "weechat-js.h"
@@ -719,25 +718,27 @@ API_FUNC(list_free)
}
int
-weechat_js_api_config_reload_cb (void *data, struct t_config_file *config_file)
+weechat_js_api_config_reload_cb (const void *pointer, void *data,
+ struct t_config_file *config_file)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "ss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "ss", func_argv);
if (!rc)
ret = WEECHAT_CONFIG_READ_FILE_NOT_FOUND;
@@ -777,31 +778,32 @@ API_FUNC(config_new)
}
int
-weechat_js_api_config_read_cb (void *data,
+weechat_js_api_config_read_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = (option_name) ? (char *)option_name : empty_arg;
func_argv[4] = (value) ? (char *)value : empty_arg;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "sssss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "sssss", func_argv);
if (!rc)
ret = WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -822,28 +824,29 @@ weechat_js_api_config_read_cb (void *data,
}
int
-weechat_js_api_config_section_write_cb (void *data,
+weechat_js_api_config_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = (section_name) ? (char *)section_name : empty_arg;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "sss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "sss", func_argv);
if (!rc)
ret = WEECHAT_CONFIG_WRITE_ERROR;
@@ -862,28 +865,29 @@ weechat_js_api_config_section_write_cb (void *data,
}
int
-weechat_js_api_config_section_write_default_cb (void *data,
+weechat_js_api_config_section_write_default_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = (section_name) ? (char *)section_name : empty_arg;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "sss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "sss", func_argv);
if (!rc)
ret = WEECHAT_CONFIG_WRITE_ERROR;
@@ -902,32 +906,33 @@ weechat_js_api_config_section_write_default_cb (void *data,
}
int
-weechat_js_api_config_section_create_option_cb (void *data,
+weechat_js_api_config_section_create_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = (option_name) ? (char *)option_name : empty_arg;
func_argv[4] = (value) ? (char *)value : empty_arg;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "sssss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "sssss", func_argv);
if (!rc)
ret = WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -948,30 +953,31 @@ weechat_js_api_config_section_create_option_cb (void *data,
}
int
-weechat_js_api_config_section_delete_option_cb (void *data,
+weechat_js_api_config_section_delete_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = API_PTR2STR(option);
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "ssss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "ssss", func_argv);
if (!rc)
ret = WEECHAT_CONFIG_OPTION_UNSET_ERROR;
@@ -1060,28 +1066,29 @@ API_FUNC(config_search_section)
}
int
-weechat_js_api_config_option_check_value_cb (void *data,
+weechat_js_api_config_option_check_value_cb (const void *pointer, void *data,
struct t_config_option *option,
const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
func_argv[2] = (value) ? (char *)value : empty_arg;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "sss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "sss", func_argv);
if (!rc)
ret = 0;
@@ -1100,26 +1107,27 @@ weechat_js_api_config_option_check_value_cb (void *data,
}
void
-weechat_js_api_config_option_change_cb (void *data,
+weechat_js_api_config_option_change_cb (const void *pointer, void *data,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "ss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "ss", func_argv);
if (func_argv[1])
free (func_argv[1]);
@@ -1130,26 +1138,27 @@ weechat_js_api_config_option_change_cb (void *data,
}
void
-weechat_js_api_config_option_delete_cb (void *data,
+weechat_js_api_config_option_delete_cb (const void *pointer, void *data,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "ss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "ss", func_argv);
if (func_argv[1])
free (func_argv[1]);
@@ -1536,9 +1545,7 @@ API_FUNC(config_option_free)
v8::String::Utf8Value option(args[0]);
- plugin_script_api_config_option_free (
- weechat_js_plugin,
- js_current_script,
+ weechat_config_option_free (
(struct t_config_option *)API_STR2PTR(*option));
API_RETURN_OK;
@@ -1550,9 +1557,7 @@ API_FUNC(config_section_free_options)
v8::String::Utf8Value section(args[0]);
- plugin_script_api_config_section_free_options (
- weechat_js_plugin,
- js_current_script,
+ weechat_config_section_free_options (
(struct t_config_section *)API_STR2PTR(*section));
API_RETURN_OK;
@@ -1564,9 +1569,7 @@ API_FUNC(config_section_free)
v8::String::Utf8Value section(args[0]);
- plugin_script_api_config_section_free (
- weechat_js_plugin,
- js_current_script,
+ weechat_config_section_free (
(struct t_config_section *)API_STR2PTR(*section));
API_RETURN_OK;
@@ -1578,10 +1581,7 @@ API_FUNC(config_free)
v8::String::Utf8Value config_file(args[0]);
- plugin_script_api_config_free (
- weechat_js_plugin,
- js_current_script,
- (struct t_config_file *)API_STR2PTR(*config_file));
+ weechat_config_free ((struct t_config_file *)API_STR2PTR(*config_file));
API_RETURN_OK;
}
@@ -1809,30 +1809,32 @@ API_FUNC(log_print)
}
int
-weechat_js_api_hook_command_cb (void *data, struct t_gui_buffer *buffer,
+weechat_js_api_hook_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
/* make C++ compiler happy */
(void) argv;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (argc > 1) ? argv_eol[1] : empty_arg;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "sss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "sss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -1880,27 +1882,29 @@ API_FUNC(hook_command)
}
int
-weechat_js_api_hook_command_run_cb (void *data, struct t_gui_buffer *buffer,
+weechat_js_api_hook_command_run_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *command)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (command) ? (char *)command : empty_arg;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "sss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "sss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -1941,28 +1945,30 @@ API_FUNC(hook_command_run)
}
int
-weechat_js_api_hook_timer_cb (void *data, int remaining_calls)
+weechat_js_api_hook_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char str_remaining_calls[32], empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_remaining_calls, sizeof (str_remaining_calls),
"%d", remaining_calls);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_remaining_calls;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "ss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "ss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -2006,27 +2012,28 @@ API_FUNC(hook_timer)
}
int
-weechat_js_api_hook_fd_cb (void *data, int fd)
+weechat_js_api_hook_fd_cb (const void *pointer, void *data, int fd)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char str_fd[32], empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_fd, sizeof (str_fd), "%d", fd);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_fd;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "ss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "ss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -2072,30 +2079,31 @@ API_FUNC(hook_fd)
}
int
-weechat_js_api_hook_process_cb (void *data,
+weechat_js_api_hook_process_cb (const void *pointer, void *data,
const char *command, int return_code,
const char *out, const char *err)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (command) ? (char *)command : empty_arg;
func_argv[2] = &return_code;
func_argv[3] = (out) ? (char *)out : empty_arg;
func_argv[4] = (err) ? (char *)err : empty_arg;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "ssiss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "ssiss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -2172,36 +2180,38 @@ API_FUNC(hook_process_hashtable)
}
int
-weechat_js_api_hook_connect_cb (void *data, int status, int gnutls_rc,
+weechat_js_api_hook_connect_cb (const void *pointer, void *data,
+ int status, int gnutls_rc,
int sock, const char *error,
const char *ip_address)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[6];
char str_status[32], str_gnutls_rc[32], str_sock[32];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_status, sizeof (str_status), "%d", status);
snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc);
snprintf (str_sock, sizeof (str_sock), "%d", sock);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_status;
func_argv[2] = str_gnutls_rc;
func_argv[3] = str_sock;
func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg;
func_argv[5] = (error) ? (char *)error : empty_arg;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "ssssss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "ssssss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -2255,28 +2265,31 @@ API_FUNC(hook_connect)
}
int
-weechat_js_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
+weechat_js_api_hook_print_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
time_t date,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[8];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
static char timebuffer[64];
int *rc, ret;
/* make C compiler happy */
(void) tags_count;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)date);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = timebuffer;
func_argv[3] = weechat_string_build_with_split_string (tags, ",");
@@ -2287,11 +2300,10 @@ weechat_js_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
func_argv[6] = (prefix) ? (char *)prefix : empty_arg;
func_argv[7] = (message) ? (char *)message : empty_arg;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "ssssiiss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "ssssiiss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -2341,20 +2353,23 @@ API_FUNC(hook_print)
}
int
-weechat_js_api_hook_signal_cb (void *data, const char *signal,
+weechat_js_api_hook_signal_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
static char str_value[64];
int *rc, ret, free_needed;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (signal) ? (char *)signal : empty_arg;
free_needed = 0;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
@@ -2379,11 +2394,10 @@ weechat_js_api_hook_signal_cb (void *data, const char *signal,
else
func_argv[2] = empty_arg;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "sss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "sss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -2460,27 +2474,29 @@ API_FUNC(hook_signal_send)
}
int
-weechat_js_api_hook_hsignal_cb (void *data, const char *signal,
+weechat_js_api_hook_hsignal_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (signal) ? (char *)signal : empty_arg;
func_argv[2] = hashtable;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "ssh", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "ssh", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -2541,27 +2557,28 @@ API_FUNC(hook_hsignal_send)
}
int
-weechat_js_api_hook_config_cb (void *data, const char *option,
- const char *value)
+weechat_js_api_hook_config_cb (const void *pointer, void *data,
+ const char *option, const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (option) ? (char *)option : empty_arg;
func_argv[2] = (value) ? (char *)value : empty_arg;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "sss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "sss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -2600,29 +2617,31 @@ API_FUNC(hook_config)
}
int
-weechat_js_api_hook_completion_cb (void *data, const char *completion_item,
+weechat_js_api_hook_completion_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (completion_item) ? (char *)completion_item : empty_arg;
func_argv[2] = API_PTR2STR(buffer);
func_argv[3] = API_PTR2STR(completion);
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "ssss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "ssss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -2703,27 +2722,29 @@ API_FUNC(hook_completion_list_add)
}
char *
-weechat_js_api_hook_modifier_cb (void *data, const char *modifier,
+weechat_js_api_hook_modifier_cb (const void *pointer, void *data,
+ const char *modifier,
const char *modifier_data, const char *string)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (modifier) ? (char *)modifier : empty_arg;
func_argv[2] = (modifier_data) ? (char *)modifier_data : empty_arg;
func_argv[3] = (string) ? (char *)string : empty_arg;
- return (char *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
- "ssss", func_argv);
+ return (char *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_STRING,
+ ptr_function,
+ "ssss", func_argv);
}
return NULL;
@@ -2767,26 +2788,28 @@ API_FUNC(hook_modifier_exec)
}
const char *
-weechat_js_api_hook_info_cb (void *data, const char *info_name,
+weechat_js_api_hook_info_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (info_name) ? (char *)info_name : empty_arg;
func_argv[2] = (arguments) ? (char *)arguments : empty_arg;
- return (const char *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
- "sss", func_argv);
+ return (const char *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_STRING,
+ ptr_function,
+ "sss", func_argv);
}
return NULL;
@@ -2819,26 +2842,29 @@ API_FUNC(hook_info)
}
struct t_hashtable *
-weechat_js_api_hook_info_hashtable_cb (void *data, const char *info_name,
+weechat_js_api_hook_info_hashtable_cb (const void *pointer, void *data,
+ const char *info_name,
struct t_hashtable *hashtable)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
struct t_hashtable *ret_hashtable;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (info_name) ? (char *)info_name : empty_arg;
func_argv[2] = hashtable;
ret_hashtable = (struct t_hashtable *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
+ script,
WEECHAT_SCRIPT_EXEC_HASHTABLE,
- script_callback->function,
+ ptr_function,
"ssh", func_argv);
return ret_hashtable;
@@ -2876,27 +2902,30 @@ API_FUNC(hook_info_hashtable)
}
struct t_infolist *
-weechat_js_api_hook_infolist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+weechat_js_api_hook_infolist_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
struct t_infolist *result;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (infolist_name) ? (char *)infolist_name : empty_arg;
- func_argv[2] = API_PTR2STR(pointer);
+ func_argv[2] = API_PTR2STR(obj_pointer);
func_argv[3] = (arguments) ? (char *)arguments : empty_arg;
result = (struct t_infolist *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
+ script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (func_argv[2])
@@ -2937,25 +2966,27 @@ API_FUNC(hook_infolist)
}
struct t_hashtable *
-weechat_js_api_hook_focus_cb (void *data,
+weechat_js_api_hook_focus_cb (const void *pointer, void *data,
struct t_hashtable *info)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
struct t_hashtable *ret_hashtable;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = info;
ret_hashtable = (struct t_hashtable *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
+ script,
WEECHAT_SCRIPT_EXEC_HASHTABLE,
- script_callback->function,
+ ptr_function,
"sh", func_argv);
return ret_hashtable;
@@ -3005,9 +3036,7 @@ API_FUNC(unhook)
v8::String::Utf8Value hook(args[0]);
- plugin_script_api_unhook (weechat_js_plugin,
- js_current_script,
- (struct t_hook *)API_STR2PTR(*hook));
+ weechat_unhook ((struct t_hook *)API_STR2PTR(*hook));
API_RETURN_OK;
}
@@ -3018,33 +3047,35 @@ API_FUNC(unhook_all)
v8::String::Utf8Value hook(args[0]);
- plugin_script_api_unhook_all (weechat_js_plugin, js_current_script);
+ weechat_unhook_all_plugin (js_current_script->name);
API_RETURN_OK;
}
int
-weechat_js_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
+weechat_js_api_buffer_input_data_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (input_data) ? (char *)input_data : empty_arg;
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "sss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "sss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -3064,25 +3095,27 @@ weechat_js_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
}
int
-weechat_js_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+weechat_js_api_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "ss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "ss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -3181,10 +3214,7 @@ API_FUNC(buffer_close)
v8::String::Utf8Value buffer(args[0]);
- plugin_script_api_buffer_close (
- weechat_js_plugin,
- js_current_script,
- (struct t_gui_buffer *)API_STR2PTR(*buffer));
+ weechat_buffer_close ((struct t_gui_buffer *)API_STR2PTR(*buffer));
API_RETURN_OK;
}
@@ -3689,33 +3719,35 @@ API_FUNC(bar_item_search)
}
char *
-weechat_js_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
+weechat_js_api_bar_item_build_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' }, *ret;
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- if (strncmp (script_callback->function, "(extra)", 7) == 0)
+ if (strncmp (ptr_function, "(extra)", 7) == 0)
{
/* new callback: data, item, window, buffer, extra_info */
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(item);
func_argv[2] = API_PTR2STR(window);
func_argv[3] = API_PTR2STR(buffer);
func_argv[4] = extra_info;
- ret = (char *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function + 7,
- "ssssh", func_argv);
+ ret = (char *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_STRING,
+ ptr_function + 7,
+ "ssssh", func_argv);
if (func_argv[1])
free (func_argv[1]);
@@ -3727,15 +3759,14 @@ weechat_js_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
else
{
/* old callback: data, item, window */
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(item);
func_argv[2] = API_PTR2STR(window);
- ret = (char *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
- "sss", func_argv);
+ ret = (char *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_STRING,
+ ptr_function,
+ "sss", func_argv);
if (func_argv[1])
free (func_argv[1]);
@@ -3788,10 +3819,7 @@ API_FUNC(bar_item_remove)
v8::String::Utf8Value item(args[0]);
- plugin_script_api_bar_item_remove (
- weechat_js_plugin,
- js_current_script,
- (struct t_gui_bar_item *)API_STR2PTR(*item));
+ weechat_bar_item_remove ((struct t_gui_bar_item *)API_STR2PTR(*item));
API_RETURN_OK;
}
@@ -4567,66 +4595,34 @@ API_FUNC(hdata_get_string)
API_RETURN_STRING(result);
}
-API_FUNC(upgrade_new)
-{
- int write;
- char *result;
-
- API_INIT_FUNC(1, "upgrade_new", "si", API_RETURN_EMPTY);
-
- v8::String::Utf8Value filename(args[0]);
- write = args[1]->IntegerValue();
-
- result = API_PTR2STR(weechat_upgrade_new (*filename, write));
-
- API_RETURN_STRING_FREE(result);
-}
-
-API_FUNC(upgrade_write_object)
-{
- int object_id, rc;
-
- API_INIT_FUNC(1, "upgrade_write_object", "sis", API_RETURN_INT(0));
-
- v8::String::Utf8Value upgrade_file(args[0]);
- object_id = args[1]->IntegerValue();
- v8::String::Utf8Value infolist(args[2]);
-
- rc = weechat_upgrade_write_object (
- (struct t_upgrade_file *)API_STR2PTR(*upgrade_file),
- object_id,
- (struct t_infolist *)API_STR2PTR(*infolist));
-
- API_RETURN_INT(rc);
-}
-
int
-weechat_js_api_upgrade_read_cb (void *data,
+weechat_js_api_upgrade_read_cb (const void *pointer, void *data,
struct t_upgrade_file *upgrade_file,
int object_id,
struct t_infolist *infolist)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' }, str_object_id[32];
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_object_id, sizeof (str_object_id), "%d", object_id);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(upgrade_file);
func_argv[2] = str_object_id;
func_argv[3] = API_PTR2STR(infolist);
- rc = (int *)weechat_js_exec (
- (struct t_plugin_script *)script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "ssss", func_argv);
+ rc = (int *)weechat_js_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "ssss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -4646,23 +4642,56 @@ weechat_js_api_upgrade_read_cb (void *data,
return WEECHAT_RC_ERROR;
}
+API_FUNC(upgrade_new)
+{
+ char *result;
+
+ API_INIT_FUNC(1, "upgrade_new", "sss", API_RETURN_EMPTY);
+
+ v8::String::Utf8Value filename(args[0]);
+ v8::String::Utf8Value function(args[0]);
+ v8::String::Utf8Value data(args[0]);
+
+ result = API_PTR2STR(
+ plugin_script_api_upgrade_new (
+ weechat_js_plugin,
+ js_current_script,
+ *filename,
+ &weechat_js_api_upgrade_read_cb,
+ *function,
+ *data));
+
+ API_RETURN_STRING_FREE(result);
+}
+
+API_FUNC(upgrade_write_object)
+{
+ int object_id, rc;
+
+ API_INIT_FUNC(1, "upgrade_write_object", "sis", API_RETURN_INT(0));
+
+ v8::String::Utf8Value upgrade_file(args[0]);
+ object_id = args[1]->IntegerValue();
+ v8::String::Utf8Value infolist(args[2]);
+
+ rc = weechat_upgrade_write_object (
+ (struct t_upgrade_file *)API_STR2PTR(*upgrade_file),
+ object_id,
+ (struct t_infolist *)API_STR2PTR(*infolist));
+
+ API_RETURN_INT(rc);
+}
+
API_FUNC(upgrade_read)
{
int rc;
- API_INIT_FUNC(1, "upgrade_read", "sss", API_RETURN_INT(0));
+ API_INIT_FUNC(1, "upgrade_read", "s", API_RETURN_INT(0));
v8::String::Utf8Value upgrade_file(args[0]);
- v8::String::Utf8Value function(args[1]);
- v8::String::Utf8Value data(args[2]);
- rc = plugin_script_api_upgrade_read (
- weechat_js_plugin,
- js_current_script,
- (struct t_upgrade_file *)API_STR2PTR(*upgrade_file),
- &weechat_js_api_upgrade_read_cb,
- *function,
- *data);
+ rc = weechat_upgrade_read (
+ (struct t_upgrade_file *)API_STR2PTR(*upgrade_file));
API_RETURN_INT(rc);
}
diff --git a/src/plugins/javascript/weechat-js-api.h b/src/plugins/javascript/weechat-js-api.h
index 199296234..61e240362 100644
--- a/src/plugins/javascript/weechat-js-api.h
+++ b/src/plugins/javascript/weechat-js-api.h
@@ -21,10 +21,12 @@
#ifndef WEECHAT_JS_API_H
#define WEECHAT_JS_API_H 1
-extern int weechat_js_api_buffer_input_data_cb (void *data,
+extern int weechat_js_api_buffer_input_data_cb (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data);
-extern int weechat_js_api_buffer_close_cb (void *data,
+extern int weechat_js_api_buffer_close_cb (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer);
#endif /* WEECHAT_JS_API_H */
diff --git a/src/plugins/javascript/weechat-js.cpp b/src/plugins/javascript/weechat-js.cpp
index 927f76cb8..904d75b7a 100644
--- a/src/plugins/javascript/weechat-js.cpp
+++ b/src/plugins/javascript/weechat-js.cpp
@@ -516,12 +516,14 @@ weechat_js_reload_name (const char *name)
*/
int
-weechat_js_command_cb (void *data, struct t_gui_buffer *buffer,
+weechat_js_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
char *ptr_name, *path_script;
/* make C++ compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -615,11 +617,13 @@ weechat_js_command_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-weechat_js_completion_cb (void *data, const char *completion_item,
+weechat_js_completion_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* make C++ compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -634,9 +638,11 @@ weechat_js_completion_cb (void *data, const char *completion_item,
*/
struct t_hdata *
-weechat_js_hdata_cb (void *data, const char *hdata_name)
+weechat_js_hdata_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
/* make C++ compiler happy */
+ (void) pointer;
(void) data;
return plugin_script_hdata_script (weechat_plugin,
@@ -649,10 +655,12 @@ weechat_js_hdata_cb (void *data, const char *hdata_name)
*/
struct t_infolist *
-weechat_js_infolist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+weechat_js_infolist_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
/* make C++ compiler happy */
+ (void) pointer;
(void) data;
if (!infolist_name || !infolist_name[0])
@@ -661,7 +669,7 @@ weechat_js_infolist_cb (void *data, const char *infolist_name,
if (weechat_strcasecmp (infolist_name, "javascript_script") == 0)
{
return plugin_script_infolist_list_scripts (weechat_js_plugin,
- js_scripts, pointer,
+ js_scripts, obj_pointer,
arguments);
}
@@ -673,10 +681,12 @@ weechat_js_infolist_cb (void *data, const char *infolist_name,
*/
int
-weechat_js_signal_debug_dump_cb (void *data, const char *signal,
+weechat_js_signal_debug_dump_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C++ compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -695,10 +705,12 @@ weechat_js_signal_debug_dump_cb (void *data, const char *signal,
*/
int
-weechat_js_signal_debug_libs_cb (void *data, const char *signal,
+weechat_js_signal_debug_libs_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C++ compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -711,40 +723,20 @@ weechat_js_signal_debug_libs_cb (void *data, const char *signal,
}
/*
- * Callback called when a buffer is closed.
- */
-
-int
-weechat_js_signal_buffer_closed_cb (void *data, const char *signal,
- const char *type_data, void *signal_data)
-{
- /* make C++ compiler happy */
- (void) data;
- (void) signal;
- (void) type_data;
-
- if (signal_data)
- {
- plugin_script_remove_buffer_callbacks (js_scripts,
- (struct t_gui_buffer *)signal_data);
- }
-
- return WEECHAT_RC_OK;
-}
-
-/*
* Timer for executing actions.
*/
int
-weechat_js_timer_action_cb (void *data, int remaining_calls)
+weechat_js_timer_action_cb (const void *pointer, void *data,
+ int remaining_calls)
{
/* make C++ compiler happy */
+ (void) data;
(void) remaining_calls;
- if (data)
+ if (pointer)
{
- if (data == &js_action_install_list)
+ if (pointer == &js_action_install_list)
{
plugin_script_action_install (weechat_js_plugin,
js_scripts,
@@ -753,7 +745,7 @@ weechat_js_timer_action_cb (void *data, int remaining_calls)
&js_quiet,
&js_action_install_list);
}
- else if (data == &js_action_remove_list)
+ else if (pointer == &js_action_remove_list)
{
plugin_script_action_remove (weechat_js_plugin,
js_scripts,
@@ -761,7 +753,7 @@ weechat_js_timer_action_cb (void *data, int remaining_calls)
&js_quiet,
&js_action_remove_list);
}
- else if (data == &js_action_autoload_list)
+ else if (pointer == &js_action_autoload_list)
{
plugin_script_action_autoload (weechat_js_plugin,
&js_quiet,
@@ -778,11 +770,13 @@ weechat_js_timer_action_cb (void *data, int remaining_calls)
*/
int
-weechat_js_signal_script_action_cb (void *data, const char *signal,
+weechat_js_signal_script_action_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data)
{
/* make C++ compiler happy */
+ (void) pointer;
(void) data;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
@@ -793,7 +787,7 @@ weechat_js_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_js_timer_action_cb,
- &js_action_install_list);
+ &js_action_install_list, NULL);
}
else if (strcmp (signal, "javascript_script_remove") == 0)
{
@@ -801,7 +795,7 @@ weechat_js_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_js_timer_action_cb,
- &js_action_remove_list);
+ &js_action_remove_list, NULL);
}
else if (strcmp (signal, "javascript_script_autoload") == 0)
{
@@ -809,7 +803,7 @@ weechat_js_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_js_timer_action_cb,
- &js_action_autoload_list);
+ &js_action_autoload_list, NULL);
}
}
@@ -833,7 +827,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
init.callback_infolist = &weechat_js_infolist_cb;
init.callback_signal_debug_dump = &weechat_js_signal_debug_dump_cb;
init.callback_signal_debug_libs = &weechat_js_signal_debug_libs_cb;
- init.callback_signal_buffer_closed = &weechat_js_signal_buffer_closed_cb;
init.callback_signal_script_action = &weechat_js_signal_script_action_cb;
init.callback_load_file = &weechat_js_load_cb;
diff --git a/src/plugins/logger/logger-config.c b/src/plugins/logger/logger-config.c
index f91f7887b..478201d15 100644
--- a/src/plugins/logger/logger-config.c
+++ b/src/plugins/logger/logger-config.c
@@ -62,10 +62,11 @@ struct t_config_option *logger_config_file_time_format;
*/
void
-logger_config_change_file_option_restart_log (void *data,
+logger_config_change_file_option_restart_log (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -78,10 +79,11 @@ logger_config_change_file_option_restart_log (void *data,
*/
void
-logger_config_flush_delay_change (void *data,
+logger_config_flush_delay_change (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -112,7 +114,7 @@ logger_config_flush_delay_change (void *data,
}
logger_timer = weechat_hook_timer (weechat_config_integer (logger_config_file_flush_delay) * 1000,
0, 0,
- &logger_timer_cb, NULL);
+ &logger_timer_cb, NULL, NULL);
}
}
@@ -121,10 +123,11 @@ logger_config_flush_delay_change (void *data,
*/
void
-logger_config_level_change (void *data,
+logger_config_level_change (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -137,12 +140,13 @@ logger_config_level_change (void *data,
*/
int
-logger_config_level_delete_option (void *data,
+logger_config_level_delete_option (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -159,7 +163,7 @@ logger_config_level_delete_option (void *data,
*/
int
-logger_config_level_create_option (void *data,
+logger_config_level_create_option (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
@@ -169,6 +173,7 @@ logger_config_level_create_option (void *data,
int rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
rc = WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -196,9 +201,10 @@ logger_config_level_create_option (void *data,
option_name, "integer",
_("logging level for this buffer (0 = logging disabled, "
"1 = a few messages (most important) .. 9 = all messages)"),
- NULL, 0, 9, "9", value, 0, NULL, NULL,
- &logger_config_level_change, NULL,
- NULL, NULL);
+ NULL, 0, 9, "9", value, 0,
+ NULL, NULL, NULL,
+ &logger_config_level_change, NULL, NULL,
+ NULL, NULL, NULL);
rc = (ptr_option) ?
WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
}
@@ -232,7 +238,7 @@ logger_config_get_level (const char *name)
int
logger_config_set_level (const char *name, const char *value)
{
- return logger_config_level_create_option (NULL,
+ return logger_config_level_create_option (NULL, NULL,
logger_config_file,
logger_config_section_level,
name,
@@ -244,10 +250,11 @@ logger_config_set_level (const char *name, const char *value)
*/
void
-logger_config_mask_change (void *data,
+logger_config_mask_change (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -260,12 +267,13 @@ logger_config_mask_change (void *data,
*/
int
-logger_config_mask_delete_option (void *data,
+logger_config_mask_delete_option (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -282,7 +290,7 @@ logger_config_mask_delete_option (void *data,
*/
int
-logger_config_mask_create_option (void *data,
+logger_config_mask_create_option (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
@@ -292,6 +300,7 @@ logger_config_mask_create_option (void *data,
int rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
rc = WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -319,9 +328,10 @@ logger_config_mask_create_option (void *data,
option_name, "string",
_("file mask for log file; local buffer variables are "
"permitted"),
- NULL, 0, 0, "", value, 0, NULL, NULL,
- &logger_config_mask_change, NULL,
- NULL, NULL);
+ NULL, 0, 0, "", value, 0,
+ NULL, NULL, NULL,
+ &logger_config_mask_change, NULL, NULL,
+ NULL, NULL, NULL);
rc = (ptr_option) ?
WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
}
@@ -362,16 +372,18 @@ logger_config_init ()
struct t_config_section *ptr_section;
logger_config_file = weechat_config_new (LOGGER_CONFIG_NAME,
- NULL, NULL);
+ NULL, NULL, NULL);
if (!logger_config_file)
return 0;
/* look */
ptr_section = weechat_config_new_section (logger_config_file, "look",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (logger_config_file);
@@ -383,14 +395,17 @@ logger_config_init ()
"backlog", "integer",
N_("maximum number of lines to display from log file when creating "
"new buffer (0 = no backlog)"),
- NULL, 0, INT_MAX, "20", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, INT_MAX, "20", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* color */
ptr_section = weechat_config_new_section (logger_config_file, "color",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (logger_config_file);
@@ -401,19 +416,23 @@ logger_config_init ()
logger_config_file, ptr_section,
"backlog_end", "color",
N_("color for line ending the backlog"),
- NULL, -1, 0, "default", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, -1, 0, "default", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
logger_config_color_backlog_line = weechat_config_new_option (
logger_config_file, ptr_section,
"backlog_line", "color",
N_("color for backlog lines"),
- NULL, -1, 0, "default", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, -1, 0, "default", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* file */
ptr_section = weechat_config_new_section (logger_config_file, "file",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (logger_config_file);
@@ -425,20 +444,24 @@ logger_config_init ()
"auto_log", "boolean",
N_("automatically save content of buffers to files (unless a buffer "
"disables log)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
logger_config_file_flush_delay = weechat_config_new_option (
logger_config_file, ptr_section,
"flush_delay", "integer",
N_("number of seconds between flush of log files (0 = write in log "
"files immediately for each line printed)"),
- NULL, 0, 3600, "120", NULL, 0, NULL, NULL,
- &logger_config_flush_delay_change, NULL, NULL, NULL);
+ NULL, 0, 3600, "120", NULL, 0,
+ NULL, NULL, NULL,
+ &logger_config_flush_delay_change, NULL, NULL,
+ NULL, NULL, NULL);
logger_config_file_info_lines = weechat_config_new_option (
logger_config_file, ptr_section,
"info_lines", "boolean",
N_("write information line in log file when log starts or ends for a "
"buffer"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
logger_config_file_mask = weechat_config_new_option (
logger_config_file, ptr_section,
"mask", "string",
@@ -449,24 +472,30 @@ logger_config_init ()
"that are defined on all buffers, so for example you should NOT "
"use $server nor $channel); date specifiers are permitted "
"(see man strftime)"),
- NULL, 0, 0, "$plugin.$name.weechatlog", NULL, 0, NULL, NULL,
- &logger_config_change_file_option_restart_log, NULL, NULL, NULL);
+ NULL, 0, 0, "$plugin.$name.weechatlog", NULL, 0,
+ NULL, NULL, NULL,
+ &logger_config_change_file_option_restart_log, NULL, NULL,
+ NULL, NULL, NULL);
logger_config_file_name_lower_case = weechat_config_new_option (
logger_config_file, ptr_section,
"name_lower_case", "boolean",
N_("use only lower case for log filenames"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- &logger_config_change_file_option_restart_log, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &logger_config_change_file_option_restart_log, NULL, NULL,
+ NULL, NULL, NULL);
logger_config_file_nick_prefix = weechat_config_new_option (
logger_config_file, ptr_section,
"nick_prefix", "string",
N_("text to write before nick in prefix of message, example: \"<\""),
- NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
logger_config_file_nick_suffix = weechat_config_new_option (
logger_config_file, ptr_section,
"nick_suffix", "string",
N_("text to write after nick in prefix of message, example: \">\""),
- NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
logger_config_file_path = weechat_config_new_option (
logger_config_file, ptr_section,
"path", "string",
@@ -474,29 +503,36 @@ logger_config_init ()
"replaced by WeeChat home (\"~/.weechat\" by default); date "
"specifiers are permitted (see man strftime) "
"(note: content is evaluated, see /help eval)"),
- NULL, 0, 0, "%h/logs/", NULL, 0, NULL, NULL,
- &logger_config_change_file_option_restart_log, NULL, NULL, NULL);
+ NULL, 0, 0, "%h/logs/", NULL, 0,
+ NULL, NULL, NULL,
+ &logger_config_change_file_option_restart_log, NULL, NULL,
+ NULL, NULL, NULL);
logger_config_file_replacement_char = weechat_config_new_option (
logger_config_file, ptr_section,
"replacement_char", "string",
N_("replacement char for special chars in filename built with mask "
"(like directory delimiter)"),
- NULL, 0, 0, "_", NULL, 0, NULL, NULL,
- &logger_config_change_file_option_restart_log, NULL, NULL, NULL);
+ NULL, 0, 0, "_", NULL, 0,
+ NULL, NULL, NULL,
+ &logger_config_change_file_option_restart_log, NULL, NULL,
+ NULL, NULL, NULL);
logger_config_file_time_format = weechat_config_new_option (
logger_config_file, ptr_section,
"time_format", "string",
N_("timestamp used in log files (see man strftime for date/time "
"specifiers)"),
- NULL, 0, 0, "%Y-%m-%d %H:%M:%S", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "%Y-%m-%d %H:%M:%S", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* level */
- ptr_section = weechat_config_new_section (logger_config_file, "level",
- 1, 1,
- NULL, NULL, NULL, NULL,
- NULL, NULL,
- &logger_config_level_create_option, NULL,
- &logger_config_level_delete_option, NULL);
+ ptr_section = weechat_config_new_section (
+ logger_config_file, "level",
+ 1, 1,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &logger_config_level_create_option, NULL, NULL,
+ &logger_config_level_delete_option, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (logger_config_file);
@@ -506,12 +542,14 @@ logger_config_init ()
logger_config_section_level = ptr_section;
/* mask */
- ptr_section = weechat_config_new_section (logger_config_file, "mask",
- 1, 1,
- NULL, NULL, NULL, NULL,
- NULL, NULL,
- &logger_config_mask_create_option, NULL,
- &logger_config_mask_delete_option, NULL);
+ ptr_section = weechat_config_new_section (
+ logger_config_file, "mask",
+ 1, 1,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &logger_config_mask_create_option, NULL, NULL,
+ &logger_config_mask_delete_option, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (logger_config_file);
@@ -536,7 +574,7 @@ logger_config_read ()
rc = weechat_config_read (logger_config_file);
logger_config_loading = 0;
- logger_config_flush_delay_change (NULL, NULL);
+ logger_config_flush_delay_change (NULL, NULL, NULL);
return rc;
}
diff --git a/src/plugins/logger/logger-info.c b/src/plugins/logger/logger-info.c
index dd0f3ae60..4eb0a0202 100644
--- a/src/plugins/logger/logger-info.c
+++ b/src/plugins/logger/logger-info.c
@@ -32,28 +32,31 @@
*/
struct t_infolist *
-logger_info_infolist_logger_buffer_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+logger_info_infolist_logger_buffer_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer,
+ const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_logger_buffer *ptr_logger_buffer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
(void) arguments;
- if (pointer && !logger_buffer_valid (pointer))
+ if (obj_pointer && !logger_buffer_valid (obj_pointer))
return NULL;
ptr_infolist = weechat_infolist_new ();
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one logger buffer */
- if (!logger_buffer_add_to_infolist (ptr_infolist, pointer))
+ if (!logger_buffer_add_to_infolist (ptr_infolist, obj_pointer))
{
weechat_infolist_free (ptr_infolist);
return NULL;
@@ -90,5 +93,5 @@ logger_info_init ()
"logger_buffer", N_("list of logger buffers"),
N_("logger pointer (optional)"),
NULL,
- &logger_info_infolist_logger_buffer_cb, NULL);
+ &logger_info_infolist_logger_buffer_cb, NULL, NULL);
}
diff --git a/src/plugins/logger/logger.c b/src/plugins/logger/logger.c
index 8b698470a..71378c1e3 100644
--- a/src/plugins/logger/logger.c
+++ b/src/plugins/logger/logger.c
@@ -856,10 +856,12 @@ logger_flush ()
*/
int
-logger_command_cb (void *data, struct t_gui_buffer *buffer,
+logger_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argv_eol;
@@ -897,10 +899,12 @@ logger_command_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-logger_buffer_opened_signal_cb (void *data, const char *signal,
+logger_buffer_opened_signal_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -915,10 +919,12 @@ logger_buffer_opened_signal_cb (void *data, const char *signal,
*/
int
-logger_buffer_closing_signal_cb (void *data, const char *signal,
+logger_buffer_closing_signal_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -933,10 +939,12 @@ logger_buffer_closing_signal_cb (void *data, const char *signal,
*/
int
-logger_buffer_renamed_signal_cb (void *data, const char *signal,
+logger_buffer_renamed_signal_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -1035,12 +1043,14 @@ logger_backlog (struct t_gui_buffer *buffer, const char *filename, int lines)
*/
int
-logger_backlog_signal_cb (void *data, const char *signal,
+logger_backlog_signal_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
struct t_logger_buffer *ptr_logger_buffer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -1074,10 +1084,12 @@ logger_backlog_signal_cb (void *data, const char *signal,
*/
int
-logger_start_signal_cb (void *data, const char *signal, const char *type_data,
+logger_start_signal_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -1092,12 +1104,14 @@ logger_start_signal_cb (void *data, const char *signal, const char *type_data,
*/
int
-logger_stop_signal_cb (void *data, const char *signal, const char *type_data,
+logger_stop_signal_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
struct t_logger_buffer *ptr_logger_buffer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -1158,10 +1172,12 @@ logger_adjust_log_filenames ()
*/
int
-logger_day_changed_signal_cb (void *data, const char *signal,
+logger_day_changed_signal_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -1226,7 +1242,8 @@ logger_get_line_tag_info (int tags_count, const char **tags,
*/
int
-logger_print_cb (void *data, struct t_gui_buffer *buffer, time_t date,
+logger_print_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, time_t date,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
@@ -1237,6 +1254,7 @@ logger_print_cb (void *data, struct t_gui_buffer *buffer, time_t date,
int line_log_level, prefix_is_nick;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) displayed;
(void) highlight;
@@ -1278,9 +1296,10 @@ logger_print_cb (void *data, struct t_gui_buffer *buffer, time_t date,
*/
int
-logger_timer_cb (void *data, int remaining_calls)
+logger_timer_cb (const void *pointer, void *data, int remaining_calls)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) remaining_calls;
@@ -1347,19 +1366,26 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
" || set 1|2|3|4|5|6|7|8|9"
" || flush"
" || disable",
- &logger_command_cb, NULL);
+ &logger_command_cb, NULL, NULL);
logger_start_buffer_all (1);
- weechat_hook_signal ("buffer_opened", &logger_buffer_opened_signal_cb, NULL);
- weechat_hook_signal ("buffer_closing", &logger_buffer_closing_signal_cb, NULL);
- weechat_hook_signal ("buffer_renamed", &logger_buffer_renamed_signal_cb, NULL);
- weechat_hook_signal ("logger_backlog", &logger_backlog_signal_cb, NULL);
- weechat_hook_signal ("logger_start", &logger_start_signal_cb, NULL);
- weechat_hook_signal ("logger_stop", &logger_stop_signal_cb, NULL);
- weechat_hook_signal ("day_changed", &logger_day_changed_signal_cb, NULL);
-
- weechat_hook_print (NULL, NULL, NULL, 1, &logger_print_cb, NULL);
+ weechat_hook_signal ("buffer_opened",
+ &logger_buffer_opened_signal_cb, NULL, NULL);
+ weechat_hook_signal ("buffer_closing",
+ &logger_buffer_closing_signal_cb, NULL, NULL);
+ weechat_hook_signal ("buffer_renamed",
+ &logger_buffer_renamed_signal_cb, NULL, NULL);
+ weechat_hook_signal ("logger_backlog",
+ &logger_backlog_signal_cb, NULL, NULL);
+ weechat_hook_signal ("logger_start",
+ &logger_start_signal_cb, NULL, NULL);
+ weechat_hook_signal ("logger_stop",
+ &logger_stop_signal_cb, NULL, NULL);
+ weechat_hook_signal ("day_changed",
+ &logger_day_changed_signal_cb, NULL, NULL);
+
+ weechat_hook_print (NULL, NULL, NULL, 1, &logger_print_cb, NULL, NULL);
logger_info_init ();
diff --git a/src/plugins/logger/logger.h b/src/plugins/logger/logger.h
index df3e0d8e0..195f7d8da 100644
--- a/src/plugins/logger/logger.h
+++ b/src/plugins/logger/logger.h
@@ -32,6 +32,7 @@ extern struct t_hook *logger_timer;
extern void logger_start_buffer_all (int write_info_line);
extern void logger_stop_all (int write_info_line);
extern void logger_adjust_log_filenames ();
-extern int logger_timer_cb (void *data, int remaining_calls);
+extern int logger_timer_cb (const void *pointer, void *data,
+ int remaining_calls);
#endif /* WEECHAT_LOGGER_H */
diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c
index ac9ad7397..1900aed0b 100644
--- a/src/plugins/lua/weechat-lua-api.c
+++ b/src/plugins/lua/weechat-lua-api.c
@@ -33,7 +33,6 @@
#include "../weechat-plugin.h"
#include "../plugin-script.h"
#include "../plugin-script-api.h"
-#include "../plugin-script-callback.h"
#include "weechat-lua.h"
@@ -782,24 +781,26 @@ API_FUNC(list_free)
}
int
-weechat_lua_api_config_reload_cb (void *data,
+weechat_lua_api_config_reload_cb (const void *pointer, void *data,
struct t_config_file *config_file)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -842,29 +843,31 @@ API_FUNC(config_new)
}
int
-weechat_lua_api_config_read_cb (void *data,
+weechat_lua_api_config_read_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = (option_name) ? (char *)option_name : empty_arg;
func_argv[4] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sssss", func_argv);
if (!rc)
@@ -886,26 +889,28 @@ weechat_lua_api_config_read_cb (void *data,
}
int
-weechat_lua_api_config_section_write_cb (void *data,
+weechat_lua_api_config_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = (section_name) ? (char *)section_name : empty_arg;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -925,26 +930,28 @@ weechat_lua_api_config_section_write_cb (void *data,
}
int
-weechat_lua_api_config_section_write_default_cb (void *data,
+weechat_lua_api_config_section_write_default_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = (section_name) ? (char *)section_name : empty_arg;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -964,30 +971,32 @@ weechat_lua_api_config_section_write_default_cb (void *data,
}
int
-weechat_lua_api_config_section_create_option_cb (void *data,
+weechat_lua_api_config_section_create_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = (option_name) ? (char *)option_name : empty_arg;
func_argv[4] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sssss", func_argv);
if (!rc)
@@ -1009,28 +1018,30 @@ weechat_lua_api_config_section_create_option_cb (void *data,
}
int
-weechat_lua_api_config_section_delete_option_cb (void *data,
+weechat_lua_api_config_section_delete_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = API_PTR2STR(option);
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -1082,27 +1093,29 @@ API_FUNC(config_new_section)
function_delete_option = lua_tostring (L, -2);
data_delete_option = lua_tostring (L, -1);
- result = API_PTR2STR(plugin_script_api_config_new_section (weechat_lua_plugin,
- lua_current_script,
- API_STR2PTR(config_file),
- name,
- user_can_add_options,
- user_can_delete_options,
- &weechat_lua_api_config_read_cb,
- function_read,
- data_read,
- &weechat_lua_api_config_section_write_cb,
- function_write,
- data_write,
- &weechat_lua_api_config_section_write_default_cb,
- function_write_default,
- data_write_default,
- &weechat_lua_api_config_section_create_option_cb,
- function_create_option,
- data_create_option,
- &weechat_lua_api_config_section_delete_option_cb,
- function_delete_option,
- data_delete_option));
+ result = API_PTR2STR(
+ plugin_script_api_config_new_section (
+ weechat_lua_plugin,
+ lua_current_script,
+ API_STR2PTR(config_file),
+ name,
+ user_can_add_options,
+ user_can_delete_options,
+ &weechat_lua_api_config_read_cb,
+ function_read,
+ data_read,
+ &weechat_lua_api_config_section_write_cb,
+ function_write,
+ data_write,
+ &weechat_lua_api_config_section_write_default_cb,
+ function_write_default,
+ data_write_default,
+ &weechat_lua_api_config_section_create_option_cb,
+ function_create_option,
+ data_create_option,
+ &weechat_lua_api_config_section_delete_option_cb,
+ function_delete_option,
+ data_delete_option));
API_RETURN_STRING_FREE(result);
}
@@ -1126,26 +1139,28 @@ API_FUNC(config_search_section)
}
int
-weechat_lua_api_config_option_check_value_cb (void *data,
+weechat_lua_api_config_option_check_value_cb (const void *pointer, void *data,
struct t_config_option *option,
const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
func_argv[2] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -1165,24 +1180,26 @@ weechat_lua_api_config_option_check_value_cb (void *data,
}
void
-weechat_lua_api_config_option_change_cb (void *data,
+weechat_lua_api_config_option_change_cb (const void *pointer, void *data,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (func_argv[1])
@@ -1194,24 +1211,26 @@ weechat_lua_api_config_option_change_cb (void *data,
}
void
-weechat_lua_api_config_option_delete_cb (void *data,
+weechat_lua_api_config_option_delete_cb (const void *pointer, void *data,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (func_argv[1])
@@ -1655,9 +1674,7 @@ API_FUNC(config_option_free)
option = lua_tostring (L, -1);
- plugin_script_api_config_option_free (weechat_lua_plugin,
- lua_current_script,
- API_STR2PTR(option));
+ weechat_config_option_free (API_STR2PTR(option));
API_RETURN_OK;
}
@@ -1672,9 +1689,7 @@ API_FUNC(config_section_free_options)
section = lua_tostring (L, -1);
- plugin_script_api_config_section_free_options (weechat_lua_plugin,
- lua_current_script,
- API_STR2PTR(section));
+ weechat_config_section_free_options (API_STR2PTR(section));
API_RETURN_OK;
}
@@ -1689,9 +1704,7 @@ API_FUNC(config_section_free)
section = lua_tostring (L, -1);
- plugin_script_api_config_section_free (weechat_lua_plugin,
- lua_current_script,
- API_STR2PTR(section));
+ weechat_config_section_free (API_STR2PTR(section));
API_RETURN_OK;
}
@@ -1706,9 +1719,7 @@ API_FUNC(config_free)
config_file = lua_tostring (L, -1);
- plugin_script_api_config_free (weechat_lua_plugin,
- lua_current_script,
- API_STR2PTR(config_file));
+ weechat_config_free (API_STR2PTR(config_file));
API_RETURN_OK;
}
@@ -1975,28 +1986,31 @@ API_FUNC(log_print)
}
int
-weechat_lua_api_hook_command_cb (void *data, struct t_gui_buffer *buffer,
+weechat_lua_api_hook_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
/* make C compiler happy */
(void) argv;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (argc > 1) ? argv_eol[1] : empty_arg;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2048,25 +2062,28 @@ API_FUNC(hook_command)
}
int
-weechat_lua_api_hook_command_run_cb (void *data, struct t_gui_buffer *buffer,
+weechat_lua_api_hook_command_run_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *command)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (command) ? (char *)command : empty_arg;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2109,26 +2126,29 @@ API_FUNC(hook_command_run)
}
int
-weechat_lua_api_hook_timer_cb (void *data, int remaining_calls)
+weechat_lua_api_hook_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char str_remaining_calls[32], empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_remaining_calls, sizeof (str_remaining_calls),
"%d", remaining_calls);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_remaining_calls;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -2174,25 +2194,27 @@ API_FUNC(hook_timer)
}
int
-weechat_lua_api_hook_fd_cb (void *data, int fd)
+weechat_lua_api_hook_fd_cb (const void *pointer, void *data, int fd)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char str_fd[32], empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_fd, sizeof (str_fd), "%d", fd);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_fd;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -2240,28 +2262,30 @@ API_FUNC(hook_fd)
}
int
-weechat_lua_api_hook_process_cb (void *data,
+weechat_lua_api_hook_process_cb (const void *pointer, void *data,
const char *command, int return_code,
const char *out, const char *err)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (command) ? (char *)command : empty_arg;
func_argv[2] = &return_code;
func_argv[3] = (out) ? (char *)out : empty_arg;
func_argv[4] = (err) ? (char *)err : empty_arg;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssiss", func_argv);
if (!rc)
@@ -2340,34 +2364,37 @@ API_FUNC(hook_process_hashtable)
}
int
-weechat_lua_api_hook_connect_cb (void *data, int status, int gnutls_rc,
+weechat_lua_api_hook_connect_cb (const void *pointer, void *data,
+ int status, int gnutls_rc,
int sock, const char *error,
const char *ip_address)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[6];
char str_status[32], str_gnutls_rc[32], str_sock[32];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_status, sizeof (str_status), "%d", status);
snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc);
snprintf (str_sock, sizeof (str_sock), "%d", sock);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_status;
func_argv[2] = str_gnutls_rc;
func_argv[3] = str_sock;
func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg;
func_argv[5] = (error) ? (char *)error : empty_arg;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssssss", func_argv);
if (!rc)
@@ -2423,28 +2450,31 @@ API_FUNC(hook_connect)
}
int
-weechat_lua_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
+weechat_lua_api_hook_print_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
time_t date,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[8];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
static char timebuffer[64];
int *rc, ret;
/* make C compiler happy */
(void) tags_count;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)date);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = timebuffer;
func_argv[3] = weechat_string_build_with_split_string (tags, ",");
@@ -2455,9 +2485,9 @@ weechat_lua_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
func_argv[6] = (prefix) ? (char *)prefix : empty_arg;
func_argv[7] = (message) ? (char *)message : empty_arg;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssssiiss", func_argv);
if (!rc)
@@ -2509,20 +2539,23 @@ API_FUNC(hook_print)
}
int
-weechat_lua_api_hook_signal_cb (void *data, const char *signal,
+weechat_lua_api_hook_signal_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
static char str_value[64];
int *rc, ret, free_needed;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (signal) ? (char *)signal : empty_arg;
free_needed = 0;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
@@ -2547,9 +2580,9 @@ weechat_lua_api_hook_signal_cb (void *data, const char *signal,
else
func_argv[2] = empty_arg;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2629,25 +2662,28 @@ API_FUNC(hook_signal_send)
}
int
-weechat_lua_api_hook_hsignal_cb (void *data, const char *signal,
+weechat_lua_api_hook_hsignal_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (signal) ? (char *)signal : empty_arg;
func_argv[2] = hashtable;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssh", func_argv);
if (!rc)
@@ -2712,25 +2748,27 @@ API_FUNC(hook_hsignal_send)
}
int
-weechat_lua_api_hook_config_cb (void *data, const char *option,
- const char *value)
+weechat_lua_api_hook_config_cb (const void *pointer, void *data,
+ const char *option, const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (option) ? (char *)option : empty_arg;
func_argv[2] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2771,27 +2809,30 @@ API_FUNC(hook_config)
}
int
-weechat_lua_api_hook_completion_cb (void *data, const char *completion_item,
+weechat_lua_api_hook_completion_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (completion_item) ? (char *)completion_item : empty_arg;
func_argv[2] = API_PTR2STR(buffer);
func_argv[3] = API_PTR2STR(completion);
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -2877,26 +2918,29 @@ API_FUNC(hook_completion_list_add)
}
char *
-weechat_lua_api_hook_modifier_cb (void *data, const char *modifier,
+weechat_lua_api_hook_modifier_cb (const void *pointer, void *data,
+ const char *modifier,
const char *modifier_data,
const char *string)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (modifier) ? (char *)modifier : empty_arg;
func_argv[2] = (modifier_data) ? (char *)modifier_data : empty_arg;
func_argv[3] = (string) ? (char *)string : empty_arg;
- return (char *)weechat_lua_exec (script_callback->script,
+ return (char *)weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
}
@@ -2945,24 +2989,27 @@ API_FUNC(hook_modifier_exec)
}
const char *
-weechat_lua_api_hook_info_cb (void *data, const char *info_name,
+weechat_lua_api_hook_info_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (info_name) ? (char *)info_name : empty_arg;
func_argv[2] = (arguments) ? (char *)arguments : empty_arg;
- return (const char *)weechat_lua_exec (script_callback->script,
+ return (const char *)weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
}
@@ -2997,25 +3044,29 @@ API_FUNC(hook_info)
}
struct t_hashtable *
-weechat_lua_api_hook_info_hashtable_cb (void *data, const char *info_name,
+weechat_lua_api_hook_info_hashtable_cb (const void *pointer, void *data,
+ const char *info_name,
struct t_hashtable *hashtable)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (info_name) ? (char *)info_name : empty_arg;
func_argv[2] = hashtable;
- return (struct t_hashtable *)weechat_lua_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_HASHTABLE,
- script_callback->function,
- "ssh", func_argv);
+ return (struct t_hashtable *)weechat_lua_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_HASHTABLE,
+ ptr_function,
+ "ssh", func_argv);
}
return NULL;
@@ -3052,27 +3103,31 @@ API_FUNC(hook_info_hashtable)
}
struct t_infolist *
-weechat_lua_api_hook_infolist_cb (void *data, const char *info_name,
- void *pointer, const char *arguments)
+weechat_lua_api_hook_infolist_cb (const void *pointer, void *data,
+ const char *info_name,
+ void *obj_pointer, const char *arguments)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
struct t_infolist *result;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (info_name) ? (char *)info_name : empty_arg;
- func_argv[2] = API_PTR2STR(pointer);
+ func_argv[2] = API_PTR2STR(obj_pointer);
func_argv[3] = (arguments) ? (char *)arguments : empty_arg;
- result = (struct t_infolist *)weechat_lua_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
- "ssss", func_argv);
+ result = (struct t_infolist *)weechat_lua_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_STRING,
+ ptr_function,
+ "ssss", func_argv);
if (func_argv[2])
free (func_argv[2]);
@@ -3114,24 +3169,27 @@ API_FUNC(hook_infolist)
}
struct t_hashtable *
-weechat_lua_api_hook_focus_cb (void *data,
+weechat_lua_api_hook_focus_cb (const void *pointer, void *data,
struct t_hashtable *info)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = info;
- return (struct t_hashtable *)weechat_lua_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_HASHTABLE,
- script_callback->function,
- "sh", func_argv);
+ return (struct t_hashtable *)weechat_lua_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_HASHTABLE,
+ ptr_function,
+ "sh", func_argv);
}
return NULL;
@@ -3187,9 +3245,7 @@ API_FUNC(unhook)
hook = lua_tostring (L, -1);
- plugin_script_api_unhook (weechat_lua_plugin,
- lua_current_script,
- API_STR2PTR(hook));
+ weechat_unhook (API_STR2PTR(hook));
API_RETURN_OK;
}
@@ -3198,31 +3254,34 @@ API_FUNC(unhook_all)
{
API_INIT_FUNC(1, "unhook_all", API_RETURN_ERROR);
- plugin_script_api_unhook_all (weechat_lua_plugin, lua_current_script);
+ weechat_unhook_all_plugin (lua_current_script->name);
API_RETURN_OK;
}
int
-weechat_lua_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
+weechat_lua_api_buffer_input_data_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (input_data) ? (char *)input_data : empty_arg;
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -3242,23 +3301,26 @@ weechat_lua_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
}
int
-weechat_lua_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+weechat_lua_api_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -3370,9 +3432,7 @@ API_FUNC(buffer_close)
buffer = lua_tostring (L, -1);
- plugin_script_api_buffer_close (weechat_lua_plugin,
- lua_current_script,
- API_STR2PTR(buffer));
+ weechat_buffer_close (API_STR2PTR(buffer));
API_RETURN_OK;
}
@@ -3931,31 +3991,34 @@ API_FUNC(bar_item_search)
}
char *
-weechat_lua_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
+weechat_lua_api_bar_item_build_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' }, *ret;
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- if (strncmp (script_callback->function, "(extra)", 7) == 0)
+ if (strncmp (ptr_function, "(extra)", 7) == 0)
{
/* new callback: data, item, window, buffer, extra_info */
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(item);
func_argv[2] = API_PTR2STR(window);
func_argv[3] = API_PTR2STR(buffer);
func_argv[4] = extra_info;
- ret = (char *)weechat_lua_exec (script_callback->script,
+ ret = (char *)weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function + 7,
+ ptr_function + 7,
"ssssh", func_argv);
if (func_argv[1])
@@ -3968,13 +4031,13 @@ weechat_lua_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
else
{
/* old callback: data, item, window */
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(item);
func_argv[2] = API_PTR2STR(window);
- ret = (char *)weechat_lua_exec (script_callback->script,
+ ret = (char *)weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (func_argv[1])
@@ -4037,9 +4100,7 @@ API_FUNC(bar_item_remove)
item = lua_tostring (L, -1);
- plugin_script_api_bar_item_remove (weechat_lua_plugin,
- lua_current_script,
- API_STR2PTR(item));
+ weechat_bar_item_remove (API_STR2PTR(item));
API_RETURN_OK;
}
@@ -4887,69 +4948,33 @@ API_FUNC(hdata_get_string)
API_RETURN_STRING(result);
}
-API_FUNC(upgrade_new)
-{
- const char *filename;
- char *result;
- int write;
-
- API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY);
- if (lua_gettop (L) < 2)
- API_WRONG_ARGS(API_RETURN_EMPTY);
-
- filename = lua_tostring (L, -2);
- write = lua_tonumber (L, -1);
-
- result = API_PTR2STR(weechat_upgrade_new (filename, write));
-
- API_RETURN_STRING_FREE(result);
-}
-
-API_FUNC(upgrade_write_object)
-{
- const char *upgrade_file, *infolist;
- int object_id, rc;
-
- API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0));
- if (lua_gettop (L) < 3)
- API_WRONG_ARGS(API_RETURN_INT(0));
-
- upgrade_file = lua_tostring (L, -3);
- object_id = lua_tonumber (L, -2);
- infolist = lua_tostring (L, -1);
-
- rc = weechat_upgrade_write_object (API_STR2PTR(upgrade_file),
- object_id,
- API_STR2PTR(infolist));
-
- API_RETURN_INT(rc);
-}
-
int
-weechat_lua_api_upgrade_read_cb (void *data,
+weechat_lua_api_upgrade_read_cb (const void *pointer, void *data,
struct t_upgrade_file *upgrade_file,
int object_id,
struct t_infolist *infolist)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' }, str_object_id[32];
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_object_id, sizeof (str_object_id), "%d", object_id);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(upgrade_file);
func_argv[2] = str_object_id;
func_argv[3] = API_PTR2STR(infolist);
- rc = (int *) weechat_lua_exec (script_callback->script,
+ rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -4970,25 +4995,63 @@ weechat_lua_api_upgrade_read_cb (void *data,
return WEECHAT_RC_ERROR;
}
+API_FUNC(upgrade_new)
+{
+ const char *filename, *function, *data;
+ char *result;
+
+ API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY);
+ if (lua_gettop (L) < 3)
+ API_WRONG_ARGS(API_RETURN_EMPTY);
+
+ filename = lua_tostring (L, -3);
+ function = lua_tostring (L, -2);
+ data = lua_tostring (L, -1);
+
+ result = API_PTR2STR(
+ plugin_script_api_upgrade_new (
+ weechat_lua_plugin,
+ lua_current_script,
+ filename,
+ &weechat_lua_api_upgrade_read_cb,
+ function,
+ data));
+
+ API_RETURN_STRING_FREE(result);
+}
+
+API_FUNC(upgrade_write_object)
+{
+ const char *upgrade_file, *infolist;
+ int object_id, rc;
+
+ API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0));
+ if (lua_gettop (L) < 3)
+ API_WRONG_ARGS(API_RETURN_INT(0));
+
+ upgrade_file = lua_tostring (L, -3);
+ object_id = lua_tonumber (L, -2);
+ infolist = lua_tostring (L, -1);
+
+ rc = weechat_upgrade_write_object (API_STR2PTR(upgrade_file),
+ object_id,
+ API_STR2PTR(infolist));
+
+ API_RETURN_INT(rc);
+}
+
API_FUNC(upgrade_read)
{
- const char *upgrade_file, *function, *data;
+ const char *upgrade_file;
int rc;
API_INIT_FUNC(1, "upgrade_read", API_RETURN_INT(0));
- if (lua_gettop (L) < 3)
+ if (lua_gettop (L) < 1)
API_WRONG_ARGS(API_RETURN_INT(0));
- upgrade_file = lua_tostring (L, -3);
- function = lua_tostring (L, -2);
- data = lua_tostring (L, -1);
+ upgrade_file = lua_tostring (L, -1);
- rc = plugin_script_api_upgrade_read (weechat_lua_plugin,
- lua_current_script,
- API_STR2PTR(upgrade_file),
- &weechat_lua_api_upgrade_read_cb,
- function,
- data);
+ rc = weechat_upgrade_read (API_STR2PTR(upgrade_file));
API_RETURN_INT(rc);
}
diff --git a/src/plugins/lua/weechat-lua-api.h b/src/plugins/lua/weechat-lua-api.h
index 3227967dd..5143a5041 100644
--- a/src/plugins/lua/weechat-lua-api.h
+++ b/src/plugins/lua/weechat-lua-api.h
@@ -24,10 +24,12 @@
extern struct luaL_Reg weechat_lua_api_funcs[];
extern struct t_lua_const weechat_lua_api_consts[];
-extern int weechat_lua_api_buffer_input_data_cb (void *data,
+extern int weechat_lua_api_buffer_input_data_cb (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data);
-extern int weechat_lua_api_buffer_close_cb (void *data,
+extern int weechat_lua_api_buffer_close_cb (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer);
#endif /* WEECHAT_LUA_API_H */
diff --git a/src/plugins/lua/weechat-lua.c b/src/plugins/lua/weechat-lua.c
index e20eaa912..321d69c83 100644
--- a/src/plugins/lua/weechat-lua.c
+++ b/src/plugins/lua/weechat-lua.c
@@ -606,12 +606,14 @@ weechat_lua_unload_all ()
*/
int
-weechat_lua_command_cb (void *data, struct t_gui_buffer *buffer,
+weechat_lua_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
char *ptr_name, *path_script;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -707,11 +709,13 @@ weechat_lua_command_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-weechat_lua_completion_cb (void *data, const char *completion_item,
+weechat_lua_completion_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -726,9 +730,11 @@ weechat_lua_completion_cb (void *data, const char *completion_item,
*/
struct t_hdata *
-weechat_lua_hdata_cb (void *data, const char *hdata_name)
+weechat_lua_hdata_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
return plugin_script_hdata_script (weechat_plugin,
@@ -741,10 +747,12 @@ weechat_lua_hdata_cb (void *data, const char *hdata_name)
*/
struct t_infolist *
-weechat_lua_infolist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+weechat_lua_infolist_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!infolist_name || !infolist_name[0])
@@ -753,7 +761,7 @@ weechat_lua_infolist_cb (void *data, const char *infolist_name,
if (weechat_strcasecmp (infolist_name, "lua_script") == 0)
{
return plugin_script_infolist_list_scripts (weechat_lua_plugin,
- lua_scripts, pointer,
+ lua_scripts, obj_pointer,
arguments);
}
@@ -765,10 +773,12 @@ weechat_lua_infolist_cb (void *data, const char *infolist_name,
*/
int
-weechat_lua_signal_debug_dump_cb (void *data, const char *signal,
+weechat_lua_signal_debug_dump_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -787,10 +797,12 @@ weechat_lua_signal_debug_dump_cb (void *data, const char *signal,
*/
int
-weechat_lua_signal_debug_libs_cb (void *data, const char *signal,
+weechat_lua_signal_debug_libs_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -806,37 +818,20 @@ weechat_lua_signal_debug_libs_cb (void *data, const char *signal,
}
/*
- * Callback called when a buffer is closed.
- */
-
-int
-weechat_lua_signal_buffer_closed_cb (void *data, const char *signal,
- const char *type_data, void *signal_data)
-{
- /* make C compiler happy */
- (void) data;
- (void) signal;
- (void) type_data;
-
- if (signal_data)
- plugin_script_remove_buffer_callbacks (lua_scripts, signal_data);
-
- return WEECHAT_RC_OK;
-}
-
-/*
* Timer for executing actions.
*/
int
-weechat_lua_timer_action_cb (void *data, int remaining_calls)
+weechat_lua_timer_action_cb (const void *pointer, void *data,
+ int remaining_calls)
{
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- if (data)
+ if (pointer)
{
- if (data == &lua_action_install_list)
+ if (pointer == &lua_action_install_list)
{
plugin_script_action_install (weechat_lua_plugin,
lua_scripts,
@@ -845,7 +840,7 @@ weechat_lua_timer_action_cb (void *data, int remaining_calls)
&lua_quiet,
&lua_action_install_list);
}
- else if (data == &lua_action_remove_list)
+ else if (pointer == &lua_action_remove_list)
{
plugin_script_action_remove (weechat_lua_plugin,
lua_scripts,
@@ -853,7 +848,7 @@ weechat_lua_timer_action_cb (void *data, int remaining_calls)
&lua_quiet,
&lua_action_remove_list);
}
- else if (data == &lua_action_autoload_list)
+ else if (pointer == &lua_action_autoload_list)
{
plugin_script_action_autoload (weechat_lua_plugin,
&lua_quiet,
@@ -869,11 +864,13 @@ weechat_lua_timer_action_cb (void *data, int remaining_calls)
*/
int
-weechat_lua_signal_script_action_cb (void *data, const char *signal,
+weechat_lua_signal_script_action_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
@@ -884,7 +881,7 @@ weechat_lua_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_lua_timer_action_cb,
- &lua_action_install_list);
+ &lua_action_install_list, NULL);
}
else if (strcmp (signal, "lua_script_remove") == 0)
{
@@ -892,7 +889,7 @@ weechat_lua_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_lua_timer_action_cb,
- &lua_action_remove_list);
+ &lua_action_remove_list, NULL);
}
else if (strcmp (signal, "lua_script_autoload") == 0)
{
@@ -900,7 +897,7 @@ weechat_lua_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_lua_timer_action_cb,
- &lua_action_autoload_list);
+ &lua_action_autoload_list, NULL);
}
}
@@ -924,7 +921,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
init.callback_infolist = &weechat_lua_infolist_cb;
init.callback_signal_debug_dump = &weechat_lua_signal_debug_dump_cb;
init.callback_signal_debug_libs = &weechat_lua_signal_debug_libs_cb;
- init.callback_signal_buffer_closed = &weechat_lua_signal_buffer_closed_cb;
init.callback_signal_script_action = &weechat_lua_signal_script_action_cb;
init.callback_load_file = &weechat_lua_load_cb;
diff --git a/src/plugins/perl/weechat-perl-api.c b/src/plugins/perl/weechat-perl-api.c
index c4cc5f303..ccfa4997b 100644
--- a/src/plugins/perl/weechat-perl-api.c
+++ b/src/plugins/perl/weechat-perl-api.c
@@ -31,7 +31,6 @@
#include "../weechat-plugin.h"
#include "../plugin-script.h"
#include "../plugin-script-api.h"
-#include "../plugin-script-callback.h"
#include "weechat-perl.h"
@@ -762,24 +761,26 @@ API_FUNC(list_free)
}
int
-weechat_perl_api_config_reload_cb (void *data,
+weechat_perl_api_config_reload_cb (const void *pointer, void *data,
struct t_config_file *config_file)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -822,30 +823,32 @@ API_FUNC(config_new)
}
int
-weechat_perl_api_config_section_read_cb (void *data,
+weechat_perl_api_config_section_read_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = (option_name) ? (char *)option_name : empty_arg;
func_argv[4] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sssss", func_argv);
if (!rc)
@@ -867,26 +870,28 @@ weechat_perl_api_config_section_read_cb (void *data,
}
int
-weechat_perl_api_config_section_write_cb (void *data,
+weechat_perl_api_config_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = (section_name) ? (char *)section_name : empty_arg;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -906,26 +911,28 @@ weechat_perl_api_config_section_write_cb (void *data,
}
int
-weechat_perl_api_config_section_write_default_cb (void *data,
+weechat_perl_api_config_section_write_default_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = (section_name) ? (char *)section_name : empty_arg;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -945,30 +952,32 @@ weechat_perl_api_config_section_write_default_cb (void *data,
}
int
-weechat_perl_api_config_section_create_option_cb (void *data,
+weechat_perl_api_config_section_create_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = (option_name) ? (char *)option_name : empty_arg;
func_argv[4] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sssss", func_argv);
if (!rc)
@@ -990,28 +999,30 @@ weechat_perl_api_config_section_create_option_cb (void *data,
}
int
-weechat_perl_api_config_section_delete_option_cb (void *data,
+weechat_perl_api_config_section_delete_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = API_PTR2STR(option);
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -1060,27 +1071,29 @@ API_FUNC(config_new_section)
function_delete_option = SvPV_nolen (ST (12));
data_delete_option = SvPV_nolen (ST (13));
- result = API_PTR2STR(plugin_script_api_config_new_section (weechat_perl_plugin,
- perl_current_script,
- API_STR2PTR(cfg_file),
- name,
- SvIV (ST (2)), /* user_can_add_options */
- SvIV (ST (3)), /* user_can_delete_options */
- &weechat_perl_api_config_section_read_cb,
- function_read,
- data_read,
- &weechat_perl_api_config_section_write_cb,
- function_write,
- data_write,
- &weechat_perl_api_config_section_write_default_cb,
- function_write_default,
- data_write_default,
- &weechat_perl_api_config_section_create_option_cb,
- function_create_option,
- data_create_option,
- &weechat_perl_api_config_section_delete_option_cb,
- function_delete_option,
- data_delete_option));
+ result = API_PTR2STR(
+ plugin_script_api_config_new_section (
+ weechat_perl_plugin,
+ perl_current_script,
+ API_STR2PTR(cfg_file),
+ name,
+ SvIV (ST (2)), /* user_can_add_options */
+ SvIV (ST (3)), /* user_can_delete_options */
+ &weechat_perl_api_config_section_read_cb,
+ function_read,
+ data_read,
+ &weechat_perl_api_config_section_write_cb,
+ function_write,
+ data_write,
+ &weechat_perl_api_config_section_write_default_cb,
+ function_write_default,
+ data_write_default,
+ &weechat_perl_api_config_section_create_option_cb,
+ function_create_option,
+ data_create_option,
+ &weechat_perl_api_config_section_delete_option_cb,
+ function_delete_option,
+ data_delete_option));
API_RETURN_STRING_FREE(result);
}
@@ -1104,26 +1117,28 @@ API_FUNC(config_search_section)
}
int
-weechat_perl_api_config_option_check_value_cb (void *data,
+weechat_perl_api_config_option_check_value_cb (const void *pointer, void *data,
struct t_config_option *option,
const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
func_argv[2] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -1143,24 +1158,26 @@ weechat_perl_api_config_option_check_value_cb (void *data,
}
void
-weechat_perl_api_config_option_change_cb (void *data,
+weechat_perl_api_config_option_change_cb (const void *pointer, void *data,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (func_argv[1])
@@ -1172,24 +1189,26 @@ weechat_perl_api_config_option_change_cb (void *data,
}
void
-weechat_perl_api_config_option_delete_cb (void *data,
+weechat_perl_api_config_option_delete_cb (const void *pointer, void *data,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (func_argv[1])
@@ -1605,9 +1624,7 @@ API_FUNC(config_option_free)
if (items < 1)
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_option_free (weechat_perl_plugin,
- perl_current_script,
- API_STR2PTR(SvPV_nolen (ST (0)))); /* option */
+ weechat_config_option_free (API_STR2PTR(SvPV_nolen (ST (0)))); /* option */
API_RETURN_OK;
}
@@ -1620,9 +1637,8 @@ API_FUNC(config_section_free_options)
if (items < 1)
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_section_free_options (weechat_perl_plugin,
- perl_current_script,
- API_STR2PTR(SvPV_nolen (ST (0)))); /* section */
+ weechat_config_section_free_options (
+ API_STR2PTR(SvPV_nolen (ST (0)))); /* section */
API_RETURN_OK;
}
@@ -1635,9 +1651,8 @@ API_FUNC(config_section_free)
if (items < 1)
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_section_free (weechat_perl_plugin,
- perl_current_script,
- API_STR2PTR(SvPV_nolen (ST (0)))); /* section */
+ weechat_config_section_free (
+ API_STR2PTR(SvPV_nolen (ST (0)))); /* section */
API_RETURN_OK;
}
@@ -1650,9 +1665,7 @@ API_FUNC(config_free)
if (items < 1)
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_free (weechat_perl_plugin,
- perl_current_script,
- API_STR2PTR(SvPV_nolen (ST (0)))); /* config_file */
+ weechat_config_free (API_STR2PTR(SvPV_nolen (ST (0)))); /* config_file */
API_RETURN_OK;
}
@@ -1918,28 +1931,31 @@ API_FUNC(log_print)
}
int
-weechat_perl_api_hook_command_cb (void *data, struct t_gui_buffer *buffer,
+weechat_perl_api_hook_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
/* make C compiler happy */
(void) argv;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (argc > 1) ? argv_eol[1] : empty_arg;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -1991,25 +2007,28 @@ API_FUNC(hook_command)
}
int
-weechat_perl_api_hook_command_run_cb (void *data, struct t_gui_buffer *buffer,
+weechat_perl_api_hook_command_run_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *command)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (command) ? (char *)command : empty_arg;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2052,26 +2071,29 @@ API_FUNC(hook_command_run)
}
int
-weechat_perl_api_hook_timer_cb (void *data, int remaining_calls)
+weechat_perl_api_hook_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char str_remaining_calls[32], empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_remaining_calls, sizeof (str_remaining_calls),
"%d", remaining_calls);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_remaining_calls;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -2110,25 +2132,27 @@ API_FUNC(hook_timer)
}
int
-weechat_perl_api_hook_fd_cb (void *data, int fd)
+weechat_perl_api_hook_fd_cb (const void *pointer, void *data, int fd)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char str_fd[32], empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_fd, sizeof (str_fd), "%d", fd);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_fd;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -2168,28 +2192,30 @@ API_FUNC(hook_fd)
}
int
-weechat_perl_api_hook_process_cb (void *data,
+weechat_perl_api_hook_process_cb (const void *pointer, void *data,
const char *command, int return_code,
const char *out, const char *err)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (command) ? (char *)command : empty_arg;
func_argv[2] = &return_code;
func_argv[3] = (out) ? (char *)out : empty_arg;
func_argv[4] = (err) ? (char *)err : empty_arg;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssiss", func_argv);
if (!rc)
@@ -2264,34 +2290,37 @@ API_FUNC(hook_process_hashtable)
}
int
-weechat_perl_api_hook_connect_cb (void *data, int status, int gnutls_rc,
+weechat_perl_api_hook_connect_cb (const void *pointer, void *data,
+ int status, int gnutls_rc,
int sock, const char *error,
const char *ip_address)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[6];
char str_status[32], str_gnutls_rc[32], str_sock[32];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_status, sizeof (str_status), "%d", status);
snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc);
snprintf (str_sock, sizeof (str_sock), "%d", sock);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_status;
func_argv[2] = str_gnutls_rc;
func_argv[3] = str_sock;
func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg;
func_argv[5] = (error) ? (char *)error : empty_arg;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssssss", func_argv);
if (!rc)
@@ -2343,28 +2372,31 @@ API_FUNC(hook_connect)
}
int
-weechat_perl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
+weechat_perl_api_hook_print_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
time_t date,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[8];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
static char timebuffer[64];
int *rc, ret;
/* make C compiler happy */
(void) tags_count;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)date);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = timebuffer;
func_argv[3] = weechat_string_build_with_split_string (tags, ",");
@@ -2375,9 +2407,9 @@ weechat_perl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
func_argv[6] = (prefix) ? (char *)prefix : empty_arg;
func_argv[7] = (message) ? (char *)message : empty_arg;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssssiiss", func_argv);
if (!rc)
@@ -2427,20 +2459,23 @@ API_FUNC(hook_print)
}
int
-weechat_perl_api_hook_signal_cb (void *data, const char *signal, const char *type_data,
+weechat_perl_api_hook_signal_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
static char str_value[64];
int *rc, ret, free_needed;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (signal) ? (char *)signal : empty_arg;
free_needed = 0;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
@@ -2465,9 +2500,9 @@ weechat_perl_api_hook_signal_cb (void *data, const char *signal, const char *typ
else
func_argv[2] = empty_arg;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2548,25 +2583,28 @@ API_FUNC(hook_signal_send)
}
int
-weechat_perl_api_hook_hsignal_cb (void *data, const char *signal,
+weechat_perl_api_hook_hsignal_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (signal) ? (char *)signal : empty_arg;
func_argv[2] = hashtable;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssh", func_argv);
if (!rc)
@@ -2632,24 +2670,27 @@ API_FUNC(hook_hsignal_send)
}
int
-weechat_perl_api_hook_config_cb (void *data, const char *option, const char *value)
+weechat_perl_api_hook_config_cb (const void *pointer, void *data,
+ const char *option, const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (option) ? (char *)option : empty_arg;
func_argv[2] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2690,27 +2731,30 @@ API_FUNC(hook_config)
}
int
-weechat_perl_api_hook_completion_cb (void *data, const char *completion_item,
+weechat_perl_api_hook_completion_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (completion_item) ? (char *)completion_item : empty_arg;
func_argv[2] = API_PTR2STR(buffer);
func_argv[3] = API_PTR2STR(completion);
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -2797,25 +2841,29 @@ API_FUNC(hook_completion_list_add)
}
char *
-weechat_perl_api_hook_modifier_cb (void *data, const char *modifier,
- const char *modifier_data, const char *string)
+weechat_perl_api_hook_modifier_cb (const void *pointer, void *data,
+ const char *modifier,
+ const char *modifier_data,
+ const char *string)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (modifier) ? (char *)modifier : empty_arg;
func_argv[2] = (modifier_data) ? (char *)modifier_data : empty_arg;
func_argv[3] = (string) ? (char *)string : empty_arg;
- return (char *)weechat_perl_exec (script_callback->script,
+ return (char *)weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
}
@@ -2864,24 +2912,27 @@ API_FUNC(hook_modifier_exec)
}
const char *
-weechat_perl_api_hook_info_cb (void *data, const char *info_name,
+weechat_perl_api_hook_info_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (info_name) ? (char *)info_name : empty_arg;
func_argv[2] = (arguments) ? (char *)arguments : empty_arg;
- return (const char *)weechat_perl_exec (script_callback->script,
+ return (const char *)weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
}
@@ -2916,25 +2967,29 @@ API_FUNC(hook_info)
}
struct t_hashtable *
-weechat_perl_api_hook_info_hashtable_cb (void *data, const char *info_name,
+weechat_perl_api_hook_info_hashtable_cb (const void *pointer, void *data,
+ const char *info_name,
struct t_hashtable *hashtable)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (info_name) ? (char *)info_name : empty_arg;
func_argv[2] = hashtable;
- return (struct t_hashtable *)weechat_perl_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_HASHTABLE,
- script_callback->function,
- "ssh", func_argv);
+ return (struct t_hashtable *)weechat_perl_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_HASHTABLE,
+ ptr_function,
+ "ssh", func_argv);
}
return NULL;
@@ -2971,27 +3026,31 @@ API_FUNC(hook_info_hashtable)
}
struct t_infolist *
-weechat_perl_api_hook_infolist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+weechat_perl_api_hook_infolist_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
struct t_infolist *result;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (infolist_name) ? (char *)infolist_name : empty_arg;
- func_argv[2] = API_PTR2STR(pointer);
+ func_argv[2] = API_PTR2STR(obj_pointer);
func_argv[3] = (arguments) ? (char *)arguments : empty_arg;
- result = (struct t_infolist *)weechat_perl_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
- "ssss", func_argv);
+ result = (struct t_infolist *)weechat_perl_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_STRING,
+ ptr_function,
+ "ssss", func_argv);
if (func_argv[2])
free (func_argv[2]);
@@ -3033,24 +3092,27 @@ API_FUNC(hook_infolist)
}
struct t_hashtable *
-weechat_perl_api_hook_focus_cb (void *data,
+weechat_perl_api_hook_focus_cb (const void *pointer, void *data,
struct t_hashtable *info)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = info;
- return (struct t_hashtable *)weechat_perl_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_HASHTABLE,
- script_callback->function,
- "sh", func_argv);
+ return (struct t_hashtable *)weechat_perl_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_HASHTABLE,
+ ptr_function,
+ "sh", func_argv);
}
return NULL;
@@ -3105,9 +3167,7 @@ API_FUNC(unhook)
if (items < 1)
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_unhook (weechat_perl_plugin,
- perl_current_script,
- API_STR2PTR(SvPV_nolen (ST (0)))); /* hook */
+ weechat_unhook (API_STR2PTR(SvPV_nolen (ST (0)))); /* hook */
API_RETURN_OK;
}
@@ -3122,31 +3182,34 @@ API_FUNC(unhook_all)
API_INIT_FUNC(1, "unhook_all", API_RETURN_ERROR);
- plugin_script_api_unhook_all (weechat_perl_plugin, perl_current_script);
+ weechat_unhook_all_plugin (perl_current_script->name);
API_RETURN_OK;
}
int
-weechat_perl_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
+weechat_perl_api_buffer_input_data_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (input_data) ? (char *)input_data : empty_arg;
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -3165,23 +3228,26 @@ weechat_perl_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
}
int
-weechat_perl_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+weechat_perl_api_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -3298,9 +3364,7 @@ API_FUNC(buffer_close)
if (items < 1)
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_buffer_close (weechat_perl_plugin,
- perl_current_script,
- API_STR2PTR(SvPV_nolen (ST (0)))); /* buffer */
+ weechat_buffer_close (API_STR2PTR(SvPV_nolen (ST (0)))); /* buffer */
API_RETURN_OK;
}
@@ -3860,31 +3924,34 @@ API_FUNC(bar_item_search)
}
char *
-weechat_perl_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
+weechat_perl_api_bar_item_build_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' }, *ret;
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- if (strncmp (script_callback->function, "(extra)", 7) == 0)
+ if (strncmp (ptr_function, "(extra)", 7) == 0)
{
/* new callback: data, item, window, buffer, extra_info */
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(item);
func_argv[2] = API_PTR2STR(window);
func_argv[3] = API_PTR2STR(buffer);
func_argv[4] = extra_info;
- ret = (char *)weechat_perl_exec (script_callback->script,
+ ret = (char *)weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function + 7,
+ ptr_function + 7,
"ssssh", func_argv);
if (func_argv[1])
@@ -3897,13 +3964,13 @@ weechat_perl_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
else
{
/* old callback: data, item, window */
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(item);
func_argv[2] = API_PTR2STR(window);
- ret = (char *)weechat_perl_exec (script_callback->script,
+ ret = (char *)weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (func_argv[1])
@@ -3962,9 +4029,7 @@ API_FUNC(bar_item_remove)
if (items < 1)
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_bar_item_remove (weechat_perl_plugin,
- perl_current_script,
- API_STR2PTR(SvPV_nolen (ST (0)))); /* item */
+ weechat_bar_item_remove (API_STR2PTR(SvPV_nolen (ST (0)))); /* item */
API_RETURN_OK;
}
@@ -4823,68 +4888,33 @@ API_FUNC(hdata_get_string)
API_RETURN_STRING(result);
}
-API_FUNC(upgrade_new)
-{
- char *result, *filename;
- dXSARGS;
-
- API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY);
- if (items < 2)
- API_WRONG_ARGS(API_RETURN_EMPTY);
-
- filename = SvPV_nolen (ST (0));
-
- result = API_PTR2STR(weechat_upgrade_new (filename,
- SvIV (ST (1)))); /* write */
-
- API_RETURN_STRING_FREE(result);
-}
-
-API_FUNC(upgrade_write_object)
-{
- char *upgrade_file, *infolist;
- int rc;
- dXSARGS;
-
- API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0));
- if (items < 3)
- API_WRONG_ARGS(API_RETURN_INT(0));
-
- upgrade_file = SvPV_nolen (ST (0));
- infolist = SvPV_nolen (ST (2));
-
- rc = weechat_upgrade_write_object (API_STR2PTR(upgrade_file),
- SvIV (ST (1)), /* object_id */
- API_STR2PTR(infolist));
-
- API_RETURN_INT(rc);
-}
-
int
-weechat_perl_api_upgrade_read_cb (void *data,
+weechat_perl_api_upgrade_read_cb (const void *pointer, void *data,
struct t_upgrade_file *upgrade_file,
int object_id,
struct t_infolist *infolist)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' }, str_object_id[32];
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_object_id, sizeof (str_object_id), "%d", object_id);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(upgrade_file);
func_argv[2] = str_object_id;
func_argv[3] = API_PTR2STR(infolist);
- rc = (int *) weechat_perl_exec (script_callback->script,
+ rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -4905,26 +4935,64 @@ weechat_perl_api_upgrade_read_cb (void *data,
return WEECHAT_RC_ERROR;
}
+API_FUNC(upgrade_new)
+{
+ char *result, *filename, *function, *data;
+ dXSARGS;
+
+ API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY);
+ if (items < 3)
+ API_WRONG_ARGS(API_RETURN_EMPTY);
+
+ filename = SvPV_nolen (ST (0));
+ function = SvPV_nolen (ST (1));
+ data = SvPV_nolen (ST (2));
+
+ result = API_PTR2STR(
+ plugin_script_api_upgrade_new (
+ weechat_perl_plugin,
+ perl_current_script,
+ filename,
+ &weechat_perl_api_upgrade_read_cb,
+ function,
+ data));
+
+ API_RETURN_STRING_FREE(result);
+}
+
+API_FUNC(upgrade_write_object)
+{
+ char *upgrade_file, *infolist;
+ int rc;
+ dXSARGS;
+
+ API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0));
+ if (items < 3)
+ API_WRONG_ARGS(API_RETURN_INT(0));
+
+ upgrade_file = SvPV_nolen (ST (0));
+ infolist = SvPV_nolen (ST (2));
+
+ rc = weechat_upgrade_write_object (API_STR2PTR(upgrade_file),
+ SvIV (ST (1)), /* object_id */
+ API_STR2PTR(infolist));
+
+ API_RETURN_INT(rc);
+}
+
API_FUNC(upgrade_read)
{
- char *upgrade_file, *function, *data;
+ char *upgrade_file;
int rc;
dXSARGS;
API_INIT_FUNC(1, "upgrade_read", API_RETURN_INT(0));
- if (items < 3)
+ if (items < 1)
API_WRONG_ARGS(API_RETURN_INT(0));
upgrade_file = SvPV_nolen (ST (0));
- function = SvPV_nolen (ST (1));
- data = SvPV_nolen (ST (2));
- rc = plugin_script_api_upgrade_read (weechat_perl_plugin,
- perl_current_script,
- API_STR2PTR(upgrade_file),
- &weechat_perl_api_upgrade_read_cb,
- function,
- data);
+ rc = weechat_upgrade_read (API_STR2PTR(upgrade_file));
API_RETURN_INT(rc);
}
diff --git a/src/plugins/perl/weechat-perl-api.h b/src/plugins/perl/weechat-perl-api.h
index 48d06f9d4..9d8a72c79 100644
--- a/src/plugins/perl/weechat-perl-api.h
+++ b/src/plugins/perl/weechat-perl-api.h
@@ -20,10 +20,12 @@
#ifndef WEECHAT_PERL_API_H
#define WEECHAT_PERL_API_H 1
-extern int weechat_perl_api_buffer_input_data_cb (void *data,
+extern int weechat_perl_api_buffer_input_data_cb (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data);
-extern int weechat_perl_api_buffer_close_cb (void *data,
+extern int weechat_perl_api_buffer_close_cb (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer);
extern void weechat_perl_api_init (pTHX);
diff --git a/src/plugins/perl/weechat-perl.c b/src/plugins/perl/weechat-perl.c
index 70182885b..2692df598 100644
--- a/src/plugins/perl/weechat-perl.c
+++ b/src/plugins/perl/weechat-perl.c
@@ -132,8 +132,7 @@ weechat_perl_hashtable_to_hash (struct t_hashtable *hashtable)
if (!hash)
return NULL;
- weechat_hashtable_map_string (hashtable,
- &weechat_perl_hashtable_map_cb,
+ weechat_hashtable_map_string (hashtable, &weechat_perl_hashtable_map_cb,
hash);
return hash;
@@ -638,12 +637,14 @@ weechat_perl_reload_name (const char *name)
*/
int
-weechat_perl_command_cb (void *data, struct t_gui_buffer *buffer,
+weechat_perl_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
char *ptr_name, *path_script;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -739,11 +740,13 @@ weechat_perl_command_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-weechat_perl_completion_cb (void *data, const char *completion_item,
+weechat_perl_completion_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -758,9 +761,11 @@ weechat_perl_completion_cb (void *data, const char *completion_item,
*/
struct t_hdata *
-weechat_perl_hdata_cb (void *data, const char *hdata_name)
+weechat_perl_hdata_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
return plugin_script_hdata_script (weechat_plugin,
@@ -773,10 +778,12 @@ weechat_perl_hdata_cb (void *data, const char *hdata_name)
*/
struct t_infolist *
-weechat_perl_infolist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+weechat_perl_infolist_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!infolist_name || !infolist_name[0])
@@ -785,7 +792,7 @@ weechat_perl_infolist_cb (void *data, const char *infolist_name,
if (weechat_strcasecmp (infolist_name, "perl_script") == 0)
{
return plugin_script_infolist_list_scripts (weechat_perl_plugin,
- perl_scripts, pointer,
+ perl_scripts, obj_pointer,
arguments);
}
@@ -797,10 +804,12 @@ weechat_perl_infolist_cb (void *data, const char *infolist_name,
*/
int
-weechat_perl_signal_debug_dump_cb (void *data, const char *signal,
+weechat_perl_signal_debug_dump_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -819,10 +828,12 @@ weechat_perl_signal_debug_dump_cb (void *data, const char *signal,
*/
int
-weechat_perl_signal_debug_libs_cb (void *data, const char *signal,
+weechat_perl_signal_debug_libs_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -838,37 +849,20 @@ weechat_perl_signal_debug_libs_cb (void *data, const char *signal,
}
/*
- * Callback called when a buffer is closed.
- */
-
-int
-weechat_perl_signal_buffer_closed_cb (void *data, const char *signal,
- const char *type_data, void *signal_data)
-{
- /* make C compiler happy */
- (void) data;
- (void) signal;
- (void) type_data;
-
- if (signal_data)
- plugin_script_remove_buffer_callbacks (perl_scripts, signal_data);
-
- return WEECHAT_RC_OK;
-}
-
-/*
* Timer for executing actions.
*/
int
-weechat_perl_timer_action_cb (void *data, int remaining_calls)
+weechat_perl_timer_action_cb (const void *pointer, void *data,
+ int remaining_calls)
{
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- if (data)
+ if (pointer)
{
- if (data == &perl_action_install_list)
+ if (pointer == &perl_action_install_list)
{
plugin_script_action_install (weechat_perl_plugin,
perl_scripts,
@@ -877,7 +871,7 @@ weechat_perl_timer_action_cb (void *data, int remaining_calls)
&perl_quiet,
&perl_action_install_list);
}
- else if (data == &perl_action_remove_list)
+ else if (pointer == &perl_action_remove_list)
{
plugin_script_action_remove (weechat_perl_plugin,
perl_scripts,
@@ -885,7 +879,7 @@ weechat_perl_timer_action_cb (void *data, int remaining_calls)
&perl_quiet,
&perl_action_remove_list);
}
- else if (data == &perl_action_autoload_list)
+ else if (pointer == &perl_action_autoload_list)
{
plugin_script_action_autoload (weechat_perl_plugin,
&perl_quiet,
@@ -901,11 +895,13 @@ weechat_perl_timer_action_cb (void *data, int remaining_calls)
*/
int
-weechat_perl_signal_script_action_cb (void *data, const char *signal,
+weechat_perl_signal_script_action_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
@@ -916,7 +912,7 @@ weechat_perl_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_perl_timer_action_cb,
- &perl_action_install_list);
+ &perl_action_install_list, NULL);
}
else if (strcmp (signal, "perl_script_remove") == 0)
{
@@ -924,7 +920,7 @@ weechat_perl_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_perl_timer_action_cb,
- &perl_action_remove_list);
+ &perl_action_remove_list, NULL);
}
else if (strcmp (signal, "perl_script_autoload") == 0)
{
@@ -932,7 +928,7 @@ weechat_perl_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_perl_timer_action_cb,
- &perl_action_autoload_list);
+ &perl_action_autoload_list, NULL);
}
}
@@ -944,11 +940,13 @@ weechat_perl_signal_script_action_cb (void *data, const char *signal,
*/
int
-weechat_perl_signal_quit_upgrade_cb (void *data, const char *signal,
+weechat_perl_signal_quit_upgrade_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -1002,7 +1000,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
init.callback_infolist = &weechat_perl_infolist_cb;
init.callback_signal_debug_dump = &weechat_perl_signal_debug_dump_cb;
init.callback_signal_debug_libs = &weechat_perl_signal_debug_libs_cb;
- init.callback_signal_buffer_closed = &weechat_perl_signal_buffer_closed_cb;
init.callback_signal_script_action = &weechat_perl_signal_script_action_cb;
init.callback_load_file = &weechat_perl_load_cb;
@@ -1013,8 +1010,10 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
plugin_script_display_short_list (weechat_perl_plugin,
perl_scripts);
- weechat_hook_signal ("quit", &weechat_perl_signal_quit_upgrade_cb, NULL);
- weechat_hook_signal ("upgrade", &weechat_perl_signal_quit_upgrade_cb, NULL);
+ weechat_hook_signal ("quit",
+ &weechat_perl_signal_quit_upgrade_cb, NULL, NULL);
+ weechat_hook_signal ("upgrade",
+ &weechat_perl_signal_quit_upgrade_cb, NULL, NULL);
/* init OK */
return WEECHAT_RC_OK;
diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c
index 455e46041..4be88b077 100644
--- a/src/plugins/plugin-api.c
+++ b/src/plugins/plugin-api.c
@@ -285,12 +285,13 @@ plugin_api_command (struct t_weechat_plugin *plugin,
*/
char *
-plugin_api_modifier_color_decode_ansi_cb (void *data,
+plugin_api_modifier_color_decode_ansi_cb (const void *pointer, void *data,
const char *modifier,
const char *modifier_data,
const char *string)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) modifier;
@@ -305,10 +306,12 @@ plugin_api_modifier_color_decode_ansi_cb (void *data,
*/
const char *
-plugin_api_info_version_cb (void *data, const char *info_name,
+plugin_api_info_version_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -321,12 +324,14 @@ plugin_api_info_version_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_version_number_cb (void *data, const char *info_name,
+plugin_api_info_version_number_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
static char version_number[32] = { '\0' };
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -344,10 +349,12 @@ plugin_api_info_version_number_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_version_git_cb (void *data, const char *info_name,
+plugin_api_info_version_git_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -360,10 +367,12 @@ plugin_api_info_version_git_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_date_cb (void *data, const char *info_name,
+plugin_api_info_date_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -376,10 +385,12 @@ plugin_api_info_date_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_dir_separator_cb (void *data, const char *info_name,
+plugin_api_info_dir_separator_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -392,12 +403,14 @@ plugin_api_info_dir_separator_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_weechat_dir_cb (void *data, const char *info_name,
+plugin_api_info_weechat_dir_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
static char weechat_dir_absolute_path[PATH_MAX] = { '\0' };
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -416,10 +429,12 @@ plugin_api_info_weechat_dir_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_weechat_libdir_cb (void *data, const char *info_name,
+plugin_api_info_weechat_libdir_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -432,10 +447,12 @@ plugin_api_info_weechat_libdir_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_weechat_sharedir_cb (void *data, const char *info_name,
+plugin_api_info_weechat_sharedir_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -448,10 +465,12 @@ plugin_api_info_weechat_sharedir_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_weechat_localedir_cb (void *data, const char *info_name,
+plugin_api_info_weechat_localedir_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -464,10 +483,12 @@ plugin_api_info_weechat_localedir_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_weechat_site_cb (void *data, const char *info_name,
+plugin_api_info_weechat_site_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -480,10 +501,12 @@ plugin_api_info_weechat_site_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_weechat_site_download_cb (void *data, const char *info_name,
+plugin_api_info_weechat_site_download_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -496,12 +519,14 @@ plugin_api_info_weechat_site_download_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_weechat_upgrading_cb (void *data, const char *info_name,
+plugin_api_info_weechat_upgrading_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
static char value[32];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -515,10 +540,12 @@ plugin_api_info_weechat_upgrading_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_charset_terminal_cb (void *data, const char *info_name,
+plugin_api_info_charset_terminal_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -531,10 +558,12 @@ plugin_api_info_charset_terminal_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_charset_internal_cb (void *data, const char *info_name,
+plugin_api_info_charset_internal_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -547,10 +576,12 @@ plugin_api_info_charset_internal_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_locale_cb (void *data, const char *info_name,
+plugin_api_info_locale_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -563,13 +594,15 @@ plugin_api_info_locale_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_inactivity_cb (void *data, const char *info_name,
+plugin_api_info_inactivity_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
time_t inactivity;
static char value[32];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -587,12 +620,14 @@ plugin_api_info_inactivity_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_filters_enabled_cb (void *data, const char *info_name,
+plugin_api_info_filters_enabled_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
static char value[32];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -606,12 +641,14 @@ plugin_api_info_filters_enabled_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_cursor_mode_cb (void *data, const char *info_name,
+plugin_api_info_cursor_mode_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
static char value[32];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -625,12 +662,14 @@ plugin_api_info_cursor_mode_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_term_width_cb (void *data, const char *info_name,
+plugin_api_info_term_width_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
static char value[32];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -644,12 +683,14 @@ plugin_api_info_term_width_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_term_height_cb (void *data, const char *info_name,
+plugin_api_info_term_height_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
static char value[32];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -663,10 +704,12 @@ plugin_api_info_term_height_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_color_ansi_regex_cb (void *data, const char *info_name,
+plugin_api_info_color_ansi_regex_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
(void) arguments;
@@ -679,12 +722,14 @@ plugin_api_info_color_ansi_regex_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_color_term2rgb_cb (void *data, const char *info_name,
+plugin_api_info_color_term2rgb_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
static char value[32];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
@@ -702,7 +747,8 @@ plugin_api_info_color_term2rgb_cb (void *data, const char *info_name,
*/
const char *
-plugin_api_info_color_rgb2term_cb (void *data, const char *info_name,
+plugin_api_info_color_rgb2term_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
static char value[32];
@@ -710,6 +756,7 @@ plugin_api_info_color_rgb2term_cb (void *data, const char *info_name,
char *pos, *color;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
@@ -745,28 +792,30 @@ plugin_api_info_color_rgb2term_cb (void *data, const char *info_name,
*/
struct t_infolist *
-plugin_api_infolist_bar_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_bar_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_gui_bar *ptr_bar;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
/* invalid bar pointer ? */
- if (pointer && (!gui_bar_valid (pointer)))
+ if (obj_pointer && (!gui_bar_valid (obj_pointer)))
return NULL;
ptr_infolist = infolist_new (NULL);
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one bar */
- if (!gui_bar_add_to_infolist (ptr_infolist, pointer))
+ if (!gui_bar_add_to_infolist (ptr_infolist, obj_pointer))
{
infolist_free (ptr_infolist);
return NULL;
@@ -801,28 +850,30 @@ plugin_api_infolist_bar_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_bar_item_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_bar_item_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_gui_bar_item *ptr_bar_item;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
/* invalid bar item pointer ? */
- if (pointer && (!gui_bar_item_valid (pointer)))
+ if (obj_pointer && (!gui_bar_item_valid (obj_pointer)))
return NULL;
ptr_infolist = infolist_new (NULL);
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one bar item */
- if (!gui_bar_item_add_to_infolist (ptr_infolist, pointer))
+ if (!gui_bar_item_add_to_infolist (ptr_infolist, obj_pointer))
{
infolist_free (ptr_infolist);
return NULL;
@@ -858,8 +909,9 @@ plugin_api_infolist_bar_item_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_bar_window_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_bar_window_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_gui_bar *ptr_bar;
@@ -867,22 +919,23 @@ plugin_api_infolist_bar_window_cb (void *data, const char *infolist_name,
struct t_gui_window *ptr_window;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
(void) arguments;
/* invalid bar window pointer ? */
- if (pointer && (!gui_bar_window_valid (pointer)))
+ if (obj_pointer && (!gui_bar_window_valid (obj_pointer)))
return NULL;
ptr_infolist = infolist_new (NULL);
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one bar window */
- if (!gui_bar_window_add_to_infolist (ptr_infolist, pointer))
+ if (!gui_bar_window_add_to_infolist (ptr_infolist, obj_pointer))
{
infolist_free (ptr_infolist);
return NULL;
@@ -930,28 +983,30 @@ plugin_api_infolist_bar_window_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_buffer_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_buffer_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_gui_buffer *ptr_buffer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
/* invalid buffer pointer ? */
- if (pointer && (!gui_buffer_valid (pointer)))
+ if (obj_pointer && (!gui_buffer_valid (obj_pointer)))
return NULL;
ptr_infolist = infolist_new (NULL);
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one buffer */
- if (!gui_buffer_add_to_infolist (ptr_infolist, pointer))
+ if (!gui_buffer_add_to_infolist (ptr_infolist, obj_pointer))
{
infolist_free (ptr_infolist);
return NULL;
@@ -987,23 +1042,25 @@ plugin_api_infolist_buffer_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_buffer_lines_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_buffer_lines_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_gui_line *ptr_line;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
(void) arguments;
- if (!pointer)
- pointer = gui_buffers;
+ if (!obj_pointer)
+ obj_pointer = gui_buffers;
else
{
/* invalid buffer pointer ? */
- if (!gui_buffer_valid (pointer))
+ if (!gui_buffer_valid (obj_pointer))
return NULL;
}
@@ -1011,11 +1068,11 @@ plugin_api_infolist_buffer_lines_cb (void *data, const char *infolist_name,
if (!ptr_infolist)
return NULL;
- for (ptr_line = ((struct t_gui_buffer *)pointer)->own_lines->first_line;
+ for (ptr_line = ((struct t_gui_buffer *)obj_pointer)->own_lines->first_line;
ptr_line; ptr_line = ptr_line->next_line)
{
if (!gui_line_add_to_infolist (ptr_infolist,
- ((struct t_gui_buffer *)pointer)->own_lines,
+ ((struct t_gui_buffer *)obj_pointer)->own_lines,
ptr_line))
{
infolist_free (ptr_infolist);
@@ -1032,16 +1089,18 @@ plugin_api_infolist_buffer_lines_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_filter_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_filter_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_gui_filter *ptr_filter;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
- (void) pointer;
+ (void) obj_pointer;
ptr_infolist = infolist_new (NULL);
if (!ptr_infolist)
@@ -1070,27 +1129,29 @@ plugin_api_infolist_filter_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_history_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_history_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_gui_history *ptr_history;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
(void) arguments;
/* invalid buffer pointer ? */
- if (pointer && (!gui_buffer_valid (pointer)))
+ if (obj_pointer && (!gui_buffer_valid (obj_pointer)))
return NULL;
ptr_infolist = infolist_new (NULL);
if (!ptr_infolist)
return NULL;
- for (ptr_history = (pointer) ?
- ((struct t_gui_buffer *)pointer)->history : gui_history;
+ for (ptr_history = (obj_pointer) ?
+ ((struct t_gui_buffer *)obj_pointer)->history : gui_history;
ptr_history; ptr_history = ptr_history->next_history)
{
if (!gui_history_add_to_infolist (ptr_infolist, ptr_history))
@@ -1109,24 +1170,26 @@ plugin_api_infolist_history_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_hook_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_hook_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
/* invalid hook pointer ? */
- if (pointer && !hook_valid (pointer))
+ if (obj_pointer && !hook_valid (obj_pointer))
return NULL;
ptr_infolist = infolist_new (NULL);
if (!ptr_infolist)
return NULL;
- if (!hook_add_to_infolist (ptr_infolist, pointer, arguments))
+ if (!hook_add_to_infolist (ptr_infolist, obj_pointer, arguments))
{
infolist_free (ptr_infolist);
return NULL;
@@ -1141,16 +1204,18 @@ plugin_api_infolist_hook_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_hotlist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_hotlist_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_gui_hotlist *ptr_hotlist;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
- (void) pointer;
+ (void) obj_pointer;
(void) arguments;
ptr_infolist = infolist_new (NULL);
@@ -1176,17 +1241,19 @@ plugin_api_infolist_hotlist_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_key_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_key_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_gui_key *ptr_key;
int context;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
- (void) pointer;
+ (void) obj_pointer;
ptr_infolist = infolist_new (NULL);
if (!ptr_infolist)
@@ -1218,16 +1285,18 @@ plugin_api_infolist_key_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_layout_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_layout_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_gui_layout *ptr_layout;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
- (void) pointer;
+ (void) obj_pointer;
(void) arguments;
ptr_infolist = infolist_new (NULL);
@@ -1253,24 +1322,26 @@ plugin_api_infolist_layout_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_nicklist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_nicklist_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
/* invalid buffer pointer ? */
- if (!pointer || (!gui_buffer_valid (pointer)))
+ if (!obj_pointer || (!gui_buffer_valid (obj_pointer)))
return NULL;
ptr_infolist = infolist_new (NULL);
if (!ptr_infolist)
return NULL;
- if (!gui_nicklist_add_to_infolist (ptr_infolist, pointer, arguments))
+ if (!gui_nicklist_add_to_infolist (ptr_infolist, obj_pointer, arguments))
{
infolist_free (ptr_infolist);
return NULL;
@@ -1285,15 +1356,17 @@ plugin_api_infolist_nicklist_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_option_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_option_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
- (void) pointer;
+ (void) obj_pointer;
ptr_infolist = infolist_new (NULL);
if (!ptr_infolist)
@@ -1314,28 +1387,30 @@ plugin_api_infolist_option_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_plugin_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_plugin_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_weechat_plugin *ptr_plugin;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
/* invalid plugin pointer ? */
- if (pointer && (!plugin_valid (pointer)))
+ if (obj_pointer && (!plugin_valid (obj_pointer)))
return NULL;
ptr_infolist = infolist_new (NULL);
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one plugin */
- if (!plugin_add_to_infolist (ptr_infolist, pointer))
+ if (!plugin_add_to_infolist (ptr_infolist, obj_pointer))
{
infolist_free (ptr_infolist);
return NULL;
@@ -1371,28 +1446,30 @@ plugin_api_infolist_plugin_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_proxy_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_proxy_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_proxy *ptr_proxy;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
/* invalid proxy pointer ? */
- if (pointer && (!proxy_valid (pointer)))
+ if (obj_pointer && (!proxy_valid (obj_pointer)))
return NULL;
ptr_infolist = infolist_new (NULL);
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one proxy */
- if (!proxy_add_to_infolist (ptr_infolist, pointer))
+ if (!proxy_add_to_infolist (ptr_infolist, obj_pointer))
{
infolist_free (ptr_infolist);
return NULL;
@@ -1428,16 +1505,18 @@ plugin_api_infolist_proxy_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_url_options_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_url_options_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
- (void) pointer;
+ (void) obj_pointer;
(void) arguments;
ptr_infolist = infolist_new (NULL);
@@ -1462,8 +1541,9 @@ plugin_api_infolist_url_options_cb (void *data, const char *infolist_name,
*/
struct t_infolist *
-plugin_api_infolist_window_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+plugin_api_infolist_window_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_gui_window *ptr_window;
@@ -1471,21 +1551,22 @@ plugin_api_infolist_window_cb (void *data, const char *infolist_name,
char *error;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
/* invalid window pointer ? */
- if (pointer && (!gui_window_valid (pointer)))
+ if (obj_pointer && (!gui_window_valid (obj_pointer)))
return NULL;
ptr_infolist = infolist_new (NULL);
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one window */
- if (!gui_window_add_to_infolist (ptr_infolist, pointer))
+ if (!gui_window_add_to_infolist (ptr_infolist, obj_pointer))
{
infolist_free (ptr_infolist);
return NULL;
@@ -1697,228 +1778,228 @@ plugin_api_init ()
{
/* WeeChat core modifiers */
hook_modifier (NULL, "color_decode_ansi",
- &plugin_api_modifier_color_decode_ansi_cb, NULL);
+ &plugin_api_modifier_color_decode_ansi_cb, NULL, NULL);
/* WeeChat core info hooks */
hook_info (NULL, "version",
N_("WeeChat version"),
- NULL, &plugin_api_info_version_cb, NULL);
+ NULL, &plugin_api_info_version_cb, NULL, NULL);
hook_info (NULL, "version_number",
N_("WeeChat version (as number)"),
- NULL, &plugin_api_info_version_number_cb, NULL);
+ NULL, &plugin_api_info_version_number_cb, NULL, NULL);
hook_info (NULL, "version_git",
N_("WeeChat git version (output of command \"git describe\" "
"for a development version only, empty for a stable "
"release)"),
- NULL, &plugin_api_info_version_git_cb, NULL);
+ NULL, &plugin_api_info_version_git_cb, NULL, NULL);
hook_info (NULL, "date",
N_("WeeChat compilation date"),
- NULL, &plugin_api_info_date_cb, NULL);
+ NULL, &plugin_api_info_date_cb, NULL, NULL);
hook_info (NULL, "dir_separator",
N_("directory separator"),
- NULL, &plugin_api_info_dir_separator_cb, NULL);
+ NULL, &plugin_api_info_dir_separator_cb, NULL, NULL);
hook_info (NULL, "weechat_dir",
N_("WeeChat directory"),
- NULL, &plugin_api_info_weechat_dir_cb, NULL);
+ NULL, &plugin_api_info_weechat_dir_cb, NULL, NULL);
hook_info (NULL, "weechat_libdir",
N_("WeeChat \"lib\" directory"),
- NULL, &plugin_api_info_weechat_libdir_cb, NULL);
+ NULL, &plugin_api_info_weechat_libdir_cb, NULL, NULL);
hook_info (NULL, "weechat_sharedir",
N_("WeeChat \"share\" directory"),
- NULL, &plugin_api_info_weechat_sharedir_cb, NULL);
+ NULL, &plugin_api_info_weechat_sharedir_cb, NULL, NULL);
hook_info (NULL, "weechat_localedir",
N_("WeeChat \"locale\" directory"),
- NULL, &plugin_api_info_weechat_localedir_cb, NULL);
+ NULL, &plugin_api_info_weechat_localedir_cb, NULL, NULL);
hook_info (NULL, "weechat_site",
N_("WeeChat site"),
- NULL, &plugin_api_info_weechat_site_cb, NULL);
+ NULL, &plugin_api_info_weechat_site_cb, NULL, NULL);
hook_info (NULL, "weechat_site_download",
N_("WeeChat site, download page"),
- NULL, &plugin_api_info_weechat_site_download_cb, NULL);
+ NULL, &plugin_api_info_weechat_site_download_cb, NULL, NULL);
hook_info (NULL, "weechat_upgrading",
N_("1 if WeeChat is upgrading (command `/upgrade`)"),
- NULL, &plugin_api_info_weechat_upgrading_cb, NULL);
+ NULL, &plugin_api_info_weechat_upgrading_cb, NULL, NULL);
hook_info (NULL, "charset_terminal",
N_("terminal charset"),
- NULL, &plugin_api_info_charset_terminal_cb, NULL);
+ NULL, &plugin_api_info_charset_terminal_cb, NULL, NULL);
hook_info (NULL, "charset_internal",
N_("WeeChat internal charset"),
- NULL, &plugin_api_info_charset_internal_cb, NULL);
+ NULL, &plugin_api_info_charset_internal_cb, NULL, NULL);
hook_info (NULL, "locale",
N_("locale used for translating messages"),
- NULL, &plugin_api_info_locale_cb, NULL);
+ NULL, &plugin_api_info_locale_cb, NULL, NULL);
hook_info (NULL, "inactivity",
N_("keyboard inactivity (seconds)"),
- NULL, &plugin_api_info_inactivity_cb, NULL);
+ NULL, &plugin_api_info_inactivity_cb, NULL, NULL);
hook_info (NULL, "filters_enabled",
N_("1 if filters are enabled"),
- NULL, &plugin_api_info_filters_enabled_cb, NULL);
+ NULL, &plugin_api_info_filters_enabled_cb, NULL, NULL);
hook_info (NULL, "cursor_mode",
N_("1 if cursor mode is enabled"),
- NULL, &plugin_api_info_cursor_mode_cb, NULL);
+ NULL, &plugin_api_info_cursor_mode_cb, NULL, NULL);
hook_info (NULL, "term_width",
N_("width of terminal"),
- NULL, &plugin_api_info_term_width_cb, NULL);
+ NULL, &plugin_api_info_term_width_cb, NULL, NULL);
hook_info (NULL, "term_height",
N_("height of terminal"),
- NULL, &plugin_api_info_term_height_cb, NULL);
+ NULL, &plugin_api_info_term_height_cb, NULL, NULL);
hook_info (NULL, "color_ansi_regex",
N_("POSIX extended regular expression to search ANSI escape "
"codes"),
- NULL, &plugin_api_info_color_ansi_regex_cb, NULL);
+ NULL, &plugin_api_info_color_ansi_regex_cb, NULL, NULL);
hook_info (NULL, "color_term2rgb",
N_("terminal color (0-255) converted to RGB color"),
N_("color (terminal color: 0-255)"),
- &plugin_api_info_color_term2rgb_cb, NULL);
+ &plugin_api_info_color_term2rgb_cb, NULL, NULL);
hook_info (NULL, "color_rgb2term",
N_("RGB color converted to terminal color (0-255)"),
N_("rgb,limit (limit is optional and is set to 256 by default)"),
- &plugin_api_info_color_rgb2term_cb, NULL);
+ &plugin_api_info_color_rgb2term_cb, NULL, NULL);
/* WeeChat core infolist hooks */
hook_infolist (NULL, "bar",
N_("list of bars"),
N_("bar pointer (optional)"),
N_("bar name (wildcard \"*\" is allowed) (optional)"),
- &plugin_api_infolist_bar_cb, NULL);
+ &plugin_api_infolist_bar_cb, NULL, NULL);
hook_infolist (NULL, "bar_item",
N_("list of bar items"),
N_("bar item pointer (optional)"),
N_("bar item name (wildcard \"*\" is allowed) (optional)"),
- &plugin_api_infolist_bar_item_cb, NULL);
+ &plugin_api_infolist_bar_item_cb, NULL, NULL);
hook_infolist (NULL, "bar_window",
N_("list of bar windows"),
N_("bar window pointer (optional)"),
NULL,
- &plugin_api_infolist_bar_window_cb, NULL);
+ &plugin_api_infolist_bar_window_cb, NULL, NULL);
hook_infolist (NULL, "buffer",
N_("list of buffers"),
N_("buffer pointer (optional)"),
N_("buffer name (wildcard \"*\" is allowed) (optional)"),
- &plugin_api_infolist_buffer_cb, NULL);
+ &plugin_api_infolist_buffer_cb, NULL, NULL);
hook_infolist (NULL, "buffer_lines",
N_("lines of a buffer"),
N_("buffer pointer"),
NULL,
- &plugin_api_infolist_buffer_lines_cb, NULL);
+ &plugin_api_infolist_buffer_lines_cb, NULL, NULL);
hook_infolist (NULL, "filter",
N_("list of filters"),
NULL,
N_("filter name (wildcard \"*\" is allowed) (optional)"),
- &plugin_api_infolist_filter_cb, NULL);
+ &plugin_api_infolist_filter_cb, NULL, NULL);
hook_infolist (NULL, "history",
N_("history of commands"),
N_("buffer pointer (if not set, return global history) (optional)"),
NULL,
- &plugin_api_infolist_history_cb, NULL);
+ &plugin_api_infolist_history_cb, NULL, NULL);
hook_infolist (NULL, "hook",
N_("list of hooks"),
N_("hook pointer (optional)"),
N_("type,arguments (type is command/timer/.., arguments to "
"get only some hooks (wildcard \"*\" is allowed), "
"both are optional)"),
- &plugin_api_infolist_hook_cb, NULL);
+ &plugin_api_infolist_hook_cb, NULL, NULL);
hook_infolist (NULL, "hotlist",
N_("list of buffers in hotlist"),
NULL,
NULL,
- &plugin_api_infolist_hotlist_cb, NULL);
+ &plugin_api_infolist_hotlist_cb, NULL, NULL);
hook_infolist (NULL, "key",
N_("list of key bindings"),
NULL,
N_("context (\"default\", \"search\", \"cursor\" or "
"\"mouse\") (optional)"),
- &plugin_api_infolist_key_cb, NULL);
+ &plugin_api_infolist_key_cb, NULL, NULL);
hook_infolist (NULL, "layout",
N_("list of layouts"),
NULL,
NULL,
- &plugin_api_infolist_layout_cb, NULL);
+ &plugin_api_infolist_layout_cb, NULL, NULL);
hook_infolist (NULL, "nicklist",
N_("nicks in nicklist for a buffer"),
N_("buffer pointer"),
N_("nick_xxx or group_xxx to get only nick/group xxx "
"(optional)"),
- &plugin_api_infolist_nicklist_cb, NULL);
+ &plugin_api_infolist_nicklist_cb, NULL, NULL);
hook_infolist (NULL, "option",
N_("list of options"),
NULL,
N_("option name (wildcard \"*\" is allowed) (optional)"),
- &plugin_api_infolist_option_cb, NULL);
+ &plugin_api_infolist_option_cb, NULL, NULL);
hook_infolist (NULL, "plugin",
N_("list of plugins"),
N_("plugin pointer (optional)"),
N_("plugin name (wildcard \"*\" is allowed) (optional)"),
- &plugin_api_infolist_plugin_cb, NULL);
+ &plugin_api_infolist_plugin_cb, NULL, NULL);
hook_infolist (NULL, "proxy",
N_("list of proxies"),
N_("proxy pointer (optional)"),
N_("proxy name (wildcard \"*\" is allowed) (optional)"),
- &plugin_api_infolist_proxy_cb, NULL);
+ &plugin_api_infolist_proxy_cb, NULL, NULL);
hook_infolist (NULL, "url_options",
N_("options for URL"),
NULL,
NULL,
- &plugin_api_infolist_url_options_cb, NULL);
+ &plugin_api_infolist_url_options_cb, NULL, NULL);
hook_infolist (NULL, "window",
N_("list of windows"),
N_("window pointer (optional)"),
N_("\"current\" for current window or a window number (optional)"),
- &plugin_api_infolist_window_cb, NULL);
+ &plugin_api_infolist_window_cb, NULL, NULL);
/* WeeChat core hdata */
hook_hdata (NULL, "bar", N_("bar"),
- &gui_bar_hdata_bar_cb, NULL);
+ &gui_bar_hdata_bar_cb, NULL, NULL);
hook_hdata (NULL, "bar_item", N_("bar item"),
- &gui_bar_item_hdata_bar_item_cb, NULL);
+ &gui_bar_item_hdata_bar_item_cb, NULL, NULL);
hook_hdata (NULL, "bar_window", N_("bar window"),
- &gui_bar_window_hdata_bar_window_cb, NULL);
+ &gui_bar_window_hdata_bar_window_cb, NULL, NULL);
hook_hdata (NULL, "buffer", N_("buffer"),
- &gui_buffer_hdata_buffer_cb, NULL);
+ &gui_buffer_hdata_buffer_cb, NULL, NULL);
hook_hdata (NULL, "buffer_visited", N_("visited buffer"),
- &gui_buffer_hdata_buffer_visited_cb, NULL);
+ &gui_buffer_hdata_buffer_visited_cb, NULL, NULL);
hook_hdata (NULL, "completion", N_("structure with completion"),
- &gui_completion_hdata_completion_cb, NULL);
+ &gui_completion_hdata_completion_cb, NULL, NULL);
hook_hdata (NULL, "config_file", N_("config file"),
- &config_file_hdata_config_file_cb, NULL);
+ &config_file_hdata_config_file_cb, NULL, NULL);
hook_hdata (NULL, "config_section", N_("config section"),
- &config_file_hdata_config_section_cb, NULL);
+ &config_file_hdata_config_section_cb, NULL, NULL);
hook_hdata (NULL, "config_option", N_("config option"),
- &config_file_hdata_config_option_cb, NULL);
+ &config_file_hdata_config_option_cb, NULL, NULL);
hook_hdata (NULL, "filter", N_("filter"),
- &gui_filter_hdata_filter_cb, NULL);
+ &gui_filter_hdata_filter_cb, NULL, NULL);
hook_hdata (NULL, "history", N_("history of commands in buffer"),
- &gui_history_hdata_history_cb, NULL);
+ &gui_history_hdata_history_cb, NULL, NULL);
hook_hdata (NULL, "hotlist", N_("hotlist"),
- &gui_hotlist_hdata_hotlist_cb, NULL);
+ &gui_hotlist_hdata_hotlist_cb, NULL, NULL);
hook_hdata (NULL, "input_undo", N_("structure with undo for input line"),
- &gui_buffer_hdata_input_undo_cb, NULL);
+ &gui_buffer_hdata_input_undo_cb, NULL, NULL);
hook_hdata (NULL, "key", N_("a key (keyboard shortcut)"),
- &gui_key_hdata_key_cb, NULL);
+ &gui_key_hdata_key_cb, NULL, NULL);
hook_hdata (NULL, "layout", N_("layout"),
- &gui_layout_hdata_layout_cb, NULL);
+ &gui_layout_hdata_layout_cb, NULL, NULL);
hook_hdata (NULL, "layout_buffer", N_("buffer layout"),
- &gui_layout_hdata_layout_buffer_cb, NULL);
+ &gui_layout_hdata_layout_buffer_cb, NULL, NULL);
hook_hdata (NULL, "layout_window", N_("window layout"),
- &gui_layout_hdata_layout_window_cb, NULL);
+ &gui_layout_hdata_layout_window_cb, NULL, NULL);
hook_hdata (NULL, "lines", N_("structure with lines"),
- &gui_line_hdata_lines_cb, NULL);
+ &gui_line_hdata_lines_cb, NULL, NULL);
hook_hdata (NULL, "line", N_("structure with one line"),
- &gui_line_hdata_line_cb, NULL);
+ &gui_line_hdata_line_cb, NULL, NULL);
hook_hdata (NULL, "line_data", N_("structure with one line data"),
- &gui_line_hdata_line_data_cb, NULL);
+ &gui_line_hdata_line_data_cb, NULL, NULL);
hook_hdata (NULL, "nick_group", N_("group in nicklist"),
- &gui_nicklist_hdata_nick_group_cb, NULL);
+ &gui_nicklist_hdata_nick_group_cb, NULL, NULL);
hook_hdata (NULL, "nick", N_("nick in nicklist"),
- &gui_nicklist_hdata_nick_cb, NULL);
+ &gui_nicklist_hdata_nick_cb, NULL, NULL);
hook_hdata (NULL, "plugin", N_("plugin"),
- &plugin_hdata_plugin_cb, NULL);
+ &plugin_hdata_plugin_cb, NULL, NULL);
hook_hdata (NULL, "proxy", N_("proxy"),
- &proxy_hdata_proxy_cb, NULL);
+ &proxy_hdata_proxy_cb, NULL, NULL);
hook_hdata (NULL, "window", N_("window"),
- &gui_window_hdata_window_cb, NULL);
+ &gui_window_hdata_window_cb, NULL, NULL);
hook_hdata (NULL, "window_scroll", N_("scroll info in window"),
- &gui_window_hdata_window_scroll_cb, NULL);
+ &gui_window_hdata_window_scroll_cb, NULL, NULL);
hook_hdata (NULL, "window_tree", N_("tree of windows"),
- &gui_window_hdata_window_tree_cb, NULL);
+ &gui_window_hdata_window_tree_cb, NULL, NULL);
}
diff --git a/src/plugins/plugin-config.c b/src/plugins/plugin-config.c
index dab7798e8..8ba100a75 100644
--- a/src/plugins/plugin-config.c
+++ b/src/plugins/plugin-config.c
@@ -94,7 +94,8 @@ plugin_config_set_internal (const char *option, const char *value)
ptr_option = config_file_new_option (
plugin_config_file, plugin_config_section_var,
option, "string", NULL,
- NULL, 0, 0, "", value, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "", value, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
rc = (ptr_option) ? WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
}
@@ -133,11 +134,13 @@ plugin_config_set (const char *plugin_name, const char *option_name,
*/
void
-plugin_config_desc_changed_cb (void *data, struct t_config_option *option)
+plugin_config_desc_changed_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_config_option *ptr_option;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_option = config_file_search_option (plugin_config_file,
@@ -177,12 +180,14 @@ plugin_config_set_desc_internal (const char *option, const char *value)
ptr_option = config_file_new_option (
plugin_config_file, plugin_config_section_desc,
option, "string", _("description of plugin option"),
- NULL, 0, 0, "", value, 0, NULL, NULL,
- &plugin_config_desc_changed_cb, NULL, NULL, NULL);
+ NULL, 0, 0, "", value, 0,
+ NULL, NULL, NULL,
+ &plugin_config_desc_changed_cb, NULL, NULL,
+ NULL, NULL, NULL);
}
if (ptr_option)
- plugin_config_desc_changed_cb (NULL, ptr_option);
+ plugin_config_desc_changed_cb (NULL, NULL, ptr_option);
}
/*
@@ -213,9 +218,11 @@ plugin_config_set_desc (const char *plugin_name, const char *option_name,
*/
int
-plugin_config_reload (void *data, struct t_config_file *config_file)
+plugin_config_reload (const void *pointer, void *data,
+ struct t_config_file *config_file)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
/* remove all plugin options and descriptions */
@@ -231,13 +238,15 @@ plugin_config_reload (void *data, struct t_config_file *config_file)
*/
int
-plugin_config_create_option (void *data, struct t_config_file *config_file,
+plugin_config_create_option (const void *pointer, void *data,
+ struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
struct t_config_option *ptr_option_desc, *ptr_option;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_option_desc = config_file_search_option (config_file,
@@ -248,7 +257,8 @@ plugin_config_create_option (void *data, struct t_config_file *config_file,
config_file, section,
option_name, "string",
(ptr_option_desc) ? CONFIG_STRING(ptr_option_desc) : NULL,
- NULL, 0, 0, "", value, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "", value, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
return (ptr_option) ?
WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -259,13 +269,15 @@ plugin_config_create_option (void *data, struct t_config_file *config_file,
*/
int
-plugin_config_create_desc (void *data, struct t_config_file *config_file,
+plugin_config_create_desc (const void *pointer, void *data,
+ struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
struct t_config_option *ptr_option_var, *ptr_option;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_option_var = config_file_search_option (config_file,
@@ -285,8 +297,10 @@ plugin_config_create_desc (void *data, struct t_config_file *config_file,
ptr_option = config_file_new_option (
config_file, section,
option_name, "string", _("description of plugin option"),
- NULL, 0, 0, "", value, 0, NULL, NULL,
- &plugin_config_desc_changed_cb, NULL, NULL, NULL);
+ NULL, 0, 0, "", value, 0,
+ NULL, NULL, NULL,
+ &plugin_config_desc_changed_cb, NULL, NULL,
+ NULL, NULL, NULL);
return (ptr_option) ?
WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
@@ -297,13 +311,15 @@ plugin_config_create_desc (void *data, struct t_config_file *config_file,
*/
int
-plugin_config_delete_desc (void *data, struct t_config_file *config_file,
+plugin_config_delete_desc (const void *pointer, void *data,
+ struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
{
struct t_config_option *ptr_option_var;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) section;
@@ -332,23 +348,23 @@ void
plugin_config_init ()
{
plugin_config_file = config_file_new (NULL, PLUGIN_CONFIG_NAME,
- &plugin_config_reload, NULL);
+ &plugin_config_reload, NULL, NULL);
if (plugin_config_file)
{
plugin_config_section_var = config_file_new_section (
plugin_config_file, "var", 1, 1,
- NULL, NULL,
- NULL, NULL,
- NULL, NULL,
- &plugin_config_create_option, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &plugin_config_create_option, NULL, NULL,
+ NULL, NULL, NULL);
plugin_config_section_desc = config_file_new_section (
plugin_config_file, "desc", 1, 1,
- NULL, NULL,
- NULL, NULL,
- NULL, NULL,
- &plugin_config_create_desc, NULL,
- &plugin_config_delete_desc, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &plugin_config_create_desc, NULL, NULL,
+ &plugin_config_delete_desc, NULL, NULL);
}
else
{
diff --git a/src/plugins/plugin-script-api.c b/src/plugins/plugin-script-api.c
index b46e236f3..1354042b9 100644
--- a/src/plugins/plugin-script-api.c
+++ b/src/plugins/plugin-script-api.c
@@ -28,7 +28,6 @@
#include "weechat-plugin.h"
#include "plugin-script.h"
#include "plugin-script-api.h"
-#include "plugin-script-callback.h"
/*
@@ -55,24 +54,25 @@ struct t_config_file *
plugin_script_api_config_new (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *name,
- int (*callback_reload)(void *data,
+ int (*callback_reload)(const void *pointer,
+ void *data,
struct t_config_file *config_file),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_config_file *new_config_file;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
- return NULL;
+ function_and_data = plugin_script_build_function_and_data (function, data);
- new_config_file = weechat_config_new (name, callback_reload,
- (function && function[0]) ? script_cb : NULL);
- if (new_config_file)
- script_cb->config_file = new_config_file;
- else
- plugin_script_callback_remove (script, script_cb);
+ new_config_file = weechat_config_new
+ (name,
+ (function_and_data) ? callback_reload : NULL,
+ script,
+ function_and_data);
+
+ if (!new_config_file && function_and_data)
+ free (function_and_data);
return new_config_file;
}
@@ -90,97 +90,91 @@ plugin_script_api_config_new_section (struct t_weechat_plugin *weechat_plugin,
const char *name,
int user_can_add_options,
int user_can_delete_options,
- int (*callback_read)(void *data,
+ int (*callback_read)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value),
const char *function_read,
const char *data_read,
- int (*callback_write)(void *data,
+ int (*callback_write)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
const char *section_name),
const char *function_write,
const char *data_write,
- int (*callback_write_default)(void *data,
+ int (*callback_write_default)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
const char *section_name),
const char *function_write_default,
const char *data_write_default,
- int (*callback_create_option)(void *data,
+ int (*callback_create_option)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value),
const char *function_create_option,
const char *data_create_option,
- int (*callback_delete_option)(void *data,
+ int (*callback_delete_option)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option),
const char *function_delete_option,
const char *data_delete_option)
{
- struct t_plugin_script_cb *script_cb_read, *script_cb_write;
- struct t_plugin_script_cb *script_cb_write_default, *script_cb_create_option;
- struct t_plugin_script_cb *script_cb_delete_option;
+ char *function_and_data_read, *function_and_data_write;
+ char *function_and_data_write_default, *function_and_data_create_option;
+ char *function_and_data_delete_option;
struct t_config_section *new_section;
- script_cb_read = plugin_script_callback_add (script, function_read, data_read);
- script_cb_write = plugin_script_callback_add (script, function_write, data_write);
- script_cb_write_default = plugin_script_callback_add (script, function_write_default, data_write_default);
- script_cb_create_option = plugin_script_callback_add (script, function_create_option, data_create_option);
- script_cb_delete_option = plugin_script_callback_add (script, function_delete_option, data_delete_option);
- if (!script_cb_read || !script_cb_write || !script_cb_write_default
- || !script_cb_create_option || !script_cb_delete_option)
- {
- if (script_cb_read)
- plugin_script_callback_remove (script, script_cb_read);
- if (script_cb_write)
- plugin_script_callback_remove (script, script_cb_write);
- if (script_cb_write_default)
- plugin_script_callback_remove (script, script_cb_write_default);
- if (script_cb_create_option)
- plugin_script_callback_remove (script, script_cb_create_option);
- if (script_cb_delete_option)
- plugin_script_callback_remove (script, script_cb_delete_option);
- return NULL;
- }
-
- new_section = weechat_config_new_section (config_file,
- name,
- user_can_add_options,
- user_can_delete_options,
- (function_read && function_read[0]) ? callback_read : NULL,
- (function_read && function_read[0]) ? script_cb_read : NULL,
- (function_write && function_write[0]) ? callback_write : NULL,
- (function_write && function_write[0]) ? script_cb_write : NULL,
- (function_write_default && function_write_default[0]) ? callback_write_default : NULL,
- (function_write_default && function_write_default[0]) ? script_cb_write_default : NULL,
- (function_create_option && function_create_option[0]) ? callback_create_option : NULL,
- (function_create_option && function_create_option[0]) ? script_cb_create_option : NULL,
- (function_delete_option && function_delete_option[0]) ? callback_delete_option : NULL,
- (function_delete_option && function_delete_option[0]) ? script_cb_delete_option : NULL);
- if (new_section)
- {
- script_cb_read->config_file = config_file;
- script_cb_read->config_section = new_section;
- script_cb_write->config_file = config_file;
- script_cb_write->config_section = new_section;
- script_cb_write_default->config_file = config_file;
- script_cb_write_default->config_section = new_section;
- script_cb_create_option->config_file = config_file;
- script_cb_create_option->config_section = new_section;
- script_cb_delete_option->config_file = config_file;
- script_cb_delete_option->config_section = new_section;
- }
- else
+ function_and_data_read = plugin_script_build_function_and_data (
+ function_read, data_read);
+ function_and_data_write = plugin_script_build_function_and_data (
+ function_write, data_write);
+ function_and_data_write_default = plugin_script_build_function_and_data (
+ function_write_default, data_write_default);
+ function_and_data_create_option = plugin_script_build_function_and_data (
+ function_create_option, data_create_option);
+ function_and_data_delete_option = plugin_script_build_function_and_data (
+ function_delete_option, data_delete_option);
+
+ new_section = weechat_config_new_section (
+ config_file,
+ name,
+ user_can_add_options,
+ user_can_delete_options,
+ (function_and_data_read) ? callback_read : NULL,
+ script,
+ function_and_data_read,
+ (function_and_data_write) ? callback_write : NULL,
+ script,
+ function_and_data_write,
+ (function_and_data_write_default) ? callback_write_default : NULL,
+ script,
+ function_and_data_write_default,
+ (function_and_data_create_option) ? callback_create_option : NULL,
+ script,
+ function_and_data_create_option,
+ (function_and_data_delete_option) ? callback_delete_option : NULL,
+ script,
+ function_and_data_delete_option);;
+
+ if (!new_section)
{
- plugin_script_callback_remove (script, script_cb_read);
- plugin_script_callback_remove (script, script_cb_write);
- plugin_script_callback_remove (script, script_cb_write_default);
- plugin_script_callback_remove (script, script_cb_create_option);
- plugin_script_callback_remove (script, script_cb_delete_option);
+ if (function_and_data_read)
+ free (function_and_data_read);
+ if (function_and_data_write)
+ free (function_and_data_write);
+ if (function_and_data_write_default)
+ free (function_and_data_write_default);
+ if (function_and_data_create_option)
+ free (function_and_data_create_option);
+ if (function_and_data_delete_option)
+ free (function_and_data_delete_option);
}
return new_section;
@@ -203,184 +197,63 @@ plugin_script_api_config_new_option (struct t_weechat_plugin *weechat_plugin,
const char *default_value,
const char *value,
int null_value_allowed,
- int (*callback_check_value)(void *data,
+ int (*callback_check_value)(const void *pointer,
+ void *data,
struct t_config_option *option,
const char *value),
const char *function_check_value,
const char *data_check_value,
- void (*callback_change)(void *data,
+ void (*callback_change)(const void *pointer,
+ void *data,
struct t_config_option *option),
const char *function_change,
const char *data_change,
- void (*callback_delete)(void *data,
+ void (*callback_delete)(const void *pointer,
+ void *data,
struct t_config_option *option),
const char *function_delete,
const char *data_delete)
{
- struct t_plugin_script_cb *script_cb_check_value, *script_cb_change;
- struct t_plugin_script_cb *script_cb_delete;
+ char *function_and_data_check_value, *function_and_data_change;
+ char *function_and_data_delete;
struct t_config_option *new_option;
- script_cb_check_value = plugin_script_callback_add (script, function_check_value, data_check_value);
- script_cb_change = plugin_script_callback_add (script, function_change, data_change);
- script_cb_delete = plugin_script_callback_add (script, function_delete, data_delete);
- if (!script_cb_check_value || !script_cb_change || !script_cb_delete)
+ function_and_data_check_value = plugin_script_build_function_and_data (
+ function_check_value, data_check_value);
+ function_and_data_change = plugin_script_build_function_and_data (
+ function_change, data_change);
+ function_and_data_delete = plugin_script_build_function_and_data (
+ function_delete, data_delete);
+
+ new_option = weechat_config_new_option (
+ config_file, section, name, type,
+ description, string_values, min,
+ max, default_value, value,
+ null_value_allowed,
+ (function_and_data_check_value) ? callback_check_value : NULL,
+ script,
+ function_and_data_check_value,
+ (function_and_data_change) ? callback_change : NULL,
+ script,
+ function_and_data_change,
+ (function_and_data_delete) ? callback_delete : NULL,
+ script,
+ function_and_data_delete);
+
+ if (!new_option)
{
- if (script_cb_check_value)
- plugin_script_callback_remove (script, script_cb_check_value);
- if (script_cb_change)
- plugin_script_callback_remove (script, script_cb_change);
- if (script_cb_delete)
- plugin_script_callback_remove (script, script_cb_delete);
- return NULL;
- }
-
- new_option = weechat_config_new_option (config_file, section, name, type,
- description, string_values, min,
- max, default_value, value,
- null_value_allowed,
- (function_check_value && function_check_value[0]) ? callback_check_value : NULL,
- (function_check_value && function_check_value[0]) ? script_cb_check_value : NULL,
- (function_change && function_change[0]) ? callback_change : NULL,
- (function_change && function_change[0]) ? script_cb_change : NULL,
- (function_delete && function_delete[0]) ? callback_delete : NULL,
- (function_delete && function_delete[0]) ? script_cb_delete : NULL);
- if (new_option)
- {
- script_cb_check_value->config_file = config_file;
- script_cb_check_value->config_section = section;
- script_cb_check_value->config_option = new_option;
- script_cb_change->config_file = config_file;
- script_cb_change->config_section = section;
- script_cb_change->config_option = new_option;
- script_cb_delete->config_file = config_file;
- script_cb_delete->config_section = section;
- script_cb_delete->config_option = new_option;
- }
- else
- {
- plugin_script_callback_remove (script, script_cb_check_value);
- plugin_script_callback_remove (script, script_cb_change);
- plugin_script_callback_remove (script, script_cb_delete);
+ if (function_and_data_check_value)
+ free (function_and_data_check_value);
+ if (function_and_data_change)
+ free (function_and_data_change);
+ if (function_and_data_delete)
+ free (function_and_data_delete);
}
return new_option;
}
/*
- * Frees an option in configuration file.
- */
-
-void
-plugin_script_api_config_option_free (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_config_option *option)
-{
- struct t_plugin_script_cb *ptr_script_cb, *next_callback;
-
- if (!weechat_plugin || !script || !option)
- return;
-
- weechat_config_option_free (option);
-
- ptr_script_cb = script->callbacks;
- while (ptr_script_cb)
- {
- next_callback = ptr_script_cb->next_callback;
-
- if (ptr_script_cb->config_option == option)
- plugin_script_callback_remove (script, ptr_script_cb);
-
- ptr_script_cb = next_callback;
- }
-}
-
-/*
- * Frees all option of a section in configuration file.
- */
-
-void
-plugin_script_api_config_section_free_options (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_config_section *section)
-{
- struct t_plugin_script_cb *ptr_script_cb, *next_callback;
-
- if (!weechat_plugin || !script || !section)
- return;
-
- weechat_config_section_free_options (section);
-
- ptr_script_cb = script->callbacks;
- while (ptr_script_cb)
- {
- next_callback = ptr_script_cb->next_callback;
-
- if ((ptr_script_cb->config_section == section)
- && ptr_script_cb->config_option)
- plugin_script_callback_remove (script, ptr_script_cb);
-
- ptr_script_cb = next_callback;
- }
-}
-
-/*
- * Frees a section in configuration file.
- */
-
-void
-plugin_script_api_config_section_free (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_config_section *section)
-{
- struct t_plugin_script_cb *ptr_script_cb, *next_callback;
-
- if (!weechat_plugin || !script || !section)
- return;
-
- weechat_config_section_free (section);
-
- ptr_script_cb = script->callbacks;
- while (ptr_script_cb)
- {
- next_callback = ptr_script_cb->next_callback;
-
- if (ptr_script_cb->config_section == section)
- plugin_script_callback_remove (script, ptr_script_cb);
-
- ptr_script_cb = next_callback;
- }
-}
-
-/*
- * Frees a configuration file.
- */
-
-void
-plugin_script_api_config_free (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_config_file *config_file)
-{
- struct t_plugin_script_cb *ptr_script_cb, *next_callback;
-
- if (!weechat_plugin || !script || !config_file)
- return;
-
- weechat_config_free (config_file);
-
- ptr_script_cb = script->callbacks;
- while (ptr_script_cb)
- {
- next_callback = ptr_script_cb->next_callback;
-
- if (ptr_script_cb->config_file == config_file)
- plugin_script_callback_remove (script, ptr_script_cb);
-
- ptr_script_cb = next_callback;
- }
-}
-
-/*
* Prints a message.
*/
@@ -492,30 +365,35 @@ plugin_script_api_hook_command (struct t_weechat_plugin *weechat_plugin,
const char *command, const char *description,
const char *args, const char *args_description,
const char *completion,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
int argc, char **argv,
char **argv_eol),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
new_hook = weechat_hook_command (command, description, args,
args_description, completion,
- callback, script_cb);
+ callback, script, function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
+ {
+ if (function_and_data)
+ free (function_and_data);
+ }
return new_hook;
}
@@ -530,28 +408,33 @@ struct t_hook *
plugin_script_api_hook_command_run (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *command,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *command),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
new_hook = weechat_hook_command_run (command,
- callback, script_cb);
+ callback, script, function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
+ {
+ if (function_and_data)
+ free (function_and_data);
+ }
return new_hook;
}
@@ -566,27 +449,32 @@ struct t_hook *
plugin_script_api_hook_timer (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
int interval, int align_second, int max_calls,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
int remaining_calls),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
new_hook = weechat_hook_timer (interval, align_second, max_calls,
- callback, script_cb);
+ callback, script, function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
+ {
+ if (function_and_data)
+ free (function_and_data);
+ }
return new_hook;
}
@@ -602,26 +490,32 @@ plugin_script_api_hook_fd (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
int fd, int flag_read, int flag_write,
int flag_exception,
- int (*callback)(void *data, int fd),
+ int (*callback)(const void *pointer,
+ void *data,
+ int fd),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
new_hook = weechat_hook_fd (fd, flag_read, flag_write, flag_exception,
- callback, script_cb);
+ callback, script, function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
+ {
+ if (function_and_data)
+ free (function_and_data);
+ }
return new_hook;
}
@@ -638,7 +532,8 @@ plugin_script_api_hook_process_hashtable (struct t_weechat_plugin *weechat_plugi
const char *command,
struct t_hashtable *options,
int timeout,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
const char *command,
int return_code,
const char *out,
@@ -646,22 +541,27 @@ plugin_script_api_hook_process_hashtable (struct t_weechat_plugin *weechat_plugi
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
new_hook = weechat_hook_process_hashtable (command, options, timeout,
- callback, script_cb);
+ callback, script,
+ function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
+ {
+ if (function_and_data)
+ free (function_and_data);
+ }
return new_hook;
}
@@ -677,7 +577,8 @@ plugin_script_api_hook_process (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *command,
int timeout,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
const char *command,
int return_code,
const char *out,
@@ -699,37 +600,44 @@ plugin_script_api_hook_process (struct t_weechat_plugin *weechat_plugin,
struct t_hook *
plugin_script_api_hook_connect (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
- const char *proxy, const char *address, int port,
+ const char *proxy,
+ const char *address, int port,
int ipv6, int retry,
void *gnutls_sess, void *gnutls_cb,
int gnutls_dhkey_size,
const char *gnutls_priorities,
const char *local_hostname,
- int (*callback)(void *data, int status,
- int gnutls_rc, int sock,
+ int (*callback)(const void *pointer,
+ void *data,
+ int status, int gnutls_rc,
+ int sock,
const char *error,
const char *ip_address),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
new_hook = weechat_hook_connect (proxy, address, port, ipv6, retry,
gnutls_sess, gnutls_cb, gnutls_dhkey_size,
gnutls_priorities, local_hostname,
- callback, script_cb);
+ callback, script, function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
+ {
+ if (function_and_data)
+ free (function_and_data);
+ }
return new_hook;
}
@@ -746,32 +654,38 @@ plugin_script_api_hook_print (struct t_weechat_plugin *weechat_plugin,
struct t_gui_buffer *buffer,
const char *tags, const char *message,
int strip_colors,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
time_t date,
- int tags_count, const char **tags,
+ int tags_count,
+ const char **tags,
int displayed, int highlight,
const char *prefix,
const char *message),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
new_hook = weechat_hook_print (buffer, tags, message, strip_colors,
- callback, script_cb);
+ callback, script, function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
+ {
+ if (function_and_data)
+ free (function_and_data);
+ }
return new_hook;
}
@@ -786,27 +700,34 @@ struct t_hook *
plugin_script_api_hook_signal (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *signal,
- int (*callback)(void *data, const char *signal,
+ int (*callback)(const void *pointer,
+ void *data,
+ const char *signal,
const char *type_data,
void *signal_data),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
- new_hook = weechat_hook_signal (signal, callback, script_cb);
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
+ new_hook = weechat_hook_signal (signal, callback, script,
+ function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
+ {
+ if (function_and_data)
+ free (function_and_data);
+ }
return new_hook;
}
@@ -821,26 +742,33 @@ struct t_hook *
plugin_script_api_hook_hsignal (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *signal,
- int (*callback)(void *data, const char *signal,
+ int (*callback)(const void *pointer,
+ void *data,
+ const char *signal,
struct t_hashtable *hashtable),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
- new_hook = weechat_hook_hsignal (signal, callback, script_cb);
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
+ new_hook = weechat_hook_hsignal (signal, callback, script,
+ function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
+ {
+ if (function_and_data)
+ free (function_and_data);
+ }
return new_hook;
}
@@ -855,26 +783,33 @@ struct t_hook *
plugin_script_api_hook_config (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *option,
- int (*callback)(void *data, const char *option,
+ int (*callback)(const void *pointer,
+ void *data,
+ const char *option,
const char *value),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
- new_hook = weechat_hook_config (option, callback, script_cb);
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
+ new_hook = weechat_hook_config (option, callback, script,
+ function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
+ {
+ if (function_and_data)
+ free (function_and_data);
+ }
return new_hook;
}
@@ -890,29 +825,34 @@ plugin_script_api_hook_completion (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *completion,
const char *description,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
new_hook = weechat_hook_completion (completion, description,
- callback, script_cb);
+ callback, script, function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
+ {
+ if (function_and_data)
+ free (function_and_data);
+ }
return new_hook;
}
@@ -927,27 +867,34 @@ struct t_hook *
plugin_script_api_hook_modifier (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *modifier,
- char *(*callback)(void *data, const char *modifier,
+ char *(*callback)(const void *pointer,
+ void *data,
+ const char *modifier,
const char *modifier_data,
const char *string),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
- new_hook = weechat_hook_modifier (modifier, callback, script_cb);
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
+ new_hook = weechat_hook_modifier (modifier,
+ callback, script, function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
+ {
+ if (function_and_data)
+ free (function_and_data);
+ }
return new_hook;
}
@@ -964,28 +911,33 @@ plugin_script_api_hook_info (struct t_weechat_plugin *weechat_plugin,
const char *info_name,
const char *description,
const char *args_description,
- const char *(*callback)(void *data,
+ const char *(*callback)(const void *pointer,
+ void *data,
const char *info_name,
const char *arguments),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
new_hook = weechat_hook_info (info_name, description, args_description,
- callback, script_cb);
+ callback, script, function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
+ {
+ if (function_and_data)
+ free (function_and_data);
+ }
return new_hook;
}
@@ -1003,30 +955,36 @@ plugin_script_api_hook_info_hashtable (struct t_weechat_plugin *weechat_plugin,
const char *description,
const char *args_description,
const char *output_description,
- struct t_hashtable *(*callback)(void *data,
+ struct t_hashtable *(*callback)(const void *pointer,
+ void *data,
const char *info_name,
struct t_hashtable *hashtable),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
new_hook = weechat_hook_info_hashtable (info_name, description,
args_description,
output_description,
- callback, script_cb);
+ callback, script,
+ function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
+ {
+ if (function_and_data)
+ free (function_and_data);
+ }
return new_hook;
}
@@ -1044,30 +1002,35 @@ plugin_script_api_hook_infolist (struct t_weechat_plugin *weechat_plugin,
const char *description,
const char *pointer_description,
const char *args_description,
- struct t_infolist *(*callback)(void *data,
+ struct t_infolist *(*callback)(const void *pointer,
+ void *data,
const char *infolist_name,
- void *pointer,
+ void *obj_pointer,
const char *arguments),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
new_hook = weechat_hook_infolist (infolist_name, description,
pointer_description, args_description,
- callback, script_cb);
+ callback, script, function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
+ {
+ if (function_and_data)
+ free (function_and_data);
+ }
return new_hook;
}
@@ -1082,81 +1045,33 @@ struct t_hook *
plugin_script_api_hook_focus (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *area,
- struct t_hashtable *(*callback)(void *data,
+ struct t_hashtable *(*callback)(const void *pointer,
+ void *data,
struct t_hashtable *info),
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
+ char *function_and_data;
struct t_hook *new_hook;
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
+ if (!function || !function[0])
return NULL;
- new_hook = weechat_hook_focus (area, callback, script_cb);
+ function_and_data = plugin_script_build_function_and_data (function, data);
+
+ new_hook = weechat_hook_focus (area, callback, script, function_and_data);
+
if (new_hook)
{
weechat_hook_set (new_hook, "subplugin", script->name);
- script_cb->hook = new_hook;
}
else
- plugin_script_callback_remove (script, script_cb);
-
- return new_hook;
-}
-
-/*
- * Unhooks something.
- */
-
-void
-plugin_script_api_unhook (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_hook *hook)
-{
- struct t_plugin_script_cb *ptr_script_cb, *next_callback;
-
- if (!weechat_plugin || !script || !hook)
- return;
-
- weechat_unhook (hook);
-
- ptr_script_cb = script->callbacks;
- while (ptr_script_cb)
{
- next_callback = ptr_script_cb->next_callback;
-
- if (ptr_script_cb->hook == hook)
- plugin_script_callback_remove (script, ptr_script_cb);
-
- ptr_script_cb = next_callback;
+ if (function_and_data)
+ free (function_and_data);
}
-}
-
-/*
- * Unhooks everything for a script.
- */
-
-void
-plugin_script_api_unhook_all (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script)
-{
- struct t_plugin_script_cb *ptr_script_cb, *next_callback;
-
- ptr_script_cb = script->callbacks;
- while (ptr_script_cb)
- {
- next_callback = ptr_script_cb->next_callback;
- if (ptr_script_cb->hook)
- {
- weechat_unhook (ptr_script_cb->hook);
- plugin_script_callback_remove (script, ptr_script_cb);
- }
-
- ptr_script_cb = next_callback;
- }
+ return new_hook;
}
/*
@@ -1167,86 +1082,61 @@ struct t_gui_buffer *
plugin_script_api_buffer_new (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *name,
- int (*input_callback)(void *data,
+ int (*input_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data),
const char *function_input,
const char *data_input,
- int (*close_callback)(void *data,
+ int (*close_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer),
const char *function_close,
const char *data_close)
{
- struct t_plugin_script_cb *script_cb_input;
- struct t_plugin_script_cb *script_cb_close;
+ char *function_and_data_input, *function_and_data_close;
struct t_gui_buffer *new_buffer;
- script_cb_input = plugin_script_callback_add (script, function_input, data_input);
- script_cb_close = plugin_script_callback_add (script, function_close, data_close);
- if (!script_cb_input || !script_cb_close)
- {
- if (script_cb_input)
- plugin_script_callback_remove (script, script_cb_input);
- if (script_cb_close)
- plugin_script_callback_remove (script, script_cb_close);
- return NULL;
- }
+ function_and_data_input = plugin_script_build_function_and_data (
+ function_input, data_input);
+ function_and_data_close = plugin_script_build_function_and_data (
+ function_close, data_close);
+
+ new_buffer = weechat_buffer_new (
+ name,
+ (function_and_data_input) ? input_callback : NULL,
+ script,
+ function_and_data_input,
+ (function_and_data_close) ? close_callback : NULL,
+ script,
+ function_and_data_close);
- new_buffer = weechat_buffer_new (name,
- (function_input && function_input[0]) ? input_callback : NULL,
- (function_input && function_input[0]) ? script_cb_input : NULL,
- (function_close && function_close[0]) ? close_callback : NULL,
- (function_close && function_close[0]) ? script_cb_close : NULL);
if (new_buffer)
{
- script_cb_input->buffer = new_buffer;
- script_cb_close->buffer = new_buffer;
-
/* used when upgrading weechat, to set callbacks */
- weechat_buffer_set (new_buffer, "localvar_set_script_name", script->name);
- weechat_buffer_set (new_buffer, "localvar_set_script_input_cb", function_input);
- weechat_buffer_set (new_buffer, "localvar_set_script_input_cb_data", data_input);
- weechat_buffer_set (new_buffer, "localvar_set_script_close_cb", function_close);
- weechat_buffer_set (new_buffer, "localvar_set_script_close_cb_data", data_close);
+ weechat_buffer_set (new_buffer,
+ "localvar_set_script_name", script->name);
+ weechat_buffer_set (new_buffer,
+ "localvar_set_script_input_cb", function_input);
+ weechat_buffer_set (new_buffer,
+ "localvar_set_script_input_cb_data", data_input);
+ weechat_buffer_set (new_buffer,
+ "localvar_set_script_close_cb", function_close);
+ weechat_buffer_set (new_buffer,
+ "localvar_set_script_close_cb_data", data_close);
}
else
{
- plugin_script_callback_remove (script, script_cb_input);
- plugin_script_callback_remove (script, script_cb_close);
+ if (function_and_data_input)
+ free (function_and_data_input);
+ if (function_and_data_close)
+ free (function_and_data_close);
}
return new_buffer;
}
/*
- * Closes a buffer.
- */
-
-void
-plugin_script_api_buffer_close (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_gui_buffer *buffer)
-{
- struct t_plugin_script_cb *ptr_script_cb, *next_callback;
-
- if (!weechat_plugin || !script || !buffer)
- return;
-
- weechat_buffer_close (buffer);
-
- ptr_script_cb = script->callbacks;
- while (ptr_script_cb)
- {
- next_callback = ptr_script_cb->next_callback;
-
- if (ptr_script_cb->buffer == buffer)
- plugin_script_callback_remove (script, ptr_script_cb);
-
- ptr_script_cb = next_callback;
- }
-}
-
-/*
* Adds a new bar item.
*
* Returns pointer to new bar item, NULL if error.
@@ -1256,7 +1146,8 @@ struct t_gui_bar_item *
plugin_script_api_bar_item_new (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *name,
- char *(*build_callback)(void *data,
+ char *(*build_callback)(const void *pointer,
+ void *data,
struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
@@ -1264,9 +1155,8 @@ plugin_script_api_bar_item_new (struct t_weechat_plugin *weechat_plugin,
const char *function,
const char *data)
{
- struct t_plugin_script_cb *script_cb;
struct t_gui_bar_item *new_item;
- char str_function[1024];
+ char str_function[1024], *function_and_data;;
int new_callback;
new_callback = 0;
@@ -1284,47 +1174,16 @@ plugin_script_api_bar_item_new (struct t_weechat_plugin *weechat_plugin,
function);
}
- script_cb = plugin_script_callback_add (script, str_function, data);
- if (!script_cb)
- return NULL;
+ function_and_data = plugin_script_build_function_and_data (str_function,
+ data);
- new_item = weechat_bar_item_new (name,
- (str_function[0]) ? build_callback : NULL,
- (str_function[0]) ? script_cb : NULL);
- if (new_item)
- script_cb->bar_item = new_item;
- else
- plugin_script_callback_remove (script, script_cb);
+ new_item = weechat_bar_item_new (name, build_callback, script,
+ function_and_data);
- return new_item;
-}
-
-/*
- * Removes a bar item.
- */
+ if (!new_item && function_and_data)
+ free (function_and_data);
-void
-plugin_script_api_bar_item_remove (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_gui_bar_item *item)
-{
- struct t_plugin_script_cb *ptr_script_cb, *next_callback;
-
- if (!weechat_plugin || !script || !item)
- return;
-
- weechat_bar_item_remove (item);
-
- ptr_script_cb = script->callbacks;
- while (ptr_script_cb)
- {
- next_callback = ptr_script_cb->next_callback;
-
- if (ptr_script_cb->bar_item == item)
- plugin_script_callback_remove (script, ptr_script_cb);
-
- ptr_script_cb = next_callback;
- }
+ return new_item;
}
/*
@@ -1372,6 +1231,7 @@ plugin_script_api_config_get_plugin (struct t_weechat_plugin *weechat_plugin,
strcat (option_fullname, option);
return_value = weechat_config_get_plugin (option_fullname);
+
free (option_fullname);
return return_value;
@@ -1403,6 +1263,7 @@ plugin_script_api_config_is_set_plugin (struct t_weechat_plugin *weechat_plugin,
strcat (option_fullname, option);
return_code = weechat_config_is_set_plugin (option_fullname);
+
free (option_fullname);
return return_code;
@@ -1430,6 +1291,7 @@ plugin_script_api_config_set_plugin (struct t_weechat_plugin *weechat_plugin,
strcat (option_fullname, option);
return_code = weechat_config_set_plugin (option_fullname, value);
+
free (option_fullname);
return return_code;
@@ -1456,6 +1318,7 @@ plugin_script_api_config_set_desc_plugin (struct t_weechat_plugin *weechat_plugi
strcat (option_fullname, option);
weechat_config_set_desc_plugin (option_fullname, description);
+
free (option_fullname);
}
@@ -1481,46 +1344,45 @@ plugin_script_api_config_unset_plugin (struct t_weechat_plugin *weechat_plugin,
strcat (option_fullname, option);
return_code = weechat_config_unset_plugin (option_fullname);
+
free (option_fullname);
return return_code;
}
/*
- * Reads upgrade file.
+ * Creates an upgrade file.
*
* Returns:
* 1: OK
* 0: error
*/
-int
-plugin_script_api_upgrade_read (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_upgrade_file *upgrade_file,
- int (*callback_read)(void *data,
- struct t_upgrade_file *upgrade_file,
- int object_id,
- struct t_infolist *infolist),
- const char *function,
- const char *data)
+struct t_upgrade_file *
+plugin_script_api_upgrade_new (struct t_weechat_plugin *weechat_plugin,
+ struct t_plugin_script *script,
+ const char *filename,
+ int (*callback_read)(const void *pointer,
+ void *data,
+ struct t_upgrade_file *upgrade_file,
+ int object_id,
+ struct t_infolist *infolist),
+ const char *function,
+ const char *data)
{
- struct t_plugin_script_cb *script_cb;
- int rc;
+ char *function_and_data;
+ struct t_upgrade_file *new_upgrade_file;
- if (!function || !function[0])
- return 0;
+ function_and_data = plugin_script_build_function_and_data (function, data);
- script_cb = plugin_script_callback_add (script, function, data);
- if (!script_cb)
- return 0;
- script_cb->upgrade_file = upgrade_file;
-
- rc = weechat_upgrade_read (upgrade_file,
- callback_read,
- script_cb);
+ new_upgrade_file = weechat_upgrade_new (
+ filename,
+ (function_and_data) ? callback_read : NULL,
+ script,
+ function_and_data);
- plugin_script_callback_remove (script, script_cb);
+ if (!new_upgrade_file && function_and_data)
+ free (function_and_data);
- return rc;
+ return new_upgrade_file;
}
diff --git a/src/plugins/plugin-script-api.h b/src/plugins/plugin-script-api.h
index 8ad03e742..d6cfb68b8 100644
--- a/src/plugins/plugin-script-api.h
+++ b/src/plugins/plugin-script-api.h
@@ -26,7 +26,8 @@ extern void plugin_script_api_charset_set (struct t_plugin_script *script,
extern struct t_config_file *plugin_script_api_config_new (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *name,
- int (*callback_reload)(void *data,
+ int (*callback_reload)(const void *pointer,
+ void *data,
struct t_config_file *config_file),
const char *function,
const char *data);
@@ -36,31 +37,36 @@ extern struct t_config_section *plugin_script_api_config_new_section (struct t_w
const char *name,
int user_can_add_options,
int user_can_delete_options,
- int (*callback_read)(void *data,
+ int (*callback_read)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value),
const char *function_read,
const char *data_read,
- int (*callback_write)(void *data,
+ int (*callback_write)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
const char *section_name),
const char *function_write,
const char *data_write,
- int (*callback_write_default)(void *data,
+ int (*callback_write_default)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
const char *section_name),
const char *function_write_default,
const char *data_write_default,
- int (*callback_create_option)(void *data,
+ int (*callback_create_option)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value),
const char *function_create_option,
const char *data_create_option,
- int (*callback_delete_option)(void *data,
+ int (*callback_delete_option)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option),
@@ -78,31 +84,22 @@ extern struct t_config_option *plugin_script_api_config_new_option (struct t_wee
const char *default_value,
const char *value,
int null_value_allowed,
- int (*callback_check_value)(void *data,
+ int (*callback_check_value)(const void *pointer,
+ void *data,
struct t_config_option *option,
const char *value),
const char *function_check_value,
const char *data_check_value,
- void (*callback_change)(void *data,
+ void (*callback_change)(const void *pointer,
+ void *data,
struct t_config_option *option),
const char *function_change,
const char *data_change,
- void (*callback_delete)(void *data,
+ void (*callback_delete)(const void *pointer,
+ void *data,
struct t_config_option *option),
const char *function_delete,
const char *data_delete);
-extern void plugin_script_api_config_option_free (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_config_option *option);
-extern void plugin_script_api_config_section_free_options (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_config_section *section);
-extern void plugin_script_api_config_section_free (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_config_section *section);
-extern void plugin_script_api_config_free (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_config_file *config_file);
extern void plugin_script_api_printf (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer,
@@ -124,7 +121,8 @@ extern struct t_hook *plugin_script_api_hook_command (struct t_weechat_plugin *w
const char *command, const char *description,
const char *args, const char *args_description,
const char *completion,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
int argc, char **argv,
char **argv_eol),
@@ -133,7 +131,8 @@ extern struct t_hook *plugin_script_api_hook_command (struct t_weechat_plugin *w
extern struct t_hook *plugin_script_api_hook_command_run (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *command,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *command),
const char *function,
@@ -142,7 +141,8 @@ extern struct t_hook *plugin_script_api_hook_timer (struct t_weechat_plugin *wee
struct t_plugin_script *script,
int interval, int align_second,
int max_calls,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
int remaining_calls),
const char *function,
const char *data);
@@ -150,7 +150,9 @@ extern struct t_hook *plugin_script_api_hook_fd (struct t_weechat_plugin *weecha
struct t_plugin_script *script,
int fd, int flag_read,
int flag_write, int flag_exception,
- int (*callback)(void *data, int fd),
+ int (*callback)(const void *pointer,
+ void *data,
+ int fd),
const char *function,
const char *data);
extern struct t_hook *plugin_script_api_hook_process_hashtable (struct t_weechat_plugin *weechat_plugin,
@@ -158,7 +160,8 @@ extern struct t_hook *plugin_script_api_hook_process_hashtable (struct t_weechat
const char *command,
struct t_hashtable *options,
int timeout,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
const char *command,
int return_code,
const char *out,
@@ -169,7 +172,8 @@ extern struct t_hook *plugin_script_api_hook_process (struct t_weechat_plugin *w
struct t_plugin_script *script,
const char *command,
int timeout,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
const char *command,
int return_code,
const char *out,
@@ -188,7 +192,8 @@ extern struct t_hook *plugin_script_api_hook_connect (struct t_weechat_plugin *w
int gnutls_dhkey_size,
const char *gnutls_priorities,
const char *local_hostname,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
int status,
int gnutls_rc,
int sock,
@@ -202,7 +207,8 @@ extern struct t_hook *plugin_script_api_hook_print (struct t_weechat_plugin *wee
const char *tags,
const char *message,
int strip_colors,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
time_t date,
int tags_count,
@@ -216,7 +222,8 @@ extern struct t_hook *plugin_script_api_hook_print (struct t_weechat_plugin *wee
extern struct t_hook *plugin_script_api_hook_signal (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *signal,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
const char *signal,
const char *type_data,
void *signal_data),
@@ -225,7 +232,8 @@ extern struct t_hook *plugin_script_api_hook_signal (struct t_weechat_plugin *we
extern struct t_hook *plugin_script_api_hook_hsignal (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *signal,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
const char *signal,
struct t_hashtable *hashtable),
const char *function,
@@ -233,7 +241,8 @@ extern struct t_hook *plugin_script_api_hook_hsignal (struct t_weechat_plugin *w
extern struct t_hook *plugin_script_api_hook_config (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *option,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
const char *option,
const char *value),
const char *function,
@@ -242,7 +251,8 @@ extern struct t_hook *plugin_script_api_hook_completion (struct t_weechat_plugin
struct t_plugin_script *script,
const char *completion,
const char *description,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion),
@@ -251,7 +261,8 @@ extern struct t_hook *plugin_script_api_hook_completion (struct t_weechat_plugin
extern struct t_hook *plugin_script_api_hook_modifier (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *modifier,
- char *(*callback)(void *data,
+ char *(*callback)(const void *pointer,
+ void *data,
const char *modifier,
const char *modifier_data,
const char *string),
@@ -262,7 +273,8 @@ extern struct t_hook *plugin_script_api_hook_info (struct t_weechat_plugin *weec
const char *info_name,
const char *description,
const char *args_description,
- const char *(*callback)(void *data,
+ const char *(*callback)(const void *pointer,
+ void *data,
const char *info_name,
const char *arguments),
const char *function,
@@ -273,7 +285,8 @@ extern struct t_hook *plugin_script_api_hook_info_hashtable (struct t_weechat_pl
const char *description,
const char *args_description,
const char *output_description,
- struct t_hashtable *(*callback)(void *data,
+ struct t_hashtable *(*callback)(const void *pointer,
+ void *data,
const char *info_name,
struct t_hashtable *hashtable),
const char *function,
@@ -284,52 +297,46 @@ extern struct t_hook *plugin_script_api_hook_infolist (struct t_weechat_plugin *
const char *description,
const char *pointer_description,
const char *args_description,
- struct t_infolist *(*callback)(void *data,
+ struct t_infolist *(*callback)(const void *pointer,
+ void *data,
const char *infolist_name,
- void *pointer,
+ void *obj_pointer,
const char *arguments),
const char *function,
const char *data);
extern struct t_hook *plugin_script_api_hook_focus (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *area,
- struct t_hashtable *(*callback)(void *data,
+ struct t_hashtable *(*callback)(const void *pointer,
+ void *data,
struct t_hashtable *info),
const char *function,
const char *data);
-extern void plugin_script_api_unhook (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_hook *hook);
-extern void plugin_script_api_unhook_all (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script);
extern struct t_gui_buffer *plugin_script_api_buffer_new (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *name,
- int (*input_callback)(void *data,
+ int (*input_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data),
const char *function_input,
const char *data_input,
- int (*close_callback)(void *data,
+ int (*close_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer),
const char *function_close,
const char *data_close);
-extern void plugin_script_api_buffer_close (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_gui_buffer *buffer);
extern struct t_gui_bar_item *plugin_script_api_bar_item_new (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *name,
- char *(*build_callback)(void *data,
+ char *(*build_callback)(const void *pointer,
+ void *data,
struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info),
const char *function,
const char *data);
-extern void plugin_script_api_bar_item_remove (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_gui_bar_item *item);
extern int plugin_script_api_command (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer,
@@ -350,14 +357,15 @@ extern void plugin_script_api_config_set_desc_plugin (struct t_weechat_plugin *w
extern int plugin_script_api_config_unset_plugin (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *option);
-extern int plugin_script_api_upgrade_read (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script *script,
- struct t_upgrade_file *upgrade_file,
- int (*callback_read)(void *data,
- struct t_upgrade_file *upgrade_file,
- int object_id,
- struct t_infolist *infolist),
- const char *function,
- const char *data);
+extern struct t_upgrade_file *plugin_script_api_upgrade_new (struct t_weechat_plugin *weechat_plugin,
+ struct t_plugin_script *script,
+ const char *filename,
+ int (*callback_read)(const void *pointer,
+ void *data,
+ struct t_upgrade_file *upgrade_file,
+ int object_id,
+ struct t_infolist *infolist),
+ const char *function,
+ const char *data);
#endif /* WEECHAT_PLUGIN_SCRIPT_API_H */
diff --git a/src/plugins/plugin-script-callback.c b/src/plugins/plugin-script-callback.c
deleted file mode 100644
index 7d734f77c..000000000
--- a/src/plugins/plugin-script-callback.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * script-callback.c - script callbacks management
- *
- * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org>
- *
- * This file is part of WeeChat, the extensible chat client.
- *
- * WeeChat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * WeeChat is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-#include <stddef.h>
-
-#include "weechat-plugin.h"
-#include "plugin-script.h"
-#include "plugin-script-callback.h"
-
-
-/*
- * Allocates a new callback and initializes it.
- */
-
-struct t_plugin_script_cb *
-plugin_script_callback_alloc ()
-{
- struct t_plugin_script_cb *new_script_callback;
-
- new_script_callback = malloc (sizeof (*new_script_callback));
- if (new_script_callback)
- {
- new_script_callback->script = NULL;
- new_script_callback->function = NULL;
- new_script_callback->data = NULL;
- new_script_callback->config_file = NULL;
- new_script_callback->config_section = NULL;
- new_script_callback->config_option = NULL;
- new_script_callback->hook = NULL;
- new_script_callback->buffer = NULL;
- new_script_callback->bar_item = NULL;
- new_script_callback->upgrade_file = NULL;
- return new_script_callback;
- }
-
- return NULL;
-}
-
-/*
- * Adds a callback to list of callbacks.
- *
- * Returns pointer to new callback, NULL if error.
- */
-
-struct t_plugin_script_cb *
-plugin_script_callback_add (struct t_plugin_script *script,
- const char *function,
- const char *data)
-{
- struct t_plugin_script_cb *script_cb;
- if (!script)
- return NULL;
-
- script_cb = plugin_script_callback_alloc ();
- if (!script_cb)
- return NULL;
-
- /* initialize callback */
- script_cb->script = script;
- script_cb->function = (function) ? strdup (function) : NULL;
- script_cb->data = (data) ? strdup (data) : NULL;
-
- /* add callback to list */
- if (script->callbacks)
- script->callbacks->prev_callback = script_cb;
- script_cb->prev_callback = NULL;
- script_cb->next_callback = script->callbacks;
- script->callbacks = script_cb;
-
- return script_cb;
-}
-
-/*
- * Frees data of a script callback.
- */
-
-void
-plugin_script_callback_free_data (struct t_plugin_script_cb *script_callback)
-{
- if (script_callback->function)
- free (script_callback->function);
- if (script_callback->data)
- free (script_callback->data);
-}
-
-/*
- * Removes a callback from a script.
- */
-
-void
-plugin_script_callback_remove (struct t_plugin_script *script,
- struct t_plugin_script_cb *script_callback)
-{
- /* remove callback from list */
- if (script_callback->prev_callback)
- (script_callback->prev_callback)->next_callback =
- script_callback->next_callback;
- if (script_callback->next_callback)
- (script_callback->next_callback)->prev_callback =
- script_callback->prev_callback;
- if (script->callbacks == script_callback)
- script->callbacks = script_callback->next_callback;
-
- plugin_script_callback_free_data (script_callback);
-
- free (script_callback);
-}
-
-/*
- * Removes all callbacks from a script.
- */
-
-void
-plugin_script_callback_remove_all (struct t_plugin_script *script)
-{
- while (script->callbacks)
- {
- plugin_script_callback_remove (script, script->callbacks);
- }
-}
-
-/*
- * Gets hdata for script callback.
- */
-
-struct t_hdata *
-plugin_script_callback_hdata_callback_cb (void *data,
- const char *hdata_name)
-{
- struct t_weechat_plugin *weechat_plugin;
- struct t_hdata *hdata;
- char str_hdata_script[128];
-
- weechat_plugin = (struct t_weechat_plugin *)data;
-
- hdata = weechat_hdata_new (hdata_name, "prev_callback", "next_callback",
- 0, 0, NULL, NULL);
- if (hdata)
- {
- snprintf (str_hdata_script, sizeof (str_hdata_script),
- "%s_script", weechat_plugin->name);
- WEECHAT_HDATA_VAR(struct t_plugin_script_cb, script, POINTER, 0, NULL, str_hdata_script);
- WEECHAT_HDATA_VAR(struct t_plugin_script_cb, function, STRING, 0, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script_cb, data, STRING, 0, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script_cb, config_file, POINTER, 0, NULL, "config_file");
- WEECHAT_HDATA_VAR(struct t_plugin_script_cb, config_section, POINTER, 0, NULL, "config_section");
- WEECHAT_HDATA_VAR(struct t_plugin_script_cb, config_option, POINTER, 0, NULL, "config_option");
- WEECHAT_HDATA_VAR(struct t_plugin_script_cb, hook, POINTER, 0, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script_cb, buffer, POINTER, 0, NULL, "buffer");
- WEECHAT_HDATA_VAR(struct t_plugin_script_cb, bar_item, POINTER, 0, NULL, "bar_item");
- WEECHAT_HDATA_VAR(struct t_plugin_script_cb, upgrade_file, POINTER, 0, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script_cb, prev_callback, POINTER, 0, NULL, hdata_name);
- WEECHAT_HDATA_VAR(struct t_plugin_script_cb, next_callback, POINTER, 0, NULL, hdata_name);
- }
- return hdata;
-}
-
-/*
- * Prints callbacks in WeeChat log file (usually for crash dump).
- */
-
-void
-plugin_script_callback_print_log (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script_cb *script_callback)
-{
- weechat_log_printf ("");
- weechat_log_printf (" [callback (addr:0x%lx)]", script_callback);
- weechat_log_printf (" script. . . . . . . : 0x%lx", script_callback->script);
- weechat_log_printf (" function. . . . . . : '%s'", script_callback->function);
- weechat_log_printf (" data. . . . . . . . : '%s'", script_callback->data);
- weechat_log_printf (" config_file . . . . : 0x%lx", script_callback->config_file);
- weechat_log_printf (" config_section. . . : 0x%lx", script_callback->config_section);
- weechat_log_printf (" config_option . . . : 0x%lx", script_callback->config_option);
- weechat_log_printf (" hook. . . . . . . . : 0x%lx", script_callback->hook);
- weechat_log_printf (" buffer. . . . . . . : 0x%lx", script_callback->buffer);
- weechat_log_printf (" bar_item. . . . . . : 0x%lx", script_callback->bar_item);
- weechat_log_printf (" upgrade_file. . . . : 0x%lx", script_callback->upgrade_file);
- weechat_log_printf (" prev_callback . . . : 0x%lx", script_callback->prev_callback);
- weechat_log_printf (" next_callback . . . : 0x%lx", script_callback->next_callback);
-}
diff --git a/src/plugins/plugin-script-callback.h b/src/plugins/plugin-script-callback.h
deleted file mode 100644
index 0ff2fa1f1..000000000
--- a/src/plugins/plugin-script-callback.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org>
- *
- * This file is part of WeeChat, the extensible chat client.
- *
- * WeeChat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * WeeChat is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef WEECHAT_PLUGIN_SCRIPT_CALLBACK_H
-#define WEECHAT_PLUGIN_SCRIPT_CALLBACK_H 1
-
-struct t_plugin_script_cb
-{
- void *script; /* pointer to script */
- char *function; /* script function called */
- char *data; /* data string for callback */
- struct t_config_file *config_file; /* not NULL for config file */
- struct t_config_section *config_section; /* not NULL for config section */
- struct t_config_option *config_option; /* not NULL for config option */
- struct t_hook *hook; /* not NULL for hook */
- struct t_gui_buffer *buffer; /* not NULL for buffer */
- struct t_gui_bar_item *bar_item; /* not NULL for bar item */
- struct t_upgrade_file *upgrade_file; /* not NULL for upgrade file */
- struct t_plugin_script_cb *prev_callback; /* link to next callback */
- struct t_plugin_script_cb *next_callback; /* link to previous callback */
-};
-
-extern struct t_plugin_script_cb *plugin_script_callback_add (struct t_plugin_script *script,
- const char *function,
- const char *data);
-extern void plugin_script_callback_remove (struct t_plugin_script *script,
- struct t_plugin_script_cb *script_callback);
-extern void plugin_script_callback_remove_all (struct t_plugin_script *script);
-extern struct t_hdata *plugin_script_callback_hdata_callback_cb (void *data,
- const char *hdata_name);
-extern void plugin_script_callback_print_log (struct t_weechat_plugin *weechat_plugin,
- struct t_plugin_script_cb *script_callback);
-
-#endif /* WEECHAT_PLUGIN_SCRIPT_CALLBACK_H */
diff --git a/src/plugins/plugin-script.c b/src/plugins/plugin-script.c
index 7a33b10e5..620ddba6d 100644
--- a/src/plugins/plugin-script.c
+++ b/src/plugins/plugin-script.c
@@ -33,7 +33,6 @@
#include "weechat-plugin.h"
#include "plugin-script.h"
-#include "plugin-script-callback.h"
#define SCRIPT_OPTION_CHECK_LICENSE "check_license"
@@ -67,13 +66,19 @@ plugin_script_config_read (struct t_weechat_plugin *weechat_plugin)
*/
int
-plugin_script_config_cb (void *data, const char *option, const char *value)
+plugin_script_config_cb (const void *pointer, void *data,
+ const char *option, const char *value)
{
+ struct t_weechat_plugin *plugin;
+
/* make C compiler happy */
+ (void) data;
(void) option;
(void) value;
- plugin_script_config_read (data);
+ plugin = (struct t_weechat_plugin *)pointer;
+
+ plugin_script_config_read (plugin);
return WEECHAT_RC_OK;
}
@@ -130,7 +135,8 @@ plugin_script_init (struct t_weechat_plugin *weechat_plugin,
{
snprintf (string, length, "plugins.var.%s.%s",
weechat_plugin->name, SCRIPT_OPTION_CHECK_LICENSE);
- weechat_hook_config (string, &plugin_script_config_cb, weechat_plugin);
+ weechat_hook_config (string,
+ &plugin_script_config_cb, weechat_plugin, NULL);
free (string);
}
@@ -175,7 +181,7 @@ plugin_script_init (struct t_weechat_plugin *weechat_plugin,
"\n"
"Without argument, this command lists all loaded scripts."),
completion,
- init->callback_command, NULL);
+ init->callback_command, NULL, NULL);
if (string)
free (string);
if (completion)
@@ -188,29 +194,24 @@ plugin_script_init (struct t_weechat_plugin *weechat_plugin,
{
snprintf (string, length, "%s_script", weechat_plugin->name);
weechat_hook_completion (string, N_("list of scripts"),
- init->callback_completion, NULL);
+ init->callback_completion, NULL, NULL);
weechat_hook_hdata (string, N_("list of scripts"),
- init->callback_hdata, weechat_plugin);
+ init->callback_hdata, weechat_plugin, NULL);
weechat_hook_infolist (string, N_("list of scripts"),
N_("script pointer (optional)"),
- N_("script name (wildcard \"*\" is allowed) (optional)"),
- init->callback_infolist, NULL);
- snprintf (string, length, "%s_callback", weechat_plugin->name);
- weechat_hook_hdata (string, N_("callback of a script"),
- &plugin_script_callback_hdata_callback_cb,
- weechat_plugin);
+ N_("script name (wildcard \"*\" is allowed) "
+ "(optional)"),
+ init->callback_infolist, NULL, NULL);
free (string);
}
/* add signal for "debug_dump" */
- weechat_hook_signal ("debug_dump", init->callback_signal_debug_dump, NULL);
+ weechat_hook_signal ("debug_dump",
+ init->callback_signal_debug_dump, NULL, NULL);
/* add signal for "debug_libs" */
- weechat_hook_signal ("debug_libs", init->callback_signal_debug_libs, NULL);
-
- /* add signal for "buffer_closed" */
- weechat_hook_signal ("buffer_closed",
- init->callback_signal_buffer_closed, NULL);
+ weechat_hook_signal ("debug_libs",
+ init->callback_signal_debug_libs, NULL, NULL);
/* add signals for script actions (install/remove/autoload) */
for (i = 0; action_signals[i]; i++)
@@ -219,7 +220,7 @@ plugin_script_init (struct t_weechat_plugin *weechat_plugin,
weechat_plugin->name,
action_signals[i]);
weechat_hook_signal (signal_name,
- init->callback_signal_script_action, NULL);
+ init->callback_signal_script_action, NULL, NULL);
}
/* parse arguments */
@@ -334,12 +335,74 @@ invalid:
}
/*
+ * Builds concatenated function name and data (both are strings).
+ * The result will be sent to callbacks.
+ */
+
+char *
+plugin_script_build_function_and_data (const char *function, const char *data)
+{
+ int length_function, length_data, length;
+ char *result;
+
+ if (!function || !function[0])
+ return NULL;
+
+ length_function = (function) ? strlen (function) : 0;
+ length_data = (data) ? strlen (data) : 0;
+ length = length_function + 1 + length_data + 1;
+
+ result = malloc (length);
+ if (!result)
+ return NULL;
+
+ if (function)
+ memcpy (result, function, length_function + 1);
+ else
+ result[0] = '\0';
+
+ if (data)
+ memcpy (result + length_function + 1, data, length_data + 1);
+ else
+ result[length_function + 1] = '\0';
+
+ return result;
+}
+
+/*
+ * Gets pointer on function name and data from a callback data pointer
+ * (which contains 2 strings separated by '\0').
+ */
+
+void
+plugin_script_get_function_and_data (void *callback_data,
+ const char **function, const char **data)
+{
+ const char *string, *ptr_data;
+
+ string = (const char *)callback_data;
+
+ if (string)
+ {
+ *function = string;
+ ptr_data = string + strlen (string) + 1;
+ *data = (ptr_data[0]) ? ptr_data : NULL;
+ }
+ else
+ {
+ *function = NULL;
+ *data = NULL;
+ }
+}
+
+/*
* Auto-loads all scripts in a directory.
*/
void
plugin_script_auto_load (struct t_weechat_plugin *weechat_plugin,
- void (*callback)(void *data, const char *filename))
+ void (*callback)(void *data,
+ const char *filename))
{
const char *dir_home;
char *dir_name;
@@ -356,7 +419,7 @@ plugin_script_auto_load (struct t_weechat_plugin *weechat_plugin,
snprintf (dir_name, dir_length,
"%s/%s/autoload", dir_home, weechat_plugin->name);
- weechat_exec_on_files (dir_name, 0, NULL, callback);
+ weechat_exec_on_files (dir_name, 0, callback, NULL);
free (dir_name);
}
@@ -605,7 +668,6 @@ plugin_script_add (struct t_weechat_plugin *weechat_plugin,
new_script->shutdown_func = (shutdown_func) ?
strdup (shutdown_func) : NULL;
new_script->charset = (charset) ? strdup (charset) : NULL;
- new_script->callbacks = NULL;
new_script->unloading = 0;
plugin_script_insert_sorted (weechat_plugin, scripts, last_script,
@@ -630,19 +692,21 @@ void
plugin_script_set_buffer_callbacks (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts,
struct t_plugin_script *script,
- int (*callback_buffer_input) (void *data,
+ int (*callback_buffer_input) (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data),
- int (*callback_buffer_close) (void *data,
+ int (*callback_buffer_close) (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer))
{
struct t_infolist *infolist;
struct t_gui_buffer *ptr_buffer;
- const char *script_name, *str_script_input_cb, *str_script_input_cb_data;
+ const char *script_name;
+ const char *str_script_input_cb, *str_script_input_cb_data;
const char *str_script_close_cb, *str_script_close_cb_data;
+ char *function_and_data;
struct t_plugin_script *ptr_script;
- struct t_plugin_script_cb *script_cb_input;
- struct t_plugin_script_cb *script_cb_close;
infolist = weechat_infolist_get ("buffer", NULL, NULL);
if (infolist)
@@ -659,46 +723,49 @@ plugin_script_set_buffer_callbacks (struct t_weechat_plugin *weechat_plugin,
script_name);
if (ptr_script && (ptr_script == script))
{
- str_script_input_cb = weechat_buffer_get_string (ptr_buffer,
- "localvar_script_input_cb");
- str_script_input_cb_data = weechat_buffer_get_string (ptr_buffer,
- "localvar_script_input_cb_data");
- str_script_close_cb = weechat_buffer_get_string (ptr_buffer,
- "localvar_script_close_cb");
- str_script_close_cb_data = weechat_buffer_get_string (ptr_buffer,
- "localvar_script_close_cb_data");
-
- if (str_script_input_cb && str_script_input_cb[0])
+ str_script_input_cb = weechat_buffer_get_string (
+ ptr_buffer, "localvar_script_input_cb");
+ str_script_input_cb_data = weechat_buffer_get_string (
+ ptr_buffer, "localvar_script_input_cb_data");
+ str_script_close_cb = weechat_buffer_get_string (
+ ptr_buffer, "localvar_script_close_cb");
+ str_script_close_cb_data = weechat_buffer_get_string (
+ ptr_buffer, "localvar_script_close_cb_data");
+
+ function_and_data = plugin_script_build_function_and_data (
+ str_script_input_cb, str_script_input_cb_data);
+ if (function_and_data)
{
- script_cb_input = plugin_script_callback_add (ptr_script,
- str_script_input_cb,
- str_script_input_cb_data);
- if (script_cb_input)
- {
- script_cb_input->buffer = ptr_buffer;
- weechat_buffer_set_pointer (ptr_buffer,
- "input_callback",
- callback_buffer_input);
- weechat_buffer_set_pointer (ptr_buffer,
- "input_callback_data",
- script_cb_input);
- }
+ weechat_buffer_set_pointer (
+ ptr_buffer,
+ "input_callback",
+ callback_buffer_input);
+ weechat_buffer_set_pointer (
+ ptr_buffer,
+ "input_callback_pointer",
+ ptr_script);
+ weechat_buffer_set_pointer (
+ ptr_buffer,
+ "input_callback_data",
+ function_and_data);
}
- if (str_script_close_cb && str_script_close_cb[0])
+
+ function_and_data = plugin_script_build_function_and_data (
+ str_script_close_cb, str_script_close_cb_data);
+ if (function_and_data)
{
- script_cb_close = plugin_script_callback_add (ptr_script,
- str_script_close_cb,
- str_script_close_cb_data);
- if (script_cb_close)
- {
- script_cb_close->buffer = ptr_buffer;
- weechat_buffer_set_pointer (ptr_buffer,
- "close_callback",
- callback_buffer_close);
- weechat_buffer_set_pointer (ptr_buffer,
- "close_callback_data",
- script_cb_close);
- }
+ weechat_buffer_set_pointer (
+ ptr_buffer,
+ "close_callback",
+ callback_buffer_close);
+ weechat_buffer_set_pointer (
+ ptr_buffer,
+ "close_callback_pointer",
+ ptr_script);
+ weechat_buffer_set_pointer (
+ ptr_buffer,
+ "close_callback_data",
+ function_and_data);
}
}
}
@@ -709,36 +776,136 @@ plugin_script_set_buffer_callbacks (struct t_weechat_plugin *weechat_plugin,
}
/*
- * Removes callbacks for a buffer (called when a buffer is closed by user).
+ * Closes all buffers created by the script.
*/
void
-plugin_script_remove_buffer_callbacks (struct t_plugin_script *scripts,
- struct t_gui_buffer *buffer)
+plugin_script_close_buffers (struct t_weechat_plugin *weechat_plugin,
+ struct t_plugin_script *script)
{
- struct t_plugin_script *ptr_script;
- struct t_plugin_script_cb *ptr_script_cb, *next_script_cb;
+ struct t_hdata *hdata;
+ struct t_gui_buffer *ptr_buffer, *ptr_buffer_to_close;
+ const char *ptr_script_name;
- for (ptr_script = scripts; ptr_script;
- ptr_script = ptr_script->next_script)
+ hdata = weechat_hdata_get ("buffer");
+ while (1)
{
- /*
- * do not remove buffer callbacks if script is being unloaded
- * (because all callbacks will be removed anyway)
- */
- if (!ptr_script->unloading)
+ ptr_buffer = weechat_hdata_get_list (hdata, "gui_buffers");
+ ptr_buffer_to_close = NULL;
+ while (ptr_buffer)
{
- ptr_script_cb = ptr_script->callbacks;
- while (ptr_script_cb)
+ ptr_script_name = weechat_buffer_get_string (
+ ptr_buffer, "localvar_script_name");
+ if (ptr_script_name
+ && (strcmp (ptr_script_name, script->name) == 0))
{
- next_script_cb = ptr_script_cb->next_callback;
+ ptr_buffer_to_close = ptr_buffer;
+ break;
+ }
+ ptr_buffer = weechat_hdata_move (hdata, ptr_buffer, 1);
+ }
+ if (ptr_buffer_to_close)
+ {
+ weechat_buffer_close (ptr_buffer_to_close);
+ }
+ else
+ break;
+ }
+}
- if (ptr_script_cb->buffer == buffer)
- plugin_script_callback_remove (ptr_script, ptr_script_cb);
+/*
+ * Removes all bar items created by the script.
+ */
+
+void
+plugin_script_remove_bar_items (struct t_weechat_plugin *weechat_plugin,
+ struct t_plugin_script *script)
+{
+ struct t_hdata *hdata;
+ struct t_gui_bar_item *ptr_bar_item, *ptr_next_item;
+ void *callback_pointer;
- ptr_script_cb = next_script_cb;
+ hdata = weechat_hdata_get ("bar_item");
+ ptr_bar_item = weechat_hdata_get_list (hdata, "gui_bar_items");
+ while (ptr_bar_item)
+ {
+ ptr_next_item = weechat_hdata_pointer (hdata, ptr_bar_item,
+ "next_item");
+ callback_pointer = weechat_hdata_pointer (hdata, ptr_bar_item,
+ "build_callback_pointer");
+ if (callback_pointer == script)
+ weechat_bar_item_remove (ptr_bar_item);
+ ptr_bar_item = ptr_next_item;
+ }
+}
+
+/*
+ * Removes all configuration files/sections/options created by the script.
+ */
+
+void
+plugin_script_remove_configs (struct t_weechat_plugin *weechat_plugin,
+ struct t_plugin_script *script)
+{
+ struct t_hdata *hdata_config, *hdata_section, *hdata_option;
+ struct t_config_file *ptr_config, *ptr_next_config;
+ struct t_config_section *ptr_section, *ptr_next_section;
+ struct t_config_option *ptr_option, *ptr_next_option;
+ void *callback_pointer;
+
+ hdata_config = weechat_hdata_get ("config_file");
+ hdata_section = weechat_hdata_get ("config_section");
+ hdata_option = weechat_hdata_get ("config_option");
+ ptr_config = weechat_hdata_get_list (hdata_config, "config_files");
+ while (ptr_config)
+ {
+ ptr_next_config = weechat_hdata_pointer (hdata_config, ptr_config,
+ "next_config");
+ callback_pointer = weechat_hdata_pointer (
+ hdata_config, ptr_config, "callback_reload_pointer");
+ if (callback_pointer == script)
+ {
+ if (weechat_config_boolean (weechat_config_get ("weechat.plugin.save_config_on_unload")))
+ weechat_config_write (ptr_config);
+ weechat_config_free (ptr_config);
+ }
+ else
+ {
+ ptr_section = weechat_hdata_pointer (hdata_config, ptr_config,
+ "sections");
+ while (ptr_section)
+ {
+ ptr_next_section = weechat_hdata_pointer (hdata_section,
+ ptr_section,
+ "next_section");
+ callback_pointer = weechat_hdata_pointer (
+ hdata_section, ptr_section, "callback_read_pointer");
+ if (callback_pointer == script)
+ {
+ weechat_config_section_free (ptr_section);
+ }
+ else
+ {
+ ptr_option = weechat_hdata_pointer (hdata_section,
+ ptr_section,
+ "options");
+ while (ptr_option)
+ {
+ ptr_next_option = weechat_hdata_pointer (hdata_option,
+ ptr_option,
+ "next_option");
+ callback_pointer = weechat_hdata_pointer (
+ hdata_option, ptr_option,
+ "callback_check_value_pointer");
+ if (callback_pointer == script)
+ weechat_config_option_free (ptr_option);
+ ptr_option = ptr_next_option;
+ }
+ }
+ ptr_section = ptr_next_section;
}
}
+ ptr_config = ptr_next_config;
}
}
@@ -752,59 +919,16 @@ plugin_script_remove (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script **last_script,
struct t_plugin_script *script)
{
- struct t_plugin_script_cb *ptr_script_cb, *ptr_script_cb2;
-
script->unloading = 1;
- for (ptr_script_cb = script->callbacks; ptr_script_cb;
- ptr_script_cb = ptr_script_cb->next_callback)
- {
- /* free configuration file */
- if (ptr_script_cb->config_file)
- {
- if (weechat_config_boolean (weechat_config_get ("weechat.plugin.save_config_on_unload")))
- weechat_config_write (ptr_script_cb->config_file);
- weechat_config_free (ptr_script_cb->config_file);
- }
-
- /* unhook */
- if (ptr_script_cb->hook)
- weechat_unhook (ptr_script_cb->hook);
+ plugin_script_close_buffers (weechat_plugin, script);
- /* close buffer */
- if (ptr_script_cb->buffer)
- weechat_buffer_close (ptr_script_cb->buffer);
+ plugin_script_remove_bar_items (weechat_plugin, script);
- /* remove bar item */
- if (ptr_script_cb->bar_item)
- weechat_bar_item_remove (ptr_script_cb->bar_item);
-
- /*
- * remove same pointers in other callbacks
- * (to not free two times the same pointer!)
- */
- for (ptr_script_cb2 = ptr_script_cb->next_callback; ptr_script_cb2;
- ptr_script_cb2 = ptr_script_cb2->next_callback)
- {
- if (ptr_script_cb2->config_file == ptr_script_cb->config_file)
- ptr_script_cb2->config_file = NULL;
- if (ptr_script_cb2->config_section == ptr_script_cb->config_section)
- ptr_script_cb2->config_section = NULL;
- if (ptr_script_cb2->config_option == ptr_script_cb->config_option)
- ptr_script_cb2->config_option = NULL;
- if (ptr_script_cb2->hook == ptr_script_cb->hook)
- ptr_script_cb2->hook = NULL;
- if (ptr_script_cb2->buffer == ptr_script_cb->buffer)
- ptr_script_cb2->buffer = NULL;
- if (ptr_script_cb2->bar_item == ptr_script_cb->bar_item)
- ptr_script_cb2->bar_item = NULL;
- if (ptr_script_cb2->upgrade_file == ptr_script_cb->upgrade_file)
- ptr_script_cb2->upgrade_file = NULL;
- }
- }
+ plugin_script_remove_configs (weechat_plugin, script);
- /* remove all callbacks created by this script */
- plugin_script_callback_remove_all (script);
+ /* remove all hooks created by this script */
+ weechat_unhook_all_plugin (script->name);
/* free data */
if (script->filename)
@@ -1385,7 +1509,6 @@ plugin_script_hdata_script (struct t_weechat_plugin *weechat_plugin,
WEECHAT_HDATA_VAR(struct t_plugin_script, description, STRING, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_plugin_script, shutdown_func, STRING, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_plugin_script, charset, STRING, 0, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_plugin_script, callbacks, POINTER, 0, NULL, str_hdata_callback);
WEECHAT_HDATA_VAR(struct t_plugin_script, unloading, INTEGER, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_plugin_script, prev_script, POINTER, 0, NULL, hdata_name);
WEECHAT_HDATA_VAR(struct t_plugin_script, next_script, POINTER, 0, NULL, hdata_name);
@@ -1529,7 +1652,6 @@ plugin_script_print_log (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts)
{
struct t_plugin_script *ptr_script;
- struct t_plugin_script_cb *ptr_script_cb;
weechat_log_printf ("");
weechat_log_printf ("***** \"%s\" plugin dump *****",
@@ -1549,16 +1671,9 @@ plugin_script_print_log (struct t_weechat_plugin *weechat_plugin,
weechat_log_printf (" description . . . . : '%s'", ptr_script->description);
weechat_log_printf (" shutdown_func . . . : '%s'", ptr_script->shutdown_func);
weechat_log_printf (" charset . . . . . . : '%s'", ptr_script->charset);
- weechat_log_printf (" callbacks . . . . . : 0x%lx", ptr_script->callbacks);
weechat_log_printf (" unloading . . . . . : %d", ptr_script->unloading);
weechat_log_printf (" prev_script . . . . : 0x%lx", ptr_script->prev_script);
weechat_log_printf (" next_script . . . . : 0x%lx", ptr_script->next_script);
-
- for (ptr_script_cb = ptr_script->callbacks; ptr_script_cb;
- ptr_script_cb = ptr_script_cb->next_callback)
- {
- plugin_script_callback_print_log (weechat_plugin, ptr_script_cb);
- }
}
weechat_log_printf ("");
diff --git a/src/plugins/plugin-script.h b/src/plugins/plugin-script.h
index d92b30d3b..11a93001d 100644
--- a/src/plugins/plugin-script.h
+++ b/src/plugins/plugin-script.h
@@ -61,7 +61,6 @@ struct t_plugin_script
char *description; /* plugin description */
char *shutdown_func; /* function when script is unloaded*/
char *charset; /* script charset */
- struct t_plugin_script_cb *callbacks; /* callbacks for script */
int unloading; /* script is being unloaded */
struct t_plugin_script *prev_script; /* link to previous script */
struct t_plugin_script *next_script; /* link to next script */
@@ -69,27 +68,31 @@ struct t_plugin_script
struct t_plugin_script_init
{
- int (*callback_command)(void *data, struct t_gui_buffer *buffer,
+ int (*callback_command)(const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol);
- int (*callback_completion)(void *data, const char *completion_item,
+ int (*callback_completion)(const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion);
- struct t_hdata *(*callback_hdata)(void *data,
+ struct t_hdata *(*callback_hdata)(const void *pointer,
+ void *data,
const char *hdata_name);
- struct t_infolist *(*callback_infolist)(void *data,
+ struct t_infolist *(*callback_infolist)(const void *pointer,
+ void *data,
const char *infolist_name,
- void *pointer,
+ void *obj_pointer,
const char *arguments);
- int (*callback_signal_debug_dump)(void *data, const char *signal,
+ int (*callback_signal_debug_dump)(const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data);
- int (*callback_signal_debug_libs)(void *data, const char *signal,
+ int (*callback_signal_debug_libs)(const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data);
- int (*callback_signal_buffer_closed)(void *data, const char *signal,
- const char *type_data,
- void *signal_data);
- int (*callback_signal_script_action)(void *data, const char *signal,
+ int (*callback_signal_script_action)(const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data);
void (*callback_load_file)(void *data, const char *filename);
@@ -105,8 +108,14 @@ extern void *plugin_script_str2ptr (struct t_weechat_plugin *weechat_plugin,
const char *script_name,
const char *function_name,
const char *pointer_str);
+extern char *plugin_script_build_function_and_data (const char *function,
+ const char *data);
+extern void plugin_script_get_function_and_data (void *callback_data,
+ const char **function,
+ const char **data);
extern void plugin_script_auto_load (struct t_weechat_plugin *weechat_plugin,
- void (*callback)(void *data, const char *filename));
+ void (*callback)(void *data,
+ const char *filename));
extern struct t_plugin_script *plugin_script_search (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts,
const char *name);
@@ -122,13 +131,13 @@ extern struct t_plugin_script *plugin_script_add (struct t_weechat_plugin *weech
extern void plugin_script_set_buffer_callbacks (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts,
struct t_plugin_script *script,
- int (*callback_buffer_input) (void *data,
+ int (*callback_buffer_input) (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data),
- int (*callback_buffer_close) (void *data,
+ int (*callback_buffer_close) (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer));
-extern void plugin_script_remove_buffer_callbacks (struct t_plugin_script *scripts,
- struct t_gui_buffer *buffer);
extern void plugin_script_remove (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script **scripts,
struct t_plugin_script **last_script,
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index 73c842656..979ea1ff0 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -775,7 +775,7 @@ plugin_load (const char *filename, int init_plugin, int argc, char **argv)
new_plugin->hook_focus = &hook_focus;
new_plugin->hook_set = &hook_set;
new_plugin->unhook = &unhook;
- new_plugin->unhook_all = &unhook_all_plugin;
+ new_plugin->unhook_all_plugin = &unhook_all_plugin;
new_plugin->buffer_new = &gui_buffer_new;
new_plugin->buffer_search = &gui_buffer_search_by_name;
@@ -939,11 +939,11 @@ plugin_load (const char *filename, int init_plugin, int argc, char **argv)
*/
void
-plugin_auto_load_file (void *args, const char *filename)
+plugin_auto_load_file (void *data, const char *filename)
{
struct t_plugin_args *plugin_args;
- plugin_args = (struct t_plugin_args *)args;
+ plugin_args = (struct t_plugin_args *)data;
if (plugin_check_extension_allowed (filename))
plugin_load (filename, 0, plugin_args->argc, plugin_args->argv);
@@ -954,7 +954,8 @@ plugin_auto_load_file (void *args, const char *filename)
*/
int
-plugin_arraylist_cmp_cb (void *data, struct t_arraylist *arraylist,
+plugin_arraylist_cmp_cb (void *data,
+ struct t_arraylist *arraylist,
void *pointer1, void *pointer2)
{
struct t_weechat_plugin *plugin1, *plugin2;
@@ -1009,8 +1010,7 @@ plugin_auto_load (int argc, char **argv)
plugin_path2 : ((plugin_path) ?
plugin_path : CONFIG_STRING(config_plugin_path)),
0,
- &plugin_args,
- &plugin_auto_load_file);
+ &plugin_auto_load_file, &plugin_args);
if (plugin_path)
free (plugin_path);
if (plugin_path2)
@@ -1023,7 +1023,8 @@ plugin_auto_load (int argc, char **argv)
if (dir_name)
{
snprintf (dir_name, length, "%s/plugins", WEECHAT_LIBDIR);
- util_exec_on_files (dir_name, 0, &plugin_args, &plugin_auto_load_file);
+ util_exec_on_files (dir_name, 0,
+ &plugin_auto_load_file, &plugin_args);
free (dir_name);
}
@@ -1106,7 +1107,7 @@ plugin_remove (struct t_weechat_plugin *plugin)
config_file_free_all_plugin (plugin);
/* remove all hooks */
- unhook_all_plugin (plugin);
+ unhook_all_plugin (plugin, NULL);
/* remove all infolists */
infolist_free_all_plugin (plugin);
@@ -1342,11 +1343,13 @@ plugin_end ()
*/
struct t_hdata *
-plugin_hdata_plugin_cb (void *data, const char *hdata_name)
+plugin_hdata_plugin_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_plugin", "next_plugin",
diff --git a/src/plugins/plugin.h b/src/plugins/plugin.h
index c605079f6..51ad43516 100644
--- a/src/plugins/plugin.h
+++ b/src/plugins/plugin.h
@@ -46,7 +46,8 @@ extern void plugin_unload_all ();
extern void plugin_reload_name (const char *name, int argc, char **argv);
extern void plugin_init (int auto_load, int argc, char *argv[]);
extern void plugin_end ();
-extern struct t_hdata *plugin_hdata_plugin_cb (void *data,
+extern struct t_hdata *plugin_hdata_plugin_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int plugin_add_to_infolist (struct t_infolist *infolist,
struct t_weechat_plugin *plugin);
diff --git a/src/plugins/python/weechat-python-api.c b/src/plugins/python/weechat-python-api.c
index cce3cd9ea..7f6634c8a 100644
--- a/src/plugins/python/weechat-python-api.c
+++ b/src/plugins/python/weechat-python-api.c
@@ -29,7 +29,6 @@
#include "../weechat-plugin.h"
#include "../plugin-script.h"
#include "../plugin-script-api.h"
-#include "../plugin-script-callback.h"
#include "weechat-python.h"
@@ -749,24 +748,26 @@ API_FUNC(list_free)
}
int
-weechat_python_api_config_reload_cb (void *data,
+weechat_python_api_config_reload_cb (const void *pointer, void *data,
struct t_config_file *config_file)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -808,29 +809,31 @@ API_FUNC(config_new)
}
int
-weechat_python_api_config_read_cb (void *data,
+weechat_python_api_config_read_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = (option_name) ? (char *)option_name : empty_arg;
func_argv[4] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sssss", func_argv);
if (!rc)
@@ -852,26 +855,28 @@ weechat_python_api_config_read_cb (void *data,
}
int
-weechat_python_api_config_section_write_cb (void *data,
+weechat_python_api_config_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = (section_name) ? (char *)section_name : empty_arg;
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -891,26 +896,28 @@ weechat_python_api_config_section_write_cb (void *data,
}
int
-weechat_python_api_config_section_write_default_cb (void *data,
+weechat_python_api_config_section_write_default_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = (section_name) ? (char *)section_name : empty_arg;
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -930,30 +937,32 @@ weechat_python_api_config_section_write_default_cb (void *data,
}
int
-weechat_python_api_config_section_create_option_cb (void *data,
+weechat_python_api_config_section_create_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = (option_name) ? (char *)option_name : empty_arg;
func_argv[4] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sssss", func_argv);
if (!rc)
@@ -975,28 +984,30 @@ weechat_python_api_config_section_create_option_cb (void *data,
}
int
-weechat_python_api_config_section_delete_option_cb (void *data,
+weechat_python_api_config_section_delete_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = API_PTR2STR(option);
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -1052,27 +1063,29 @@ API_FUNC(config_new_section)
&data_delete_option))
API_WRONG_ARGS(API_RETURN_EMPTY);
- result = API_PTR2STR(plugin_script_api_config_new_section (weechat_python_plugin,
- python_current_script,
- API_STR2PTR(config_file),
- name,
- user_can_add_options,
- user_can_delete_options,
- &weechat_python_api_config_read_cb,
- function_read,
- data_read,
- &weechat_python_api_config_section_write_cb,
- function_write,
- data_write,
- &weechat_python_api_config_section_write_default_cb,
- function_write_default,
- data_write_default,
- &weechat_python_api_config_section_create_option_cb,
- function_create_option,
- data_create_option,
- &weechat_python_api_config_section_delete_option_cb,
- function_delete_option,
- data_delete_option));
+ result = API_PTR2STR(
+ plugin_script_api_config_new_section (
+ weechat_python_plugin,
+ python_current_script,
+ API_STR2PTR(config_file),
+ name,
+ user_can_add_options,
+ user_can_delete_options,
+ &weechat_python_api_config_read_cb,
+ function_read,
+ data_read,
+ &weechat_python_api_config_section_write_cb,
+ function_write,
+ data_write,
+ &weechat_python_api_config_section_write_default_cb,
+ function_write_default,
+ data_write_default,
+ &weechat_python_api_config_section_create_option_cb,
+ function_create_option,
+ data_create_option,
+ &weechat_python_api_config_section_delete_option_cb,
+ function_delete_option,
+ data_delete_option));
API_RETURN_STRING_FREE(result);
}
@@ -1095,26 +1108,29 @@ API_FUNC(config_search_section)
}
int
-weechat_python_api_config_option_check_value_cb (void *data,
+weechat_python_api_config_option_check_value_cb (const void *pointer,
+ void *data,
struct t_config_option *option,
const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
func_argv[2] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -1134,24 +1150,26 @@ weechat_python_api_config_option_check_value_cb (void *data,
}
void
-weechat_python_api_config_option_change_cb (void *data,
+weechat_python_api_config_option_change_cb (const void *pointer, void *data,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (func_argv[1])
@@ -1163,24 +1181,26 @@ weechat_python_api_config_option_change_cb (void *data,
}
void
-weechat_python_api_config_option_delete_cb (void *data,
+weechat_python_api_config_option_delete_cb (const void *pointer, void *data,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (func_argv[1])
@@ -1606,9 +1626,7 @@ API_FUNC(config_option_free)
if (!PyArg_ParseTuple (args, "s", &option))
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_option_free (weechat_python_plugin,
- python_current_script,
- API_STR2PTR(option));
+ weechat_config_option_free (API_STR2PTR(option));
API_RETURN_OK;
}
@@ -1622,9 +1640,7 @@ API_FUNC(config_section_free_options)
if (!PyArg_ParseTuple (args, "s", &section))
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_section_free_options (weechat_python_plugin,
- python_current_script,
- API_STR2PTR(section));
+ weechat_config_section_free_options (API_STR2PTR(section));
API_RETURN_OK;
}
@@ -1638,9 +1654,7 @@ API_FUNC(config_section_free)
if (!PyArg_ParseTuple (args, "s", &section))
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_section_free (weechat_python_plugin,
- python_current_script,
- API_STR2PTR(section));
+ weechat_config_section_free (API_STR2PTR(section));
API_RETURN_OK;
}
@@ -1654,9 +1668,7 @@ API_FUNC(config_free)
if (!PyArg_ParseTuple (args, "s", &config_file))
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_free (weechat_python_plugin,
- python_current_script,
- API_STR2PTR(config_file));
+ weechat_config_free (API_STR2PTR(config_file));
API_RETURN_OK;
}
@@ -1915,28 +1927,31 @@ API_FUNC(log_print)
}
int
-weechat_python_api_hook_command_cb (void *data, struct t_gui_buffer *buffer,
+weechat_python_api_hook_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
/* make C compiler happy */
(void) argv;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (argc > 1) ? argv_eol[1] : empty_arg;
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -1988,25 +2003,28 @@ API_FUNC(hook_command)
}
int
-weechat_python_api_hook_command_run_cb (void *data, struct t_gui_buffer *buffer,
+weechat_python_api_hook_command_run_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *command)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (command) ? (char *)command : empty_arg;
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2048,26 +2066,29 @@ API_FUNC(hook_command_run)
}
int
-weechat_python_api_hook_timer_cb (void *data, int remaining_calls)
+weechat_python_api_hook_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char str_remaining_calls[32], empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_remaining_calls, sizeof (str_remaining_calls),
"%d", remaining_calls);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_remaining_calls;
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -2113,25 +2134,27 @@ API_FUNC(hook_timer)
}
int
-weechat_python_api_hook_fd_cb (void *data, int fd)
+weechat_python_api_hook_fd_cb (const void *pointer, void *data, int fd)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char str_fd[32], empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_fd, sizeof (str_fd), "%d", fd);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_fd;
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -2179,28 +2202,30 @@ API_FUNC(hook_fd)
}
int
-weechat_python_api_hook_process_cb (void *data,
+weechat_python_api_hook_process_cb (const void *pointer, void *data,
const char *command, int return_code,
const char *out, const char *err)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (command) ? (char *)command : empty_arg;
func_argv[2] = PyLong_FromLong((long)return_code);
func_argv[3] = (out) ? (char *)out : empty_arg;
func_argv[4] = (err) ? (char *)err : empty_arg;
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssOss", func_argv);
if (!rc)
@@ -2284,33 +2309,36 @@ API_FUNC(hook_process_hashtable)
}
int
-weechat_python_api_hook_connect_cb (void *data, int status, int gnutls_rc,
+weechat_python_api_hook_connect_cb (const void *pointer, void *data,
+ int status, int gnutls_rc,
int sock, const char *error,
const char *ip_address)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[6];
char str_status[32], str_gnutls_rc[32], str_sock[32], empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_status, sizeof (str_status), "%d", status);
snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc);
snprintf (str_sock, sizeof (str_sock), "%d", sock);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_status;
func_argv[2] = str_gnutls_rc;
func_argv[3] = str_sock;
func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg;
func_argv[5] = (error) ? (char *)error : empty_arg;
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssssss", func_argv);
if (!rc)
@@ -2366,28 +2394,31 @@ API_FUNC(hook_connect)
}
int
-weechat_python_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
+weechat_python_api_hook_print_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
time_t date,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[8];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
static char timebuffer[64];
int *rc, ret;
/* make C compiler happy */
(void) tags_count;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)date);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = timebuffer;
func_argv[3] = weechat_string_build_with_split_string (tags, ",");
@@ -2398,9 +2429,9 @@ weechat_python_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
func_argv[6] = (prefix) ? (char *)prefix : empty_arg;
func_argv[7] = (message) ? (char *)message : empty_arg;
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssssOOss", func_argv);
if (!rc)
@@ -2460,20 +2491,23 @@ API_FUNC(hook_print)
}
int
-weechat_python_api_hook_signal_cb (void *data, const char *signal, const char *type_data,
+weechat_python_api_hook_signal_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
static char str_value[64];
int *rc, ret, free_needed;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (signal) ? (char *)signal : empty_arg;
free_needed = 0;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
@@ -2498,9 +2532,9 @@ weechat_python_api_hook_signal_cb (void *data, const char *signal, const char *t
else
func_argv[2] = empty_arg;
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2579,25 +2613,28 @@ API_FUNC(hook_signal_send)
}
int
-weechat_python_api_hook_hsignal_cb (void *data, const char *signal,
+weechat_python_api_hook_hsignal_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (signal) ? (char *)signal : empty_arg;
func_argv[2] = weechat_python_hashtable_to_dict (hashtable);
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssO", func_argv);
if (!rc)
@@ -2667,24 +2704,27 @@ API_FUNC(hook_hsignal_send)
}
int
-weechat_python_api_hook_config_cb (void *data, const char *option, const char *value)
+weechat_python_api_hook_config_cb (const void *pointer, void *data,
+ const char *option, const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (option) ? (char *)option : empty_arg;
func_argv[2] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2724,27 +2764,30 @@ API_FUNC(hook_config)
}
int
-weechat_python_api_hook_completion_cb (void *data, const char *completion_item,
+weechat_python_api_hook_completion_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (completion_item) ? (char *)completion_item : empty_arg;
func_argv[2] = API_PTR2STR(buffer);
func_argv[3] = API_PTR2STR(completion);
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -2830,25 +2873,29 @@ API_FUNC(hook_completion_list_add)
}
char *
-weechat_python_api_hook_modifier_cb (void *data, const char *modifier,
- const char *modifier_data, const char *string)
+weechat_python_api_hook_modifier_cb (const void *pointer, void *data,
+ const char *modifier,
+ const char *modifier_data,
+ const char *string)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (modifier) ? (char *)modifier : empty_arg;
func_argv[2] = (modifier_data) ? (char *)modifier_data : empty_arg;
func_argv[3] = (string) ? (char *)string : empty_arg;
- return (char *)weechat_python_exec (script_callback->script,
+ return (char *)weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
}
@@ -2895,24 +2942,27 @@ API_FUNC(hook_modifier_exec)
}
const char *
-weechat_python_api_hook_info_cb (void *data, const char *info_name,
+weechat_python_api_hook_info_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (info_name) ? (char *)info_name : empty_arg;
func_argv[2] = (arguments) ? (char *)arguments : empty_arg;
- return (const char *)weechat_python_exec (script_callback->script,
+ return (const char *)weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
}
@@ -2947,25 +2997,28 @@ API_FUNC(hook_info)
}
struct t_hashtable *
-weechat_python_api_hook_info_hashtable_cb (void *data, const char *info_name,
+weechat_python_api_hook_info_hashtable_cb (const void *pointer, void *data,
+ const char *info_name,
struct t_hashtable *hashtable)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
struct t_hashtable *ret_hashtable;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (info_name) ? (char *)info_name : empty_arg;
func_argv[2] = weechat_python_hashtable_to_dict (hashtable);
- ret_hashtable = weechat_python_exec (script_callback->script,
+ ret_hashtable = weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_HASHTABLE,
- script_callback->function,
+ ptr_function,
"ssO", func_argv);
if (func_argv[2])
@@ -3011,27 +3064,31 @@ API_FUNC(hook_info_hashtable)
}
struct t_infolist *
-weechat_python_api_hook_infolist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+weechat_python_api_hook_infolist_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
struct t_infolist *result;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (infolist_name) ? (char *)infolist_name : empty_arg;
- func_argv[2] = API_PTR2STR(pointer);
+ func_argv[2] = API_PTR2STR(obj_pointer);
func_argv[3] = (arguments) ? (char *)arguments : empty_arg;
- result = (struct t_infolist *)weechat_python_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
- "ssss", func_argv);
+ result = (struct t_infolist *)weechat_python_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_STRING,
+ ptr_function,
+ "ssss", func_argv);
if (func_argv[2])
free (func_argv[2]);
@@ -3074,24 +3131,26 @@ API_FUNC(hook_infolist)
}
struct t_hashtable *
-weechat_python_api_hook_focus_cb (void *data,
+weechat_python_api_hook_focus_cb (const void *pointer, void *data,
struct t_hashtable *info)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
struct t_hashtable *ret_hashtable;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = weechat_python_hashtable_to_dict (info);
- ret_hashtable = weechat_python_exec (script_callback->script,
+ ret_hashtable = weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_HASHTABLE,
- script_callback->function,
+ ptr_function,
"sO", func_argv);
if (func_argv[1])
{
@@ -3153,9 +3212,7 @@ API_FUNC(unhook)
if (!PyArg_ParseTuple (args, "s", &hook))
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_unhook (weechat_python_plugin,
- python_current_script,
- API_STR2PTR(hook));
+ weechat_unhook (API_STR2PTR(hook));
API_RETURN_OK;
}
@@ -3167,31 +3224,34 @@ API_FUNC(unhook_all)
API_INIT_FUNC(1, "unhook_all", API_RETURN_ERROR);
- plugin_script_api_unhook_all (weechat_python_plugin, python_current_script);
+ weechat_unhook_all_plugin (python_current_script->name);
API_RETURN_OK;
}
int
-weechat_python_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
+weechat_python_api_buffer_input_data_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (input_data) ? (char *)input_data : empty_arg;
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -3210,23 +3270,26 @@ weechat_python_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer
}
int
-weechat_python_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+weechat_python_api_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -3343,9 +3406,7 @@ API_FUNC(buffer_close)
if (!PyArg_ParseTuple (args, "s", &buffer))
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_buffer_close (weechat_python_plugin,
- python_current_script,
- API_STR2PTR(buffer));
+ weechat_buffer_close (API_STR2PTR(buffer));
API_RETURN_OK;
}
@@ -3882,31 +3943,34 @@ API_FUNC(bar_item_search)
}
char *
-weechat_python_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
+weechat_python_api_bar_item_build_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' }, *ret;
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- if (strncmp (script_callback->function, "(extra)", 7) == 0)
+ if (strncmp (ptr_function, "(extra)", 7) == 0)
{
/* new callback: data, item, window, buffer, extra_info */
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(item);
func_argv[2] = API_PTR2STR(window);
func_argv[3] = API_PTR2STR(buffer);
func_argv[4] = weechat_python_hashtable_to_dict (extra_info);
- ret = (char *)weechat_python_exec (script_callback->script,
+ ret = (char *)weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function + 7,
+ ptr_function + 7,
"ssssO", func_argv);
if (func_argv[1])
@@ -3923,13 +3987,13 @@ weechat_python_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
else
{
/* old callback: data, item, window */
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(item);
func_argv[2] = API_PTR2STR(window);
- ret = (char *)weechat_python_exec (script_callback->script,
+ ret = (char *)weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (func_argv[1])
@@ -3989,9 +4053,7 @@ API_FUNC(bar_item_remove)
if (!PyArg_ParseTuple (args, "s", &item))
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_bar_item_remove (weechat_python_plugin,
- python_current_script,
- API_STR2PTR(item));
+ weechat_bar_item_remove (API_STR2PTR(item));
API_RETURN_OK;
}
@@ -4814,67 +4876,33 @@ API_FUNC(hdata_get_string)
API_RETURN_STRING(result);
}
-API_FUNC(upgrade_new)
-{
- char *filename, *result;
- int write;
- PyObject *return_value;
-
- API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY);
- filename = NULL;
- write = 0;
- if (!PyArg_ParseTuple (args, "si", &filename, &write))
- API_WRONG_ARGS(API_RETURN_EMPTY);
-
- result = API_PTR2STR(weechat_upgrade_new (filename, write));
-
- API_RETURN_STRING_FREE(result);
-}
-
-API_FUNC(upgrade_write_object)
-{
- char *upgrade_file, *infolist;
- int object_id, rc;
-
- API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0));
- upgrade_file = NULL;
- object_id = 0;
- infolist = NULL;
- if (!PyArg_ParseTuple (args, "sis", &upgrade_file, &object_id, &infolist))
- API_WRONG_ARGS(API_RETURN_INT(0));
-
- rc = weechat_upgrade_write_object (API_STR2PTR(upgrade_file),
- object_id,
- API_STR2PTR(infolist));
-
- API_RETURN_INT(rc);
-}
-
int
-weechat_python_api_upgrade_read_cb (void *data,
+weechat_python_api_upgrade_read_cb (const void *pointer, void *data,
struct t_upgrade_file *upgrade_file,
int object_id,
struct t_infolist *infolist)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' }, str_object_id[32];
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_object_id, sizeof (str_object_id), "%d", object_id);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(upgrade_file);
func_argv[2] = str_object_id;
func_argv[3] = API_PTR2STR(infolist);
- rc = (int *) weechat_python_exec (script_callback->script,
+ rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -4895,24 +4923,60 @@ weechat_python_api_upgrade_read_cb (void *data,
return WEECHAT_RC_ERROR;
}
+API_FUNC(upgrade_new)
+{
+ char *filename, *function, *data, *result;
+ PyObject *return_value;
+
+ API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY);
+ filename = NULL;
+ function = NULL;
+ data = NULL;
+ if (!PyArg_ParseTuple (args, "sss", &filename, &function, &data))
+ API_WRONG_ARGS(API_RETURN_EMPTY);
+
+ result = API_PTR2STR(
+ plugin_script_api_upgrade_new (
+ weechat_python_plugin,
+ python_current_script,
+ filename,
+ &weechat_python_api_upgrade_read_cb,
+ function,
+ data));
+
+ API_RETURN_STRING_FREE(result);
+}
+
+API_FUNC(upgrade_write_object)
+{
+ char *upgrade_file, *infolist;
+ int object_id, rc;
+
+ API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0));
+ upgrade_file = NULL;
+ object_id = 0;
+ infolist = NULL;
+ if (!PyArg_ParseTuple (args, "sis", &upgrade_file, &object_id, &infolist))
+ API_WRONG_ARGS(API_RETURN_INT(0));
+
+ rc = weechat_upgrade_write_object (API_STR2PTR(upgrade_file),
+ object_id,
+ API_STR2PTR(infolist));
+
+ API_RETURN_INT(rc);
+}
+
API_FUNC(upgrade_read)
{
- char *upgrade_file, *function, *data;
+ char *upgrade_file;
int rc;
API_INIT_FUNC(1, "upgrade_read", API_RETURN_INT(0));
upgrade_file = NULL;
- function = NULL;
- data = NULL;
- if (!PyArg_ParseTuple (args, "sss", &upgrade_file, &function, &data))
+ if (!PyArg_ParseTuple (args, "s", &upgrade_file))
API_WRONG_ARGS(API_RETURN_INT(0));
- rc = plugin_script_api_upgrade_read (weechat_python_plugin,
- python_current_script,
- API_STR2PTR(upgrade_file),
- &weechat_python_api_upgrade_read_cb,
- function,
- data);
+ rc = weechat_upgrade_read (API_STR2PTR(upgrade_file));
API_RETURN_INT(rc);
}
diff --git a/src/plugins/python/weechat-python-api.h b/src/plugins/python/weechat-python-api.h
index 68b434b33..131a4661c 100644
--- a/src/plugins/python/weechat-python-api.h
+++ b/src/plugins/python/weechat-python-api.h
@@ -23,10 +23,12 @@
extern PyMethodDef weechat_python_funcs[];
-extern int weechat_python_api_buffer_input_data_cb (void *data,
+extern int weechat_python_api_buffer_input_data_cb (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data);
-extern int weechat_python_api_buffer_close_cb (void *data,
+extern int weechat_python_api_buffer_close_cb (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer);
#endif /* WEECHAT_PYTHON_API_H */
diff --git a/src/plugins/python/weechat-python.c b/src/plugins/python/weechat-python.c
index de19aa3f8..5981df271 100644
--- a/src/plugins/python/weechat-python.c
+++ b/src/plugins/python/weechat-python.c
@@ -232,8 +232,7 @@ weechat_python_hashtable_to_dict (struct t_hashtable *hashtable)
return Py_None;
}
- weechat_hashtable_map_string (hashtable,
- &weechat_python_hashtable_map_cb,
+ weechat_hashtable_map_string (hashtable, &weechat_python_hashtable_map_cb,
dict);
return dict;
@@ -927,12 +926,14 @@ weechat_python_reload_name (const char *name)
*/
int
-weechat_python_command_cb (void *data, struct t_gui_buffer *buffer,
+weechat_python_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
char *ptr_name, *path_script;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -1028,11 +1029,13 @@ weechat_python_command_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-weechat_python_completion_cb (void *data, const char *completion_item,
+weechat_python_completion_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -1047,13 +1050,15 @@ weechat_python_completion_cb (void *data, const char *completion_item,
*/
const char *
-weechat_python_info_cb (void *data, const char *info_name,
+weechat_python_info_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
int rc;
struct stat stat_buf;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) arguments;
@@ -1079,9 +1084,11 @@ weechat_python_info_cb (void *data, const char *info_name,
*/
struct t_hdata *
-weechat_python_hdata_cb (void *data, const char *hdata_name)
+weechat_python_hdata_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
return plugin_script_hdata_script (weechat_plugin,
@@ -1094,10 +1101,12 @@ weechat_python_hdata_cb (void *data, const char *hdata_name)
*/
struct t_infolist *
-weechat_python_infolist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+weechat_python_infolist_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!infolist_name || !infolist_name[0])
@@ -1106,7 +1115,8 @@ weechat_python_infolist_cb (void *data, const char *infolist_name,
if (weechat_strcasecmp (infolist_name, "python_script") == 0)
{
return plugin_script_infolist_list_scripts (weechat_python_plugin,
- python_scripts, pointer,
+ python_scripts,
+ obj_pointer,
arguments);
}
@@ -1118,10 +1128,12 @@ weechat_python_infolist_cb (void *data, const char *infolist_name,
*/
int
-weechat_python_signal_debug_dump_cb (void *data, const char *signal,
+weechat_python_signal_debug_dump_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -1140,10 +1152,12 @@ weechat_python_signal_debug_dump_cb (void *data, const char *signal,
*/
int
-weechat_python_signal_debug_libs_cb (void *data, const char *signal,
+weechat_python_signal_debug_libs_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -1159,38 +1173,20 @@ weechat_python_signal_debug_libs_cb (void *data, const char *signal,
}
/*
- * Callback called when a buffer is closed.
- */
-
-int
-weechat_python_signal_buffer_closed_cb (void *data, const char *signal,
- const char *type_data,
- void *signal_data)
-{
- /* make C compiler happy */
- (void) data;
- (void) signal;
- (void) type_data;
-
- if (signal_data)
- plugin_script_remove_buffer_callbacks (python_scripts, signal_data);
-
- return WEECHAT_RC_OK;
-}
-
-/*
* Timer for executing actions.
*/
int
-weechat_python_timer_action_cb (void *data, int remaining_calls)
+weechat_python_timer_action_cb (const void *pointer, void *data,
+ int remaining_calls)
{
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- if (data)
+ if (pointer)
{
- if (data == &python_action_install_list)
+ if (pointer == &python_action_install_list)
{
plugin_script_action_install (weechat_python_plugin,
python_scripts,
@@ -1199,7 +1195,7 @@ weechat_python_timer_action_cb (void *data, int remaining_calls)
&python_quiet,
&python_action_install_list);
}
- else if (data == &python_action_remove_list)
+ else if (pointer == &python_action_remove_list)
{
plugin_script_action_remove (weechat_python_plugin,
python_scripts,
@@ -1207,7 +1203,7 @@ weechat_python_timer_action_cb (void *data, int remaining_calls)
&python_quiet,
&python_action_remove_list);
}
- else if (data == &python_action_autoload_list)
+ else if (pointer == &python_action_autoload_list)
{
plugin_script_action_autoload (weechat_python_plugin,
&python_quiet,
@@ -1224,11 +1220,13 @@ weechat_python_timer_action_cb (void *data, int remaining_calls)
*/
int
-weechat_python_signal_script_action_cb (void *data, const char *signal,
+weechat_python_signal_script_action_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
@@ -1239,7 +1237,7 @@ weechat_python_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_python_timer_action_cb,
- &python_action_install_list);
+ &python_action_install_list, NULL);
}
else if (strcmp (signal, "python_script_remove") == 0)
{
@@ -1247,7 +1245,7 @@ weechat_python_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_python_timer_action_cb,
- &python_action_remove_list);
+ &python_action_remove_list, NULL);
}
else if (strcmp (signal, "python_script_autoload") == 0)
{
@@ -1255,7 +1253,7 @@ weechat_python_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_python_timer_action_cb,
- &python_action_autoload_list);
+ &python_action_autoload_list, NULL);
}
}
@@ -1281,7 +1279,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
weechat_hook_info ("python2_bin",
N_("path to python 2.x interpreter"),
NULL,
- &weechat_python_info_cb, NULL);
+ &weechat_python_info_cb, NULL, NULL);
/* init stdout/stderr buffer */
python_buffer_output[0] = '\0';
@@ -1319,7 +1317,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
init.callback_infolist = &weechat_python_infolist_cb;
init.callback_signal_debug_dump = &weechat_python_signal_debug_dump_cb;
init.callback_signal_debug_libs = &weechat_python_signal_debug_libs_cb;
- init.callback_signal_buffer_closed = &weechat_python_signal_buffer_closed_cb;
init.callback_signal_script_action = &weechat_python_signal_script_action_cb;
init.callback_load_file = &weechat_python_load_cb;
diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c
index 63c930bc8..502a7b6b9 100644
--- a/src/plugins/relay/irc/relay-irc.c
+++ b/src/plugins/relay/irc/relay-irc.c
@@ -158,8 +158,7 @@ relay_irc_message_parse (const char *message)
hash_msg = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (!hash_msg)
{
weechat_printf (NULL,
@@ -214,8 +213,7 @@ relay_irc_sendf (struct t_relay_client *client, const char *format, ...)
hashtable_in = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (hashtable_in)
{
weechat_hashtable_set (hashtable_in, "server", client->protocol_args);
@@ -258,7 +256,8 @@ relay_irc_sendf (struct t_relay_client *client, const char *format, ...)
*/
int
-relay_irc_signal_irc_in2_cb (void *data, const char *signal,
+relay_irc_signal_irc_in2_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
struct t_relay_client *client;
@@ -266,10 +265,11 @@ relay_irc_signal_irc_in2_cb (void *data, const char *signal,
struct t_hashtable *hash_parsed;
/* make C compiler happy */
+ (void) data;
(void) signal;
(void) type_data;
- client = (struct t_relay_client *)data;
+ client = (struct t_relay_client *)pointer;
ptr_msg = (const char *)signal_data;
if (weechat_relay_plugin->debug >= 2)
@@ -368,7 +368,8 @@ relay_irc_tag_relay_client_id (const char *tags)
*/
int
-relay_irc_signal_irc_outtags_cb (void *data, const char *signal,
+relay_irc_signal_irc_outtags_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data)
{
@@ -380,10 +381,11 @@ relay_irc_signal_irc_outtags_cb (void *data, const char *signal,
char str_infolist_args[256];
/* make C compiler happy */
+ (void) data;
(void) signal;
(void) type_data;
- client = (struct t_relay_client *)data;
+ client = (struct t_relay_client *)pointer;
tags = NULL;
@@ -483,17 +485,19 @@ end:
*/
int
-relay_irc_signal_irc_disc_cb (void *data, const char *signal,
+relay_irc_signal_irc_disc_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
struct t_relay_client *client;
/* make C compiler happy */
+ (void) data;
(void) signal;
(void) type_data;
(void) signal_data;
- client = (struct t_relay_client *)data;
+ client = (struct t_relay_client *)pointer;
if (weechat_relay_plugin->debug >= 2)
{
@@ -516,7 +520,8 @@ relay_irc_signal_irc_disc_cb (void *data, const char *signal,
*/
int
-relay_irc_hsignal_irc_redir_cb (void *data, const char *signal,
+relay_irc_hsignal_irc_redir_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable)
{
struct t_relay_client *client;
@@ -524,7 +529,10 @@ relay_irc_hsignal_irc_redir_cb (void *data, const char *signal,
char pattern[128], **messages;
const char *output;
- client = (struct t_relay_client *)data;
+ /* make C compiler happy */
+ (void) data;
+
+ client = (struct t_relay_client *)pointer;
if (weechat_relay_plugin->debug >= 2)
{
@@ -1179,7 +1187,7 @@ relay_irc_hook_signals (struct t_relay_client *client)
RELAY_IRC_DATA(client, hook_signal_irc_in2) =
weechat_hook_signal (str_signal_name,
&relay_irc_signal_irc_in2_cb,
- client);
+ client, NULL);
/*
* hook signal "xxx,irc_outtags_*" to catch IRC data sent to
@@ -1191,7 +1199,7 @@ relay_irc_hook_signals (struct t_relay_client *client)
RELAY_IRC_DATA(client, hook_signal_irc_outtags) =
weechat_hook_signal (str_signal_name,
&relay_irc_signal_irc_outtags_cb,
- client);
+ client, NULL);
/*
* hook signal "irc_server_disconnected" to disconnect client if
@@ -1200,7 +1208,7 @@ relay_irc_hook_signals (struct t_relay_client *client)
RELAY_IRC_DATA(client, hook_signal_irc_disc) =
weechat_hook_signal ("irc_server_disconnected",
&relay_irc_signal_irc_disc_cb,
- client);
+ client, NULL);
/*
* hook hsignal "irc_redirection_*" to redirect some messages
@@ -1208,7 +1216,7 @@ relay_irc_hook_signals (struct t_relay_client *client)
RELAY_IRC_DATA(client, hook_hsignal_irc_redir) =
weechat_hook_hsignal ("irc_redirection_relay_*",
&relay_irc_hsignal_irc_redir_cb,
- client);
+ client, NULL);
}
/*
@@ -1609,8 +1617,7 @@ relay_irc_recv (struct t_relay_client *client, const char *data)
hash_redirect = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (hash_redirect)
{
redirect_msg = 0;
diff --git a/src/plugins/relay/relay-buffer.c b/src/plugins/relay/relay-buffer.c
index 502384e4e..fe7751c48 100644
--- a/src/plugins/relay/relay-buffer.c
+++ b/src/plugins/relay/relay-buffer.c
@@ -152,12 +152,14 @@ relay_buffer_refresh (const char *hotlist)
*/
int
-relay_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
+relay_buffer_input_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data)
{
struct t_relay_client *client, *ptr_client, *next_client;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (buffer == relay_raw_buffer)
@@ -215,9 +217,11 @@ relay_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-relay_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+relay_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (buffer == relay_raw_buffer)
@@ -242,8 +246,8 @@ relay_buffer_open ()
if (!relay_buffer)
{
relay_buffer = weechat_buffer_new (RELAY_BUFFER_NAME,
- &relay_buffer_input_cb, NULL,
- &relay_buffer_close_cb, NULL);
+ &relay_buffer_input_cb, NULL, NULL,
+ &relay_buffer_close_cb, NULL, NULL);
/* failed to create buffer ? then exit */
if (!relay_buffer)
diff --git a/src/plugins/relay/relay-buffer.h b/src/plugins/relay/relay-buffer.h
index a377f4340..09f316a70 100644
--- a/src/plugins/relay/relay-buffer.h
+++ b/src/plugins/relay/relay-buffer.h
@@ -26,9 +26,11 @@ extern struct t_gui_buffer *relay_buffer;
extern int relay_buffer_selected_line;
extern void relay_buffer_refresh (const char *hotlist);
-extern int relay_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
- const char *input_data);
-extern int relay_buffer_close_cb (void *data, struct t_gui_buffer *buffer);
+extern int relay_buffer_input_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
+ const char *input_data);
+extern int relay_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer);
extern void relay_buffer_open ();
#endif /* WEECHAT_RELAY_BUFFER_H */
diff --git a/src/plugins/relay/relay-client.c b/src/plugins/relay/relay-client.c
index 76d66d263..684a8dd10 100644
--- a/src/plugins/relay/relay-client.c
+++ b/src/plugins/relay/relay-client.c
@@ -231,12 +231,16 @@ relay_client_set_desc (struct t_relay_client *client)
#ifdef HAVE_GNUTLS
int
-relay_client_handshake_timer_cb (void *data, int remaining_calls)
+relay_client_handshake_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
struct t_relay_client *client;
int rc;
- client = (struct t_relay_client *)data;
+ /* make C compiler happy */
+ (void) data;
+
+ client = (struct t_relay_client *)pointer;
rc = gnutls_handshake (client->gnutls_sess);
@@ -528,7 +532,7 @@ relay_client_recv_text_buffer (struct t_relay_client *client,
*/
int
-relay_client_recv_cb (void *arg_client, int fd)
+relay_client_recv_cb (const void *pointer, void *data, int fd)
{
struct t_relay_client *client;
static char buffer[4096], decoded[8192 + 1];
@@ -537,9 +541,10 @@ relay_client_recv_cb (void *arg_client, int fd)
unsigned long long decoded_length, length_buffer;
/* make C compiler happy */
+ (void) data;
(void) fd;
- client = (struct t_relay_client *)arg_client;
+ client = (struct t_relay_client *)pointer;
if (client->status != RELAY_STATUS_CONNECTED)
return WEECHAT_RC_OK;
@@ -572,11 +577,11 @@ relay_client_recv_cb (void *arg_client, int fd)
* valid or not)
*/
client->websocket = 1;
- client->http_headers = weechat_hashtable_new (32,
- WEECHAT_HASHTABLE_STRING,
- WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ client->http_headers = weechat_hashtable_new (
+ 32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING,
+ NULL, NULL);
}
}
@@ -1003,7 +1008,7 @@ relay_client_send (struct t_relay_client *client,
*/
int
-relay_client_timer_cb (void *data, int remaining_calls)
+relay_client_timer_cb (const void *pointer, void *data, int remaining_calls)
{
struct t_relay_client *ptr_client, *ptr_next_client;
int num_sent, i, purge_delay;
@@ -1011,6 +1016,7 @@ relay_client_timer_cb (void *data, int remaining_calls)
time_t current_time;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) remaining_calls;
@@ -1275,7 +1281,8 @@ relay_client_new (int sock, const char *address, struct t_relay_server *server)
(ptr_option) ?
weechat_config_integer (ptr_option) * 10 : 30 * 10,
&relay_client_handshake_timer_cb,
- new_client);
+ new_client,
+ NULL);
}
#endif /* HAVE_GNUTLS */
@@ -1314,7 +1321,7 @@ relay_client_new (int sock, const char *address, struct t_relay_server *server)
new_client->hook_fd = weechat_hook_fd (new_client->sock,
1, 0, 0,
&relay_client_recv_cb,
- new_client);
+ new_client, NULL);
relay_client_count++;
@@ -1380,7 +1387,8 @@ relay_client_new_with_infolist (struct t_infolist *infolist)
new_client->hook_fd = weechat_hook_fd (new_client->sock,
1, 0, 0,
&relay_client_recv_cb,
- new_client);
+ new_client,
+ NULL);
}
else
new_client->hook_fd = NULL;
diff --git a/src/plugins/relay/relay-client.h b/src/plugins/relay/relay-client.h
index 89f3166cd..f76eaacd7 100644
--- a/src/plugins/relay/relay-client.h
+++ b/src/plugins/relay/relay-client.h
@@ -131,12 +131,13 @@ extern struct t_relay_client *relay_client_search_by_id (int id);
extern int relay_client_status_search (const char *name);
extern int relay_client_count_active_by_port (int server_port);
extern void relay_client_set_desc (struct t_relay_client *client);
-extern int relay_client_recv_cb (void *arg_client, int fd);
+extern int relay_client_recv_cb (const void *pointer, void *data, int fd);
extern int relay_client_send (struct t_relay_client *client,
enum t_relay_client_msg_type msg_type,
const char *data,
int data_size, const char *message_raw_buffer);
-extern int relay_client_timer_cb (void *data, int remaining_calls);
+extern int relay_client_timer_cb (const void *pointer, void *data,
+ int remaining_calls);
extern struct t_relay_client *relay_client_new (int sock, const char *address,
struct t_relay_server *server);
extern struct t_relay_client *relay_client_new_with_infolist (struct t_infolist *infolist);
diff --git a/src/plugins/relay/relay-command.c b/src/plugins/relay/relay-command.c
index e795bdeaa..8774d3923 100644
--- a/src/plugins/relay/relay-command.c
+++ b/src/plugins/relay/relay-command.c
@@ -183,7 +183,8 @@ relay_command_server_list ()
*/
int
-relay_command_relay (void *data, struct t_gui_buffer *buffer, int argc,
+relay_command_relay (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
struct t_relay_server *ptr_server;
@@ -191,6 +192,7 @@ relay_command_relay (void *data, struct t_gui_buffer *buffer, int argc,
int port;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -217,11 +219,12 @@ relay_command_relay (void *data, struct t_gui_buffer *buffer, int argc,
if (weechat_strcasecmp (argv[1], "add") == 0)
{
WEECHAT_COMMAND_MIN_ARGS(4, "add");
- if (relay_config_create_option_port (NULL,
- relay_config_file,
- relay_config_section_port,
- argv[2],
- argv_eol[3]) != WEECHAT_CONFIG_OPTION_SET_ERROR)
+ if (relay_config_create_option_port (
+ NULL, NULL,
+ relay_config_file,
+ relay_config_section_port,
+ argv[2],
+ argv_eol[3]) != WEECHAT_CONFIG_OPTION_SET_ERROR)
{
weechat_printf (NULL,
_("%s: relay \"%s\" (port %s) added"),
@@ -420,5 +423,5 @@ relay_command_init ()
" || restart %(relay_relays)"
" || raw"
" || sslcertkey",
- &relay_command_relay, NULL);
+ &relay_command_relay, NULL, NULL);
}
diff --git a/src/plugins/relay/relay-completion.c b/src/plugins/relay/relay-completion.c
index b1fed1062..e5253714a 100644
--- a/src/plugins/relay/relay-completion.c
+++ b/src/plugins/relay/relay-completion.c
@@ -33,7 +33,8 @@
*/
int
-relay_completion_protocol_name_cb (void *data, const char *completion_item,
+relay_completion_protocol_name_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -41,6 +42,7 @@ relay_completion_protocol_name_cb (void *data, const char *completion_item,
char protocol_name[512];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
(void) completion_item;
@@ -75,13 +77,15 @@ relay_completion_protocol_name_cb (void *data, const char *completion_item,
*/
int
-relay_completion_relays_cb (void *data, const char *completion_item,
+relay_completion_relays_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
struct t_relay_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
(void) completion_item;
@@ -102,7 +106,8 @@ relay_completion_relays_cb (void *data, const char *completion_item,
*/
int
-relay_completion_free_port_cb (void *data, const char *completion_item,
+relay_completion_free_port_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -111,6 +116,7 @@ relay_completion_free_port_cb (void *data, const char *completion_item,
int port_max;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
(void) completion_item;
@@ -141,12 +147,12 @@ relay_completion_init ()
{
weechat_hook_completion ("relay_protocol_name",
N_("all possible protocol.name for relay plugin"),
- &relay_completion_protocol_name_cb, NULL);
+ &relay_completion_protocol_name_cb, NULL, NULL);
weechat_hook_completion ("relay_relays",
N_("protocol.name of current relays for relay "
"plugin"),
- &relay_completion_relays_cb, NULL);
+ &relay_completion_relays_cb, NULL, NULL);
weechat_hook_completion ("relay_free_port",
N_("first free port for relay plugin"),
- &relay_completion_free_port_cb, NULL);
+ &relay_completion_free_port_cb, NULL, NULL);
}
diff --git a/src/plugins/relay/relay-config.c b/src/plugins/relay/relay-config.c
index 6d12a24d4..3d979ee01 100644
--- a/src/plugins/relay/relay-config.c
+++ b/src/plugins/relay/relay-config.c
@@ -84,9 +84,11 @@ struct t_hashtable *relay_config_hashtable_irc_backlog_tags = NULL;
*/
void
-relay_config_refresh_cb (void *data, struct t_config_option *option)
+relay_config_refresh_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -99,12 +101,13 @@ relay_config_refresh_cb (void *data, struct t_config_option *option)
*/
void
-relay_config_change_network_allowed_ips (void *data,
+relay_config_change_network_allowed_ips (const void *pointer, void *data,
struct t_config_option *option)
{
const char *allowed_ips;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -137,12 +140,13 @@ relay_config_change_network_allowed_ips (void *data,
*/
void
-relay_config_change_network_bind_address_cb (void *data,
+relay_config_change_network_bind_address_cb (const void *pointer, void *data,
struct t_config_option *option)
{
struct t_relay_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -159,11 +163,13 @@ relay_config_change_network_bind_address_cb (void *data,
*/
void
-relay_config_change_network_ipv6_cb (void *data, struct t_config_option *option)
+relay_config_change_network_ipv6_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_relay_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -183,10 +189,11 @@ relay_config_change_network_ipv6_cb (void *data, struct t_config_option *option)
*/
void
-relay_config_change_network_ssl_cert_key (void *data,
+relay_config_change_network_ssl_cert_key (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -199,7 +206,7 @@ relay_config_change_network_ssl_cert_key (void *data,
*/
int
-relay_config_check_network_ssl_priorities (void *data,
+relay_config_check_network_ssl_priorities (const void *pointer, void *data,
struct t_config_option *option,
const char *value)
{
@@ -209,6 +216,7 @@ relay_config_check_network_ssl_priorities (void *data,
int rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -246,10 +254,11 @@ relay_config_check_network_ssl_priorities (void *data,
*/
void
-relay_config_change_network_ssl_priorities (void *data,
+relay_config_change_network_ssl_priorities (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -267,12 +276,13 @@ relay_config_change_network_ssl_priorities (void *data,
*/
void
-relay_config_change_network_websocket_allowed_origins (void *data,
+relay_config_change_network_websocket_allowed_origins (const void *pointer, void *data,
struct t_config_option *option)
{
const char *allowed_origins;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -309,7 +319,7 @@ relay_config_change_network_websocket_allowed_origins (void *data,
*/
int
-relay_config_check_irc_backlog_tags (void *data,
+relay_config_check_irc_backlog_tags (const void *pointer, void *data,
struct t_config_option *option,
const char *value)
{
@@ -317,6 +327,7 @@ relay_config_check_irc_backlog_tags (void *data,
int num_tags, i, rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -349,23 +360,24 @@ relay_config_check_irc_backlog_tags (void *data,
*/
void
-relay_config_change_irc_backlog_tags (void *data,
+relay_config_change_irc_backlog_tags (const void *pointer, void *data,
struct t_config_option *option)
{
char **items;
int num_items, i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
if (!relay_config_hashtable_irc_backlog_tags)
{
- relay_config_hashtable_irc_backlog_tags = weechat_hashtable_new (32,
- WEECHAT_HASHTABLE_STRING,
- WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ relay_config_hashtable_irc_backlog_tags = weechat_hashtable_new (
+ 32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING,
+ NULL, NULL);
}
else
weechat_hashtable_remove_all (relay_config_hashtable_irc_backlog_tags);
@@ -393,7 +405,8 @@ relay_config_change_irc_backlog_tags (void *data,
*/
int
-relay_config_check_port_cb (void *data, struct t_config_option *option,
+relay_config_check_port_cb (const void *pointer, void *data,
+ struct t_config_option *option,
const char *value)
{
char *error;
@@ -401,6 +414,7 @@ relay_config_check_port_cb (void *data, struct t_config_option *option,
struct t_relay_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -423,11 +437,13 @@ relay_config_check_port_cb (void *data, struct t_config_option *option,
*/
void
-relay_config_change_port_cb (void *data, struct t_config_option *option)
+relay_config_change_port_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_relay_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_server = relay_server_search (weechat_config_option_get_pointer (option, "name"));
@@ -443,11 +459,13 @@ relay_config_change_port_cb (void *data, struct t_config_option *option)
*/
void
-relay_config_delete_port_cb (void *data, struct t_config_option *option)
+relay_config_delete_port_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_relay_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_server = relay_server_search (weechat_config_option_get_pointer (option, "name"));
@@ -460,7 +478,7 @@ relay_config_delete_port_cb (void *data, struct t_config_option *option)
*/
int
-relay_config_create_option_port (void *data,
+relay_config_create_option_port (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
@@ -472,6 +490,7 @@ relay_config_create_option_port (void *data,
struct t_relay_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE;
@@ -551,9 +570,9 @@ relay_config_create_option_port (void *data,
config_file, section,
option_name, "integer", NULL,
NULL, 0, 65535, "", value, 0,
- &relay_config_check_port_cb, NULL,
- &relay_config_change_port_cb, NULL,
- &relay_config_delete_port_cb, NULL);
+ &relay_config_check_port_cb, NULL, NULL,
+ &relay_config_change_port_cb, NULL, NULL,
+ &relay_config_delete_port_cb, NULL, NULL);
rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE;
}
else
@@ -573,9 +592,11 @@ relay_config_create_option_port (void *data,
*/
int
-relay_config_reload (void *data, struct t_config_file *config_file)
+relay_config_reload (const void *pointer, void *data,
+ struct t_config_file *config_file)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
weechat_config_section_free_options (relay_config_section_port);
@@ -598,16 +619,18 @@ relay_config_init ()
struct t_config_section *ptr_section;
relay_config_file = weechat_config_new (RELAY_CONFIG_NAME,
- &relay_config_reload, NULL);
+ &relay_config_reload, NULL, NULL);
if (!relay_config_file)
return 0;
/* section look */
ptr_section = weechat_config_new_section (relay_config_file, "look",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (relay_config_file);
@@ -618,20 +641,24 @@ relay_config_init ()
relay_config_file, ptr_section,
"auto_open_buffer", "boolean",
N_("auto open relay buffer when a new client is connecting"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
relay_config_look_raw_messages = weechat_config_new_option (
relay_config_file, ptr_section,
"raw_messages", "integer",
N_("number of raw messages to save in memory when raw data buffer is "
"closed (messages will be displayed when opening raw data buffer)"),
- NULL, 0, 65535, "256", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 65535, "256", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* section color */
ptr_section = weechat_config_new_section (relay_config_file, "color",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (relay_config_file);
@@ -643,62 +670,80 @@ relay_config_init ()
"client", "color",
N_("text color for client description"),
NULL, 0, 0, "cyan", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
relay_config_color_status[RELAY_STATUS_CONNECTING] = weechat_config_new_option (
relay_config_file, ptr_section,
"status_connecting", "color",
N_("text color for \"connecting\" status"),
NULL, 0, 0, "yellow", NULL, 0,
- NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &relay_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
relay_config_color_status[RELAY_STATUS_WAITING_AUTH] = weechat_config_new_option (
relay_config_file, ptr_section,
"status_waiting_auth", "color",
N_("text color for \"waiting authentication\" status"),
NULL, 0, 0, "brown", NULL, 0,
- NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &relay_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
relay_config_color_status[RELAY_STATUS_CONNECTED] = weechat_config_new_option (
relay_config_file, ptr_section,
"status_active", "color",
N_("text color for \"connected\" status"),
NULL, 0, 0, "lightblue", NULL, 0,
- NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &relay_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
relay_config_color_status[RELAY_STATUS_AUTH_FAILED] = weechat_config_new_option (
relay_config_file, ptr_section,
"status_auth_failed", "color",
N_("text color for \"authentication failed\" status"),
NULL, 0, 0, "lightred", NULL, 0,
- NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &relay_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
relay_config_color_status[RELAY_STATUS_DISCONNECTED] = weechat_config_new_option (
relay_config_file, ptr_section,
"status_disconnected", "color",
N_("text color for \"disconnected\" status"),
NULL, 0, 0, "lightred", NULL, 0,
- NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &relay_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
relay_config_color_text = weechat_config_new_option (
relay_config_file, ptr_section,
"text", "color",
N_("text color in relay buffer"),
NULL, 0, 0, "default", NULL, 0,
- NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &relay_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
relay_config_color_text_bg = weechat_config_new_option (
relay_config_file, ptr_section,
"text_bg", "color",
N_("background color in relay buffer"),
NULL, 0, 0, "default", NULL, 0,
- NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &relay_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
relay_config_color_text_selected = weechat_config_new_option (
relay_config_file, ptr_section,
"text_selected", "color",
N_("text color of selected line in relay buffer"),
NULL, 0, 0, "white", NULL, 0,
- NULL, NULL, &relay_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &relay_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
/* section network */
ptr_section = weechat_config_new_section (relay_config_file, "network",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (relay_config_file);
@@ -712,23 +757,27 @@ relay_config_init ()
"(case insensitive, use \"(?-i)\" at beginning to make it case "
"sensitive), example: "
"\"^(123.45.67.89|192.160.*)$\""),
- NULL, 0, 0, "", NULL, 0, NULL, NULL,
- &relay_config_change_network_allowed_ips, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL,
+ &relay_config_change_network_allowed_ips, NULL, NULL,
+ NULL, NULL, NULL);
relay_config_network_bind_address = weechat_config_new_option (
relay_config_file, ptr_section,
"bind_address", "string",
N_("address for bind (if empty, connection is possible on all "
"interfaces, use \"127.0.0.1\" to allow connections from "
"local machine only)"),
- NULL, 0, 0, "", NULL, 0, NULL, NULL,
- &relay_config_change_network_bind_address_cb, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL,
+ &relay_config_change_network_bind_address_cb, NULL, NULL,
+ NULL, NULL, NULL);
relay_config_network_clients_purge_delay = weechat_config_new_option (
relay_config_file, ptr_section,
"clients_purge_delay", "integer",
N_("delay for purging disconnected clients (in minutes, 0 = purge "
"clients immediately, -1 = never purge)"),
NULL, -1, 60 * 24 * 30, "0", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
relay_config_network_compression_level = weechat_config_new_option (
relay_config_file, ptr_section,
"compression_level", "integer",
@@ -736,35 +785,40 @@ relay_config_init ()
"(0 = disable compression, 1 = low compression ... 9 = best "
"compression)"),
NULL, 0, 9, "6", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
relay_config_network_ipv6 = weechat_config_new_option (
relay_config_file, ptr_section,
"ipv6", "boolean",
N_("listen on IPv6 socket by default (in addition to IPv4 which is "
"default); protocols IPv4 and IPv6 can be forced (individually or "
"together) in the protocol name (see /help relay)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- &relay_config_change_network_ipv6_cb, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &relay_config_change_network_ipv6_cb, NULL, NULL,
+ NULL, NULL, NULL);
relay_config_network_max_clients = weechat_config_new_option (
relay_config_file, ptr_section,
"max_clients", "integer",
N_("maximum number of clients connecting to a port (0 = no limit)"),
NULL, 0, INT_MAX, "5", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
relay_config_network_password = weechat_config_new_option (
relay_config_file, ptr_section,
"password", "string",
N_("password required by clients to access this relay (empty value "
"means no password required) (note: content is evaluated, see "
"/help eval)"),
- NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
relay_config_network_ssl_cert_key = weechat_config_new_option (
relay_config_file, ptr_section,
"ssl_cert_key", "string",
N_("file with SSL certificate and private key (for serving clients "
"with SSL)"),
- NULL, 0, 0, "%h/ssl/relay.pem", NULL, 0, NULL, NULL,
- &relay_config_change_network_ssl_cert_key, NULL, NULL, NULL);
+ NULL, 0, 0, "%h/ssl/relay.pem", NULL, 0,
+ NULL, NULL, NULL,
+ &relay_config_change_network_ssl_cert_key, NULL, NULL,
+ NULL, NULL, NULL);
relay_config_network_ssl_priorities = weechat_config_new_option (
relay_config_file, ptr_section,
"ssl_priorities", "string",
@@ -773,8 +827,9 @@ relay_config_init ()
"manual, common strings are: \"PERFORMANCE\", \"NORMAL\", "
"\"SECURE128\", \"SECURE256\", \"EXPORT\", \"NONE\")"),
NULL, 0, 0, "NORMAL:-VERS-SSL3.0", NULL, 0,
- &relay_config_check_network_ssl_priorities, NULL,
- &relay_config_change_network_ssl_priorities, NULL, NULL, NULL);
+ &relay_config_check_network_ssl_priorities, NULL, NULL,
+ &relay_config_change_network_ssl_priorities, NULL, NULL,
+ NULL, NULL, NULL);
relay_config_network_websocket_allowed_origins = weechat_config_new_option (
relay_config_file, ptr_section,
"websocket_allowed_origins", "string",
@@ -782,15 +837,19 @@ relay_config_init ()
"websockets (case insensitive, use \"(?-i)\" at beginning to make "
"it case sensitive), example: "
"\"^http://(www\\.)?example\\.(com|org)\""),
- NULL, 0, 0, "", NULL, 0, NULL, NULL,
- &relay_config_change_network_websocket_allowed_origins, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL,
+ &relay_config_change_network_websocket_allowed_origins, NULL, NULL,
+ NULL, NULL, NULL);
/* section irc */
ptr_section = weechat_config_new_section (relay_config_file, "irc",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (relay_config_file);
@@ -804,24 +863,26 @@ relay_config_init ()
"(0 = unlimited, examples: 1440 = one day, 10080 = one week, "
"43200 = one month, 525600 = one year)"),
NULL, 0, INT_MAX, "1440", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
relay_config_irc_backlog_max_number = weechat_config_new_option (
relay_config_file, ptr_section,
"backlog_max_number", "integer",
N_("maximum number of lines in backlog per IRC channel "
"(0 = unlimited)"),
NULL, 0, INT_MAX, "256", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
relay_config_irc_backlog_since_last_disconnect = weechat_config_new_option (
relay_config_file, ptr_section,
"backlog_since_last_disconnect", "boolean",
N_("display backlog starting from last client disconnect"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
relay_config_irc_backlog_since_last_message = weechat_config_new_option (
relay_config_file, ptr_section,
"backlog_since_last_message", "boolean",
N_("display backlog starting from your last message"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
relay_config_irc_backlog_tags = weechat_config_new_option (
relay_config_file, ptr_section,
"backlog_tags", "string",
@@ -830,8 +891,9 @@ relay_config_init ()
"\"irc_part\", \"irc_quit\", \"irc_nick\", \"irc_privmsg\"), "
"\"*\" = all supported tags"),
NULL, 0, 0, "irc_privmsg", NULL, 0,
- &relay_config_check_irc_backlog_tags, NULL,
- &relay_config_change_irc_backlog_tags, NULL, NULL, NULL);
+ &relay_config_check_irc_backlog_tags, NULL, NULL,
+ &relay_config_change_irc_backlog_tags, NULL, NULL,
+ NULL, NULL, NULL);
relay_config_irc_backlog_time_format = weechat_config_new_option (
relay_config_file, ptr_section,
"backlog_time_format", "string",
@@ -839,16 +901,18 @@ relay_config_init ()
"(not used if server capability \"server-time\" was enabled by "
"client, because time is sent as irc tag); empty string = disable "
"time in backlog messages"),
- NULL, 0, 0, "[%H:%M] ", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "[%H:%M] ", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* section port */
- ptr_section = weechat_config_new_section (relay_config_file, "port",
- 1, 1,
- NULL, NULL,
- NULL, NULL,
- NULL, NULL,
- &relay_config_create_option_port, NULL,
- NULL, NULL);
+ ptr_section = weechat_config_new_section (
+ relay_config_file, "port",
+ 1, 1,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ &relay_config_create_option_port, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (relay_config_file);
@@ -872,8 +936,8 @@ relay_config_read ()
rc = weechat_config_read (relay_config_file);
if (rc == WEECHAT_CONFIG_READ_OK)
{
- relay_config_change_network_allowed_ips (NULL, NULL);
- relay_config_change_irc_backlog_tags (NULL, NULL);
+ relay_config_change_network_allowed_ips (NULL, NULL, NULL);
+ relay_config_change_irc_backlog_tags (NULL, NULL, NULL);
}
return rc;
}
diff --git a/src/plugins/relay/relay-config.h b/src/plugins/relay/relay-config.h
index 08597900c..329ffe2a4 100644
--- a/src/plugins/relay/relay-config.h
+++ b/src/plugins/relay/relay-config.h
@@ -58,7 +58,7 @@ extern regex_t *relay_config_regex_allowed_ips;
extern regex_t *relay_config_regex_websocket_allowed_origins;
extern struct t_hashtable *relay_config_hashtable_irc_backlog_tags;
-extern int relay_config_create_option_port (void *data,
+extern int relay_config_create_option_port (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
diff --git a/src/plugins/relay/relay-info.c b/src/plugins/relay/relay-info.c
index 123243fe7..7ec3f46cc 100644
--- a/src/plugins/relay/relay-info.c
+++ b/src/plugins/relay/relay-info.c
@@ -32,7 +32,8 @@
*/
const char *
-relay_info_info_relay_client_count_cb (void *data, const char *info_name,
+relay_info_info_relay_client_count_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
static char str_count[32];
@@ -40,6 +41,7 @@ relay_info_info_relay_client_count_cb (void *data, const char *info_name,
struct t_relay_client *ptr_client;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) info_name;
@@ -69,28 +71,30 @@ relay_info_info_relay_client_count_cb (void *data, const char *info_name,
*/
struct t_infolist *
-relay_info_infolist_relay_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+relay_info_infolist_relay_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_relay_client *ptr_client;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
(void) arguments;
- if (pointer && !relay_client_valid (pointer))
+ if (obj_pointer && !relay_client_valid (obj_pointer))
return NULL;
ptr_infolist = weechat_infolist_new ();
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one relay */
- if (!relay_client_add_to_infolist (ptr_infolist, pointer))
+ if (!relay_client_add_to_infolist (ptr_infolist, obj_pointer))
{
weechat_infolist_free (ptr_infolist);
return NULL;
@@ -129,12 +133,12 @@ relay_info_init ()
/* TRANSLATORS: please do not translate the status names, they must be used in English */
N_("status name (optional): connecting, waiting_auth, "
"connected, auth_failed, disconnected"),
- &relay_info_info_relay_client_count_cb, NULL);
+ &relay_info_info_relay_client_count_cb, NULL, NULL);
/* infolist hooks */
weechat_hook_infolist (
"relay", N_("list of relay clients"),
N_("relay pointer (optional)"),
NULL,
- &relay_info_infolist_relay_cb, NULL);
+ &relay_info_infolist_relay_cb, NULL, NULL);
}
diff --git a/src/plugins/relay/relay-raw.c b/src/plugins/relay/relay-raw.c
index 5b8d32209..8f45a6ddd 100644
--- a/src/plugins/relay/relay-raw.c
+++ b/src/plugins/relay/relay-raw.c
@@ -72,9 +72,10 @@ relay_raw_open (int switch_to_buffer)
RELAY_RAW_BUFFER_NAME);
if (!relay_raw_buffer)
{
- relay_raw_buffer = weechat_buffer_new (RELAY_RAW_BUFFER_NAME,
- &relay_buffer_input_cb, NULL,
- &relay_buffer_close_cb, NULL);
+ relay_raw_buffer = weechat_buffer_new (
+ RELAY_RAW_BUFFER_NAME,
+ &relay_buffer_input_cb, NULL, NULL,
+ &relay_buffer_close_cb, NULL, NULL);
/* failed to create buffer ? then return */
if (!relay_raw_buffer)
diff --git a/src/plugins/relay/relay-server.c b/src/plugins/relay/relay-server.c
index c454a6250..b6e2cfc44 100644
--- a/src/plugins/relay/relay-server.c
+++ b/src/plugins/relay/relay-server.c
@@ -219,7 +219,7 @@ relay_server_close_socket (struct t_relay_server *server)
*/
int
-relay_server_sock_cb (void *data, int fd)
+relay_server_sock_cb (const void *pointer, void *data, int fd)
{
struct t_relay_server *server;
struct sockaddr_in client_addr;
@@ -231,9 +231,10 @@ relay_server_sock_cb (void *data, int fd)
char *ptr_ip_address;
/* make C compiler happy */
+ (void) data;
(void) fd;
- server = (struct t_relay_server *)data;
+ server = (struct t_relay_server *)pointer;
if (server->ipv6)
{
@@ -539,7 +540,7 @@ relay_server_create_socket (struct t_relay_server *server)
server->hook_fd = weechat_hook_fd (server->sock,
1, 0, 0,
&relay_server_sock_cb,
- server);
+ server, NULL);
server->start_time = time (NULL);
diff --git a/src/plugins/relay/relay-upgrade.c b/src/plugins/relay/relay-upgrade.c
index 773fabed7..5868d94a6 100644
--- a/src/plugins/relay/relay-upgrade.c
+++ b/src/plugins/relay/relay-upgrade.c
@@ -126,7 +126,8 @@ relay_upgrade_save ()
int rc;
struct t_upgrade_file *upgrade_file;
- upgrade_file = weechat_upgrade_new (RELAY_UPGRADE_FILENAME, 1);
+ upgrade_file = weechat_upgrade_new (RELAY_UPGRADE_FILENAME,
+ NULL, NULL, NULL);
if (!upgrade_file)
return 0;
@@ -179,7 +180,7 @@ relay_upgrade_set_buffer_callbacks ()
*/
int
-relay_upgrade_read_cb (void *data,
+relay_upgrade_read_cb (const void *pointer, void *data,
struct t_upgrade_file *upgrade_file,
int object_id,
struct t_infolist *infolist)
@@ -188,6 +189,7 @@ relay_upgrade_read_cb (void *data,
struct t_relay_server *ptr_server;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) upgrade_file;
@@ -239,10 +241,13 @@ relay_upgrade_load ()
relay_upgrade_set_buffer_callbacks ();
- upgrade_file = weechat_upgrade_new (RELAY_UPGRADE_FILENAME, 0);
+ upgrade_file = weechat_upgrade_new (RELAY_UPGRADE_FILENAME,
+ &relay_upgrade_read_cb, NULL, NULL);
if (!upgrade_file)
return 0;
- rc = weechat_upgrade_read (upgrade_file, &relay_upgrade_read_cb, NULL);
+
+ rc = weechat_upgrade_read (upgrade_file);
+
weechat_upgrade_close (upgrade_file);
return rc;
diff --git a/src/plugins/relay/relay.c b/src/plugins/relay/relay.c
index e5b2e0482..06585ecd9 100644
--- a/src/plugins/relay/relay.c
+++ b/src/plugins/relay/relay.c
@@ -81,7 +81,8 @@ relay_protocol_search (const char *name)
*/
int
-relay_signal_upgrade_cb (void *data, const char *signal, const char *type_data,
+relay_signal_upgrade_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
struct t_relay_server *ptr_server;
@@ -89,6 +90,7 @@ relay_signal_upgrade_cb (void *data, const char *signal, const char *type_data,
int quit, ssl_disconnected;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -150,10 +152,12 @@ relay_signal_upgrade_cb (void *data, const char *signal, const char *type_data,
*/
int
-relay_debug_dump_cb (void *data, const char *signal, const char *type_data,
+relay_debug_dump_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -203,8 +207,8 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
/* hook completions */
relay_completion_init ();
- weechat_hook_signal ("upgrade", &relay_signal_upgrade_cb, NULL);
- weechat_hook_signal ("debug_dump", &relay_debug_dump_cb, NULL);
+ weechat_hook_signal ("upgrade", &relay_signal_upgrade_cb, NULL, NULL);
+ weechat_hook_signal ("debug_dump", &relay_debug_dump_cb, NULL, NULL);
relay_info_init ();
@@ -222,7 +226,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
relay_upgrade_load ();
relay_hook_timer = weechat_hook_timer (1 * 1000, 0, 0,
- &relay_client_timer_cb, NULL);
+ &relay_client_timer_cb, NULL, NULL);
return WEECHAT_RC_OK;
}
diff --git a/src/plugins/relay/weechat/relay-weechat-msg.c b/src/plugins/relay/weechat/relay-weechat-msg.c
index b84ec94d4..ff7aee795 100644
--- a/src/plugins/relay/weechat/relay-weechat-msg.c
+++ b/src/plugins/relay/weechat/relay-weechat-msg.c
@@ -253,7 +253,8 @@ relay_weechat_msg_add_time (struct t_relay_weechat_msg *msg, time_t time)
*/
void
-relay_weechat_msg_hashtable_map_cb (void *data, struct t_hashtable *hashtable,
+relay_weechat_msg_hashtable_map_cb (void *data,
+ struct t_hashtable *hashtable,
const void *key, const void *value)
{
struct t_relay_weechat_msg *msg;
diff --git a/src/plugins/relay/weechat/relay-weechat-protocol.c b/src/plugins/relay/weechat/relay-weechat-protocol.c
index f216cb56f..34a59745d 100644
--- a/src/plugins/relay/weechat/relay-weechat-protocol.c
+++ b/src/plugins/relay/weechat/relay-weechat-protocol.c
@@ -359,7 +359,8 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(nicklist)
*/
int
-relay_weechat_protocol_input_timer_cb (void *data,
+relay_weechat_protocol_input_timer_cb (const void *pointer,
+ void *data,
int remaining_calls)
{
char **timer_args;
@@ -367,9 +368,10 @@ relay_weechat_protocol_input_timer_cb (void *data,
struct t_gui_buffer *ptr_buffer;
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- timer_args = (char **)data;
+ timer_args = (char **)pointer;
if (!timer_args)
return WEECHAT_RC_ERROR;
@@ -438,7 +440,8 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(input)
timer_args[1] = strdup (pos + 1);
weechat_hook_timer (1, 0, 1,
&relay_weechat_protocol_input_timer_cb,
- timer_args);
+ timer_args,
+ NULL);
}
}
@@ -450,7 +453,8 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(input)
*/
int
-relay_weechat_protocol_signal_buffer_cb (void *data, const char *signal,
+relay_weechat_protocol_signal_buffer_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data)
{
@@ -463,9 +467,10 @@ relay_weechat_protocol_signal_buffer_cb (void *data, const char *signal,
char cmd_hdata[64], str_signal[128];
/* make C compiler happy */
+ (void) data;
(void) type_data;
- ptr_client = (struct t_relay_client *)data;
+ ptr_client = (struct t_relay_client *)pointer;
if (!ptr_client || !relay_client_valid (ptr_client))
return WEECHAT_RC_OK;
@@ -815,14 +820,16 @@ relay_weechat_protocol_nicklist_map_cb (void *data,
*/
int
-relay_weechat_protocol_timer_nicklist_cb (void *data, int remaining_calls)
+relay_weechat_protocol_timer_nicklist_cb (const void *pointer, void *data,
+ int remaining_calls)
{
struct t_relay_client *ptr_client;
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- ptr_client = (struct t_relay_client *)data;
+ ptr_client = (struct t_relay_client *)pointer;
if (!ptr_client || !relay_client_valid (ptr_client))
return WEECHAT_RC_OK;
@@ -842,7 +849,8 @@ relay_weechat_protocol_timer_nicklist_cb (void *data, int remaining_calls)
*/
int
-relay_weechat_protocol_hsignal_nicklist_cb (void *data, const char *signal,
+relay_weechat_protocol_hsignal_nicklist_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable)
{
struct t_relay_client *ptr_client;
@@ -852,7 +860,10 @@ relay_weechat_protocol_hsignal_nicklist_cb (void *data, const char *signal,
struct t_relay_weechat_nicklist *ptr_nicklist;
char diff;
- ptr_client = (struct t_relay_client *)data;
+ /* make C compiler happy */
+ (void) data;
+
+ ptr_client = (struct t_relay_client *)pointer;
if (!ptr_client || !relay_client_valid (ptr_client))
return WEECHAT_RC_OK;
@@ -935,7 +946,8 @@ relay_weechat_protocol_hsignal_nicklist_cb (void *data, const char *signal,
*/
int
-relay_weechat_protocol_signal_upgrade_cb (void *data, const char *signal,
+relay_weechat_protocol_signal_upgrade_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data)
{
@@ -944,10 +956,11 @@ relay_weechat_protocol_signal_upgrade_cb (void *data, const char *signal,
char str_signal[128];
/* make C compiler happy */
+ (void) data;
(void) type_data;
(void) signal_data;
- ptr_client = (struct t_relay_client *)data;
+ ptr_client = (struct t_relay_client *)pointer;
if (!ptr_client || !relay_client_valid (ptr_client))
return WEECHAT_RC_OK;
diff --git a/src/plugins/relay/weechat/relay-weechat-protocol.h b/src/plugins/relay/weechat/relay-weechat-protocol.h
index 4de3aecb3..6f99d2e74 100644
--- a/src/plugins/relay/weechat/relay-weechat-protocol.h
+++ b/src/plugins/relay/weechat/relay-weechat-protocol.h
@@ -81,22 +81,27 @@ struct t_relay_weechat_protocol_cb
t_relay_weechat_cmd_func *cmd_function; /* callback */
};
-extern int relay_weechat_protocol_signal_buffer_cb (void *data,
+extern int relay_weechat_protocol_signal_buffer_cb (const void *pointer,
+ void *data,
const char *signal,
const char *type_data,
void *signal_data);
-extern int relay_weechat_protocol_signal_nicklist_cb (void *data,
+extern int relay_weechat_protocol_signal_nicklist_cb (const void *pointer,
+ void *data,
const char *signal,
const char *type_data,
void *signal_data);
-extern int relay_weechat_protocol_hsignal_nicklist_cb (void *data,
+extern int relay_weechat_protocol_hsignal_nicklist_cb (const void *pointer,
+ void *data,
const char *signal,
struct t_hashtable *hashtable);
-extern int relay_weechat_protocol_signal_upgrade_cb (void *data,
+extern int relay_weechat_protocol_signal_upgrade_cb (const void *pointer,
+ void *data,
const char *signal,
const char *type_data,
void *signal_data);
-extern int relay_weechat_protocol_timer_nicklist_cb (void *data,
+extern int relay_weechat_protocol_timer_nicklist_cb (const void *pointer,
+ void *data,
int remaining_calls);
extern void relay_weechat_protocol_recv (struct t_relay_client *client,
const char *data);
diff --git a/src/plugins/relay/weechat/relay-weechat.c b/src/plugins/relay/weechat/relay-weechat.c
index be0ac4400..2956f7a93 100644
--- a/src/plugins/relay/weechat/relay-weechat.c
+++ b/src/plugins/relay/weechat/relay-weechat.c
@@ -76,15 +76,15 @@ relay_weechat_hook_signals (struct t_relay_client *client)
RELAY_WEECHAT_DATA(client, hook_signal_buffer) =
weechat_hook_signal ("buffer_*",
&relay_weechat_protocol_signal_buffer_cb,
- client);
+ client, NULL);
RELAY_WEECHAT_DATA(client, hook_hsignal_nicklist) =
weechat_hook_hsignal ("nicklist_*",
&relay_weechat_protocol_hsignal_nicklist_cb,
- client);
+ client, NULL);
RELAY_WEECHAT_DATA(client, hook_signal_upgrade) =
weechat_hook_signal ("upgrade*",
&relay_weechat_protocol_signal_upgrade_cb,
- client);
+ client, NULL);
}
/*
@@ -121,7 +121,7 @@ relay_weechat_hook_timer_nicklist (struct t_relay_client *client)
RELAY_WEECHAT_DATA(client, hook_timer_nicklist) =
weechat_hook_timer (100, 0, 1,
&relay_weechat_protocol_timer_nicklist_cb,
- client);
+ client, NULL);
}
/*
@@ -181,8 +181,7 @@ relay_weechat_alloc (struct t_relay_client *client)
weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_INTEGER,
- NULL,
- NULL);
+ NULL, NULL);
RELAY_WEECHAT_DATA(client, hook_signal_buffer) = NULL;
RELAY_WEECHAT_DATA(client, hook_hsignal_nicklist) = NULL;
RELAY_WEECHAT_DATA(client, hook_signal_upgrade) = NULL;
@@ -190,8 +189,7 @@ relay_weechat_alloc (struct t_relay_client *client)
weechat_hashtable_new (32,
WEECHAT_HASHTABLE_POINTER,
WEECHAT_HASHTABLE_POINTER,
- NULL,
- NULL);
+ NULL, NULL);
weechat_hashtable_set_pointer (RELAY_WEECHAT_DATA(client, buffers_nicklist),
"callback_free_value",
&relay_weechat_free_buffers_nicklist);
@@ -223,15 +221,17 @@ relay_weechat_alloc_with_infolist (struct t_relay_client *client,
if (client->protocol_data)
{
/* general stuff */
- RELAY_WEECHAT_DATA(client, password_ok) = weechat_infolist_integer (infolist, "password_ok");
- RELAY_WEECHAT_DATA(client, compression) = weechat_infolist_integer (infolist, "compression");
+ RELAY_WEECHAT_DATA(client, password_ok) = weechat_infolist_integer (
+ infolist, "password_ok");
+ RELAY_WEECHAT_DATA(client, compression) = weechat_infolist_integer (
+ infolist, "compression");
/* sync of buffers */
- RELAY_WEECHAT_DATA(client, buffers_sync) = weechat_hashtable_new (32,
- WEECHAT_HASHTABLE_STRING,
- WEECHAT_HASHTABLE_INTEGER,
- NULL,
- NULL);
+ RELAY_WEECHAT_DATA(client, buffers_sync) = weechat_hashtable_new (
+ 32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_INTEGER,
+ NULL, NULL);
index = 0;
while (1)
{
@@ -253,8 +253,7 @@ relay_weechat_alloc_with_infolist (struct t_relay_client *client,
weechat_hashtable_new (32,
WEECHAT_HASHTABLE_POINTER,
WEECHAT_HASHTABLE_POINTER,
- NULL,
- NULL);
+ NULL, NULL);
weechat_hashtable_set_pointer (RELAY_WEECHAT_DATA(client, buffers_nicklist),
"callback_free_value",
&relay_weechat_free_buffers_nicklist);
diff --git a/src/plugins/ruby/weechat-ruby-api.c b/src/plugins/ruby/weechat-ruby-api.c
index 573757375..2598e9483 100644
--- a/src/plugins/ruby/weechat-ruby-api.c
+++ b/src/plugins/ruby/weechat-ruby-api.c
@@ -29,7 +29,6 @@
#include "../weechat-plugin.h"
#include "../plugin-script.h"
#include "../plugin-script-api.h"
-#include "../plugin-script-callback.h"
#include "weechat-ruby.h"
@@ -921,24 +920,26 @@ weechat_ruby_api_list_free (VALUE class, VALUE weelist)
}
int
-weechat_ruby_api_config_reload_cb (void *data,
+weechat_ruby_api_config_reload_cb (const void *pointer, void *data,
struct t_config_file *config_file)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -987,29 +988,31 @@ weechat_ruby_api_config_new (VALUE class, VALUE name, VALUE function,
}
int
-weechat_ruby_api_config_read_cb (void *data,
+weechat_ruby_api_config_read_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = (option_name) ? (char *)option_name : empty_arg;
func_argv[4] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sssss", func_argv);
if (!rc)
@@ -1031,26 +1034,28 @@ weechat_ruby_api_config_read_cb (void *data,
}
int
-weechat_ruby_api_config_section_write_cb (void *data,
+weechat_ruby_api_config_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = (section_name) ? (char *)section_name : empty_arg;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -1070,26 +1075,28 @@ weechat_ruby_api_config_section_write_cb (void *data,
}
int
-weechat_ruby_api_config_section_write_default_cb (void *data,
+weechat_ruby_api_config_section_write_default_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = (section_name) ? (char *)section_name : empty_arg;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -1109,30 +1116,32 @@ weechat_ruby_api_config_section_write_default_cb (void *data,
}
int
-weechat_ruby_api_config_section_create_option_cb (void *data,
+weechat_ruby_api_config_section_create_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = (option_name) ? (char *)option_name : empty_arg;
func_argv[4] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sssss", func_argv);
if (!rc)
@@ -1154,28 +1163,30 @@ weechat_ruby_api_config_section_create_option_cb (void *data,
}
int
-weechat_ruby_api_config_section_delete_option_cb (void *data,
+weechat_ruby_api_config_section_delete_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = API_PTR2STR(option);
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -1260,27 +1271,29 @@ weechat_ruby_api_config_new_section (VALUE class, VALUE config_file,
c_function_delete_option = StringValuePtr (function_delete_option);
c_data_delete_option = StringValuePtr (data_delete_option);
- result = API_PTR2STR(plugin_script_api_config_new_section (weechat_ruby_plugin,
- ruby_current_script,
- API_STR2PTR(c_config_file),
- c_name,
- c_user_can_add_options,
- c_user_can_delete_options,
- &weechat_ruby_api_config_read_cb,
- c_function_read,
- c_data_read,
- &weechat_ruby_api_config_section_write_cb,
- c_function_write,
- c_data_write,
- &weechat_ruby_api_config_section_write_default_cb,
- c_function_write_default,
- c_data_write_default,
- &weechat_ruby_api_config_section_create_option_cb,
- c_function_create_option,
- c_data_create_option,
- &weechat_ruby_api_config_section_delete_option_cb,
- c_function_delete_option,
- c_data_delete_option));
+ result = API_PTR2STR(
+ plugin_script_api_config_new_section (
+ weechat_ruby_plugin,
+ ruby_current_script,
+ API_STR2PTR(c_config_file),
+ c_name,
+ c_user_can_add_options,
+ c_user_can_delete_options,
+ &weechat_ruby_api_config_read_cb,
+ c_function_read,
+ c_data_read,
+ &weechat_ruby_api_config_section_write_cb,
+ c_function_write,
+ c_data_write,
+ &weechat_ruby_api_config_section_write_default_cb,
+ c_function_write_default,
+ c_data_write_default,
+ &weechat_ruby_api_config_section_create_option_cb,
+ c_function_create_option,
+ c_data_create_option,
+ &weechat_ruby_api_config_section_delete_option_cb,
+ c_function_delete_option,
+ c_data_delete_option));
API_RETURN_STRING_FREE(result);
}
@@ -1309,26 +1322,28 @@ weechat_ruby_api_config_search_section (VALUE class, VALUE config_file,
}
int
-weechat_ruby_api_config_option_check_value_cb (void *data,
+weechat_ruby_api_config_option_check_value_cb (const void *pointer, void *data,
struct t_config_option *option,
const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
func_argv[2] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -1348,24 +1363,26 @@ weechat_ruby_api_config_option_check_value_cb (void *data,
}
void
-weechat_ruby_api_config_option_change_cb (void *data,
+weechat_ruby_api_config_option_change_cb (const void *pointer, void *data,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (func_argv[1])
@@ -1377,24 +1394,26 @@ weechat_ruby_api_config_option_change_cb (void *data,
}
void
-weechat_ruby_api_config_option_delete_cb (void *data,
+weechat_ruby_api_config_option_delete_cb (const void *pointer, void *data,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (func_argv[1])
@@ -1965,9 +1984,7 @@ weechat_ruby_api_config_option_free (VALUE class, VALUE option)
c_option = StringValuePtr (option);
- plugin_script_api_config_option_free (weechat_ruby_plugin,
- ruby_current_script,
- API_STR2PTR(c_option));
+ weechat_config_option_free (API_STR2PTR(c_option));
API_RETURN_OK;
}
@@ -1985,9 +2002,7 @@ weechat_ruby_api_config_section_free_options (VALUE class, VALUE section)
c_section = StringValuePtr (section);
- plugin_script_api_config_section_free_options (weechat_ruby_plugin,
- ruby_current_script,
- API_STR2PTR(c_section));
+ weechat_config_section_free_options (API_STR2PTR(c_section));
API_RETURN_OK;
}
@@ -2005,9 +2020,7 @@ weechat_ruby_api_config_section_free (VALUE class, VALUE section)
c_section = StringValuePtr (section);
- plugin_script_api_config_section_free (weechat_ruby_plugin,
- ruby_current_script,
- API_STR2PTR(c_section));
+ weechat_config_section_free (API_STR2PTR(c_section));
API_RETURN_OK;
}
@@ -2025,9 +2038,7 @@ weechat_ruby_api_config_free (VALUE class, VALUE config_file)
c_config_file = StringValuePtr (config_file);
- plugin_script_api_config_free (weechat_ruby_plugin,
- ruby_current_script,
- API_STR2PTR(c_config_file));
+ weechat_config_free (API_STR2PTR(c_config_file));
API_RETURN_OK;
}
@@ -2351,28 +2362,31 @@ weechat_ruby_api_log_print (VALUE class, VALUE message)
}
int
-weechat_ruby_api_hook_command_cb (void *data, struct t_gui_buffer *buffer,
+weechat_ruby_api_hook_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
/* make C compiler happy */
(void) argv;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (argc > 1) ? argv_eol[1] : empty_arg;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2437,25 +2451,28 @@ weechat_ruby_api_hook_command (VALUE class, VALUE command, VALUE description,
}
int
-weechat_ruby_api_hook_command_run_cb (void *data, struct t_gui_buffer *buffer,
+weechat_ruby_api_hook_command_run_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *command)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (command) ? (char *)command : empty_arg;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2504,26 +2521,29 @@ weechat_ruby_api_hook_command_run (VALUE class, VALUE command, VALUE function,
}
int
-weechat_ruby_api_hook_timer_cb (void *data, int remaining_calls)
+weechat_ruby_api_hook_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char str_remaining_calls[32], empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_remaining_calls, sizeof (str_remaining_calls),
"%d", remaining_calls);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_remaining_calls;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -2578,25 +2598,27 @@ weechat_ruby_api_hook_timer (VALUE class, VALUE interval, VALUE align_second,
}
int
-weechat_ruby_api_hook_fd_cb (void *data, int fd)
+weechat_ruby_api_hook_fd_cb (const void *pointer, void *data, int fd)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char str_fd[32], empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_fd, sizeof (str_fd), "%d", fd);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_fd;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -2654,28 +2676,30 @@ weechat_ruby_api_hook_fd (VALUE class, VALUE fd, VALUE read, VALUE write,
}
int
-weechat_ruby_api_hook_process_cb (void *data,
+weechat_ruby_api_hook_process_cb (const void *pointer, void *data,
const char *command, int return_code,
const char *out, const char *err)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (command) ? (char *)command : empty_arg;
func_argv[2] = &return_code;
func_argv[3] = (out) ? (char *)out : empty_arg;
func_argv[4] = (err) ? (char *)err : empty_arg;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssiss", func_argv);
if (!rc)
@@ -2771,34 +2795,37 @@ weechat_ruby_api_hook_process_hashtable (VALUE class, VALUE command,
}
int
-weechat_ruby_api_hook_connect_cb (void *data, int status, int gnutls_rc,
+weechat_ruby_api_hook_connect_cb (const void *pointer, void *data,
+ int status, int gnutls_rc,
int sock, const char *error,
const char *ip_address)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[6];
char str_status[32], str_gnutls_rc[32], str_sock[32];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_status, sizeof (str_status), "%d", status);
snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc);
snprintf (str_sock, sizeof (str_sock), "%d", sock);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_status;
func_argv[2] = str_gnutls_rc;
func_argv[3] = str_sock;
func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg;
func_argv[5] = (error) ? (char *)error : empty_arg;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssssss", func_argv);
if (!rc)
@@ -2869,28 +2896,31 @@ weechat_ruby_api_hook_connect (VALUE class, VALUE proxy, VALUE address,
}
int
-weechat_ruby_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
+weechat_ruby_api_hook_print_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
time_t date,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[8];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
static char timebuffer[64];
int *rc, ret;
/* make C compiler happy */
(void) tags_count;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)date);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = timebuffer;
func_argv[3] = weechat_string_build_with_split_string (tags, ",");
@@ -2901,9 +2931,9 @@ weechat_ruby_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
func_argv[6] = (prefix) ? (char *)prefix : empty_arg;
func_argv[7] = (message) ? (char *)message : empty_arg;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssssiiss", func_argv);
if (!rc)
@@ -2966,20 +2996,23 @@ weechat_ruby_api_hook_print (VALUE class, VALUE buffer, VALUE tags,
}
int
-weechat_ruby_api_hook_signal_cb (void *data, const char *signal, const char *type_data,
+weechat_ruby_api_hook_signal_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
static char str_value[64];
int *rc, ret, free_needed;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (signal) ? (char *)signal : empty_arg;
free_needed = 0;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
@@ -3004,9 +3037,9 @@ weechat_ruby_api_hook_signal_cb (void *data, const char *signal, const char *typ
else
func_argv[2] = empty_arg;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -3098,25 +3131,28 @@ weechat_ruby_api_hook_signal_send (VALUE class, VALUE signal, VALUE type_data,
}
int
-weechat_ruby_api_hook_hsignal_cb (void *data, const char *signal,
+weechat_ruby_api_hook_hsignal_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (signal) ? (char *)signal : empty_arg;
func_argv[2] = hashtable;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssh", func_argv);
if (!rc)
@@ -3191,24 +3227,27 @@ weechat_ruby_api_hook_hsignal_send (VALUE class, VALUE signal, VALUE hashtable)
}
int
-weechat_ruby_api_hook_config_cb (void *data, const char *option, const char *value)
+weechat_ruby_api_hook_config_cb (const void *pointer, void *data,
+ const char *option, const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (option) ? (char *)option : empty_arg;
func_argv[2] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -3255,27 +3294,30 @@ weechat_ruby_api_hook_config (VALUE class, VALUE option, VALUE function,
}
int
-weechat_ruby_api_hook_completion_cb (void *data, const char *completion_item,
+weechat_ruby_api_hook_completion_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (completion_item) ? (char *)completion_item : empty_arg;
func_argv[2] = API_PTR2STR(buffer);
func_argv[3] = API_PTR2STR(completion);
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -3385,25 +3427,29 @@ weechat_ruby_api_hook_completion_list_add (VALUE class, VALUE completion,
}
char *
-weechat_ruby_api_hook_modifier_cb (void *data, const char *modifier,
- const char *modifier_data, const char *string)
+weechat_ruby_api_hook_modifier_cb (const void *pointer, void *data,
+ const char *modifier,
+ const char *modifier_data,
+ const char *string)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (modifier) ? (char *)modifier : empty_arg;
func_argv[2] = (modifier_data) ? (char *)modifier_data : empty_arg;
func_argv[3] = (string) ? (char *)string : empty_arg;
- return (char *)weechat_ruby_exec (script_callback->script,
+ return (char *)weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
}
@@ -3464,24 +3510,27 @@ weechat_ruby_api_hook_modifier_exec (VALUE class, VALUE modifier,
}
const char *
-weechat_ruby_api_hook_info_cb (void *data, const char *info_name,
+weechat_ruby_api_hook_info_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (info_name) ? (char *)info_name : empty_arg;
func_argv[2] = (arguments) ? (char *)arguments : empty_arg;
- return (const char *)weechat_ruby_exec (script_callback->script,
+ return (const char *)weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
}
@@ -3526,25 +3575,29 @@ weechat_ruby_api_hook_info (VALUE class, VALUE info_name, VALUE description,
}
struct t_hashtable *
-weechat_ruby_api_hook_info_hashtable_cb (void *data, const char *info_name,
+weechat_ruby_api_hook_info_hashtable_cb (const void *pointer, void *data,
+ const char *info_name,
struct t_hashtable *hashtable)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (info_name) ? (char *)info_name : empty_arg;
func_argv[2] = hashtable;
- return (struct t_hashtable *)weechat_ruby_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_HASHTABLE,
- script_callback->function,
- "ssh", func_argv);
+ return (struct t_hashtable *)weechat_ruby_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_HASHTABLE,
+ ptr_function,
+ "ssh", func_argv);
}
return NULL;
@@ -3595,27 +3648,31 @@ weechat_ruby_api_hook_info_hashtable (VALUE class, VALUE info_name,
}
struct t_infolist *
-weechat_ruby_api_hook_infolist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+weechat_ruby_api_hook_infolist_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
struct t_infolist *result;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (infolist_name) ? (char *)infolist_name : empty_arg;
- func_argv[2] = API_PTR2STR(pointer);
+ func_argv[2] = API_PTR2STR(obj_pointer);
func_argv[3] = (arguments) ? (char *)arguments : empty_arg;
- result = (struct t_infolist *)weechat_ruby_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
- "ssss", func_argv);
+ result = (struct t_infolist *)weechat_ruby_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_STRING,
+ ptr_function,
+ "ssss", func_argv);
if (func_argv[2])
free (func_argv[2]);
@@ -3670,23 +3727,27 @@ weechat_ruby_api_hook_infolist (VALUE class, VALUE infolist_name,
}
struct t_hashtable *
-weechat_ruby_api_hook_focus_cb (void *data, struct t_hashtable *info)
+weechat_ruby_api_hook_focus_cb (const void *pointer, void *data,
+ struct t_hashtable *info)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = info;
- return (struct t_hashtable *)weechat_ruby_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_HASHTABLE,
- script_callback->function,
- "sh", func_argv);
+ return (struct t_hashtable *)weechat_ruby_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_HASHTABLE,
+ ptr_function,
+ "sh", func_argv);
}
return NULL;
@@ -3759,9 +3820,7 @@ weechat_ruby_api_unhook (VALUE class, VALUE hook)
c_hook = StringValuePtr (hook);
- plugin_script_api_unhook (weechat_ruby_plugin,
- ruby_current_script,
- API_STR2PTR(c_hook));
+ weechat_unhook (API_STR2PTR(c_hook));
API_RETURN_OK;
}
@@ -3771,31 +3830,34 @@ weechat_ruby_api_unhook_all (VALUE class)
{
API_INIT_FUNC(1, "unhook_all", API_RETURN_ERROR);
- plugin_script_api_unhook_all (weechat_ruby_plugin, ruby_current_script);
+ weechat_unhook_all_plugin (ruby_current_script->name);
API_RETURN_OK;
}
int
-weechat_ruby_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
+weechat_ruby_api_buffer_input_data_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (input_data) ? (char *)input_data : empty_arg;
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -3815,23 +3877,26 @@ weechat_ruby_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
}
int
-weechat_ruby_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+weechat_ruby_api_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
- rc = (int *) weechat_ruby_exec (script_callback->script,
+ rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -3967,9 +4032,7 @@ weechat_ruby_api_buffer_close (VALUE class, VALUE buffer)
c_buffer = StringValuePtr (buffer);
- plugin_script_api_buffer_close (weechat_ruby_plugin,
- ruby_current_script,
- API_STR2PTR(c_buffer));
+ weechat_buffer_close (API_STR2PTR(c_buffer));
API_RETURN_OK;
}
@@ -4687,31 +4750,34 @@ weechat_ruby_api_bar_item_search (VALUE class, VALUE name)
}
char *
-weechat_ruby_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
+weechat_ruby_api_bar_item_build_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' }, *ret;
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- if (strncmp (script_callback->function, "(extra)", 7) == 0)
+ if (strncmp (ptr_function, "(extra)", 7) == 0)
{
/* new callback: data, item, window, buffer, extra_info */
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(item);
func_argv[2] = API_PTR2STR(window);
func_argv[3] = API_PTR2STR(buffer);
func_argv[4] = extra_info;
- ret = (char *)weechat_ruby_exec (script_callback->script,
+ ret = (char *)weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function + 7,
+ ptr_function + 7,
"ssssh", func_argv);
if (func_argv[1])
@@ -4724,13 +4790,13 @@ weechat_ruby_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
else
{
/* old callback: data, item, window */
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(item);
func_argv[2] = API_PTR2STR(window);
- ret = (char *)weechat_ruby_exec (script_callback->script,
+ ret = (char *)weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (func_argv[1])
@@ -4805,9 +4871,7 @@ weechat_ruby_api_bar_item_remove (VALUE class, VALUE item)
c_item = StringValuePtr (item);
- plugin_script_api_bar_item_remove (weechat_ruby_plugin,
- ruby_current_script,
- API_STR2PTR(c_item));
+ weechat_bar_item_remove (API_STR2PTR(c_item));
API_RETURN_OK;
}
@@ -5888,25 +5952,80 @@ weechat_ruby_api_hdata_get_string (VALUE class, VALUE hdata, VALUE property)
API_RETURN_STRING(result);
}
+int
+weechat_ruby_api_upgrade_read_cb (const void *pointer, void *data,
+ struct t_upgrade_file *upgrade_file,
+ int object_id,
+ struct t_infolist *infolist)
+{
+ struct t_plugin_script *script;
+ void *func_argv[4];
+ char empty_arg[1] = { '\0' }, str_object_id[32];
+ const char *ptr_function, *ptr_data;
+ int *rc, ret;
+
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
+
+ if (ptr_function && ptr_function[0])
+ {
+ snprintf (str_object_id, sizeof (str_object_id), "%d", object_id);
+
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
+ func_argv[1] = API_PTR2STR(upgrade_file);
+ func_argv[2] = str_object_id;
+ func_argv[3] = API_PTR2STR(infolist);
+
+ rc = (int *) weechat_ruby_exec (script,
+ WEECHAT_SCRIPT_EXEC_INT,
+ ptr_function,
+ "ssss", func_argv);
+
+ if (!rc)
+ ret = WEECHAT_RC_ERROR;
+ else
+ {
+ ret = *rc;
+ free (rc);
+ }
+ if (func_argv[1])
+ free (func_argv[1]);
+ if (func_argv[3])
+ free (func_argv[3]);
+
+ return ret;
+ }
+
+ return WEECHAT_RC_ERROR;
+}
+
static VALUE
-weechat_ruby_api_upgrade_new (VALUE class, VALUE filename, VALUE write)
+weechat_ruby_api_upgrade_new (VALUE class, VALUE filename, VALUE function,
+ VALUE data)
{
- char *c_filename, *result;
- int c_write;
+ char *c_filename, *c_function, *c_data, *result;
VALUE return_value;
API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY);
- if (NIL_P (filename) || NIL_P (write))
+ if (NIL_P (filename) || NIL_P (function) || NIL_P (data))
API_WRONG_ARGS(API_RETURN_EMPTY);
Check_Type (filename, T_STRING);
- Check_Type (write, T_FIXNUM);
+ Check_Type (function, T_STRING);
+ Check_Type (data, T_STRING);
c_filename = StringValuePtr (filename);
- c_write = FIX2INT (write);
+ c_function = StringValuePtr (function);
+ c_data = StringValuePtr (data);
- result = API_PTR2STR(weechat_upgrade_new (c_filename,
- c_write));
+ result = API_PTR2STR(
+ plugin_script_api_upgrade_new (
+ weechat_ruby_plugin,
+ ruby_current_script,
+ c_filename,
+ &weechat_ruby_api_upgrade_read_cb,
+ c_function,
+ c_data));
API_RETURN_STRING_FREE(result);
}
@@ -5937,76 +6056,21 @@ weechat_ruby_api_upgrade_write_object (VALUE class, VALUE upgrade_file,
API_RETURN_INT(rc);
}
-int
-weechat_ruby_api_upgrade_read_cb (void *data,
- struct t_upgrade_file *upgrade_file,
- int object_id,
- struct t_infolist *infolist)
-{
- struct t_plugin_script_cb *script_callback;
- void *func_argv[4];
- char empty_arg[1] = { '\0' }, str_object_id[32];
- int *rc, ret;
-
- script_callback = (struct t_plugin_script_cb *)data;
-
- if (script_callback && script_callback->function && script_callback->function[0])
- {
- snprintf (str_object_id, sizeof (str_object_id), "%d", object_id);
-
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
- func_argv[1] = API_PTR2STR(upgrade_file);
- func_argv[2] = str_object_id;
- func_argv[3] = API_PTR2STR(infolist);
-
- rc = (int *) weechat_ruby_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
- "ssss", func_argv);
-
- if (!rc)
- ret = WEECHAT_RC_ERROR;
- else
- {
- ret = *rc;
- free (rc);
- }
- if (func_argv[1])
- free (func_argv[1]);
- if (func_argv[3])
- free (func_argv[3]);
-
- return ret;
- }
-
- return WEECHAT_RC_ERROR;
-}
-
static VALUE
-weechat_ruby_api_upgrade_read (VALUE class, VALUE upgrade_file,
- VALUE function, VALUE data)
+weechat_ruby_api_upgrade_read (VALUE class, VALUE upgrade_file)
{
- char *c_upgrade_file, *c_function, *c_data;
+ char *c_upgrade_file;
int rc;
API_INIT_FUNC(1, "upgrade_read", API_RETURN_INT(0));
- if (NIL_P (upgrade_file) || NIL_P (function) || NIL_P (data))
+ if (NIL_P (upgrade_file))
API_WRONG_ARGS(API_RETURN_INT(0));
Check_Type (upgrade_file, T_STRING);
- Check_Type (function, T_STRING);
- Check_Type (data, T_STRING);
c_upgrade_file = StringValuePtr (upgrade_file);
- c_function = StringValuePtr (function);
- c_data = StringValuePtr (data);
- rc = plugin_script_api_upgrade_read (weechat_ruby_plugin,
- ruby_current_script,
- API_STR2PTR(c_upgrade_file),
- &weechat_ruby_api_upgrade_read_cb,
- c_function,
- c_data);
+ rc = weechat_upgrade_read (API_STR2PTR(c_upgrade_file));
API_RETURN_INT(rc);
}
@@ -6270,8 +6334,8 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
API_DEF_FUNC(hdata_hashtable, 3);
API_DEF_FUNC(hdata_update, 3);
API_DEF_FUNC(hdata_get_string, 2);
- API_DEF_FUNC(upgrade_new, 2);
+ API_DEF_FUNC(upgrade_new, 3);
API_DEF_FUNC(upgrade_write_object, 3);
- API_DEF_FUNC(upgrade_read, 3);
+ API_DEF_FUNC(upgrade_read, 1);
API_DEF_FUNC(upgrade_close, 1);
}
diff --git a/src/plugins/ruby/weechat-ruby-api.h b/src/plugins/ruby/weechat-ruby-api.h
index d6676bb03..39f84c706 100644
--- a/src/plugins/ruby/weechat-ruby-api.h
+++ b/src/plugins/ruby/weechat-ruby-api.h
@@ -21,10 +21,12 @@
#ifndef WEECHAT_RUBY_API_H
#define WEECHAT_RUBY_API_H 1
-extern int weechat_ruby_api_buffer_input_data_cb (void *data,
+extern int weechat_ruby_api_buffer_input_data_cb (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data);
-extern int weechat_ruby_api_buffer_close_cb (void *data,
+extern int weechat_ruby_api_buffer_close_cb (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer);
extern void weechat_ruby_api_init (VALUE ruby_mWeechat);
diff --git a/src/plugins/ruby/weechat-ruby.c b/src/plugins/ruby/weechat-ruby.c
index d55e1d7c4..5a1590fe2 100644
--- a/src/plugins/ruby/weechat-ruby.c
+++ b/src/plugins/ruby/weechat-ruby.c
@@ -146,8 +146,7 @@ weechat_ruby_hashtable_to_hash (struct t_hashtable *hashtable)
if (NIL_P (hash))
return Qnil;
- weechat_hashtable_map_string (hashtable,
- &weechat_ruby_hashtable_map_cb,
+ weechat_hashtable_map_string (hashtable, &weechat_ruby_hashtable_map_cb,
&hash);
return hash;
@@ -776,12 +775,14 @@ weechat_ruby_unload_all ()
*/
int
-weechat_ruby_command_cb (void *data, struct t_gui_buffer *buffer,
+weechat_ruby_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
char *ptr_name, *path_script;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -877,11 +878,13 @@ weechat_ruby_command_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-weechat_ruby_completion_cb (void *data, const char *completion_item,
+weechat_ruby_completion_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -896,9 +899,11 @@ weechat_ruby_completion_cb (void *data, const char *completion_item,
*/
struct t_hdata *
-weechat_ruby_hdata_cb (void *data, const char *hdata_name)
+weechat_ruby_hdata_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
return plugin_script_hdata_script (weechat_plugin,
@@ -911,10 +916,12 @@ weechat_ruby_hdata_cb (void *data, const char *hdata_name)
*/
struct t_infolist *
-weechat_ruby_infolist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+weechat_ruby_infolist_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!infolist_name || !infolist_name[0])
@@ -923,7 +930,7 @@ weechat_ruby_infolist_cb (void *data, const char *infolist_name,
if (weechat_strcasecmp (infolist_name, "ruby_script") == 0)
{
return plugin_script_infolist_list_scripts (weechat_ruby_plugin,
- ruby_scripts, pointer,
+ ruby_scripts, obj_pointer,
arguments);
}
@@ -935,10 +942,12 @@ weechat_ruby_infolist_cb (void *data, const char *infolist_name,
*/
int
-weechat_ruby_signal_debug_dump_cb (void *data, const char *signal,
+weechat_ruby_signal_debug_dump_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -957,10 +966,12 @@ weechat_ruby_signal_debug_dump_cb (void *data, const char *signal,
*/
int
-weechat_ruby_signal_debug_libs_cb (void *data, const char *signal,
+weechat_ruby_signal_debug_libs_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -976,37 +987,20 @@ weechat_ruby_signal_debug_libs_cb (void *data, const char *signal,
}
/*
- * Callback called when a buffer is closed.
- */
-
-int
-weechat_ruby_signal_buffer_closed_cb (void *data, const char *signal,
- const char *type_data, void *signal_data)
-{
- /* make C compiler happy */
- (void) data;
- (void) signal;
- (void) type_data;
-
- if (signal_data)
- plugin_script_remove_buffer_callbacks (ruby_scripts, signal_data);
-
- return WEECHAT_RC_OK;
-}
-
-/*
* Timer for executing actions.
*/
int
-weechat_ruby_timer_action_cb (void *data, int remaining_calls)
+weechat_ruby_timer_action_cb (const void *pointer, void *data,
+ int remaining_calls)
{
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- if (data)
+ if (pointer)
{
- if (data == &ruby_action_install_list)
+ if (pointer == &ruby_action_install_list)
{
plugin_script_action_install (weechat_ruby_plugin,
ruby_scripts,
@@ -1015,7 +1009,7 @@ weechat_ruby_timer_action_cb (void *data, int remaining_calls)
&ruby_quiet,
&ruby_action_install_list);
}
- else if (data == &ruby_action_remove_list)
+ else if (pointer == &ruby_action_remove_list)
{
plugin_script_action_remove (weechat_ruby_plugin,
ruby_scripts,
@@ -1023,7 +1017,7 @@ weechat_ruby_timer_action_cb (void *data, int remaining_calls)
&ruby_quiet,
&ruby_action_remove_list);
}
- else if (data == &ruby_action_autoload_list)
+ else if (pointer == &ruby_action_autoload_list)
{
plugin_script_action_autoload (weechat_ruby_plugin,
&ruby_quiet,
@@ -1039,11 +1033,13 @@ weechat_ruby_timer_action_cb (void *data, int remaining_calls)
*/
int
-weechat_ruby_signal_script_action_cb (void *data, const char *signal,
+weechat_ruby_signal_script_action_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
@@ -1054,7 +1050,7 @@ weechat_ruby_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_ruby_timer_action_cb,
- &ruby_action_install_list);
+ &ruby_action_install_list, NULL);
}
else if (strcmp (signal, "ruby_script_remove") == 0)
{
@@ -1062,7 +1058,7 @@ weechat_ruby_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_ruby_timer_action_cb,
- &ruby_action_remove_list);
+ &ruby_action_remove_list, NULL);
}
else if (strcmp (signal, "ruby_script_autoload") == 0)
{
@@ -1070,7 +1066,7 @@ weechat_ruby_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_ruby_timer_action_cb,
- &ruby_action_autoload_list);
+ &ruby_action_autoload_list, NULL);
}
}
@@ -1190,7 +1186,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
init.callback_infolist = &weechat_ruby_infolist_cb;
init.callback_signal_debug_dump = &weechat_ruby_signal_debug_dump_cb;
init.callback_signal_debug_libs = &weechat_ruby_signal_debug_libs_cb;
- init.callback_signal_buffer_closed = &weechat_ruby_signal_buffer_closed_cb;
init.callback_signal_script_action = &weechat_ruby_signal_script_action_cb;
init.callback_load_file = &weechat_ruby_load_cb;
diff --git a/src/plugins/script/script-action.c b/src/plugins/script/script-action.c
index 2dab05f53..3c4510b8e 100644
--- a/src/plugins/script/script-action.c
+++ b/src/plugins/script/script-action.c
@@ -483,12 +483,14 @@ script_action_autoload (const char *name, int quiet, int autoload)
*/
int
-script_action_installnext_timer_cb (void *data, int remaining_calls)
+script_action_installnext_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- script_action_install ((data) ? 1 : 0);
+ script_action_install ((pointer) ? 1 : 0);
return WEECHAT_RC_OK;
}
@@ -498,7 +500,8 @@ script_action_installnext_timer_cb (void *data, int remaining_calls)
*/
int
-script_action_install_process_cb (void *data, const char *command,
+script_action_install_process_cb (const void *pointer, void *data,
+ const char *command,
int return_code, const char *out,
const char *err)
{
@@ -507,9 +510,10 @@ script_action_install_process_cb (void *data, const char *command,
struct t_script_repo *ptr_script;
/* make C compiler happy */
+ (void) data;
(void) out;
- quiet = (data) ? 1 : 0;
+ quiet = (pointer) ? 1 : 0;
if (return_code >= 0)
{
@@ -558,7 +562,8 @@ script_action_install_process_cb (void *data, const char *command,
/* schedule install of next script */
weechat_hook_timer (10, 0, 1,
&script_action_installnext_timer_cb,
- (quiet) ? (void *)1 : (void *)0);
+ (quiet) ? (void *)1 : (void *)0,
+ NULL);
}
}
}
@@ -633,8 +638,7 @@ script_action_install (int quiet)
options = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (options)
{
url = script_build_download_url (ptr_script_to_install->url);
@@ -653,7 +657,8 @@ script_action_install (int quiet)
options,
weechat_config_integer (script_config_scripts_download_timeout) * 1000,
&script_action_install_process_cb,
- (quiet) ? (void *)1 : (void *)0);
+ (quiet) ? (void *)1 : (void *)0,
+ NULL);
free (url);
}
weechat_hashtable_free (options);
@@ -799,7 +804,8 @@ script_action_hold (const char *name, int quiet)
*/
int
-script_action_show_diff_process_cb (void *data, const char *command,
+script_action_show_diff_process_cb (const void *pointer, void *data,
+ const char *command,
int return_code, const char *out,
const char *err)
{
@@ -808,6 +814,7 @@ script_action_show_diff_process_cb (void *data, const char *command,
int num_lines, i, diff_color;
/* make C compiler happy */
+ (void) data;
(void) command;
if (script_buffer && script_buffer_detail_script
@@ -876,7 +883,7 @@ script_action_show_diff_process_cb (void *data, const char *command,
if ((return_code == WEECHAT_HOOK_PROCESS_ERROR) || (return_code >= 0))
{
/* last call to this callback: delete temporary file */
- filename = (char *)data;
+ filename = (char *)pointer;
unlink (filename);
free (filename);
}
@@ -889,7 +896,8 @@ script_action_show_diff_process_cb (void *data, const char *command,
*/
int
-script_action_show_source_process_cb (void *data, const char *command,
+script_action_show_source_process_cb (const void *pointer, void *data,
+ const char *command,
int return_code, const char *out,
const char *err)
{
@@ -901,6 +909,7 @@ script_action_show_source_process_cb (void *data, const char *command,
int length, diff_made;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) out;
@@ -999,7 +1008,7 @@ script_action_show_source_process_cb (void *data, const char *command,
weechat_color ("magenta"));
weechat_hook_process (diff_command, 10000,
&script_action_show_diff_process_cb,
- filename);
+ filename, NULL);
diff_made = 1;
free (diff_command);
}
@@ -1062,8 +1071,7 @@ script_action_show (const char *name, int quiet)
options = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (options)
{
url = script_build_download_url (ptr_script->url);
@@ -1075,7 +1083,7 @@ script_action_show (const char *name, int quiet)
options,
weechat_config_integer (script_config_scripts_download_timeout) * 1000,
&script_action_show_source_process_cb,
- NULL);
+ NULL, NULL);
free (url);
}
weechat_hashtable_free (options);
diff --git a/src/plugins/script/script-buffer.c b/src/plugins/script/script-buffer.c
index 0bf1ec642..fd23bfbe6 100644
--- a/src/plugins/script/script-buffer.c
+++ b/src/plugins/script/script-buffer.c
@@ -403,12 +403,9 @@ script_buffer_get_script_usage (struct t_script_repo *script)
struct t_weelist *list;
char hdata_name[128], str_option[256], str_info[1024];
int config_files;
- const char *ptr_name_hdata_callback, *type;
- struct t_hdata *ptr_hdata_script, *ptr_hdata_callback;
- struct t_hdata *ptr_hdata_config_file, *ptr_hdata_bar_item;
- void *ptr_script, *ptr_callback;
- struct t_config_file *ptr_config_file;
- struct t_hook *ptr_hook;
+ struct t_hdata *hdata_script, *hdata_config, *hdata_bar_item;
+ void *ptr_script, *callback_pointer;
+ struct t_config_file *ptr_config;
struct t_gui_bar_item *ptr_bar_item;
struct t_infolist *infolist;
@@ -416,126 +413,161 @@ script_buffer_get_script_usage (struct t_script_repo *script)
snprintf (hdata_name, sizeof (hdata_name),
"%s_script", script_language[script->language]);
- ptr_hdata_script = weechat_hdata_get (hdata_name);
- if (!ptr_hdata_script)
+ hdata_script = weechat_hdata_get (hdata_name);
+ if (!hdata_script)
return NULL;
- ptr_script = script_buffer_get_script_pointer (script, ptr_hdata_script);
+ ptr_script = script_buffer_get_script_pointer (script, hdata_script);
if (!ptr_script)
return NULL;
- ptr_name_hdata_callback = weechat_hdata_get_var_hdata (ptr_hdata_script,
- "callbacks");
- if (!ptr_name_hdata_callback)
- return NULL;
- ptr_hdata_callback = weechat_hdata_get (ptr_name_hdata_callback);
- if (!ptr_hdata_callback)
- return NULL;
-
list = weechat_list_new ();
- ptr_hdata_config_file = weechat_hdata_get ("config_file");
- ptr_hdata_bar_item = weechat_hdata_get ("bar_item");
-
- ptr_callback = weechat_hdata_pointer (ptr_hdata_script,
- ptr_script,
- "callbacks");
- while (ptr_callback)
+ /* get configuration files created by the script */
+ hdata_config = weechat_hdata_get ("config_file");
+ ptr_config = weechat_hdata_get_list (hdata_config, "config_files");
+ while (ptr_config)
{
- str_info[0] = '\0';
- ptr_config_file = weechat_hdata_pointer (ptr_hdata_callback,
- ptr_callback,
- "config_file");
- ptr_hook = weechat_hdata_pointer (ptr_hdata_callback,
- ptr_callback,
- "hook");
- ptr_bar_item = weechat_hdata_pointer (ptr_hdata_callback,
- ptr_callback,
- "bar_item");
- if (ptr_config_file)
+ callback_pointer = weechat_hdata_pointer (
+ hdata_config, ptr_config, "callback_reload_pointer");
+ if (callback_pointer == ptr_script)
{
snprintf (str_info, sizeof (str_info),
_("configuration file \"%s\" (options %s.*)"),
- weechat_hdata_string (ptr_hdata_config_file,
- ptr_config_file,
+ weechat_hdata_string (hdata_config, ptr_config,
"filename"),
- weechat_hdata_string (ptr_hdata_config_file,
- ptr_config_file,
+ weechat_hdata_string (hdata_config, ptr_config,
"name"));
+ weechat_list_add (list, str_info, WEECHAT_LIST_POS_END, NULL);
config_files++;
}
- else if (ptr_hook)
+ ptr_config = weechat_hdata_move (hdata_config, ptr_config, 1);
+ }
+
+ /* get the commands created by the script */
+ infolist = weechat_infolist_get ("hook", NULL, "command");
+ if (infolist)
+ {
+ while (weechat_infolist_next (infolist))
{
- infolist = weechat_infolist_get ("hook", ptr_hook, NULL);
- if (infolist)
+ callback_pointer = weechat_infolist_pointer (infolist,
+ "callback_pointer");
+ if (callback_pointer == ptr_script)
{
- if (weechat_infolist_next (infolist))
- {
- type = weechat_infolist_string (infolist, "type");
- if (type)
- {
- if (strcmp (type, "command") == 0)
- {
- snprintf (str_info, sizeof (str_info),
- _("command /%s"),
- weechat_infolist_string (infolist,
- "command"));
- }
- else if (strcmp (type, "completion") == 0)
- {
- snprintf (str_info, sizeof (str_info),
- _("completion %%(%s)"),
- weechat_infolist_string (infolist,
- "completion_item"));
- }
- else if (strcmp (type, "info") == 0)
- {
- snprintf (str_info, sizeof (str_info),
- "info \"%s\"",
- weechat_infolist_string (infolist,
- "info_name"));
- }
- else if (strcmp (type, "info_hashtable") == 0)
- {
- snprintf (str_info, sizeof (str_info),
- "info_hashtable \"%s\"",
- weechat_infolist_string (infolist,
- "info_name"));
- }
- else if (strcmp (type, "infolist") == 0)
- {
- snprintf (str_info, sizeof (str_info),
- "infolist \"%s\"",
- weechat_infolist_string (infolist,
- "infolist_name"));
- }
- }
- }
- weechat_infolist_free (infolist);
+ snprintf (str_info, sizeof (str_info),
+ _("command /%s"),
+ weechat_infolist_string (infolist,
+ "command"));
+ weechat_list_add (list, str_info, WEECHAT_LIST_POS_END, NULL);
+ }
+ }
+ weechat_infolist_free (infolist);
+ }
+
+ /* get the completions created by the script */
+ infolist = weechat_infolist_get ("hook", NULL, "completion");
+ if (infolist)
+ {
+ while (weechat_infolist_next (infolist))
+ {
+ callback_pointer = weechat_infolist_pointer (infolist,
+ "callback_pointer");
+ if (callback_pointer == ptr_script)
+ {
+ snprintf (str_info, sizeof (str_info),
+ _("completion %%(%s)"),
+ weechat_infolist_string (infolist,
+ "completion_item"));
+ weechat_list_add (list, str_info, WEECHAT_LIST_POS_END, NULL);
+ }
+ }
+ weechat_infolist_free (infolist);
+ }
+
+ /* get the infos created by the script */
+ infolist = weechat_infolist_get ("hook", NULL, "info");
+ if (infolist)
+ {
+ while (weechat_infolist_next (infolist))
+ {
+ callback_pointer = weechat_infolist_pointer (infolist,
+ "callback_pointer");
+ if (callback_pointer == ptr_script)
+ {
+ snprintf (str_info, sizeof (str_info),
+ "info \"%s\"",
+ weechat_infolist_string (infolist,
+ "info_name"));
+ weechat_list_add (list, str_info, WEECHAT_LIST_POS_END, NULL);
}
}
- else if (ptr_bar_item)
+ weechat_infolist_free (infolist);
+ }
+
+ /* get the infos (hashtable) created by the script */
+ infolist = weechat_infolist_get ("hook", NULL, "info_hashtable");
+ if (infolist)
+ {
+ while (weechat_infolist_next (infolist))
+ {
+ callback_pointer = weechat_infolist_pointer (infolist,
+ "callback_pointer");
+ if (callback_pointer == ptr_script)
+ {
+ snprintf (str_info, sizeof (str_info),
+ "info_hashtable \"%s\"",
+ weechat_infolist_string (infolist,
+ "info_name"));
+ weechat_list_add (list, str_info, WEECHAT_LIST_POS_END, NULL);
+ }
+ }
+ weechat_infolist_free (infolist);
+ }
+
+ /* get the infolists created by the script */
+ infolist = weechat_infolist_get ("hook", NULL, "infolist");
+ if (infolist)
+ {
+ while (weechat_infolist_next (infolist))
+ {
+ callback_pointer = weechat_infolist_pointer (infolist,
+ "callback_pointer");
+ if (callback_pointer == ptr_script)
+ {
+ snprintf (str_info, sizeof (str_info),
+ "infolist \"%s\"",
+ weechat_infolist_string (infolist,
+ "infolist_name"));
+ weechat_list_add (list, str_info, WEECHAT_LIST_POS_END, NULL);
+ }
+ }
+ weechat_infolist_free (infolist);
+ }
+
+ /* get the bar items created by the script */
+ hdata_bar_item = weechat_hdata_get ("bar_item");
+ ptr_bar_item = weechat_hdata_get_list (hdata_bar_item, "gui_bar_items");
+ while (ptr_bar_item)
+ {
+ callback_pointer = weechat_hdata_pointer (hdata_bar_item, ptr_bar_item,
+ "build_callback_pointer");
+ if (callback_pointer == ptr_script)
{
snprintf (str_info, sizeof (str_info),
_("bar item \"%s\""),
- weechat_hdata_string (ptr_hdata_bar_item,
+ weechat_hdata_string (hdata_bar_item,
ptr_bar_item,
"name"));
+ weechat_list_add (list, str_info, WEECHAT_LIST_POS_END, NULL);
}
- if (str_info[0])
- {
- weechat_list_add (list, str_info,
- WEECHAT_LIST_POS_END, NULL);
- }
- ptr_callback = weechat_hdata_move (ptr_hdata_callback,
- ptr_callback,
- 1);
+ ptr_bar_item = weechat_hdata_move (hdata_bar_item, ptr_bar_item, 1);
}
+ /* get the script options (in plugins.var) */
snprintf (str_option, sizeof (str_option),
"plugins.var.%s.%s.*",
script_language[script->language],
- weechat_hdata_string (ptr_hdata_script, ptr_script, "name"));
+ weechat_hdata_string (hdata_script, ptr_script, "name"));
infolist = weechat_infolist_get ("option", NULL, str_option);
if (infolist)
{
@@ -892,13 +924,14 @@ script_buffer_check_line_outside_window ()
*/
int
-script_buffer_window_scrolled_cb (void *data, const char *signal,
- const char *type_data,
+script_buffer_window_scrolled_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
int start_line_y, chat_height, line;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -936,7 +969,8 @@ script_buffer_window_scrolled_cb (void *data, const char *signal,
*/
int
-script_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
+script_buffer_input_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data)
{
char *actions[][2] = { { "A", "toggleautoload" },
@@ -953,6 +987,7 @@ script_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
/* close buffer */
@@ -1010,9 +1045,11 @@ script_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-script_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+script_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -1089,9 +1126,10 @@ script_buffer_open ()
{
if (!script_buffer)
{
- script_buffer = weechat_buffer_new (SCRIPT_BUFFER_NAME,
- &script_buffer_input_cb, NULL,
- &script_buffer_close_cb, NULL);
+ script_buffer = weechat_buffer_new (
+ SCRIPT_BUFFER_NAME,
+ &script_buffer_input_cb, NULL, NULL,
+ &script_buffer_close_cb, NULL, NULL);
/* failed to create buffer ? then exit */
if (!script_buffer)
diff --git a/src/plugins/script/script-buffer.h b/src/plugins/script/script-buffer.h
index 63b5f6af6..7f23729c7 100644
--- a/src/plugins/script/script-buffer.h
+++ b/src/plugins/script/script-buffer.h
@@ -36,12 +36,15 @@ extern void script_buffer_show_detail_script (struct t_script_repo *script);
extern void script_buffer_get_window_info (struct t_gui_window *window,
int *start_line_y, int *chat_height);
extern void script_buffer_check_line_outside_window ();
-extern int script_buffer_window_scrolled_cb (void *data, const char *signal,
+extern int script_buffer_window_scrolled_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data);
-extern int script_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
+extern int script_buffer_input_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data);
-extern int script_buffer_close_cb (void *data, struct t_gui_buffer *buffer);
+extern int script_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer);
extern void script_buffer_set_callbacks ();
extern void script_buffer_set_keys ();
extern void script_buffer_open ();
diff --git a/src/plugins/script/script-command.c b/src/plugins/script/script-command.c
index 20916368e..1cf459bac 100644
--- a/src/plugins/script/script-command.c
+++ b/src/plugins/script/script-command.c
@@ -121,7 +121,8 @@ script_command_action (struct t_gui_buffer *buffer, const char *action,
*/
int
-script_command_script (void *data, struct t_gui_buffer *buffer, int argc,
+script_command_script (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
char *error, command[128];
@@ -129,6 +130,7 @@ script_command_script (void *data, struct t_gui_buffer *buffer, int argc,
int line;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (argc == 1)
@@ -383,5 +385,5 @@ script_command_init ()
" || hold %(script_scripts)|%*"
" || update"
" || upgrade",
- &script_command_script, NULL);
+ &script_command_script, NULL, NULL);
}
diff --git a/src/plugins/script/script-completion.c b/src/plugins/script/script-completion.c
index 781fd4877..053873ac1 100644
--- a/src/plugins/script/script-completion.c
+++ b/src/plugins/script/script-completion.c
@@ -34,13 +34,15 @@
*/
int
-script_completion_languages_cb (void *data, const char *completion_item,
+script_completion_languages_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -60,13 +62,15 @@ script_completion_languages_cb (void *data, const char *completion_item,
*/
int
-script_completion_extensions_cb (void *data, const char *completion_item,
+script_completion_extensions_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -86,13 +90,15 @@ script_completion_extensions_cb (void *data, const char *completion_item,
*/
int
-script_completion_scripts_cb (void *data, const char *completion_item,
+script_completion_scripts_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
struct t_script_repo *ptr_script;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -113,13 +119,15 @@ script_completion_scripts_cb (void *data, const char *completion_item,
*/
int
-script_completion_scripts_installed_cb (void *data, const char *completion_item,
+script_completion_scripts_installed_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
struct t_script_repo *ptr_script;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -176,7 +184,8 @@ script_completion_exec_file_cb (void *data, const char *filename)
*/
int
-script_completion_scripts_files_cb (void *data, const char *completion_item,
+script_completion_scripts_files_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -186,6 +195,7 @@ script_completion_scripts_files_cb (void *data, const char *completion_item,
void *pointers[2];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -205,13 +215,15 @@ script_completion_scripts_files_cb (void *data, const char *completion_item,
snprintf (directory, length,
"%s/%s", weechat_home, script_language[i]);
weechat_exec_on_files (directory, 0,
- pointers, &script_completion_exec_file_cb);
+ &script_completion_exec_file_cb,
+ pointers);
/* look for files in "~/.weechat/<language>/autoload/" */
snprintf (directory, length,
"%s/%s/autoload", weechat_home, script_language[i]);
weechat_exec_on_files (directory, 0,
- pointers, &script_completion_exec_file_cb);
+ &script_completion_exec_file_cb,
+ pointers);
}
free (directory);
}
@@ -224,7 +236,8 @@ script_completion_scripts_files_cb (void *data, const char *completion_item,
*/
int
-script_completion_tags_cb (void *data, const char *completion_item,
+script_completion_tags_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -233,6 +246,7 @@ script_completion_tags_cb (void *data, const char *completion_item,
int num_tags, i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -269,20 +283,20 @@ script_completion_init ()
{
weechat_hook_completion ("script_languages",
N_("list of script languages"),
- &script_completion_languages_cb, NULL);
+ &script_completion_languages_cb, NULL, NULL);
weechat_hook_completion ("script_extensions",
N_("list of script extensions"),
- &script_completion_extensions_cb, NULL);
+ &script_completion_extensions_cb, NULL, NULL);
weechat_hook_completion ("script_scripts",
N_("list of scripts in repository"),
- &script_completion_scripts_cb, NULL);
+ &script_completion_scripts_cb, NULL, NULL);
weechat_hook_completion ("script_scripts_installed",
N_("list of scripts installed (from repository)"),
- &script_completion_scripts_installed_cb, NULL);
+ &script_completion_scripts_installed_cb, NULL, NULL);
weechat_hook_completion ("script_files",
N_("files in script directories"),
- &script_completion_scripts_files_cb, NULL);
+ &script_completion_scripts_files_cb, NULL, NULL);
weechat_hook_completion ("script_tags",
N_("tags of scripts in repository"),
- &script_completion_tags_cb, NULL);
+ &script_completion_tags_cb, NULL, NULL);
}
diff --git a/src/plugins/script/script-config.c b/src/plugins/script/script-config.c
index ac5363190..ee3d7a187 100644
--- a/src/plugins/script/script-config.c
+++ b/src/plugins/script/script-config.c
@@ -205,9 +205,11 @@ script_config_get_script_download_filename (struct t_script_repo *script,
*/
void
-script_config_refresh_cb (void *data, struct t_config_option *option)
+script_config_refresh_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -221,9 +223,11 @@ script_config_refresh_cb (void *data, struct t_config_option *option)
*/
void
-script_config_reload_scripts_cb (void *data, struct t_config_option *option)
+script_config_reload_scripts_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -240,9 +244,11 @@ script_config_reload_scripts_cb (void *data, struct t_config_option *option)
*/
void
-script_config_change_use_keys_cb (void *data, struct t_config_option *option)
+script_config_change_use_keys_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -255,9 +261,11 @@ script_config_change_use_keys_cb (void *data, struct t_config_option *option)
*/
void
-script_config_change_hold_cb (void *data, struct t_config_option *option)
+script_config_change_hold_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -355,9 +363,11 @@ script_config_unhold (const char *name_with_extension)
*/
int
-script_config_reload (void *data, struct t_config_file *config_file)
+script_config_reload (const void *pointer, void *data,
+ struct t_config_file *config_file)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
return weechat_config_reload (config_file);
@@ -377,16 +387,18 @@ script_config_init ()
struct t_config_section *ptr_section;
script_config_file = weechat_config_new (SCRIPT_CONFIG_NAME,
- &script_config_reload, NULL);
+ &script_config_reload, NULL, NULL);
if (!script_config_file)
return 0;
/* look */
ptr_section = weechat_config_new_section (script_config_file, "look",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (script_config_file);
@@ -403,13 +415,15 @@ script_config_init ()
"%u=date updated, %v=version, %V=version loaded, %w=min_weechat, "
"%W=max_weechat)"),
NULL, 0, 0, "%s %n %V %v %u | %d | %t", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_look_diff_color = weechat_config_new_option (
script_config_file, ptr_section,
"diff_color", "boolean",
N_("colorize output of diff"),
NULL, 0, 0, "on", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
script_config_look_diff_command = weechat_config_new_option (
script_config_file, ptr_section,
"diff_command", "string",
@@ -418,7 +432,7 @@ script_config_init ()
"or diff), empty value = disable diff, other string = name of "
"command, for example \"diff\")"),
NULL, 0, 0, "auto", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
script_config_look_display_source = weechat_config_new_option (
script_config_file, ptr_section,
"display_source", "boolean",
@@ -426,7 +440,7 @@ script_config_init ()
"(script is downloaded in a temporary file when detail on script "
"is displayed)"),
NULL, 0, 0, "on", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
script_config_look_quiet_actions = weechat_config_new_option (
script_config_file, ptr_section,
"quiet_actions", "boolean",
@@ -434,7 +448,7 @@ script_config_init ()
"buffer when scripts are installed/removed/loaded/unloaded (only "
"errors are displayed)"),
NULL, 0, 0, "on", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
script_config_look_sort = weechat_config_new_option (
script_config_file, ptr_section,
"sort", "string",
@@ -445,14 +459,18 @@ script_config_init ()
"order; example: \"i,u\": installed scripts first, sorted by update "
"date"),
NULL, 0, 0, "p,n", NULL, 0,
- NULL, NULL, &script_config_reload_scripts_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_reload_scripts_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_look_translate_description = weechat_config_new_option (
script_config_file, ptr_section,
"translate_description", "boolean",
N_("translate description of scripts (if translation is available in "
"your language, otherwise English version is used)"),
NULL, 0, 0, "on", NULL, 0,
- NULL, NULL, &script_config_reload_scripts_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_reload_scripts_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_look_use_keys = weechat_config_new_option (
script_config_file, ptr_section,
"use_keys", "boolean",
@@ -460,14 +478,18 @@ script_config_init ()
"install, alt+r = remove, ...); if disabled, only the input is "
"allowed: i, r, ..."),
NULL, 0, 0, "on", NULL, 0,
- NULL, NULL, &script_config_change_use_keys_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_change_use_keys_cb, NULL, NULL,
+ NULL, NULL, NULL);
/* color */
ptr_section = weechat_config_new_section (script_config_file, "color",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (script_config_file);
@@ -479,164 +501,218 @@ script_config_init ()
"status_autoloaded", "color",
N_("color for status \"autoloaded\" (\"a\")"),
NULL, 0, 0, "cyan", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_status_held = weechat_config_new_option (
script_config_file, ptr_section,
"status_held", "color",
N_("color for status \"held\" (\"H\")"),
NULL, 0, 0, "white", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_status_installed = weechat_config_new_option (
script_config_file, ptr_section,
"status_installed", "color",
N_("color for status \"installed\" (\"i\")"),
NULL, 0, 0, "lightcyan", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_status_obsolete = weechat_config_new_option (
script_config_file, ptr_section,
"status_obsolete", "color",
N_("color for status \"obsolete\" (\"N\")"),
NULL, 0, 0, "lightmagenta", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_status_popular = weechat_config_new_option (
script_config_file, ptr_section,
"status_popular", "color",
N_("color for status \"popular\" (\"*\")"),
NULL, 0, 0, "yellow", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_status_running = weechat_config_new_option (
script_config_file, ptr_section,
"status_running", "color",
N_("color for status \"running\" (\"r\")"),
NULL, 0, 0, "lightgreen", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_status_unknown = weechat_config_new_option (
script_config_file, ptr_section,
"status_unknown", "color",
N_("color for status \"unknown\" (\"?\")"),
NULL, 0, 0, "lightred", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text = weechat_config_new_option (
script_config_file, ptr_section,
"text", "color",
N_("text color in script buffer"),
NULL, 0, 0, "default", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_bg = weechat_config_new_option (
script_config_file, ptr_section,
"text_bg", "color",
N_("background color in script buffer"),
NULL, 0, 0, "default", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_bg_selected = weechat_config_new_option (
script_config_file, ptr_section,
"text_bg_selected", "color",
N_("background color for selected line in script buffer"),
NULL, 0, 0, "red", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_date = weechat_config_new_option (
script_config_file, ptr_section,
"text_date", "color",
N_("text color of dates in script buffer"),
NULL, 0, 0, "default", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_date_selected = weechat_config_new_option (
script_config_file, ptr_section,
"text_date_selected", "color",
N_("text color of dates for selected line in script buffer"),
NULL, 0, 0, "white", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_delimiters = weechat_config_new_option (
script_config_file, ptr_section,
"text_delimiters", "color",
N_("text color of delimiters in script buffer"),
NULL, 0, 0, "default", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_description = weechat_config_new_option (
script_config_file, ptr_section,
"text_description", "color",
N_("text color of description in script buffer"),
NULL, 0, 0, "default", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_description_selected = weechat_config_new_option (
script_config_file, ptr_section,
"text_description_selected", "color",
N_("text color of description for selected line in script buffer"),
NULL, 0, 0, "white", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_extension = weechat_config_new_option (
script_config_file, ptr_section,
"text_extension", "color",
N_("text color of extension in script buffer"),
NULL, 0, 0, "default", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_extension_selected = weechat_config_new_option (
script_config_file, ptr_section,
"text_extension_selected", "color",
N_("text color of extension for selected line in script buffer"),
NULL, 0, 0, "white", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_name = weechat_config_new_option (
script_config_file, ptr_section,
"text_name", "color",
N_("text color of script name in script buffer"),
NULL, 0, 0, "cyan", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_name_selected = weechat_config_new_option (
script_config_file, ptr_section,
"text_name_selected", "color",
N_("text color of script name for selected line in script buffer"),
NULL, 0, 0, "lightcyan", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_selected = weechat_config_new_option (
script_config_file, ptr_section,
"text_selected", "color",
N_("text color for selected line in script buffer"),
NULL, 0, 0, "white", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_tags = weechat_config_new_option (
script_config_file, ptr_section,
"text_tags", "color",
N_("text color of tags in script buffer"),
NULL, 0, 0, "brown", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_tags_selected = weechat_config_new_option (
script_config_file, ptr_section,
"text_tags_selected", "color",
N_("text color of tags for selected line in script buffer"),
NULL, 0, 0, "yellow", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_version = weechat_config_new_option (
script_config_file, ptr_section,
"text_version", "color",
N_("text color of version in script buffer"),
NULL, 0, 0, "magenta", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_version_loaded = weechat_config_new_option (
script_config_file, ptr_section,
"text_version_loaded", "color",
N_("text color of version loaded in script buffer"),
NULL, 0, 0, "default", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_version_loaded_selected = weechat_config_new_option (
script_config_file, ptr_section,
"text_version_loaded_selected", "color",
N_("text color of version loaded for selected line in script buffer"),
NULL, 0, 0, "white", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_color_text_version_selected = weechat_config_new_option (
script_config_file, ptr_section,
"text_version_selected", "color",
N_("text color of version for selected line in script buffer"),
NULL, 0, 0, "lightmagenta", NULL, 0,
- NULL, NULL, &script_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &script_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
/* scripts */
ptr_section = weechat_config_new_section (script_config_file, "scripts",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (script_config_file);
@@ -649,51 +725,53 @@ script_config_init ()
N_("autoload scripts installed (make a link in \"autoload\" directory "
"to script in parent directory)"),
NULL, 0, 0, "on", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
script_config_scripts_cache_expire = weechat_config_new_option (
script_config_file, ptr_section,
"cache_expire", "integer",
N_("local cache expiration time, in minutes (-1 = never expires, "
"0 = always expire)"),
- NULL, -1, 525600, "1440", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, -1, 525600, "1440", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
script_config_scripts_download_timeout = weechat_config_new_option (
script_config_file, ptr_section,
"download_timeout", "integer",
N_("timeout (in seconds) for download of scripts and list of scripts"),
- NULL, 1, 3600, "30", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 1, 3600, "30", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
script_config_scripts_path = weechat_config_new_option (
script_config_file, ptr_section,
"path", "string",
N_("local cache directory for scripts; \"%h\" at beginning of string "
"is replaced by WeeChat home (\"~/.weechat\" by default) "
"(note: content is evaluated, see /help eval)"),
- NULL, 0, 0, "%h/script", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "%h/script", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
script_config_scripts_hold = weechat_config_new_option (
script_config_file, ptr_section,
"hold", "string",
N_("scripts to \"hold\": comma-separated list of scripts which will "
"never been upgraded and can not be removed, for example: "
"\"buffers.pl,iset.pl\""),
- NULL, 0, 0, "", NULL, 0, NULL, NULL,
- &script_config_change_hold_cb, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL,
+ &script_config_change_hold_cb, NULL, NULL,
+ NULL, NULL, NULL);
script_config_scripts_url = weechat_config_new_option (
script_config_file, ptr_section,
"url", "string",
N_("URL for file with list of scripts; by default HTTPS is forced, "
"see option script.scripts.url_force_https"),
- NULL, 0, 0, "http://weechat.org/files/plugins.xml.gz", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "http://weechat.org/files/plugins.xml.gz", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
script_config_scripts_url_force_https = weechat_config_new_option (
script_config_file, ptr_section,
"url_force_https", "boolean",
N_("force use of HTTPS for downloads (index and scripts); "
"you should disable this option only if you have problems with "
"the downloads"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
return 1;
}
diff --git a/src/plugins/script/script-info.c b/src/plugins/script/script-info.c
index e9df673cb..c3111d5b9 100644
--- a/src/plugins/script/script-info.c
+++ b/src/plugins/script/script-info.c
@@ -33,27 +33,30 @@
*/
struct t_infolist *
-script_info_infolist_script_script_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+script_info_infolist_script_script_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer,
+ const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_script_repo *ptr_script;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
- if (pointer && !script_repo_script_valid (pointer))
+ if (obj_pointer && !script_repo_script_valid (obj_pointer))
return NULL;
ptr_infolist = weechat_infolist_new ();
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one script */
- if (!script_repo_add_to_infolist (ptr_infolist, pointer))
+ if (!script_repo_add_to_infolist (ptr_infolist, obj_pointer))
{
weechat_infolist_free (ptr_infolist);
return NULL;
@@ -97,10 +100,10 @@ script_info_init ()
N_("script pointer (optional)"),
N_("script name with extension "
"(wildcard \"*\" is allowed) (optional)"),
- &script_info_infolist_script_script_cb, NULL);
+ &script_info_infolist_script_script_cb, NULL, NULL);
/* hdata hooks */
weechat_hook_hdata (
"script_script", N_("scripts from repository"),
- &script_repo_hdata_script_cb, NULL);
+ &script_repo_hdata_script_cb, NULL, NULL);
}
diff --git a/src/plugins/script/script-repo.c b/src/plugins/script/script-repo.c
index c5790a338..72b02d4e5 100644
--- a/src/plugins/script/script-repo.c
+++ b/src/plugins/script/script-repo.c
@@ -1140,11 +1140,11 @@ script_repo_file_read (int quiet)
if (!script_repo_max_length_field)
{
- script_repo_max_length_field = weechat_hashtable_new (32,
- WEECHAT_HASHTABLE_STRING,
- WEECHAT_HASHTABLE_INTEGER,
- NULL,
- NULL);
+ script_repo_max_length_field = weechat_hashtable_new (
+ 32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_INTEGER,
+ NULL, NULL);
}
else
weechat_hashtable_remove_all (script_repo_max_length_field);
@@ -1201,8 +1201,7 @@ script_repo_file_read (int quiet)
descriptions = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
/* read plugins.xml.gz */
while (!gzeof (file))
@@ -1422,17 +1421,19 @@ script_repo_file_read (int quiet)
*/
int
-script_repo_file_update_process_cb (void *data, const char *command,
+script_repo_file_update_process_cb (const void *pointer, void *data,
+ const char *command,
int return_code, const char *out,
const char *err)
{
int quiet;
/* make C compiler happy */
+ (void) data;
(void) command;
(void) out;
- quiet = (data == 0) ? 0 : 1;
+ quiet = (pointer) ? 1 : 0;
if (return_code >= 0)
{
@@ -1479,8 +1480,7 @@ script_repo_file_update (int quiet)
options = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (options)
{
url = script_build_download_url (
@@ -1499,7 +1499,8 @@ script_repo_file_update (int quiet)
options,
weechat_config_integer (script_config_scripts_download_timeout) * 1000,
&script_repo_file_update_process_cb,
- (quiet) ? (void *)1 : (void *)0);
+ (quiet) ? (void *)1 : (void *)0,
+ NULL);
free (url);
}
weechat_hashtable_free (options);
@@ -1513,11 +1514,13 @@ script_repo_file_update (int quiet)
*/
struct t_hdata *
-script_repo_hdata_script_cb (void *data, const char *hdata_name)
+script_repo_hdata_script_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
+ (void) pointer;
(void) data;
hdata = weechat_hdata_new (hdata_name, "prev_script", "next_script",
diff --git a/src/plugins/script/script-repo.h b/src/plugins/script/script-repo.h
index 8d14b0300..c2ff595fd 100644
--- a/src/plugins/script/script-repo.h
+++ b/src/plugins/script/script-repo.h
@@ -79,7 +79,8 @@ extern int script_repo_file_exists ();
extern int script_repo_file_is_uptodate ();
extern int script_repo_file_read (int quiet);
extern void script_repo_file_update (int quiet);
-extern struct t_hdata *script_repo_hdata_script_cb (void *data,
+extern struct t_hdata *script_repo_hdata_script_cb (const void *pointer,
+ void *data,
const char *hdata_name);
extern int script_repo_add_to_infolist (struct t_infolist *infolist,
struct t_script_repo *script);
diff --git a/src/plugins/script/script.c b/src/plugins/script/script.c
index f5dfe4294..b95b73628 100644
--- a/src/plugins/script/script.c
+++ b/src/plugins/script/script.c
@@ -179,8 +179,7 @@ script_get_scripts ()
script_loaded = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
}
else
weechat_hashtable_remove_all (script_loaded);
@@ -217,10 +216,12 @@ script_get_scripts ()
*/
int
-script_debug_dump_cb (void *data, const char *signal, const char *type_data,
+script_debug_dump_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -247,9 +248,10 @@ script_debug_dump_cb (void *data, const char *signal, const char *type_data,
*/
int
-script_timer_refresh_cb (void *data, int remaining_calls)
+script_timer_refresh_cb (const void *pointer, void *data, int remaining_calls)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
script_get_loaded_plugins ();
@@ -268,10 +270,12 @@ script_timer_refresh_cb (void *data, int remaining_calls)
*/
int
-script_signal_plugin_cb (void *data, const char *signal, const char *type_data,
+script_signal_plugin_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) type_data;
@@ -285,7 +289,8 @@ script_signal_plugin_cb (void *data, const char *signal, const char *type_data,
if (!script_timer_refresh)
{
script_timer_refresh = weechat_hook_timer (50, 0, 1,
- &script_timer_refresh_cb, NULL);
+ &script_timer_refresh_cb,
+ NULL, NULL);
}
return WEECHAT_RC_OK;
@@ -296,10 +301,12 @@ script_signal_plugin_cb (void *data, const char *signal, const char *type_data,
*/
int
-script_signal_script_cb (void *data, const char *signal, const char *type_data,
+script_signal_script_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) type_data;
@@ -313,7 +320,8 @@ script_signal_script_cb (void *data, const char *signal, const char *type_data,
if (!script_timer_refresh)
{
script_timer_refresh = weechat_hook_timer (50, 0, 1,
- &script_timer_refresh_cb, NULL);
+ &script_timer_refresh_cb,
+ NULL, NULL);
}
return WEECHAT_RC_OK;
@@ -324,7 +332,8 @@ script_signal_script_cb (void *data, const char *signal, const char *type_data,
*/
struct t_hashtable *
-script_focus_chat_cb (void *data, struct t_hashtable *info)
+script_focus_chat_cb (const void *pointer, void *data,
+ struct t_hashtable *info)
{
const char *buffer;
int rc;
@@ -336,6 +345,7 @@ script_focus_chat_cb (void *data, struct t_hashtable *info)
struct tm *tm;
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!script_buffer)
@@ -429,12 +439,16 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
script_completion_init ();
script_info_init ();
- weechat_hook_signal ("debug_dump", &script_debug_dump_cb, NULL);
- weechat_hook_signal ("window_scrolled", &script_buffer_window_scrolled_cb, NULL);
- weechat_hook_signal ("plugin_*", &script_signal_plugin_cb, NULL);
- weechat_hook_signal ("*_script_*", &script_signal_script_cb, NULL);
+ weechat_hook_signal ("debug_dump",
+ &script_debug_dump_cb, NULL, NULL);
+ weechat_hook_signal ("window_scrolled",
+ &script_buffer_window_scrolled_cb, NULL, NULL);
+ weechat_hook_signal ("plugin_*",
+ &script_signal_plugin_cb, NULL, NULL);
+ weechat_hook_signal ("*_script_*",
+ &script_signal_script_cb, NULL, NULL);
- weechat_hook_focus ("chat", &script_focus_chat_cb, NULL);
+ weechat_hook_focus ("chat", &script_focus_chat_cb, NULL, NULL);
if (script_repo_file_exists ())
{
diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c
index 8930927e5..31434ff45 100644
--- a/src/plugins/tcl/weechat-tcl-api.c
+++ b/src/plugins/tcl/weechat-tcl-api.c
@@ -32,7 +32,6 @@
#include "../weechat-plugin.h"
#include "../plugin-script.h"
#include "../plugin-script-api.h"
-#include "../plugin-script-callback.h"
#include "weechat-tcl.h"
@@ -934,25 +933,27 @@ API_FUNC(list_free)
}
int
-weechat_tcl_api_config_reload_cb (void *data,
+weechat_tcl_api_config_reload_cb (const void *pointer, void *data,
struct t_config_file *config_file)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -996,29 +997,31 @@ API_FUNC(config_new)
}
int
-weechat_tcl_api_config_section_read_cb (void *data,
+weechat_tcl_api_config_section_read_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = (option_name) ? (char *)option_name : empty_arg;
func_argv[4] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sssss", func_argv);
if (!rc)
@@ -1040,26 +1043,28 @@ weechat_tcl_api_config_section_read_cb (void *data,
}
int
-weechat_tcl_api_config_section_write_cb (void *data,
+weechat_tcl_api_config_section_write_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = (section_name) ? (char *)section_name : empty_arg;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -1079,26 +1084,28 @@ weechat_tcl_api_config_section_write_cb (void *data,
}
int
-weechat_tcl_api_config_section_write_default_cb (void *data,
+weechat_tcl_api_config_section_write_default_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = (section_name) ? (char *)section_name : empty_arg;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -1118,30 +1125,32 @@ weechat_tcl_api_config_section_write_default_cb (void *data,
}
int
-weechat_tcl_api_config_section_create_option_cb (void *data,
+weechat_tcl_api_config_section_create_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = (option_name) ? (char *)option_name : empty_arg;
func_argv[4] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sssss", func_argv);
if (!rc)
@@ -1163,28 +1172,30 @@ weechat_tcl_api_config_section_create_option_cb (void *data,
}
int
-weechat_tcl_api_config_section_delete_option_cb (void *data,
+weechat_tcl_api_config_section_delete_option_cb (const void *pointer, void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(config_file);
func_argv[2] = API_PTR2STR(section);
func_argv[3] = API_PTR2STR(option);
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -1240,27 +1251,29 @@ API_FUNC(config_new_section)
function_delete_option = Tcl_GetStringFromObj (objv[13], &i);
data_delete_option = Tcl_GetStringFromObj (objv[14], &i);
- result = API_PTR2STR(plugin_script_api_config_new_section (weechat_tcl_plugin,
- tcl_current_script,
- API_STR2PTR(cfg_file),
- name,
- can_add, /* user_can_add_options */
- can_delete, /* user_can_delete_options */
- &weechat_tcl_api_config_section_read_cb,
- function_read,
- data_read,
- &weechat_tcl_api_config_section_write_cb,
- function_write,
- data_write,
- &weechat_tcl_api_config_section_write_default_cb,
- function_write_default,
- data_write_default,
- &weechat_tcl_api_config_section_create_option_cb,
- function_create_option,
- data_create_option,
- &weechat_tcl_api_config_section_delete_option_cb,
- function_delete_option,
- data_delete_option));
+ result = API_PTR2STR(
+ plugin_script_api_config_new_section (
+ weechat_tcl_plugin,
+ tcl_current_script,
+ API_STR2PTR(cfg_file),
+ name,
+ can_add, /* user_can_add_options */
+ can_delete, /* user_can_delete_options */
+ &weechat_tcl_api_config_section_read_cb,
+ function_read,
+ data_read,
+ &weechat_tcl_api_config_section_write_cb,
+ function_write,
+ data_write,
+ &weechat_tcl_api_config_section_write_default_cb,
+ function_write_default,
+ data_write_default,
+ &weechat_tcl_api_config_section_create_option_cb,
+ function_create_option,
+ data_create_option,
+ &weechat_tcl_api_config_section_delete_option_cb,
+ function_delete_option,
+ data_delete_option));
API_RETURN_STRING_FREE(result);
}
@@ -1286,26 +1299,28 @@ API_FUNC(config_search_section)
int
-weechat_tcl_api_config_option_check_value_cb (void *data,
+weechat_tcl_api_config_option_check_value_cb (const void *pointer, void *data,
struct t_config_option *option,
const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
func_argv[2] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -1325,24 +1340,26 @@ weechat_tcl_api_config_option_check_value_cb (void *data,
}
void
-weechat_tcl_api_config_option_change_cb (void *data,
+weechat_tcl_api_config_option_change_cb (const void *pointer, void *data,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (func_argv[1])
@@ -1354,24 +1371,26 @@ weechat_tcl_api_config_option_change_cb (void *data,
}
void
-weechat_tcl_api_config_option_delete_cb (void *data,
+weechat_tcl_api_config_option_delete_cb (const void *pointer, void *data,
struct t_config_option *option)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(option);
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (func_argv[1])
@@ -1818,9 +1837,8 @@ API_FUNC(config_option_free)
if (objc < 2)
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_option_free (weechat_tcl_plugin,
- tcl_current_script,
- API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* option */
+ weechat_config_option_free (
+ API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* option */
API_RETURN_OK;
}
@@ -1834,9 +1852,8 @@ API_FUNC(config_section_free_options)
if (objc < 2)
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_section_free_options (weechat_tcl_plugin,
- tcl_current_script,
- API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* section */
+ weechat_config_section_free_options (
+ API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* section */
API_RETURN_OK;
}
@@ -1850,9 +1867,8 @@ API_FUNC(config_section_free)
if (objc < 2)
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_section_free (weechat_tcl_plugin,
- tcl_current_script,
- API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* section */
+ weechat_config_section_free (
+ API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* section */
API_RETURN_OK;
}
@@ -1866,9 +1882,8 @@ API_FUNC(config_free)
if (objc < 2)
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_config_free (weechat_tcl_plugin,
- tcl_current_script,
- API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* config_file */
+ weechat_config_free (
+ API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* config_file */
API_RETURN_OK;
}
@@ -2152,28 +2167,31 @@ API_FUNC(log_print)
}
int
-weechat_tcl_api_hook_command_cb (void *data, struct t_gui_buffer *buffer,
+weechat_tcl_api_hook_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
/* make C compiler happy */
(void) argv;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (argc > 1) ? argv_eol[1] : empty_arg;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2226,25 +2244,28 @@ API_FUNC(hook_command)
}
int
-weechat_tcl_api_hook_command_run_cb (void *data, struct t_gui_buffer *buffer,
+weechat_tcl_api_hook_command_run_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *command)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (command) ? (char *)command : empty_arg;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2288,26 +2309,29 @@ API_FUNC(hook_command_run)
}
int
-weechat_tcl_api_hook_timer_cb (void *data, int remaining_calls)
+weechat_tcl_api_hook_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char str_remaining_calls[32], empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_remaining_calls, sizeof (str_remaining_calls),
"%d", remaining_calls);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_remaining_calls;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -2353,25 +2377,27 @@ API_FUNC(hook_timer)
}
int
-weechat_tcl_api_hook_fd_cb (void *data, int fd)
+weechat_tcl_api_hook_fd_cb (const void *pointer, void *data, int fd)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char str_fd[32], empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_fd, sizeof (str_fd), "%d", fd);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_fd;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
@@ -2418,28 +2444,30 @@ API_FUNC(hook_fd)
}
int
-weechat_tcl_api_hook_process_cb (void *data,
+weechat_tcl_api_hook_process_cb (const void *pointer, void *data,
const char *command, int return_code,
const char *out, const char *err)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (command) ? (char *)command : empty_arg;
func_argv[2] = &return_code;
func_argv[3] = (out) ? (char *)out : empty_arg;
func_argv[4] = (err) ? (char *)err : empty_arg;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssiss", func_argv);
if (!rc)
@@ -2522,34 +2550,37 @@ API_FUNC(hook_process_hashtable)
}
int
-weechat_tcl_api_hook_connect_cb (void *data, int status, int gnutls_rc,
+weechat_tcl_api_hook_connect_cb (const void *pointer, void *data,
+ int status, int gnutls_rc,
int sock, const char *error,
const char *ip_address)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[6];
char str_status[32], str_gnutls_rc[32], str_sock[32];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_status, sizeof (str_status), "%d", status);
snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc);
snprintf (str_sock, sizeof (str_sock), "%d", sock);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = str_status;
func_argv[2] = str_gnutls_rc;
func_argv[3] = str_sock;
func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg;
func_argv[5] = (error) ? (char *)error : empty_arg;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssssss", func_argv);
if (!rc)
@@ -2607,28 +2638,31 @@ API_FUNC(hook_connect)
}
int
-weechat_tcl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
+weechat_tcl_api_hook_print_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
time_t date,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[8];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
static char timebuffer[64];
int *rc, ret;
/* make C compiler happy */
(void) tags_count;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)date);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = timebuffer;
func_argv[3] = weechat_string_build_with_split_string (tags, ",");
@@ -2639,9 +2673,9 @@ weechat_tcl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
func_argv[6] = (prefix) ? (char *)prefix : empty_arg;
func_argv[7] = (message) ? (char *)message : empty_arg;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssssiiss", func_argv);
if (!rc)
@@ -2695,20 +2729,23 @@ API_FUNC(hook_print)
}
int
-weechat_tcl_api_hook_signal_cb (void *data, const char *signal, const char *type_data,
+weechat_tcl_api_hook_signal_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
static char str_value[64];
int *rc, ret, free_needed;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (signal) ? (char *)signal : empty_arg;
free_needed = 0;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
@@ -2733,9 +2770,9 @@ weechat_tcl_api_hook_signal_cb (void *data, const char *signal, const char *type
else
func_argv[2] = empty_arg;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2820,25 +2857,28 @@ API_FUNC(hook_signal_send)
}
int
-weechat_tcl_api_hook_hsignal_cb (void *data, const char *signal,
+weechat_tcl_api_hook_hsignal_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (signal) ? (char *)signal : empty_arg;
func_argv[2] = hashtable;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssh", func_argv);
if (!rc)
@@ -2905,24 +2945,27 @@ API_FUNC(hook_hsignal_send)
}
int
-weechat_tcl_api_hook_config_cb (void *data, const char *option, const char *value)
+weechat_tcl_api_hook_config_cb (const void *pointer, void *data,
+ const char *option, const char *value)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (option) ? (char *)option : empty_arg;
func_argv[2] = (value) ? (char *)value : empty_arg;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
@@ -2964,27 +3007,30 @@ API_FUNC(hook_config)
}
int
-weechat_tcl_api_hook_completion_cb (void *data, const char *completion_item,
+weechat_tcl_api_hook_completion_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (completion_item) ? (char *)completion_item : empty_arg;
func_argv[2] = API_PTR2STR(buffer);
func_argv[3] = API_PTR2STR(completion);
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -3077,25 +3123,29 @@ API_FUNC(hook_completion_list_add)
}
char *
-weechat_tcl_api_hook_modifier_cb (void *data, const char *modifier,
- const char *modifier_data, const char *string)
+weechat_tcl_api_hook_modifier_cb (const void *pointer, void *data,
+ const char *modifier,
+ const char *modifier_data,
+ const char *string)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (modifier) ? (char *)modifier : empty_arg;
func_argv[2] = (modifier_data) ? (char *)modifier_data : empty_arg;
func_argv[3] = (string) ? (char *)string : empty_arg;
- return (char *)weechat_tcl_exec (script_callback->script,
+ return (char *)weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
}
@@ -3146,24 +3196,27 @@ API_FUNC(hook_modifier_exec)
}
const char *
-weechat_tcl_api_hook_info_cb (void *data, const char *info_name,
+weechat_tcl_api_hook_info_cb (const void *pointer, void *data,
+ const char *info_name,
const char *arguments)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (info_name) ? (char *)info_name : empty_arg;
func_argv[2] = (arguments) ? (char *)arguments : empty_arg;
- return (const char *)weechat_tcl_exec (script_callback->script,
+ return (const char *)weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
}
@@ -3199,25 +3252,29 @@ API_FUNC(hook_info)
}
struct t_hashtable *
-weechat_tcl_api_hook_info_hashtable_cb (void *data, const char *info_name,
+weechat_tcl_api_hook_info_hashtable_cb (const void *pointer, void *data,
+ const char *info_name,
struct t_hashtable *hashtable)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (info_name) ? (char *)info_name : empty_arg;
func_argv[2] = hashtable;
- return (struct t_hashtable *)weechat_tcl_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_HASHTABLE,
- script_callback->function,
- "ssh", func_argv);
+ return (struct t_hashtable *)weechat_tcl_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_HASHTABLE,
+ ptr_function,
+ "ssh", func_argv);
}
return NULL;
@@ -3255,27 +3312,31 @@ API_FUNC(hook_info_hashtable)
}
struct t_infolist *
-weechat_tcl_api_hook_infolist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+weechat_tcl_api_hook_infolist_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
struct t_infolist *result;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = (infolist_name) ? (char *)infolist_name : empty_arg;
- func_argv[2] = API_PTR2STR(pointer);
+ func_argv[2] = API_PTR2STR(obj_pointer);
func_argv[3] = (arguments) ? (char *)arguments : empty_arg;
- result = (struct t_infolist *)weechat_tcl_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
- "ssss", func_argv);
+ result = (struct t_infolist *)weechat_tcl_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_STRING,
+ ptr_function,
+ "ssss", func_argv);
if (func_argv[2])
free (func_argv[2]);
@@ -3318,24 +3379,27 @@ API_FUNC(hook_infolist)
}
struct t_hashtable *
-weechat_tcl_api_hook_focus_cb (void *data,
+weechat_tcl_api_hook_focus_cb (const void *pointer, void *data,
struct t_hashtable *info)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = info;
- return (struct t_hashtable *)weechat_tcl_exec (script_callback->script,
- WEECHAT_SCRIPT_EXEC_HASHTABLE,
- script_callback->function,
- "sh", func_argv);
+ return (struct t_hashtable *)weechat_tcl_exec (
+ script,
+ WEECHAT_SCRIPT_EXEC_HASHTABLE,
+ ptr_function,
+ "sh", func_argv);
}
return NULL;
@@ -3393,9 +3457,8 @@ API_FUNC(unhook)
if (objc < 2)
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_unhook (weechat_tcl_plugin,
- tcl_current_script,
- API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* hook */
+ weechat_unhook (
+ API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* hook */
API_RETURN_OK;
}
@@ -3411,31 +3474,34 @@ API_FUNC(unhook_all)
API_INIT_FUNC(1, "unhook_all", API_RETURN_ERROR);
- plugin_script_api_unhook_all (weechat_tcl_plugin, tcl_current_script);
+ weechat_unhook_all_plugin (tcl_current_script->name);
API_RETURN_OK;
}
int
-weechat_tcl_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
+weechat_tcl_api_buffer_input_data_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[3];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
func_argv[2] = (input_data) ? (char *)input_data : empty_arg;
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -3454,23 +3520,26 @@ weechat_tcl_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
}
int
-weechat_tcl_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+weechat_tcl_api_buffer_close_cb (const void *pointer,
+ void *data, struct t_gui_buffer *buffer)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[2];
char empty_arg[1] = { '\0' };
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(buffer);
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ss", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
@@ -3593,9 +3662,8 @@ API_FUNC(buffer_close)
if (objc < 2)
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_buffer_close (weechat_tcl_plugin,
- tcl_current_script,
- API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* buffer */
+ weechat_buffer_close (
+ API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* buffer */
API_RETURN_OK;
}
@@ -4198,31 +4266,34 @@ API_FUNC(bar_item_search)
}
char *
-weechat_tcl_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
+weechat_tcl_api_bar_item_build_cb (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[5];
char empty_arg[1] = { '\0' }, *ret;
+ const char *ptr_function, *ptr_data;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
- if (strncmp (script_callback->function, "(extra)", 7) == 0)
+ if (strncmp (ptr_function, "(extra)", 7) == 0)
{
/* new callback: data, item, window, buffer, extra_info */
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(item);
func_argv[2] = API_PTR2STR(window);
func_argv[3] = API_PTR2STR(buffer);
func_argv[4] = extra_info;
- ret = (char *)weechat_tcl_exec (script_callback->script,
+ ret = (char *)weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function + 7,
+ ptr_function + 7,
"ssssh", func_argv);
if (func_argv[1])
@@ -4235,13 +4306,13 @@ weechat_tcl_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
else
{
/* old callback: data, item, window */
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(item);
func_argv[2] = API_PTR2STR(window);
- ret = (char *)weechat_tcl_exec (script_callback->script,
+ ret = (char *)weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_STRING,
- script_callback->function,
+ ptr_function,
"sss", func_argv);
if (func_argv[1])
@@ -4303,9 +4374,8 @@ API_FUNC(bar_item_remove)
if (objc < 2)
API_WRONG_ARGS(API_RETURN_ERROR);
- plugin_script_api_bar_item_remove (weechat_tcl_plugin,
- tcl_current_script,
- API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* item */
+ weechat_bar_item_remove (
+ API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* item */
API_RETURN_OK;
}
@@ -5179,74 +5249,33 @@ API_FUNC(hdata_get_string)
API_RETURN_STRING(result);
}
-API_FUNC(upgrade_new)
-{
- Tcl_Obj *objp;
- char *result, *filename;
- int i, write;
-
- API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY);
- if (objc < 3)
- API_WRONG_ARGS(API_RETURN_EMPTY);
-
- if (Tcl_GetIntFromObj (interp, objv[2], &write) != TCL_OK)
- API_WRONG_ARGS(API_RETURN_EMPTY);
-
- filename = Tcl_GetStringFromObj (objv[1], &i);
-
- result = API_PTR2STR(weechat_upgrade_new (filename, write));
-
- API_RETURN_STRING_FREE(result);
-}
-
-API_FUNC(upgrade_write_object)
-{
- Tcl_Obj *objp;
- char *upgrade_file, *infolist;
- int rc, i, object_id;
-
- API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0));
- if (objc < 4)
- API_WRONG_ARGS(API_RETURN_INT(0));
-
- if (Tcl_GetIntFromObj (interp, objv[2], &object_id) != TCL_OK)
- API_WRONG_ARGS(API_RETURN_INT(0));
-
- upgrade_file = Tcl_GetStringFromObj (objv[1], &i);
- infolist = Tcl_GetStringFromObj (objv[3], &i);
-
- rc = weechat_upgrade_write_object (API_STR2PTR(upgrade_file),
- object_id,
- API_STR2PTR(infolist));
-
- API_RETURN_INT(rc);
-}
-
int
-weechat_tcl_api_upgrade_read_cb (void *data,
+weechat_tcl_api_upgrade_read_cb (const void *pointer, void *data,
struct t_upgrade_file *upgrade_file,
int object_id,
struct t_infolist *infolist)
{
- struct t_plugin_script_cb *script_callback;
+ struct t_plugin_script *script;
void *func_argv[4];
char empty_arg[1] = { '\0' }, str_object_id[32];
+ const char *ptr_function, *ptr_data;
int *rc, ret;
- script_callback = (struct t_plugin_script_cb *)data;
+ script = (struct t_plugin_script *)pointer;
+ plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
- if (script_callback && script_callback->function && script_callback->function[0])
+ if (ptr_function && ptr_function[0])
{
snprintf (str_object_id, sizeof (str_object_id), "%d", object_id);
- func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
+ func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
func_argv[1] = API_PTR2STR(upgrade_file);
func_argv[2] = str_object_id;
func_argv[3] = API_PTR2STR(infolist);
- rc = (int *) weechat_tcl_exec (script_callback->script,
+ rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
- script_callback->function,
+ ptr_function,
"ssss", func_argv);
if (!rc)
@@ -5267,26 +5296,68 @@ weechat_tcl_api_upgrade_read_cb (void *data,
return WEECHAT_RC_ERROR;
}
+API_FUNC(upgrade_new)
+{
+ Tcl_Obj *objp;
+ char *result, *filename, *function, *data;
+ int i;
+
+ API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY);
+ if (objc < 4)
+ API_WRONG_ARGS(API_RETURN_EMPTY);
+
+ filename = Tcl_GetStringFromObj (objv[1], &i);
+ function = Tcl_GetStringFromObj (objv[2], &i);
+ data = Tcl_GetStringFromObj (objv[3], &i);
+
+ result = API_PTR2STR(
+ plugin_script_api_upgrade_new (
+ weechat_tcl_plugin,
+ tcl_current_script,
+ filename,
+ &weechat_tcl_api_upgrade_read_cb,
+ function,
+ data));
+
+ API_RETURN_STRING_FREE(result);
+}
+
+API_FUNC(upgrade_write_object)
+{
+ Tcl_Obj *objp;
+ char *upgrade_file, *infolist;
+ int rc, i, object_id;
+
+ API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0));
+ if (objc < 4)
+ API_WRONG_ARGS(API_RETURN_INT(0));
+
+ if (Tcl_GetIntFromObj (interp, objv[2], &object_id) != TCL_OK)
+ API_WRONG_ARGS(API_RETURN_INT(0));
+
+ upgrade_file = Tcl_GetStringFromObj (objv[1], &i);
+ infolist = Tcl_GetStringFromObj (objv[3], &i);
+
+ rc = weechat_upgrade_write_object (API_STR2PTR(upgrade_file),
+ object_id,
+ API_STR2PTR(infolist));
+
+ API_RETURN_INT(rc);
+}
+
API_FUNC(upgrade_read)
{
Tcl_Obj *objp;
- char *upgrade_file, *function, *data;
+ char *upgrade_file;
int i, rc;
API_INIT_FUNC(1, "upgrade_read", API_RETURN_INT(0));
- if (objc < 4)
+ if (objc < 2)
API_WRONG_ARGS(API_RETURN_INT(0));
upgrade_file = Tcl_GetStringFromObj (objv[1], &i);
- function = Tcl_GetStringFromObj (objv[2], &i);
- data = Tcl_GetStringFromObj (objv[3], &i);
- rc = plugin_script_api_upgrade_read (weechat_tcl_plugin,
- tcl_current_script,
- API_STR2PTR(upgrade_file),
- &weechat_tcl_api_upgrade_read_cb,
- function,
- data);
+ rc = weechat_upgrade_read (API_STR2PTR(upgrade_file));
API_RETURN_INT(rc);
}
diff --git a/src/plugins/tcl/weechat-tcl-api.h b/src/plugins/tcl/weechat-tcl-api.h
index 5fd7d7ab4..758bb7f48 100644
--- a/src/plugins/tcl/weechat-tcl-api.h
+++ b/src/plugins/tcl/weechat-tcl-api.h
@@ -21,10 +21,12 @@
#ifndef WEECHAT_TCL_API_H
#define WEECHAT_TCL_API_H 1
-extern int weechat_tcl_api_buffer_input_data_cb (void *data,
+extern int weechat_tcl_api_buffer_input_data_cb (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data);
-extern int weechat_tcl_api_buffer_close_cb (void *data,
+extern int weechat_tcl_api_buffer_close_cb (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer);
extern void weechat_tcl_api_init (Tcl_Interp *interp);
diff --git a/src/plugins/tcl/weechat-tcl.c b/src/plugins/tcl/weechat-tcl.c
index eed63715a..91297e56a 100644
--- a/src/plugins/tcl/weechat-tcl.c
+++ b/src/plugins/tcl/weechat-tcl.c
@@ -122,8 +122,7 @@ weechat_tcl_hashtable_to_dict (Tcl_Interp *interp,
data[0] = interp;
data[1] = dict;
- weechat_hashtable_map_string (hashtable,
- &weechat_tcl_hashtable_map_cb,
+ weechat_hashtable_map_string (hashtable, &weechat_tcl_hashtable_map_cb,
data);
return dict;
@@ -519,12 +518,14 @@ weechat_tcl_reload_name (const char *name)
*/
int
-weechat_tcl_command_cb (void *data, struct t_gui_buffer *buffer,
+weechat_tcl_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
char *ptr_name, *path_script;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -620,11 +621,13 @@ weechat_tcl_command_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-weechat_tcl_completion_cb (void *data, const char *completion_item,
+weechat_tcl_completion_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -639,9 +642,11 @@ weechat_tcl_completion_cb (void *data, const char *completion_item,
*/
struct t_hdata *
-weechat_tcl_hdata_cb (void *data, const char *hdata_name)
+weechat_tcl_hdata_cb (const void *pointer, void *data,
+ const char *hdata_name)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
return plugin_script_hdata_script (weechat_plugin,
@@ -654,10 +659,12 @@ weechat_tcl_hdata_cb (void *data, const char *hdata_name)
*/
struct t_infolist *
-weechat_tcl_infolist_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+weechat_tcl_infolist_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!infolist_name || !infolist_name[0])
@@ -666,7 +673,7 @@ weechat_tcl_infolist_cb (void *data, const char *infolist_name,
if (weechat_strcasecmp (infolist_name, "tcl_script") == 0)
{
return plugin_script_infolist_list_scripts (weechat_tcl_plugin,
- tcl_scripts, pointer,
+ tcl_scripts, obj_pointer,
arguments);
}
@@ -678,10 +685,12 @@ weechat_tcl_infolist_cb (void *data, const char *infolist_name,
*/
int
-weechat_tcl_signal_debug_dump_cb (void *data, const char *signal,
+weechat_tcl_signal_debug_dump_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -700,10 +709,12 @@ weechat_tcl_signal_debug_dump_cb (void *data, const char *signal,
*/
int
-weechat_tcl_signal_debug_libs_cb (void *data, const char *signal,
+weechat_tcl_signal_debug_libs_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data, void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -719,37 +730,20 @@ weechat_tcl_signal_debug_libs_cb (void *data, const char *signal,
}
/*
- * Callback called when a buffer is closed.
- */
-
-int
-weechat_tcl_signal_buffer_closed_cb (void *data, const char *signal,
- const char *type_data, void *signal_data)
-{
- /* make C compiler happy */
- (void) data;
- (void) signal;
- (void) type_data;
-
- if (signal_data)
- plugin_script_remove_buffer_callbacks (tcl_scripts, signal_data);
-
- return WEECHAT_RC_OK;
-}
-
-/*
* Timer for executing actions.
*/
int
-weechat_tcl_timer_action_cb (void *data, int remaining_calls)
+weechat_tcl_timer_action_cb (const void *pointer, void *data,
+ int remaining_calls)
{
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- if (data)
+ if (pointer)
{
- if (data == &tcl_action_install_list)
+ if (pointer == &tcl_action_install_list)
{
plugin_script_action_install (weechat_tcl_plugin,
tcl_scripts,
@@ -758,7 +752,7 @@ weechat_tcl_timer_action_cb (void *data, int remaining_calls)
&tcl_quiet,
&tcl_action_install_list);
}
- else if (data == &tcl_action_remove_list)
+ else if (pointer == &tcl_action_remove_list)
{
plugin_script_action_remove (weechat_tcl_plugin,
tcl_scripts,
@@ -766,7 +760,7 @@ weechat_tcl_timer_action_cb (void *data, int remaining_calls)
&tcl_quiet,
&tcl_action_remove_list);
}
- else if (data == &tcl_action_autoload_list)
+ else if (pointer == &tcl_action_autoload_list)
{
plugin_script_action_autoload (weechat_tcl_plugin,
&tcl_quiet,
@@ -782,11 +776,13 @@ weechat_tcl_timer_action_cb (void *data, int remaining_calls)
*/
int
-weechat_tcl_signal_script_action_cb (void *data, const char *signal,
+weechat_tcl_signal_script_action_cb (const void *pointer, void *data,
+ const char *signal,
const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
@@ -797,7 +793,7 @@ weechat_tcl_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_tcl_timer_action_cb,
- &tcl_action_install_list);
+ &tcl_action_install_list, NULL);
}
else if (strcmp (signal, "tcl_script_remove") == 0)
{
@@ -805,7 +801,7 @@ weechat_tcl_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_tcl_timer_action_cb,
- &tcl_action_remove_list);
+ &tcl_action_remove_list, NULL);
}
else if (strcmp (signal, "tcl_script_autoload") == 0)
{
@@ -813,7 +809,7 @@ weechat_tcl_signal_script_action_cb (void *data, const char *signal,
(const char *)signal_data);
weechat_hook_timer (1, 0, 1,
&weechat_tcl_timer_action_cb,
- &tcl_action_autoload_list);
+ &tcl_action_autoload_list, NULL);
}
}
@@ -837,7 +833,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
init.callback_infolist = &weechat_tcl_infolist_cb;
init.callback_signal_debug_dump = &weechat_tcl_signal_debug_dump_cb;
init.callback_signal_debug_libs = &weechat_tcl_signal_debug_libs_cb;
- init.callback_signal_buffer_closed = &weechat_tcl_signal_buffer_closed_cb;
init.callback_signal_script_action = &weechat_tcl_signal_script_action_cb;
init.callback_load_file = &weechat_tcl_load_cb;
diff --git a/src/plugins/trigger/trigger-buffer.c b/src/plugins/trigger/trigger-buffer.c
index 7fd28e9f4..aaf660204 100644
--- a/src/plugins/trigger/trigger-buffer.c
+++ b/src/plugins/trigger/trigger-buffer.c
@@ -114,10 +114,12 @@ trigger_buffer_set_title ()
*/
int
-trigger_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
- const char *input_data)
+trigger_buffer_input_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
+ const char *input_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
/* close buffer */
@@ -144,9 +146,11 @@ trigger_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-trigger_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+trigger_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -188,9 +192,10 @@ trigger_buffer_open (const char *filter, int switch_to_buffer)
{
if (!trigger_buffer)
{
- trigger_buffer = weechat_buffer_new (TRIGGER_BUFFER_NAME,
- &trigger_buffer_input_cb, NULL,
- &trigger_buffer_close_cb, NULL);
+ trigger_buffer = weechat_buffer_new (
+ TRIGGER_BUFFER_NAME,
+ &trigger_buffer_input_cb, NULL, NULL,
+ &trigger_buffer_close_cb, NULL, NULL);
/* failed to create buffer ? then return */
if (!trigger_buffer)
diff --git a/src/plugins/trigger/trigger-callback.c b/src/plugins/trigger/trigger-callback.c
index 78b3636e8..3ac37a463 100644
--- a/src/plugins/trigger/trigger-callback.c
+++ b/src/plugins/trigger/trigger-callback.c
@@ -56,8 +56,7 @@ trigger_callback_irc_message_parse (const char *irc_message,
hashtable_in = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (hashtable_in)
{
weechat_hashtable_set (hashtable_in, "message", irc_message);
@@ -187,8 +186,7 @@ trigger_callback_replace_regex (struct t_trigger *trigger,
pointers = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_POINTER,
- NULL,
- NULL);
+ NULL, NULL);
if (!pointers)
return;
pointers_allocated = 1;
@@ -366,8 +364,9 @@ trigger_callback_execute (struct t_trigger *trigger,
*/
int
-trigger_callback_signal_cb (void *data, const char *signal,
- const char *type_data, void *signal_data)
+trigger_callback_signal_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
+ void *signal_data)
{
const char *ptr_signal_data;
char str_data[128], *irc_server;
@@ -463,7 +462,8 @@ end:
*/
int
-trigger_callback_hsignal_cb (void *data, const char *signal,
+trigger_callback_hsignal_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable)
{
const char *type_values;
@@ -510,8 +510,9 @@ end:
*/
char *
-trigger_callback_modifier_cb (void *data, const char *modifier,
- const char *modifier_data, const char *string)
+trigger_callback_modifier_cb (const void *pointer, void *data,
+ const char *modifier, const char *modifier_data,
+ const char *string)
{
struct t_gui_buffer *buffer;
const char *ptr_string;
@@ -691,7 +692,8 @@ end:
*/
int
-trigger_callback_print_cb (void *data, struct t_gui_buffer *buffer,
+trigger_callback_print_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
time_t date, int tags_count, const char **tags,
int displayed, int highlight, const char *prefix,
const char *message)
@@ -766,7 +768,8 @@ end:
*/
int
-trigger_callback_command_cb (void *data, struct t_gui_buffer *buffer,
+trigger_callback_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
char str_name[32];
@@ -799,7 +802,8 @@ end:
*/
int
-trigger_callback_command_run_cb (void *data, struct t_gui_buffer *buffer,
+trigger_callback_command_run_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *command)
{
TRIGGER_CALLBACK_CB_INIT(WEECHAT_RC_OK);
@@ -823,7 +827,8 @@ end:
*/
int
-trigger_callback_timer_cb (void *data, int remaining_calls)
+trigger_callback_timer_cb (const void *pointer, void *data,
+ int remaining_calls)
{
char str_temp[128];
int i;
@@ -870,7 +875,8 @@ end:
*/
int
-trigger_callback_config_cb (void *data, const char *option, const char *value)
+trigger_callback_config_cb (const void *pointer, void *data,
+ const char *option, const char *value)
{
TRIGGER_CALLBACK_CB_INIT(WEECHAT_RC_OK);
@@ -892,7 +898,8 @@ end:
*/
struct t_hashtable *
-trigger_callback_focus_cb (void *data, struct t_hashtable *info)
+trigger_callback_focus_cb (const void *pointer, void *data,
+ struct t_hashtable *info)
{
const char *ptr_value;
long unsigned int value;
@@ -936,8 +943,7 @@ trigger_callback_init ()
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
if (trigger_callback_hashtable_options_conditions)
{
weechat_hashtable_set (trigger_callback_hashtable_options_conditions,
@@ -948,8 +954,7 @@ trigger_callback_init ()
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
- NULL,
- NULL);
+ NULL, NULL);
}
/*
diff --git a/src/plugins/trigger/trigger-callback.h b/src/plugins/trigger/trigger-callback.h
index 9e411d763..9f7fb781a 100644
--- a/src/plugins/trigger/trigger-callback.h
+++ b/src/plugins/trigger/trigger-callback.h
@@ -26,10 +26,11 @@
int trigger_rc; \
pointers = NULL; \
extra_vars = NULL; \
+ (void) data; \
(void) trigger_rc; \
if (!trigger_enabled) \
return __rc; \
- trigger = (struct t_trigger *)data; \
+ trigger = (struct t_trigger *)pointer; \
if (!trigger || trigger->hook_running) \
return __rc; \
trigger->hook_count_cb++; \
@@ -43,8 +44,7 @@
32, \
WEECHAT_HASHTABLE_STRING, \
WEECHAT_HASHTABLE_POINTER, \
- NULL, \
- NULL); \
+ NULL, NULL); \
if (!pointers) \
goto end;
@@ -53,8 +53,7 @@
32, \
WEECHAT_HASHTABLE_STRING, \
WEECHAT_HASHTABLE_STRING, \
- NULL, \
- NULL); \
+ NULL, NULL); \
if (!extra_vars) \
goto end;
@@ -66,27 +65,38 @@
trigger->hook_running = 0; \
return __rc;
-extern int trigger_callback_signal_cb (void *data, const char *signal,
- const char *type_data, void *signal_data);
-extern int trigger_callback_hsignal_cb (void *data, const char *signal,
+extern int trigger_callback_signal_cb (const void *pointer, void *data,
+ const char *signal,
+ const char *type_data,
+ void *signal_data);
+extern int trigger_callback_hsignal_cb (const void *pointer, void *data,
+ const char *signal,
struct t_hashtable *hashtable);
-extern char *trigger_callback_modifier_cb (void *data, const char *modifier,
+extern char *trigger_callback_modifier_cb (const void *pointer, void *data,
+ const char *modifier,
const char *modifier_data,
const char *string);
-extern int trigger_callback_print_cb (void *data, struct t_gui_buffer *buffer,
+extern int trigger_callback_print_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
time_t date, int tags_count,
const char **tags, int displayed,
int highlight, const char *prefix,
const char *message);
-extern int trigger_callback_command_cb (void *data, struct t_gui_buffer *buffer,
- int argc, char **argv, char **argv_eol);
-extern int trigger_callback_command_run_cb (void *data,
+extern int trigger_callback_command_cb (const void *pointer,
+ void *data,
+ struct t_gui_buffer *buffer,
+ int argc, char **argv,
+ char **argv_eol);
+extern int trigger_callback_command_run_cb (const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *command);
-extern int trigger_callback_timer_cb (void *data, int remaining_calls);
-extern int trigger_callback_config_cb (void *data, const char *option,
- const char *value);
-extern struct t_hashtable *trigger_callback_focus_cb (void *data,
+extern int trigger_callback_timer_cb (const void *pointer, void *data,
+ int remaining_calls);
+extern int trigger_callback_config_cb (const void *pointer, void *data,
+ const char *option, const char *value);
+extern struct t_hashtable *trigger_callback_focus_cb (const void *pointer,
+ void *data,
struct t_hashtable *info);
extern void trigger_callback_init ();
extern void trigger_callback_end ();
diff --git a/src/plugins/trigger/trigger-command.c b/src/plugins/trigger/trigger-command.c
index 602b82f5b..3affef98e 100644
--- a/src/plugins/trigger/trigger-command.c
+++ b/src/plugins/trigger/trigger-command.c
@@ -449,7 +449,8 @@ end:
*/
int
-trigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc,
+trigger_command_trigger (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
struct t_trigger *ptr_trigger, *ptr_trigger2;
@@ -459,6 +460,7 @@ trigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc,
int regex_count, regex_rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
rc = WEECHAT_RC_OK;
@@ -1180,5 +1182,5 @@ trigger_command_init ()
" || restore %(trigger_names_default)|%*"
" || default"
" || monitor %(trigger_names)|%(trigger_hooks_filter)",
- &trigger_command_trigger, NULL);
+ &trigger_command_trigger, NULL, NULL);
}
diff --git a/src/plugins/trigger/trigger-completion.c b/src/plugins/trigger/trigger-completion.c
index c0f39dba0..7cde28930 100644
--- a/src/plugins/trigger/trigger-completion.c
+++ b/src/plugins/trigger/trigger-completion.c
@@ -33,13 +33,15 @@
*/
int
-trigger_completion_triggers_cb (void *data, const char *completion_item,
+trigger_completion_triggers_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
struct t_trigger *ptr_trigger;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -59,7 +61,8 @@ trigger_completion_triggers_cb (void *data, const char *completion_item,
*/
int
-trigger_completion_triggers_default_cb (void *data,
+trigger_completion_triggers_default_cb (const void *pointer, void *data,
+
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
@@ -67,6 +70,7 @@ trigger_completion_triggers_default_cb (void *data,
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -86,13 +90,15 @@ trigger_completion_triggers_default_cb (void *data,
*/
int
-trigger_completion_options_cb (void *data, const char *completion_item,
+trigger_completion_options_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -112,7 +118,8 @@ trigger_completion_options_cb (void *data, const char *completion_item,
*/
int
-trigger_completion_option_value_cb (void *data, const char *completion_item,
+trigger_completion_option_value_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -122,6 +129,7 @@ trigger_completion_option_value_cb (void *data, const char *completion_item,
struct t_trigger *ptr_trigger;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -170,13 +178,15 @@ trigger_completion_option_value_cb (void *data, const char *completion_item,
*/
int
-trigger_completion_hooks_cb (void *data, const char *completion_item,
+trigger_completion_hooks_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
int i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -196,7 +206,8 @@ trigger_completion_hooks_cb (void *data, const char *completion_item,
*/
int
-trigger_completion_hooks_filter_cb (void *data, const char *completion_item,
+trigger_completion_hooks_filter_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
@@ -204,6 +215,7 @@ trigger_completion_hooks_filter_cb (void *data, const char *completion_item,
char str_hook[128];
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -300,11 +312,13 @@ trigger_completion_add_default_for_hook (struct t_gui_completion *completion,
*/
int
-trigger_completion_hook_arguments_cb (void *data, const char *completion_item,
+trigger_completion_hook_arguments_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -323,11 +337,13 @@ trigger_completion_hook_arguments_cb (void *data, const char *completion_item,
*/
int
-trigger_completion_hook_conditions_cb (void *data, const char *completion_item,
+trigger_completion_hook_conditions_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -347,11 +363,13 @@ trigger_completion_hook_conditions_cb (void *data, const char *completion_item,
*/
int
-trigger_completion_hook_regex_cb (void *data, const char *completion_item,
+trigger_completion_hook_regex_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -371,11 +389,13 @@ trigger_completion_hook_regex_cb (void *data, const char *completion_item,
*/
int
-trigger_completion_hook_command_cb (void *data, const char *completion_item,
+trigger_completion_hook_command_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -395,11 +415,13 @@ trigger_completion_hook_command_cb (void *data, const char *completion_item,
*/
int
-trigger_completion_hook_rc_cb (void *data, const char *completion_item,
+trigger_completion_hook_rc_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
@@ -420,35 +442,35 @@ trigger_completion_init ()
{
weechat_hook_completion ("trigger_names",
N_("triggers"),
- &trigger_completion_triggers_cb, NULL);
+ &trigger_completion_triggers_cb, NULL, NULL);
weechat_hook_completion ("trigger_names_default",
N_("default triggers"),
- &trigger_completion_triggers_default_cb, NULL);
+ &trigger_completion_triggers_default_cb, NULL, NULL);
weechat_hook_completion ("trigger_options",
N_("options for triggers"),
- &trigger_completion_options_cb, NULL);
+ &trigger_completion_options_cb, NULL, NULL);
weechat_hook_completion ("trigger_option_value",
N_("value of a trigger option"),
- &trigger_completion_option_value_cb, NULL);
+ &trigger_completion_option_value_cb, NULL, NULL);
weechat_hook_completion ("trigger_hooks",
N_("hooks for triggers"),
- &trigger_completion_hooks_cb, NULL);
+ &trigger_completion_hooks_cb, NULL, NULL);
weechat_hook_completion ("trigger_hooks_filter",
N_("hooks for triggers (for filter in monitor buffer)"),
- &trigger_completion_hooks_filter_cb, NULL);
+ &trigger_completion_hooks_filter_cb, NULL, NULL);
weechat_hook_completion ("trigger_hook_arguments",
N_("default arguments for a hook"),
- &trigger_completion_hook_arguments_cb, NULL);
+ &trigger_completion_hook_arguments_cb, NULL, NULL);
weechat_hook_completion ("trigger_hook_conditions",
N_("default conditions for a hook"),
- &trigger_completion_hook_conditions_cb, NULL);
+ &trigger_completion_hook_conditions_cb, NULL, NULL);
weechat_hook_completion ("trigger_hook_regex",
N_("default regular expression for a hook"),
- &trigger_completion_hook_regex_cb, NULL);
+ &trigger_completion_hook_regex_cb, NULL, NULL);
weechat_hook_completion ("trigger_hook_command",
N_("default command for a hook"),
- &trigger_completion_hook_command_cb, NULL);
+ &trigger_completion_hook_command_cb, NULL, NULL);
weechat_hook_completion ("trigger_hook_rc",
N_("default return codes for hook callback"),
- &trigger_completion_hook_rc_cb, NULL);
+ &trigger_completion_hook_rc_cb, NULL, NULL);
}
diff --git a/src/plugins/trigger/trigger-config.c b/src/plugins/trigger/trigger-config.c
index 30faf9f8c..5038f2c59 100644
--- a/src/plugins/trigger/trigger-config.c
+++ b/src/plugins/trigger/trigger-config.c
@@ -102,9 +102,11 @@ char *trigger_config_default_list[][1 + TRIGGER_NUM_OPTIONS] =
*/
void
-trigger_config_change_enabled (void *data, struct t_config_option *option)
+trigger_config_change_enabled (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
trigger_enabled = weechat_config_boolean (option);
@@ -115,12 +117,13 @@ trigger_config_change_enabled (void *data, struct t_config_option *option)
*/
void
-trigger_config_change_trigger_enabled (void *data,
+trigger_config_change_trigger_enabled (const void *pointer, void *data,
struct t_config_option *option)
{
struct t_trigger *ptr_trigger;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_trigger = trigger_search_with_option (option);
@@ -138,11 +141,13 @@ trigger_config_change_trigger_enabled (void *data,
*/
void
-trigger_config_change_trigger_hook (void *data, struct t_config_option *option)
+trigger_config_change_trigger_hook (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_trigger *ptr_trigger;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_trigger = trigger_search_with_option (option);
@@ -158,12 +163,13 @@ trigger_config_change_trigger_hook (void *data, struct t_config_option *option)
*/
void
-trigger_config_change_trigger_arguments (void *data,
+trigger_config_change_trigger_arguments (const void *pointer, void *data,
struct t_config_option *option)
{
struct t_trigger *ptr_trigger;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_trigger = trigger_search_with_option (option);
@@ -179,11 +185,13 @@ trigger_config_change_trigger_arguments (void *data,
*/
void
-trigger_config_change_trigger_regex (void *data, struct t_config_option *option)
+trigger_config_change_trigger_regex (const void *pointer, void *data,
+ struct t_config_option *option)
{
struct t_trigger *ptr_trigger;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_trigger = trigger_search_with_option (option);
@@ -223,12 +231,13 @@ trigger_config_change_trigger_regex (void *data, struct t_config_option *option)
*/
void
-trigger_config_change_trigger_command (void *data,
+trigger_config_change_trigger_command (const void *pointer, void *data,
struct t_config_option *option)
{
struct t_trigger *ptr_trigger;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_trigger = trigger_search_with_option (option);
@@ -273,8 +282,10 @@ trigger_config_create_trigger_option (const char *trigger_name, int index_option
option_name, "boolean",
N_("if disabled, the hooks are removed from trigger, so it is "
"not called any more"),
- NULL, 0, 0, value, NULL, 0, NULL, NULL,
- &trigger_config_change_trigger_enabled, NULL, NULL, NULL);
+ NULL, 0, 0, value, NULL, 0,
+ NULL, NULL, NULL,
+ &trigger_config_change_trigger_enabled, NULL, NULL,
+ NULL, NULL, NULL);
break;
case TRIGGER_OPTION_HOOK:
ptr_option = weechat_config_new_option (
@@ -282,8 +293,10 @@ trigger_config_create_trigger_option (const char *trigger_name, int index_option
option_name, "integer",
N_("type of hook used"),
trigger_hook_option_values,
- 0, 0, value, NULL, 0, NULL, NULL,
- &trigger_config_change_trigger_hook, NULL, NULL, NULL);
+ 0, 0, value, NULL, 0,
+ NULL, NULL, NULL,
+ &trigger_config_change_trigger_hook, NULL, NULL,
+ NULL, NULL, NULL);
break;
case TRIGGER_OPTION_ARGUMENTS:
ptr_option = weechat_config_new_option (
@@ -291,8 +304,10 @@ trigger_config_create_trigger_option (const char *trigger_name, int index_option
option_name, "string",
N_("arguments for the hook (depend on the hook type, see /help "
"trigger)"),
- NULL, 0, 0, value, NULL, 0, NULL, NULL,
- &trigger_config_change_trigger_arguments, NULL, NULL, NULL);
+ NULL, 0, 0, value, NULL, 0,
+ NULL, NULL, NULL,
+ &trigger_config_change_trigger_arguments, NULL, NULL,
+ NULL, NULL, NULL);
break;
case TRIGGER_OPTION_CONDITIONS:
ptr_option = weechat_config_new_option (
@@ -302,7 +317,7 @@ trigger_config_create_trigger_option (const char *trigger_name, int index_option
"hook callback) (note: content is evaluated when trigger is "
"run, see /help eval)"),
NULL, 0, 0, value, NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
break;
case TRIGGER_OPTION_REGEX:
ptr_option = weechat_config_new_option (
@@ -321,8 +336,10 @@ trigger_config_create_trigger_option (const char *trigger_name, int index_option
"replace: ${re:0} to ${re:99}, ${re:+} for last match and "
"${hide:c,${re:N}} to replace all chars of group N by "
"char 'c'"),
- NULL, 0, 0, value, NULL, 0, NULL, NULL,
- &trigger_config_change_trigger_regex, NULL, NULL, NULL);
+ NULL, 0, 0, value, NULL, 0,
+ NULL, NULL, NULL,
+ &trigger_config_change_trigger_regex, NULL, NULL,
+ NULL, NULL, NULL);
break;
case TRIGGER_OPTION_COMMAND:
ptr_option = weechat_config_new_option (
@@ -330,8 +347,10 @@ trigger_config_create_trigger_option (const char *trigger_name, int index_option
option_name, "string",
N_("command(s) to run if conditions are OK, after regex "
"replacements (many commands can be separated by semicolons)"),
- NULL, 0, 0, value, NULL, 0, NULL, NULL,
- &trigger_config_change_trigger_command, NULL, NULL, NULL);
+ NULL, 0, 0, value, NULL, 0,
+ NULL, NULL, NULL,
+ &trigger_config_change_trigger_command, NULL, NULL,
+ NULL, NULL, NULL);
break;
case TRIGGER_OPTION_RETURN_CODE:
ptr_option = weechat_config_new_option (
@@ -340,7 +359,7 @@ trigger_config_create_trigger_option (const char *trigger_name, int index_option
N_("return code for hook callback (see plugin API reference to "
"know where ok_eat/error can be used efficiently)"),
"ok|ok_eat|error", 0, 0, value, NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
break;
case TRIGGER_NUM_OPTIONS:
break;
@@ -434,7 +453,8 @@ trigger_config_use_temp_triggers ()
*/
int
-trigger_config_trigger_read_cb (void *data, struct t_config_file *config_file,
+trigger_config_trigger_read_cb (const void *pointer, void *data,
+ struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
@@ -443,6 +463,7 @@ trigger_config_trigger_read_cb (void *data, struct t_config_file *config_file,
int index_option;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) config_file;
(void) section;
@@ -504,7 +525,7 @@ trigger_config_trigger_read_cb (void *data, struct t_config_file *config_file,
*/
int
-trigger_config_trigger_write_default_cb (void *data,
+trigger_config_trigger_write_default_cb (const void *pointer, void *data,
struct t_config_file *config_file,
const char *section_name)
{
@@ -512,6 +533,7 @@ trigger_config_trigger_write_default_cb (void *data,
char option_name[512];
/* make C compiler happy */
+ (void) pointer;
(void) data;
if (!weechat_config_write_line (config_file, section_name, NULL))
@@ -545,11 +567,13 @@ trigger_config_trigger_write_default_cb (void *data,
*/
int
-trigger_config_reload_cb (void *data, struct t_config_file *config_file)
+trigger_config_reload_cb (const void *pointer, void *data,
+ struct t_config_file *config_file)
{
int rc;
/* make C compiler happy */
+ (void) pointer;
(void) data;
trigger_free_all ();
@@ -574,17 +598,19 @@ trigger_config_init ()
{
struct t_config_section *ptr_section;
- trigger_config_file = weechat_config_new (TRIGGER_CONFIG_NAME,
- &trigger_config_reload_cb, NULL);
+ trigger_config_file = weechat_config_new (
+ TRIGGER_CONFIG_NAME, &trigger_config_reload_cb, NULL, NULL);
if (!trigger_config_file)
return 0;
/* look */
ptr_section = weechat_config_new_section (trigger_config_file, "look",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (trigger_config_file);
@@ -595,21 +621,25 @@ trigger_config_init ()
trigger_config_file, ptr_section,
"enabled", "boolean",
N_("enable trigger support"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL,
- &trigger_config_change_enabled, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL,
+ &trigger_config_change_enabled, NULL, NULL,
+ NULL, NULL, NULL);
trigger_config_look_monitor_strip_colors = weechat_config_new_option (
trigger_config_file, ptr_section,
"monitor_strip_colors", "boolean",
N_("strip colors in hashtable values displayed on monitor buffer"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* color */
ptr_section = weechat_config_new_section (trigger_config_file, "color",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (trigger_config_file);
@@ -621,59 +651,60 @@ trigger_config_init ()
"flag_command", "color",
N_("text color for command flag (in /trigger list)"),
NULL, 0, 0, "lightgreen", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
trigger_config_color_flag_conditions = weechat_config_new_option (
trigger_config_file, ptr_section,
"flag_conditions", "color",
N_("text color for conditions flag (in /trigger list)"),
NULL, 0, 0, "yellow", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
trigger_config_color_flag_regex = weechat_config_new_option (
trigger_config_file, ptr_section,
"flag_regex", "color",
N_("text color for regex flag (in /trigger list)"),
NULL, 0, 0, "lightcyan", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
trigger_config_color_flag_return_code = weechat_config_new_option (
trigger_config_file, ptr_section,
"flag_return_code", "color",
N_("text color for return code flag (in /trigger list)"),
NULL, 0, 0, "lightmagenta", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
trigger_config_color_regex = weechat_config_new_option (
trigger_config_file, ptr_section,
"regex", "color",
N_("text color for regular expressions"),
NULL, 0, 0, "white", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
trigger_config_color_replace = weechat_config_new_option (
trigger_config_file, ptr_section,
"replace", "color",
N_("text color for replacement text (for regular expressions)"),
NULL, 0, 0, "cyan", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
trigger_config_color_trigger = weechat_config_new_option (
trigger_config_file, ptr_section,
"trigger", "color",
N_("text color for trigger name"),
NULL, 0, 0, "green", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
trigger_config_color_trigger_disabled = weechat_config_new_option (
trigger_config_file, ptr_section,
"trigger_disabled", "color",
N_("text color for disabled trigger name"),
NULL, 0, 0, "red", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/* trigger */
- ptr_section = weechat_config_new_section (trigger_config_file,
- TRIGGER_CONFIG_SECTION_TRIGGER,
- 0, 0,
- &trigger_config_trigger_read_cb, NULL,
- NULL, NULL,
- &trigger_config_trigger_write_default_cb, NULL,
- NULL, NULL,
- NULL, NULL);
+ ptr_section = weechat_config_new_section (
+ trigger_config_file,
+ TRIGGER_CONFIG_SECTION_TRIGGER,
+ 0, 0,
+ &trigger_config_trigger_read_cb, NULL, NULL,
+ NULL, NULL, NULL,
+ &trigger_config_trigger_write_default_cb, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (trigger_config_file);
diff --git a/src/plugins/trigger/trigger.c b/src/plugins/trigger/trigger.c
index 0c4f121d0..92aacadbe 100644
--- a/src/plugins/trigger/trigger.c
+++ b/src/plugins/trigger/trigger.c
@@ -266,7 +266,7 @@ trigger_hook (struct t_trigger *trigger)
trigger->hooks[i] = weechat_hook_signal (
argv[i],
&trigger_callback_signal_cb,
- trigger);
+ trigger, NULL);
}
}
}
@@ -283,7 +283,7 @@ trigger_hook (struct t_trigger *trigger)
trigger->hooks[i] = weechat_hook_hsignal (
argv[i],
&trigger_callback_hsignal_cb,
- trigger);
+ trigger, NULL);
}
}
}
@@ -300,7 +300,7 @@ trigger_hook (struct t_trigger *trigger)
trigger->hooks[i] = weechat_hook_modifier (
argv[i],
&trigger_callback_modifier_cb,
- trigger);
+ trigger, NULL);
}
}
}
@@ -330,7 +330,7 @@ trigger_hook (struct t_trigger *trigger)
message,
strip_colors,
&trigger_callback_print_cb,
- trigger);
+ trigger, NULL);
}
break;
case TRIGGER_HOOK_COMMAND:
@@ -347,7 +347,7 @@ trigger_hook (struct t_trigger *trigger)
(argc > 3) ? argv[3] : "", /* description of args */
(argc > 4) ? argv[4] : "", /* completion */
&trigger_callback_command_cb,
- trigger);
+ trigger, NULL);
}
}
break;
@@ -363,7 +363,7 @@ trigger_hook (struct t_trigger *trigger)
trigger->hooks[i] = weechat_hook_command_run (
argv[i],
&trigger_callback_command_run_cb,
- trigger);
+ trigger, NULL);
}
}
}
@@ -393,7 +393,7 @@ trigger_hook (struct t_trigger *trigger)
(int)align_second,
(int)max_calls,
&trigger_callback_timer_cb,
- trigger);
+ trigger, NULL);
}
}
}
@@ -410,7 +410,7 @@ trigger_hook (struct t_trigger *trigger)
trigger->hooks[i] = weechat_hook_config (
argv[i],
&trigger_callback_config_cb,
- trigger);
+ trigger, NULL);
}
}
}
@@ -427,7 +427,7 @@ trigger_hook (struct t_trigger *trigger)
trigger->hooks[i] = weechat_hook_focus (
argv[i],
&trigger_callback_focus_cb,
- trigger);
+ trigger, NULL);
}
}
}
@@ -1151,10 +1151,12 @@ trigger_print_log ()
*/
int
-trigger_debug_dump_cb (void *data, const char *signal, const char *type_data,
+trigger_debug_dump_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -1197,7 +1199,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
trigger_config_read ();
/* hook some signals */
- weechat_hook_signal ("debug_dump", &trigger_debug_dump_cb, NULL);
+ weechat_hook_signal ("debug_dump", &trigger_debug_dump_cb, NULL, NULL);
/* hook completions */
trigger_completion_init ();
diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h
index 0b8c24e8b..438c2c4c2 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 "20150822-01"
+#define WEECHAT_PLUGIN_API_VERSION "20160321-01"
/* macros for defining plugin infos */
#define WEECHAT_PLUGIN_NAME(__name) \
@@ -294,7 +294,8 @@ struct t_weechat_plugin
char *(*string_replace_regex) (const char *string, void *regex,
const char *replace,
const char reference_char,
- char *(*callback)(void *data, const char *text),
+ 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);
@@ -342,8 +343,9 @@ struct t_weechat_plugin
int (*mkdir_home) (const char *directory, int mode);
int (*mkdir) (const char *directory, int mode);
int (*mkdir_parents) (const char *directory, int mode);
- void (*exec_on_files) (const char *directory, int hidden_files, void *data,
- void (*callback)(void *data, const char *filename));
+ void (*exec_on_files) (const char *directory, int hidden_files,
+ void (*callback)(void *data, const char *filename),
+ void *callback_data);
char *(*file_get_content) (const char *filename);
/* util */
@@ -428,37 +430,49 @@ struct t_weechat_plugin
/* config files */
struct t_config_file *(*config_new) (struct t_weechat_plugin *plugin,
const char *name,
- int (*callback_reload)(void *data,
+ int (*callback_reload)(const void *pointer,
+ void *data,
struct t_config_file *config_file),
+ const void *callback_reload_pointer,
void *callback_reload_data);
struct t_config_section *(*config_new_section) (struct t_config_file *config_file,
const char *name,
int user_can_add_options,
int user_can_delete_options,
- int (*callback_read)(void *data,
+ int (*callback_read)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value),
+ const void *callback_read_pointer,
void *callback_read_data,
- int (*callback_write)(void *data,
+ int (*callback_write)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
const char *section_name),
+ const void *callback_write_pointer,
void *callback_write_data,
- int (*callback_write_default)(void *data,
+ int (*callback_write_default)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
const char *section_name),
+ const void *callback_write_default_pointer,
void *callback_write_default_data,
- int (*callback_create_option)(void *data,
+ int (*callback_create_option)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name,
const char *value),
+ const void *callback_create_option_pointer,
void *callback_create_option_data,
- int (*callback_delete_option)(void *data,
+ int (*callback_delete_option)(const void *pointer,
+ void *data,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option),
+ const void *callback_delete_option_pointer,
void *callback_delete_option_data);
struct t_config_section *(*config_search_section) (struct t_config_file *config_file,
const char *section_name);
@@ -473,15 +487,21 @@ struct t_weechat_plugin
const char *default_value,
const char *value,
int null_value_allowed,
- int (*callback_check_value)(void *data,
+ int (*callback_check_value)(const void *pointer,
+ void *data,
struct t_config_option *option,
const char *value),
+ const void *callback_check_value_pointer,
void *callback_check_value_data,
- void (*callback_change)(void *data,
+ void (*callback_change)(const void *pointer,
+ void *data,
struct t_config_option *option),
+ const void *callback_change_pointer,
void *callback_change_data,
- void (*callback_delete)(void *data,
+ void (*callback_delete)(const void *pointer,
+ void *data,
struct t_config_option *option),
+ const void *callback_delete_pointer,
void *callback_delete_data);
struct t_config_option *(*config_search_option) (struct t_config_file *config_file,
struct t_config_section *section,
@@ -563,49 +583,62 @@ struct t_weechat_plugin
const char *args,
const char *args_description,
const char *completion,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
int argc, char **argv,
char **argv_eol),
+ const void *callback_pointer,
void *callback_data);
struct t_hook *(*hook_command_run) (struct t_weechat_plugin *plugin,
const char *command,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *command),
+ const void *callback_pointer,
void *callback_data);
struct t_hook *(*hook_timer) (struct t_weechat_plugin *plugin,
long interval,
int align_second,
int max_calls,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
int remaining_calls),
+ const void *callback_pointer,
void *callback_data);
struct t_hook *(*hook_fd) (struct t_weechat_plugin *plugin,
int fd,
int flag_read,
int flag_write,
int flag_exception,
- int (*callback)(void *data, int fd),
+ int (*callback)(const void *pointer,
+ void *data,
+ int fd),
+ const void *callback_pointer,
void *callback_data);
struct t_hook *(*hook_process) (struct t_weechat_plugin *plugin,
const char *command,
int timeout,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
const char *command,
int return_code,
const char *out,
const char *err),
+ const void *callback_pointer,
void *callback_data);
struct t_hook *(*hook_process_hashtable) (struct t_weechat_plugin *plugin,
const char *command,
struct t_hashtable *options,
int timeout,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
const char *command,
int return_code,
const char *out,
const char *err),
+ const void *callback_pointer,
void *callback_data);
struct t_hook *(*hook_connect) (struct t_weechat_plugin *plugin,
const char *proxy,
@@ -617,19 +650,22 @@ struct t_weechat_plugin
int gnutls_dhkey_size,
const char *gnutls_priorities,
const char *local_hostname,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
int status,
int gnutls_rc,
int sock,
const char *error,
const char *ip_address),
+ const void *callback_pointer,
void *callback_data);
struct t_hook *(*hook_print) (struct t_weechat_plugin *plugin,
struct t_gui_buffer *buffer,
const char *tags,
const char *message,
int strip_colors,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
time_t date,
int tags_count,
@@ -638,37 +674,46 @@ struct t_weechat_plugin
int highlight,
const char *prefix,
const char *message),
+ const void *callback_pointer,
void *callback_data);
struct t_hook *(*hook_signal) (struct t_weechat_plugin *plugin,
const char *signal,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
const char *signal,
const char *type_data,
void *signal_data),
+ const void *callback_pointer,
void *callback_data);
int (*hook_signal_send) (const char *signal, const char *type_data,
void *signal_data);
struct t_hook *(*hook_hsignal) (struct t_weechat_plugin *plugin,
const char *signal,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
const char *signal,
struct t_hashtable *hashtable),
+ const void *callback_pointer,
void *callback_data);
int (*hook_hsignal_send) (const char *signal,
struct t_hashtable *hashtable);
struct t_hook *(*hook_config) (struct t_weechat_plugin *plugin,
const char *option,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
const char *option,
const char *value),
+ const void *callback_pointer,
void *callback_data);
struct t_hook *(*hook_completion) (struct t_weechat_plugin *plugin,
const char *completion_item,
const char *description,
- int (*callback)(void *data,
+ int (*callback)(const void *pointer,
+ void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion),
+ const void *callback_pointer,
void *callback_data);
const char *(*hook_completion_get_string) (struct t_gui_completion *completion,
const char *property);
@@ -678,10 +723,12 @@ struct t_weechat_plugin
const char *where);
struct t_hook *(*hook_modifier) (struct t_weechat_plugin *plugin,
const char *modifier,
- char *(*callback)(void *data,
+ char *(*callback)(const void *pointer,
+ void *data,
const char *modifier,
const char *modifier_data,
const char *string),
+ const void *callback_pointer,
void *callback_data);
char *(*hook_modifier_exec) (struct t_weechat_plugin *plugin,
const char *modifier,
@@ -691,54 +738,69 @@ struct t_weechat_plugin
const char *info_name,
const char *description,
const char *args_description,
- const char *(*callback)(void *data,
+ const char *(*callback)(const void *pointer,
+ void *data,
const char *info_name,
const char *arguments),
+ const void *callback_pointer,
void *callback_data);
struct t_hook *(*hook_info_hashtable) (struct t_weechat_plugin *plugin,
const char *info_name,
const char *description,
const char *args_description,
const char *output_description,
- struct t_hashtable *(*callback)(void *data,
+ struct t_hashtable *(*callback)(const void *pointer,
+ void *data,
const char *info_name,
struct t_hashtable *hashtable),
+ const void *callback_pointer,
void *callback_data);
struct t_hook *(*hook_infolist) (struct t_weechat_plugin *plugin,
const char *infolist_name,
const char *description,
const char *pointer_description,
const char *args_description,
- struct t_infolist *(*callback)(void *data,
+ struct t_infolist *(*callback)(const void *cb_pointer,
+ void *data,
const char *infolist_name,
- void *pointer,
+ void *obj_pointer,
const char *arguments),
+ const void *callback_pointer,
void *callback_data);
struct t_hook *(*hook_hdata) (struct t_weechat_plugin *plugin,
const char *hdata_name,
const char *description,
- struct t_hdata *(*callback)(void *data,
+ struct t_hdata *(*callback)(const void *pointer,
+ void *data,
const char *hdata_name),
+ const void *callback_pointer,
void *callback_data);
struct t_hook *(*hook_focus) (struct t_weechat_plugin *plugin,
const char *area,
- struct t_hashtable *(*callback)(void *data,
+ struct t_hashtable *(*callback)(const void *pointer,
+ void *data,
struct t_hashtable *info),
+ const void *callback_pointer,
void *callback_data);
void (*hook_set) (struct t_hook *hook, const char *property,
const char *value);
void (*unhook) (struct t_hook *hook);
- void (*unhook_all) (struct t_weechat_plugin *plugin);
+ void (*unhook_all_plugin) (struct t_weechat_plugin *plugin,
+ const char *subplugin);
/* buffers */
struct t_gui_buffer *(*buffer_new) (struct t_weechat_plugin *plugin,
const char *name,
- int (*input_callback)(void *data,
+ int (*input_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer,
const char *input_data),
+ const void *input_callback_pointer,
void *input_callback_data,
- int (*close_callback)(void *data,
+ int (*close_callback)(const void *pointer,
+ void *data,
struct t_gui_buffer *buffer),
+ const void *close_callback_pointer,
void *close_callback_data);
struct t_gui_buffer *(*buffer_search) (const char *plugin, const char *name);
struct t_gui_buffer *(*buffer_search_main) ();
@@ -827,11 +889,13 @@ struct t_weechat_plugin
struct t_gui_bar_item *(*bar_item_search) (const char *name);
struct t_gui_bar_item *(*bar_item_new) (struct t_weechat_plugin *plugin,
const char *name,
- char *(*build_callback)(void *data,
+ char *(*build_callback)(const void *pointer,
+ void *data,
struct t_gui_bar_item *item,
struct t_gui_window *window,
struct t_gui_buffer *buffer,
struct t_hashtable *extra_info),
+ const void *build_callback_pointer,
void *build_callback_data);
void (*bar_item_update) (const char *name);
void (*bar_item_remove) (struct t_gui_bar_item *item);
@@ -973,16 +1037,17 @@ struct t_weechat_plugin
/* upgrade */
struct t_upgrade_file *(*upgrade_new) (const char *filename,
- int write);
+ int (*callback_read)(const void *pointer,
+ void *data,
+ struct t_upgrade_file *upgrade_file,
+ int object_id,
+ struct t_infolist *infolist),
+ const void *callback_read_pointer,
+ void *callback_read_data);
int (*upgrade_write_object) (struct t_upgrade_file *upgrade_file,
int object_id,
struct t_infolist *infolist);
- int (*upgrade_read) (struct t_upgrade_file *upgrade_file,
- int (*callback_read)(void *data,
- struct t_upgrade_file *upgrade_file,
- int object_id,
- struct t_infolist *infolist),
- void *callback_read_data);
+ int (*upgrade_read) (struct t_upgrade_file *upgrade_file);
void (*upgrade_close) (struct t_upgrade_file *upgrade_file);
};
@@ -1158,10 +1223,10 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
(weechat_plugin->mkdir)(__directory, __mode)
#define weechat_mkdir_parents(__directory, __mode) \
(weechat_plugin->mkdir_parents)(__directory, __mode)
-#define weechat_exec_on_files(__directory, __hidden_files, __data, \
- __callback) \
+#define weechat_exec_on_files(__directory, __hidden_files, __callback, \
+ __callback_data) \
(weechat_plugin->exec_on_files)(__directory, __hidden_files, \
- __data, __callback)
+ __callback, __callback_data)
#define weechat_file_get_content(__filename) \
(weechat_plugin->file_get_content)(__filename)
@@ -1211,9 +1276,10 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
/* hash tables */
#define weechat_hashtable_new(__size, __type_keys, __type_values, \
- __hash_key_cb, __keycmp_cb) \
+ __callback_hash_key, __callback_keycmp) \
(weechat_plugin->hashtable_new)(__size, __type_keys, __type_values, \
- __hash_key_cb, __keycmp_cb)
+ __callback_hash_key, \
+ __callback_keycmp)
#define weechat_hashtable_set_with_size(__hashtable, __key, __key_size, \
__value, __value_size) \
(weechat_plugin->hashtable_set_with_size)(__hashtable, __key, \
@@ -1256,31 +1322,47 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
/* config files */
#define weechat_config_new(__name, __callback_reload, \
+ __callback_reload_pointer, \
__callback_reload_data) \
(weechat_plugin->config_new)(weechat_plugin, __name, \
__callback_reload, \
+ __callback_reload_pointer, \
__callback_reload_data)
#define weechat_config_new_section(__config, __name, \
__user_can_add_options, \
__user_can_delete_options, \
- __cb_read, __cb_read_data, \
- __cb_write_std, __cb_write_std_data, \
- __cb_write_def, __cb_write_def_data, \
+ __cb_read, \
+ __cb_read_pointer, \
+ __cb_read_data, \
+ __cb_write_std, \
+ __cb_write_std_pointer, \
+ __cb_write_std_data, \
+ __cb_write_def, \
+ __cb_write_def_pointer, \
+ __cb_write_def_data, \
__cb_create_option, \
+ __cb_create_option_pointer, \
__cb_create_option_data, \
__cb_delete_option, \
+ __cb_delete_option_pointer, \
__cb_delete_option_data) \
(weechat_plugin->config_new_section)(__config, __name, \
__user_can_add_options, \
__user_can_delete_options, \
- __cb_read, __cb_read_data, \
+ __cb_read, \
+ __cb_read_pointer, \
+ __cb_read_data, \
__cb_write_std, \
+ __cb_write_std_pointer, \
__cb_write_std_data, \
__cb_write_def, \
+ __cb_write_def_pointer, \
__cb_write_def_data, \
__cb_create_option, \
+ __cb_create_option_pointer, \
__cb_create_option_data, \
__cb_delete_option, \
+ __cb_delete_option_pointer, \
__cb_delete_option_data)
#define weechat_config_search_section(__config, __name) \
(weechat_plugin->config_search_section)(__config, __name)
@@ -1289,10 +1371,13 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
__max, __default, __value, \
__null_value_allowed, \
__callback_check, \
+ __callback_check_pointer, \
__callback_check_data, \
__callback_change, \
+ __callback_change_pointer, \
__callback_change_data, \
__callback_delete, \
+ __callback_delete_pointer, \
__callback_delete_data) \
(weechat_plugin->config_new_option)(__config, __section, __name, \
__type, __desc, \
@@ -1301,10 +1386,13 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
__value, \
__null_value_allowed, \
__callback_check, \
+ __callback_check_pointer, \
__callback_check_data, \
__callback_change, \
+ __callback_change_pointer, \
__callback_change_data, \
__callback_delete, \
+ __callback_delete_pointer, \
__callback_delete_data)
#define weechat_config_search_option(__config, __section, __name) \
(weechat_plugin->config_search_option)(__config, __section, __name)
@@ -1420,69 +1508,75 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
/* hooks */
#define weechat_hook_command(__command, __description, __args, \
__args_desc, __completion, __callback, \
- __data) \
+ __pointer, __data) \
(weechat_plugin->hook_command)(weechat_plugin, __command, \
__description, __args, __args_desc, \
- __completion, __callback, __data)
-#define weechat_hook_command_run(__command, __callback, __data) \
+ __completion, __callback, __pointer, \
+ __data)
+#define weechat_hook_command_run(__command, __callback, __pointer, \
+ __data) \
(weechat_plugin->hook_command_run)(weechat_plugin, __command, \
- __callback, __data)
+ __callback, __pointer, __data)
#define weechat_hook_timer(__interval, __align_second, __max_calls, \
- __callback, __data) \
+ __callback, __pointer, __data) \
(weechat_plugin->hook_timer)(weechat_plugin, __interval, \
__align_second, __max_calls, \
- __callback, __data)
+ __callback, __pointer, __data)
#define weechat_hook_fd(__fd, __flag_read, __flag_write, \
- __flag_exception, __callback, __data) \
+ __flag_exception, __callback, __pointer, \
+ __data) \
(weechat_plugin->hook_fd)(weechat_plugin, __fd, __flag_read, \
__flag_write, __flag_exception, \
- __callback, __data)
+ __callback, __pointer, __data)
#define weechat_hook_process(__command, __timeout, __callback, \
- __callback_data) \
+ __callback_pointer, __callback_data) \
(weechat_plugin->hook_process)(weechat_plugin, __command, \
__timeout, __callback, \
- __callback_data)
+ __callback_pointer, __callback_data)
#define weechat_hook_process_hashtable(__command, __options, __timeout, \
- __callback, __callback_data) \
+ __callback, __callback_pointer, \
+ __callback_data) \
(weechat_plugin->hook_process_hashtable)(weechat_plugin, __command, \
__options, __timeout, \
__callback, \
+ __callback_pointer, \
__callback_data)
#define weechat_hook_connect(__proxy, __address, __port, __ipv6, \
__retry, __gnutls_sess, __gnutls_cb, \
__gnutls_dhkey_size, __gnutls_priorities, \
- __local_hostname, __callback, __data) \
+ __local_hostname, __callback, __pointer, \
+ __data) \
(weechat_plugin->hook_connect)(weechat_plugin, __proxy, __address, \
__port, __ipv6, __retry, \
__gnutls_sess, __gnutls_cb, \
__gnutls_dhkey_size, \
__gnutls_priorities, \
__local_hostname, \
- __callback, __data)
+ __callback, __pointer, __data)
#define weechat_hook_print(__buffer, __tags, __msg, __strip__colors, \
- __callback, __data) \
+ __callback, __pointer, __data) \
(weechat_plugin->hook_print)(weechat_plugin, __buffer, __tags, \
__msg, __strip__colors, __callback, \
- __data)
-#define weechat_hook_signal(__signal, __callback, __data) \
+ __pointer, __data)
+#define weechat_hook_signal(__signal, __callback, __pointer, __data) \
(weechat_plugin->hook_signal)(weechat_plugin, __signal, __callback, \
- __data)
+ __pointer, __data)
#define weechat_hook_signal_send(__signal, __type_data, __signal_data) \
(weechat_plugin->hook_signal_send)(__signal, __type_data, \
__signal_data)
-#define weechat_hook_hsignal(__signal, __callback, __data) \
+#define weechat_hook_hsignal(__signal, __callback, __pointer, __data) \
(weechat_plugin->hook_hsignal)(weechat_plugin, __signal, \
- __callback, __data)
+ __callback, __pointer, __data)
#define weechat_hook_hsignal_send(__signal, __hashtable) \
(weechat_plugin->hook_hsignal_send)(__signal, __hashtable)
-#define weechat_hook_config(__option, __callback, __data) \
+#define weechat_hook_config(__option, __callback, __pointer, __data) \
(weechat_plugin->hook_config)(weechat_plugin, __option, __callback, \
- __data)
+ __pointer, __data)
#define weechat_hook_completion(__completion, __description, \
- __callback, __data) \
+ __callback, __pointer, __data) \
(weechat_plugin->hook_completion)(weechat_plugin, __completion, \
__description, __callback, \
- __data)
+ __pointer, __data)
#define weechat_hook_completion_get_string(__completion, __property) \
(weechat_plugin->hook_completion_get_string)(__completion, \
__property)
@@ -1491,58 +1585,69 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
(weechat_plugin->hook_completion_list_add)(__completion, __word, \
__nick_completion, \
__where)
-#define weechat_hook_modifier(__modifier, __callback, __data) \
+#define weechat_hook_modifier(__modifier, __callback, __pointer, \
+ __data) \
(weechat_plugin->hook_modifier)(weechat_plugin, __modifier, \
- __callback, __data)
+ __callback, __pointer, __data)
#define weechat_hook_modifier_exec(__modifier, __modifier_data, \
__string) \
(weechat_plugin->hook_modifier_exec)(weechat_plugin, __modifier, \
__modifier_data, __string)
#define weechat_hook_info(__info_name, __description, \
- __args_description, __callback, __data) \
+ __args_description, __callback, __pointer, \
+ __data) \
(weechat_plugin->hook_info)(weechat_plugin, __info_name, \
- __description, __args_description, \
- __callback, __data)
+ __description, __args_description, \
+ __callback, __pointer, __data)
#define weechat_hook_info_hashtable(__info_name, __description, \
__args_description, \
__output_description, \
__callback, \
+ __pointer, \
__data) \
(weechat_plugin->hook_info_hashtable)(weechat_plugin, __info_name, \
__description, \
__args_description, \
__output_description, \
- __callback, __data)
+ __callback, __pointer, \
+ __data)
#define weechat_hook_infolist(__infolist_name, __description, \
__pointer_description, \
- __args_description, __callback, __data) \
+ __args_description, __callback, \
+ __pointer, __data) \
(weechat_plugin->hook_infolist)(weechat_plugin, __infolist_name, \
__description, \
__pointer_description, \
__args_description, __callback, \
- __data)
+ __pointer, __data)
#define weechat_hook_hdata(__hdata_name, __description, __callback, \
- __data) \
+ __pointer, __data) \
(weechat_plugin->hook_hdata)(weechat_plugin, __hdata_name, \
- __description, __callback, __data)
-#define weechat_hook_focus(__area, __callback, __data) \
- (weechat_plugin->hook_focus)(weechat_plugin, __area, __callback, \
+ __description, __callback, __pointer, \
__data)
+#define weechat_hook_focus(__area, __callback, __pointer, __data) \
+ (weechat_plugin->hook_focus)(weechat_plugin, __area, __callback, \
+ __pointer, __data)
#define weechat_hook_set(__hook, __property, __value) \
(weechat_plugin->hook_set)(__hook, __property, __value)
#define weechat_unhook(__hook) \
(weechat_plugin->unhook)( __hook)
-#define weechat_unhook_all() \
- (weechat_plugin->unhook_all_plugin)(weechat_plugin)
+#define weechat_unhook_all_plugin(__subplugin) \
+ (weechat_plugin->unhook_all_plugin)(weechat_plugin, __subplugin)
/* buffers */
#define weechat_buffer_new(__name, __input_callback, \
- __input_callback_data, __close_callback, \
+ __input_callback_pointer, \
+ __input_callback_data, \
+ __close_callback, \
+ __close_callback_pointer, \
__close_callback_data) \
(weechat_plugin->buffer_new)(weechat_plugin, __name, \
__input_callback, \
+ __input_callback_pointer, \
__input_callback_data, \
__close_callback, \
+ __close_callback_pointer, \
__close_callback_data)
#define weechat_buffer_search(__plugin, __name) \
(weechat_plugin->buffer_search)(__plugin, __name)
@@ -1646,9 +1751,13 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
/* bars */
#define weechat_bar_item_search(__name) \
(weechat_plugin->bar_item_search)(__name)
-#define weechat_bar_item_new(__name, __build_callback, __data) \
+#define weechat_bar_item_new(__name, __build_callback, \
+ __build_callback_pointer, \
+ __build_callback_data) \
(weechat_plugin->bar_item_new)(weechat_plugin, __name, \
- __build_callback, __data)
+ __build_callback, \
+ __build_callback_pointer, \
+ __build_callback_data)
#define weechat_bar_item_update(__name) \
(weechat_plugin->bar_item_update)(__name)
#define weechat_bar_item_remove(__item) \
@@ -1818,16 +1927,18 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
(weechat_plugin->hdata_get_string)(__hdata, __property)
/* upgrade */
-#define weechat_upgrade_new(__filename, __write) \
- (weechat_plugin->upgrade_new)(__filename, __write)
+#define weechat_upgrade_new(__filename, __callback_read, \
+ __callback_read_pointer, \
+ __callback_read_data) \
+ (weechat_plugin->upgrade_new)(__filename, __callback_read, \
+ __callback_read_pointer, \
+ __callback_read_data)
#define weechat_upgrade_write_object(__upgrade_file, __object_id, \
__infolist) \
(weechat_plugin->upgrade_write_object)(__upgrade_file, __object_id, \
__infolist)
-#define weechat_upgrade_read(__upgrade_file, __callback_read, \
- __callback_read_data) \
- (weechat_plugin->upgrade_read)(__upgrade_file, __callback_read, \
- __callback_read_data)
+#define weechat_upgrade_read(__upgrade_file) \
+ (weechat_plugin->upgrade_read)(__upgrade_file)
#define weechat_upgrade_close(__upgrade_file) \
(weechat_plugin->upgrade_close)(__upgrade_file)
diff --git a/src/plugins/xfer/xfer-buffer.c b/src/plugins/xfer/xfer-buffer.c
index c6840a44a..934797b46 100644
--- a/src/plugins/xfer/xfer-buffer.c
+++ b/src/plugins/xfer/xfer-buffer.c
@@ -259,12 +259,14 @@ xfer_buffer_refresh (const char *hotlist)
*/
int
-xfer_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
+xfer_buffer_input_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data)
{
struct t_xfer *xfer, *ptr_xfer, *next_xfer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
xfer = xfer_search_by_number (xfer_buffer_selected_line);
@@ -323,9 +325,11 @@ xfer_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-xfer_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+xfer_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -344,8 +348,8 @@ xfer_buffer_open ()
if (!xfer_buffer)
{
xfer_buffer = weechat_buffer_new (XFER_BUFFER_NAME,
- &xfer_buffer_input_cb, NULL,
- &xfer_buffer_close_cb, NULL);
+ &xfer_buffer_input_cb, NULL, NULL,
+ &xfer_buffer_close_cb, NULL, NULL);
/* failed to create buffer ? then exit */
if (!xfer_buffer)
diff --git a/src/plugins/xfer/xfer-buffer.h b/src/plugins/xfer/xfer-buffer.h
index a855f0939..6d5ebb188 100644
--- a/src/plugins/xfer/xfer-buffer.h
+++ b/src/plugins/xfer/xfer-buffer.h
@@ -26,9 +26,11 @@ extern struct t_gui_buffer *xfer_buffer;
extern int xfer_buffer_selected_line;
extern void xfer_buffer_refresh (const char *hotlist);
-extern int xfer_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
+extern int xfer_buffer_input_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data);
-extern int xfer_buffer_close_cb (void *data, struct t_gui_buffer *buffer);
+extern int xfer_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer);
extern void xfer_buffer_open ();
#endif /* WEECHAT_XFER_BUFFER_H */
diff --git a/src/plugins/xfer/xfer-chat.c b/src/plugins/xfer/xfer-chat.c
index 5ac687da0..ce620bdd9 100644
--- a/src/plugins/xfer/xfer-chat.c
+++ b/src/plugins/xfer/xfer-chat.c
@@ -104,7 +104,7 @@ xfer_chat_sendf (struct t_xfer *xfer, const char *format, ...)
*/
int
-xfer_chat_recv_cb (void *arg_xfer, int fd)
+xfer_chat_recv_cb (const void *pointer, void *data, int fd)
{
struct t_xfer *xfer;
static char buffer[4096 + 2];
@@ -115,9 +115,10 @@ xfer_chat_recv_cb (void *arg_xfer, int fd)
int num_read, length, ctcp_action;
/* make C compiler happy */
+ (void) data;
(void) fd;
- xfer = (struct t_xfer *)arg_xfer;
+ xfer = (struct t_xfer *)pointer;
num_read = recv (xfer->sock, buffer, sizeof (buffer) - 2, 0);
if (num_read > 0)
@@ -259,13 +260,15 @@ xfer_chat_recv_cb (void *arg_xfer, int fd)
*/
int
-xfer_chat_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
+xfer_chat_buffer_input_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
const char *input_data)
{
struct t_xfer *ptr_xfer;
char *input_data_color, str_tags[256], *str_color;
/* make C compiler happy */
+ (void) pointer;
(void) data;
ptr_xfer = xfer_search_by_buffer (buffer);
@@ -307,11 +310,13 @@ xfer_chat_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
*/
int
-xfer_chat_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
+xfer_chat_buffer_close_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
{
struct t_xfer *ptr_xfer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -353,9 +358,10 @@ xfer_chat_open_buffer (struct t_xfer *xfer)
xfer->buffer = weechat_buffer_search (XFER_PLUGIN_NAME, name);
if (!xfer->buffer)
{
- xfer->buffer = weechat_buffer_new (name,
- &xfer_chat_buffer_input_cb, NULL,
- &xfer_chat_buffer_close_cb, NULL);
+ xfer->buffer = weechat_buffer_new (
+ name,
+ &xfer_chat_buffer_input_cb, NULL, NULL,
+ &xfer_chat_buffer_close_cb, NULL, NULL);
buffer_created = 1;
/* failed to create buffer ? then return */
diff --git a/src/plugins/xfer/xfer-chat.h b/src/plugins/xfer/xfer-chat.h
index f2ecca818..fa1018651 100644
--- a/src/plugins/xfer/xfer-chat.h
+++ b/src/plugins/xfer/xfer-chat.h
@@ -21,7 +21,7 @@
#define WEECHAT_XFER_CHAT_H 1
extern void xfer_chat_sendf (struct t_xfer *xfer, const char *format, ...);
-extern int xfer_chat_recv_cb (void *arg_xfer, int fd);
+extern int xfer_chat_recv_cb (const void *pointer, void *data, int fd);
extern void xfer_chat_open_buffer (struct t_xfer *xfer);
#endif /* WEECHAT_XFER_CHAT_H */
diff --git a/src/plugins/xfer/xfer-command.c b/src/plugins/xfer/xfer-command.c
index 21790fa09..3c643e58c 100644
--- a/src/plugins/xfer/xfer-command.c
+++ b/src/plugins/xfer/xfer-command.c
@@ -35,12 +35,14 @@
*/
int
-xfer_command_me (void *data, struct t_gui_buffer *buffer, int argc,
+xfer_command_me (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
struct t_xfer *ptr_xfer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) argc;
(void) argv;
@@ -192,10 +194,12 @@ xfer_command_xfer_list (int full)
*/
int
-xfer_command_xfer (void *data, struct t_gui_buffer *buffer, int argc,
+xfer_command_xfer (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
(void) argv_eol;
@@ -251,7 +255,8 @@ xfer_command_init ()
N_("send a CTCP action to remote host"),
N_("<message>"),
N_("message: message to send"),
- NULL, &xfer_command_me, NULL);
+ NULL,
+ &xfer_command_me, NULL, NULL);
weechat_hook_command (
"xfer",
N_("xfer control"),
@@ -260,5 +265,6 @@ xfer_command_init ()
"listfull: list xfer (verbose)\n"
"\n"
"Without argument, this command opens buffer with xfer list."),
- "list|listfull", &xfer_command_xfer, NULL);
+ "list|listfull",
+ &xfer_command_xfer, NULL, NULL);
}
diff --git a/src/plugins/xfer/xfer-completion.c b/src/plugins/xfer/xfer-completion.c
index a65e34aeb..75004657e 100644
--- a/src/plugins/xfer/xfer-completion.c
+++ b/src/plugins/xfer/xfer-completion.c
@@ -33,13 +33,15 @@
*/
int
-xfer_completion_nick_cb (void *data, const char *completion_item,
+xfer_completion_nick_cb (const void *pointer, void *data,
+ const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
struct t_xfer *ptr_xfer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) completion_item;
@@ -70,5 +72,5 @@ xfer_completion_init ()
{
weechat_hook_completion ("nick",
N_("nicks of DCC chat"),
- &xfer_completion_nick_cb, NULL);
+ &xfer_completion_nick_cb, NULL, NULL);
}
diff --git a/src/plugins/xfer/xfer-config.c b/src/plugins/xfer/xfer-config.c
index e6d374a30..b3971690c 100644
--- a/src/plugins/xfer/xfer-config.c
+++ b/src/plugins/xfer/xfer-config.c
@@ -71,9 +71,11 @@ struct t_config_option *xfer_config_file_use_nick_in_filename;
*/
void
-xfer_config_refresh_cb (void *data, struct t_config_option *option)
+xfer_config_refresh_cb (const void *pointer, void *data,
+ struct t_config_option *option)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) option;
@@ -86,9 +88,11 @@ xfer_config_refresh_cb (void *data, struct t_config_option *option)
*/
int
-xfer_config_reload (void *data, struct t_config_file *config_file)
+xfer_config_reload (const void *pointer, void *data,
+ struct t_config_file *config_file)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
return weechat_config_reload (config_file);
@@ -108,15 +112,17 @@ xfer_config_init ()
struct t_config_section *ptr_section;
xfer_config_file = weechat_config_new (XFER_CONFIG_NAME,
- &xfer_config_reload, NULL);
+ &xfer_config_reload, NULL, NULL);
if (!xfer_config_file)
return 0;
ptr_section = weechat_config_new_section (xfer_config_file, "look",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (xfer_config_file);
@@ -128,26 +134,31 @@ xfer_config_init ()
"auto_open_buffer", "boolean",
N_("auto open xfer buffer when a new xfer is added "
"to list"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
xfer_config_look_progress_bar_size = weechat_config_new_option (
xfer_config_file, ptr_section,
"progress_bar_size", "integer",
N_("size of progress bar, in chars (if 0, progress bar is disabled)"),
NULL, 0, XFER_CONFIG_PROGRESS_BAR_MAX_SIZE, "20", NULL, 0,
- NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &xfer_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
xfer_config_look_pv_tags = weechat_config_new_option (
xfer_config_file, ptr_section,
"pv_tags", "string",
N_("comma separated list of tags used in private messages, for example: "
"\"notify_message\", \"notify_private\" or \"notify_highlight\""),
- NULL, 0, 0, "notify_private", NULL, 0, NULL, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "notify_private", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
ptr_section = weechat_config_new_section (xfer_config_file, "color",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (xfer_config_file);
@@ -159,61 +170,81 @@ xfer_config_init ()
"status_waiting", "color",
N_("text color for \"waiting\" status"),
NULL, 0, 0, "lightcyan", NULL, 0,
- NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &xfer_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
xfer_config_color_status[XFER_STATUS_CONNECTING] = weechat_config_new_option (
xfer_config_file, ptr_section,
"status_connecting", "color",
N_("text color for \"connecting\" status"),
NULL, 0, 0, "yellow", NULL, 0,
- NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &xfer_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
xfer_config_color_status[XFER_STATUS_ACTIVE] = weechat_config_new_option (
xfer_config_file, ptr_section,
"status_active", "color",
N_("text color for \"active\" status"),
NULL, 0, 0, "lightblue", NULL, 0,
- NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &xfer_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
xfer_config_color_status[XFER_STATUS_DONE] = weechat_config_new_option (
xfer_config_file, ptr_section,
"status_done", "color",
N_("text color for \"done\" status"),
NULL, 0, 0, "lightgreen", NULL, 0,
- NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &xfer_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
xfer_config_color_status[XFER_STATUS_FAILED] = weechat_config_new_option (
xfer_config_file, ptr_section,
"status_failed", "color",
N_("text color for \"failed\" status"),
NULL, 0, 0, "lightred", NULL, 0,
- NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &xfer_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
xfer_config_color_status[XFER_STATUS_ABORTED] = weechat_config_new_option (
xfer_config_file, ptr_section,
"status_aborted", "color",
N_("text color for \"aborted\" status"),
NULL, 0, 0, "lightred", NULL, 0,
- NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &xfer_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
xfer_config_color_text = weechat_config_new_option (
xfer_config_file, ptr_section,
"text", "color",
N_("text color in xfer buffer"),
NULL, 0, 0, "default", NULL, 0,
- NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &xfer_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
xfer_config_color_text_bg = weechat_config_new_option (
xfer_config_file, ptr_section,
"text_bg", "color",
N_("background color in xfer buffer"),
NULL, 0, 0, "default", NULL, 0,
- NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &xfer_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
xfer_config_color_text_selected = weechat_config_new_option (
xfer_config_file, ptr_section,
"text_selected", "color",
N_("text color of selected line in xfer buffer"),
NULL, 0, 0, "white", NULL, 0,
- NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL);
+ NULL, NULL, NULL,
+ &xfer_config_refresh_cb, NULL, NULL,
+ NULL, NULL, NULL);
ptr_section = weechat_config_new_section (xfer_config_file, "network",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (xfer_config_file);
@@ -225,18 +256,20 @@ xfer_config_init ()
"blocksize", "integer",
N_("block size for sending packets, in bytes"),
NULL, XFER_BLOCKSIZE_MIN, XFER_BLOCKSIZE_MAX, "65536", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
xfer_config_network_fast_send = weechat_config_new_option (
xfer_config_file, ptr_section,
"fast_send", "boolean",
N_("does not wait for ACK when sending file"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
xfer_config_network_own_ip = weechat_config_new_option (
xfer_config_file, ptr_section,
"own_ip", "string",
N_("IP or DNS address used for sending files/chats "
"(if empty, local interface IP is used)"),
- NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
xfer_config_network_port_range = weechat_config_new_option (
xfer_config_file, ptr_section,
"port_range", "string",
@@ -245,24 +278,29 @@ xfer_config_init ()
"range, ie. 5000-5015, empty value means any port, it's recommended "
"to use ports greater than 1024, because only root can use ports "
"below 1024)"),
- NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
xfer_config_network_speed_limit = weechat_config_new_option (
xfer_config_file, ptr_section,
"speed_limit", "integer",
N_("speed limit for sending files, in kilo-bytes by second (0 means "
"no limit)"),
- NULL, 0, INT_MAX, "0", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, INT_MAX, "0", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
xfer_config_network_timeout = weechat_config_new_option (
xfer_config_file, ptr_section,
"timeout", "integer",
N_("timeout for xfer request (in seconds)"),
- NULL, 5, INT_MAX, "300", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 5, INT_MAX, "300", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
ptr_section = weechat_config_new_section (xfer_config_file, "file",
0, 0,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL);
if (!ptr_section)
{
weechat_config_free (xfer_config_file);
@@ -273,12 +311,14 @@ xfer_config_init ()
xfer_config_file, ptr_section,
"auto_accept_chats", "boolean",
N_("automatically accept chat requests (use carefully!)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
xfer_config_file_auto_accept_files = weechat_config_new_option (
xfer_config_file, ptr_section,
"auto_accept_files", "boolean",
N_("automatically accept incoming files (use carefully!)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
xfer_config_file_auto_accept_nicks = weechat_config_new_option (
xfer_config_file, ptr_section,
"auto_accept_nicks", "string",
@@ -286,36 +326,42 @@ xfer_config_init ()
"chats are automatically accepted; format is \"server.nick\" (for a "
"specific server) or \"nick\" (for all servers); example: "
"\"freenode.FlashCode,andrew\""),
- NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
xfer_config_file_auto_check_crc32 = weechat_config_new_option (
xfer_config_file, ptr_section,
"auto_check_crc32", "boolean",
N_("automatically check CRC32 file checksum if it is found in the "
"filename (8 hexadecimal chars)"),
- NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "off", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
xfer_config_file_auto_rename = weechat_config_new_option (
xfer_config_file, ptr_section,
"auto_rename", "boolean",
N_("rename incoming files if already exists (add \".1\", \".2\", ...)"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
xfer_config_file_auto_resume = weechat_config_new_option (
xfer_config_file, ptr_section,
"auto_resume", "boolean",
N_("automatically resume file transfer if connection with remote host "
"is lost"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
xfer_config_file_convert_spaces = weechat_config_new_option (
xfer_config_file, ptr_section,
"convert_spaces", "boolean",
N_("convert spaces to underscores when sending and receiving files"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
xfer_config_file_download_path = weechat_config_new_option (
xfer_config_file, ptr_section,
"download_path", "string",
N_("path for writing incoming files: \"%h\" at beginning of string is "
"replaced by WeeChat home (\"~/.weechat\" by default) "
"(note: content is evaluated, see /help eval)"),
- NULL, 0, 0, "%h/xfer", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "%h/xfer", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
xfer_config_file_upload_path = weechat_config_new_option (
xfer_config_file, ptr_section,
"upload_path", "string",
@@ -323,12 +369,14 @@ xfer_config_init ()
"by user): \"%h\" at beginning of string is replaced by WeeChat "
"home (\"~/.weechat\" by default) "
"(note: content is evaluated, see /help eval)"),
- NULL, 0, 0, "~", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "~", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
xfer_config_file_use_nick_in_filename = weechat_config_new_option (
xfer_config_file, ptr_section,
"use_nick_in_filename", "boolean",
N_("use remote nick as prefix in local filename when receiving a file"),
- NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, 0, 0, "on", NULL, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
return 1;
}
diff --git a/src/plugins/xfer/xfer-info.c b/src/plugins/xfer/xfer-info.c
index d4a5b5c69..a3f55d84e 100644
--- a/src/plugins/xfer/xfer-info.c
+++ b/src/plugins/xfer/xfer-info.c
@@ -31,28 +31,30 @@
*/
struct t_infolist *
-xfer_info_infolist_xfer_cb (void *data, const char *infolist_name,
- void *pointer, const char *arguments)
+xfer_info_infolist_xfer_cb (const void *pointer, void *data,
+ const char *infolist_name,
+ void *obj_pointer, const char *arguments)
{
struct t_infolist *ptr_infolist;
struct t_xfer *ptr_xfer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) infolist_name;
(void) arguments;
- if (pointer && !xfer_valid (pointer))
+ if (obj_pointer && !xfer_valid (obj_pointer))
return NULL;
ptr_infolist = weechat_infolist_new ();
if (!ptr_infolist)
return NULL;
- if (pointer)
+ if (obj_pointer)
{
/* build list with only one xfer */
- if (!xfer_add_to_infolist (ptr_infolist, pointer))
+ if (!xfer_add_to_infolist (ptr_infolist, obj_pointer))
{
weechat_infolist_free (ptr_infolist);
return NULL;
@@ -88,5 +90,5 @@ xfer_info_init ()
"xfer", N_("list of xfer"),
N_("xfer pointer (optional)"),
NULL,
- &xfer_info_infolist_xfer_cb, NULL);
+ &xfer_info_infolist_xfer_cb, NULL, NULL);
}
diff --git a/src/plugins/xfer/xfer-network.c b/src/plugins/xfer/xfer-network.c
index d536b4fb4..f52345dee 100644
--- a/src/plugins/xfer/xfer-network.c
+++ b/src/plugins/xfer/xfer-network.c
@@ -93,16 +93,17 @@ xfer_network_write_pipe (struct t_xfer *xfer, int status, int error)
*/
int
-xfer_network_child_read_cb (void *arg_xfer, int fd)
+xfer_network_child_read_cb (const void *pointer, void *data, int fd)
{
struct t_xfer *xfer;
char bufpipe[1 + 1 + 32 + 1];
int num_read;
/* make C compiler happy */
+ (void) data;
(void) fd;
- xfer = (struct t_xfer *)arg_xfer;
+ xfer = (struct t_xfer *)pointer;
num_read = read (xfer->child_read, bufpipe, sizeof (bufpipe));
if (num_read > 0)
@@ -270,7 +271,7 @@ xfer_network_send_file_fork (struct t_xfer *xfer)
xfer->hook_fd = weechat_hook_fd (xfer->child_read,
1, 0, 0,
&xfer_network_child_read_cb,
- xfer);
+ xfer, NULL);
}
/*
@@ -328,7 +329,7 @@ xfer_network_recv_file_fork (struct t_xfer *xfer)
xfer->hook_fd = weechat_hook_fd (xfer->child_read,
1, 0, 0,
&xfer_network_child_read_cb,
- xfer);
+ xfer, NULL);
}
/*
@@ -364,7 +365,7 @@ xfer_network_child_kill (struct t_xfer *xfer)
*/
int
-xfer_network_fd_cb (void *arg_xfer, int fd)
+xfer_network_fd_cb (const void *pointer, void *data, int fd)
{
struct t_xfer *xfer;
int sock, flags, error;
@@ -373,11 +374,12 @@ xfer_network_fd_cb (void *arg_xfer, int fd)
char str_address[NI_MAXHOST];
/* make C compiler happy */
+ (void) data;
(void) fd;
length = sizeof (addr);
memset (&addr, 0, length);
- xfer = (struct t_xfer *)arg_xfer;
+ xfer = (struct t_xfer *)pointer;
if (xfer->status == XFER_STATUS_CONNECTING)
{
@@ -484,7 +486,7 @@ xfer_network_fd_cb (void *arg_xfer, int fd)
xfer->hook_fd = weechat_hook_fd (xfer->sock,
1, 0, 0,
&xfer_chat_recv_cb,
- xfer);
+ xfer, NULL);
xfer_chat_open_buffer (xfer);
}
}
@@ -498,14 +500,15 @@ xfer_network_fd_cb (void *arg_xfer, int fd)
*/
int
-xfer_network_timer_cb (void *arg_xfer, int remaining_calls)
+xfer_network_timer_cb (const void *pointer, void *data, int remaining_calls)
{
struct t_xfer *xfer;
/* make C compiler happy */
+ (void) data;
(void) remaining_calls;
- xfer = (struct t_xfer *)arg_xfer;
+ xfer = (struct t_xfer *)pointer;
if ((xfer->status == XFER_STATUS_WAITING)
|| (xfer->status == XFER_STATUS_CONNECTING))
@@ -526,7 +529,8 @@ xfer_network_timer_cb (void *arg_xfer, int remaining_calls)
*/
int
-xfer_network_connect_chat_recv_cb (void *data, int status, int gnutls_rc,
+xfer_network_connect_chat_recv_cb (const void *pointer, void *data,
+ int status, int gnutls_rc,
int sock, const char *error,
const char *ip_address)
{
@@ -534,10 +538,11 @@ xfer_network_connect_chat_recv_cb (void *data, int status, int gnutls_rc,
int flags;
/* make C compiler happy */
+ (void) data;
(void) gnutls_rc;
(void) ip_address;
- xfer = (struct t_xfer*)data;
+ xfer = (struct t_xfer*)pointer;
weechat_unhook (xfer->hook_connect);
xfer->hook_connect = NULL;
@@ -567,7 +572,7 @@ xfer_network_connect_chat_recv_cb (void *data, int status, int gnutls_rc,
xfer->hook_fd = weechat_hook_fd (xfer->sock,
1, 0, 0,
&xfer_chat_recv_cb,
- xfer);
+ xfer, NULL);
xfer_chat_open_buffer (xfer);
xfer->status = XFER_STATUS_ACTIVE;
@@ -691,7 +696,7 @@ xfer_network_connect (struct t_xfer *xfer)
xfer->hook_fd = weechat_hook_fd (xfer->sock,
1, 0, 0,
&xfer_network_fd_cb,
- xfer);
+ xfer, NULL);
/* add timeout */
if (weechat_config_integer (xfer_config_network_timeout) > 0)
@@ -699,7 +704,7 @@ xfer_network_connect (struct t_xfer *xfer)
xfer->hook_timer = weechat_hook_timer (weechat_config_integer (xfer_config_network_timeout) * 1000,
0, 1,
&xfer_network_timer_cb,
- xfer);
+ xfer, NULL);
}
}
@@ -711,7 +716,7 @@ xfer_network_connect (struct t_xfer *xfer)
xfer->port, 1, 0, NULL, NULL,
0, "NONE", NULL,
&xfer_network_connect_chat_recv_cb,
- xfer);
+ xfer, NULL);
}
/* for file receiving, connection is made in child process (blocking) */
diff --git a/src/plugins/xfer/xfer-upgrade.c b/src/plugins/xfer/xfer-upgrade.c
index 65b3bbcab..8d0cb2809 100644
--- a/src/plugins/xfer/xfer-upgrade.c
+++ b/src/plugins/xfer/xfer-upgrade.c
@@ -58,7 +58,8 @@ xfer_upgrade_save ()
int rc;
struct t_upgrade_file *upgrade_file;
- upgrade_file = weechat_upgrade_new (XFER_UPGRADE_FILENAME, 1);
+ upgrade_file = weechat_upgrade_new (XFER_UPGRADE_FILENAME,
+ NULL, NULL, NULL);
if (!upgrade_file)
return 0;
@@ -106,17 +107,19 @@ xfer_upgrade_set_buffer_callbacks ()
*/
int
-xfer_upgrade_read_cb (void *data,
+xfer_upgrade_read_cb (const void *pointer, void *data,
struct t_upgrade_file *upgrade_file,
int object_id,
struct t_infolist *infolist)
{
- /* TODO: write xfer read cb */
+ /* make C compiler happy */
+ (void) pointer;
(void) data;
(void) upgrade_file;
(void) object_id;
(void) infolist;
+ /* TODO: write xfer read cb */
return WEECHAT_RC_OK;
}
@@ -136,10 +139,13 @@ xfer_upgrade_load ()
xfer_upgrade_set_buffer_callbacks ();
- upgrade_file = weechat_upgrade_new (XFER_UPGRADE_FILENAME, 0);
+ upgrade_file = weechat_upgrade_new (XFER_UPGRADE_FILENAME,
+ &xfer_upgrade_read_cb, NULL, NULL);
if (!upgrade_file)
return 0;
- rc = weechat_upgrade_read (upgrade_file, &xfer_upgrade_read_cb, NULL);
+
+ rc = weechat_upgrade_read (upgrade_file);
+
weechat_upgrade_close (upgrade_file);
return rc;
diff --git a/src/plugins/xfer/xfer.c b/src/plugins/xfer/xfer.c
index 5af0fc7cf..fb7d5ff52 100644
--- a/src/plugins/xfer/xfer.c
+++ b/src/plugins/xfer/xfer.c
@@ -116,10 +116,12 @@ xfer_valid (struct t_xfer *xfer)
*/
int
-xfer_signal_upgrade_cb (void *data, const char *signal, const char *type_data,
+xfer_signal_upgrade_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -997,7 +999,8 @@ xfer_resolve_addr (const char *str_address, const char *str_port,
*/
int
-xfer_add_cb (void *data, const char *signal, const char *type_data,
+xfer_add_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
struct t_infolist *infolist;
@@ -1014,6 +1017,7 @@ xfer_add_cb (void *data, const char *signal, const char *type_data,
struct t_xfer *ptr_xfer;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -1367,7 +1371,8 @@ error:
*/
int
-xfer_start_resume_cb (void *data, const char *signal, const char *type_data,
+xfer_start_resume_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
struct t_infolist *infolist;
@@ -1377,6 +1382,7 @@ xfer_start_resume_cb (void *data, const char *signal, const char *type_data,
unsigned long long start_resume;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -1451,7 +1457,8 @@ error:
*/
int
-xfer_accept_resume_cb (void *data, const char *signal, const char *type_data,
+xfer_accept_resume_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
struct t_infolist *infolist;
@@ -1461,6 +1468,7 @@ xfer_accept_resume_cb (void *data, const char *signal, const char *type_data,
unsigned long long start_resume;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -1737,10 +1745,12 @@ xfer_print_log ()
*/
int
-xfer_debug_dump_cb (void *data, const char *signal, const char *type_data,
+xfer_debug_dump_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) signal;
(void) type_data;
@@ -1783,11 +1793,16 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
xfer_command_init ();
/* hook some signals */
- weechat_hook_signal ("upgrade", &xfer_signal_upgrade_cb, NULL);
- weechat_hook_signal ("xfer_add", &xfer_add_cb, NULL);
- weechat_hook_signal ("xfer_start_resume", &xfer_start_resume_cb, NULL);
- weechat_hook_signal ("xfer_accept_resume", &xfer_accept_resume_cb, NULL);
- weechat_hook_signal ("debug_dump", &xfer_debug_dump_cb, NULL);
+ weechat_hook_signal ("upgrade",
+ &xfer_signal_upgrade_cb, NULL, NULL);
+ weechat_hook_signal ("xfer_add",
+ &xfer_add_cb, NULL, NULL);
+ weechat_hook_signal ("xfer_start_resume",
+ &xfer_start_resume_cb, NULL, NULL);
+ weechat_hook_signal ("xfer_accept_resume",
+ &xfer_accept_resume_cb, NULL, NULL);
+ weechat_hook_signal ("debug_dump",
+ &xfer_debug_dump_cb, NULL, NULL);
/* hook completions */
xfer_completion_init ();