summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2014-02-10 17:42:53 +0100
committerSebastien Helleu <flashcode@flashtux.org>2014-02-10 17:42:53 +0100
commit437767c0ca37ab06d0f2c2ff2831c7ebe1c3e61f (patch)
treecc89ab5a0aa0d9a7fe280fcac8e72dcf590937eb /src
parenta0bf3938f18c275fe585639db7ad9d945e462d94 (diff)
downloadweechat-437767c0ca37ab06d0f2c2ff2831c7ebe1c3e61f.zip
api: add integer return code for functions hook_{signal|hsignal}_send
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-command.c12
-rw-r--r--src/core/wee-config.c3
-rw-r--r--src/core/wee-hook.c12
-rw-r--r--src/core/wee-hook.h8
-rw-r--r--src/core/wee-upgrade.c2
-rw-r--r--src/gui/curses/gui-curses-chat.c4
-rw-r--r--src/gui/curses/gui-curses-key.c6
-rw-r--r--src/gui/curses/gui-curses-main.c10
-rw-r--r--src/gui/curses/gui-curses-window.c32
-rw-r--r--src/gui/gui-buffer.c71
-rw-r--r--src/gui/gui-completion.c8
-rw-r--r--src/gui/gui-filter.c22
-rw-r--r--src/gui/gui-hotlist.c3
-rw-r--r--src/gui/gui-input.c18
-rw-r--r--src/gui/gui-key.c10
-rw-r--r--src/gui/gui-line.c24
-rw-r--r--src/gui/gui-nicklist.c9
-rw-r--r--src/gui/gui-window.c35
-rw-r--r--src/plugins/aspell/weechat-aspell.c4
-rw-r--r--src/plugins/guile/weechat-guile-api.c49
-rw-r--r--src/plugins/guile/weechat-guile.c9
-rw-r--r--src/plugins/irc/irc-channel.c11
-rw-r--r--src/plugins/irc/irc-command.c12
-rw-r--r--src/plugins/irc/irc-ctcp.c60
-rw-r--r--src/plugins/irc/irc-ignore.c8
-rw-r--r--src/plugins/irc/irc-notify.c10
-rw-r--r--src/plugins/irc/irc-protocol.c10
-rw-r--r--src/plugins/irc/irc-redirect.c2
-rw-r--r--src/plugins/irc/irc-server.c29
-rw-r--r--src/plugins/lua/weechat-lua-api.c31
-rw-r--r--src/plugins/lua/weechat-lua.c9
-rw-r--r--src/plugins/perl/weechat-perl-api.c41
-rw-r--r--src/plugins/perl/weechat-perl.c9
-rw-r--r--src/plugins/plugin-script.c8
-rw-r--r--src/plugins/plugin.c7
-rw-r--r--src/plugins/python/weechat-python-api.c35
-rw-r--r--src/plugins/python/weechat-python.c9
-rw-r--r--src/plugins/relay/irc/relay-irc.c9
-rw-r--r--src/plugins/ruby/weechat-ruby-api.c31
-rw-r--r--src/plugins/ruby/weechat-ruby.c9
-rw-r--r--src/plugins/script/script-action.c18
-rw-r--r--src/plugins/tcl/weechat-tcl-api.c45
-rw-r--r--src/plugins/tcl/weechat-tcl.c9
-rw-r--r--src/plugins/weechat-plugin.h10
-rw-r--r--src/plugins/xfer/xfer.c5
45 files changed, 408 insertions, 370 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index d17330df2..ba7d386d4 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -1476,8 +1476,8 @@ COMMAND_CALLBACK(debug)
else
log_printf ("Dump request for WeeChat core and plugins");
weechat_log_use_time = 0;
- hook_signal_send ("debug_dump", WEECHAT_HOOK_SIGNAL_STRING,
- (argc > 2) ? argv_eol[2] : NULL);
+ (void) hook_signal_send ("debug_dump", WEECHAT_HOOK_SIGNAL_STRING,
+ (argc > 2) ? argv_eol[2] : NULL);
weechat_log_use_time = 1;
}
else if (string_strcasecmp (argv[1], "buffer") == 0)
@@ -1521,7 +1521,7 @@ COMMAND_CALLBACK(debug)
{
gui_chat_printf (NULL, "");
gui_chat_printf (NULL, "Libs:");
- hook_signal_send ("debug_libs", WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) hook_signal_send ("debug_libs", WEECHAT_HOOK_SIGNAL_STRING, NULL);
}
else if (string_strcasecmp (argv[1], "memory") == 0)
{
@@ -4565,7 +4565,7 @@ COMMAND_CALLBACK(quit)
* send quit signal: some plugins like irc use this signal to disconnect
* from servers
*/
- hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, pos_args);
+ (void) hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, pos_args);
/* force end of WeeChat main loop */
weechat_quit = 1;
@@ -5650,8 +5650,8 @@ COMMAND_CALLBACK(upgrade)
}
/* send "upgrade" signal to plugins */
- hook_signal_send ("upgrade", WEECHAT_HOOK_SIGNAL_STRING,
- (quit) ? "quit" : NULL);
+ (void) hook_signal_send ("upgrade", WEECHAT_HOOK_SIGNAL_STRING,
+ (quit) ? "quit" : NULL);
if (!upgrade_weechat_save ())
{
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 0b45ee981..327e83360 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -930,7 +930,8 @@ config_day_change_timer_cb (void *data, int remaining_calls)
/* send signal "day_changed" */
strftime (str_time, sizeof (str_time), "%Y-%m-%d", local_time);
- hook_signal_send ("day_changed", WEECHAT_HOOK_SIGNAL_STRING, str_time);
+ (void) hook_signal_send ("day_changed",
+ WEECHAT_HOOK_SIGNAL_STRING, str_time);
}
config_day_change_old_day = new_mday;
diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c
index bb8895592..bd74cb11e 100644
--- a/src/core/wee-hook.c
+++ b/src/core/wee-hook.c
@@ -2201,12 +2201,14 @@ hook_signal (struct t_weechat_plugin *plugin, const char *signal,
* Sends a signal.
*/
-void
+int
hook_signal_send (const char *signal, const char *type_data, void *signal_data)
{
struct t_hook *ptr_hook, *next_hook;
int rc;
+ rc = WEECHAT_RC_OK;
+
hook_exec_start ();
ptr_hook = weechat_hooks[HOOK_TYPE_SIGNAL];
@@ -2231,6 +2233,8 @@ hook_signal_send (const char *signal, const char *type_data, void *signal_data)
}
hook_exec_end ();
+
+ return rc;
}
/*
@@ -2278,12 +2282,14 @@ hook_hsignal (struct t_weechat_plugin *plugin, const char *signal,
* Sends a hsignal (signal with hashtable).
*/
-void
+int
hook_hsignal_send (const char *signal, struct t_hashtable *hashtable)
{
struct t_hook *ptr_hook, *next_hook;
int rc;
+ rc = WEECHAT_RC_OK;
+
hook_exec_start ();
ptr_hook = weechat_hooks[HOOK_TYPE_HSIGNAL];
@@ -2308,6 +2314,8 @@ hook_hsignal_send (const char *signal, struct t_hashtable *hashtable)
}
hook_exec_end ();
+
+ return rc;
}
/*
diff --git a/src/core/wee-hook.h b/src/core/wee-hook.h
index 3f4a04ffa..a3a2ce97f 100644
--- a/src/core/wee-hook.h
+++ b/src/core/wee-hook.h
@@ -510,14 +510,14 @@ extern struct t_hook *hook_signal (struct t_weechat_plugin *plugin,
const char *signal,
t_hook_callback_signal *callback,
void *callback_data);
-extern void hook_signal_send (const char *signal, const char *type_data,
- void *signal_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,
void *callback_data);
-extern void hook_hsignal_send (const char *signal,
- struct t_hashtable *hashtable);
+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,
diff --git a/src/core/wee-upgrade.c b/src/core/wee-upgrade.c
index fbf8ba8b4..6837fb21c 100644
--- a/src/core/wee-upgrade.c
+++ b/src/core/wee-upgrade.c
@@ -818,5 +818,5 @@ upgrade_weechat_end ()
weechat_upgrading = 0;
/* send signal for end of /upgrade */
- hook_signal_send ("upgrade_ended", WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) hook_signal_send ("upgrade_ended", WEECHAT_HOOK_SIGNAL_STRING, NULL);
}
diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c
index 43a37a208..464518bd2 100644
--- a/src/gui/curses/gui-curses-chat.c
+++ b/src/gui/curses/gui-curses-chat.c
@@ -1784,8 +1784,8 @@ gui_chat_draw_formatted_buffer (struct t_gui_window *window)
if ((window->scroll->scrolling != old_scrolling)
|| (window->scroll->lines_after != old_lines_after))
{
- hook_signal_send ("window_scrolled",
- WEECHAT_HOOK_SIGNAL_POINTER, window);
+ (void) hook_signal_send ("window_scrolled",
+ WEECHAT_HOOK_SIGNAL_POINTER, window);
}
/* cursor is below end line of chat window? */
diff --git a/src/gui/curses/gui-curses-key.c b/src/gui/curses/gui-curses-key.c
index 431cee936..fe8b6b7a8 100644
--- a/src/gui/curses/gui-curses-key.c
+++ b/src/gui/curses/gui-curses-key.c
@@ -408,8 +408,8 @@ gui_key_flush (int paste)
if (key_str[0])
{
- hook_signal_send ("key_pressed",
- WEECHAT_HOOK_SIGNAL_STRING, key_str);
+ (void) hook_signal_send ("key_pressed",
+ WEECHAT_HOOK_SIGNAL_STRING, key_str);
if (gui_current_window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
input_old = (gui_current_window->buffer->input_buffer) ?
@@ -518,7 +518,7 @@ gui_key_read_cb (void *data, int fd)
{
/* no data on stdin, terminal lost */
log_printf (_("Terminal lost, exiting WeeChat..."));
- hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, NULL);
weechat_quit = 1;
return WEECHAT_RC_OK;
}
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c
index f5940aa69..92801af54 100644
--- a/src/gui/curses/gui-curses-main.c
+++ b/src/gui/curses/gui-curses-main.c
@@ -255,7 +255,7 @@ gui_main_signal_sigquit ()
{
log_printf (_("Signal %s received, exiting WeeChat..."),
"SIGQUIT");
- hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, NULL);
weechat_quit = 1;
}
@@ -268,7 +268,7 @@ gui_main_signal_sigterm ()
{
log_printf (_("Signal %s received, exiting WeeChat..."),
"SIGTERM");
- hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, NULL);
weechat_quit = 1;
}
@@ -287,7 +287,7 @@ gui_main_signal_sighup ()
*/
gui_reload_config = 1;
- hook_signal_send ("signal_sighup", WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) hook_signal_send ("signal_sighup", WEECHAT_HOOK_SIGNAL_STRING, NULL);
}
/*
@@ -481,8 +481,8 @@ gui_main_loop ()
if (gui_signal_sigwinch_received)
{
- hook_signal_send ("signal_sigwinch",
- WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) hook_signal_send ("signal_sigwinch",
+ WEECHAT_HOOK_SIGNAL_STRING, NULL);
gui_signal_sigwinch_received = 0;
}
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index f4444bf79..da1ed2bf3 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -1313,8 +1313,8 @@ gui_window_switch_to_buffer (struct t_gui_window *window,
if (old_buffer != buffer)
{
- hook_signal_send ("buffer_switch",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_switch",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
}
@@ -1351,8 +1351,8 @@ gui_window_switch (struct t_gui_window *window)
gui_input_move_to_buffer (old_window->buffer, window->buffer);
- hook_signal_send ("window_switch",
- WEECHAT_HOOK_SIGNAL_POINTER, gui_current_window);
+ (void) hook_signal_send ("window_switch",
+ WEECHAT_HOOK_SIGNAL_POINTER, gui_current_window);
}
/*
@@ -1394,8 +1394,8 @@ gui_window_page_up (struct t_gui_window *window)
snprintf (scroll, sizeof (scroll), "-%d",
num_lines + 1);
gui_window_scroll (window, scroll);
- hook_signal_send ("window_scrolled",
- WEECHAT_HOOK_SIGNAL_POINTER, window);
+ (void) hook_signal_send ("window_scrolled",
+ WEECHAT_HOOK_SIGNAL_POINTER, window);
}
break;
case GUI_BUFFER_NUM_TYPES:
@@ -1451,8 +1451,8 @@ gui_window_page_down (struct t_gui_window *window)
snprintf (scroll, sizeof (scroll), "+%d",
num_lines + 1);
gui_window_scroll (window, scroll);
- hook_signal_send ("window_scrolled",
- WEECHAT_HOOK_SIGNAL_POINTER, window);
+ (void) hook_signal_send ("window_scrolled",
+ WEECHAT_HOOK_SIGNAL_POINTER, window);
break;
case GUI_BUFFER_NUM_TYPES:
break;
@@ -1491,8 +1491,8 @@ gui_window_scroll_up (struct t_gui_window *window)
snprintf (scroll, sizeof (scroll), "-%d",
CONFIG_INTEGER(config_look_scroll_amount));
gui_window_scroll (window, scroll);
- hook_signal_send ("window_scrolled",
- WEECHAT_HOOK_SIGNAL_POINTER, window);
+ (void) hook_signal_send ("window_scrolled",
+ WEECHAT_HOOK_SIGNAL_POINTER, window);
}
break;
case GUI_BUFFER_NUM_TYPES:
@@ -1542,8 +1542,8 @@ gui_window_scroll_down (struct t_gui_window *window)
snprintf (scroll, sizeof (scroll), "+%d",
CONFIG_INTEGER(config_look_scroll_amount));
gui_window_scroll (window, scroll);
- hook_signal_send ("window_scrolled",
- WEECHAT_HOOK_SIGNAL_POINTER, window);
+ (void) hook_signal_send ("window_scrolled",
+ WEECHAT_HOOK_SIGNAL_POINTER, window);
break;
case GUI_BUFFER_NUM_TYPES:
break;
@@ -1575,8 +1575,8 @@ gui_window_scroll_top (struct t_gui_window *window)
{
window->scroll->start_line = NULL;
gui_buffer_ask_chat_refresh (window->buffer, 2);
- hook_signal_send ("window_scrolled",
- WEECHAT_HOOK_SIGNAL_POINTER, window);
+ (void) hook_signal_send ("window_scrolled",
+ WEECHAT_HOOK_SIGNAL_POINTER, window);
}
break;
case GUI_BUFFER_NUM_TYPES:
@@ -1615,8 +1615,8 @@ gui_window_scroll_bottom (struct t_gui_window *window)
{
gui_buffer_ask_chat_refresh (window->buffer, 2);
}
- hook_signal_send ("window_scrolled",
- WEECHAT_HOOK_SIGNAL_POINTER, window);
+ (void) hook_signal_send ("window_scrolled",
+ WEECHAT_HOOK_SIGNAL_POINTER, window);
break;
case GUI_BUFFER_NUM_TYPES:
break;
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c
index 6b85f9987..53b214346 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -173,9 +173,9 @@ gui_buffer_local_var_add (struct t_gui_buffer *buffer, const char *name,
ptr_value = hashtable_get (buffer->local_variables, name);
hashtable_set (buffer->local_variables, name, value);
- hook_signal_send ((ptr_value) ?
- "buffer_localvar_changed" : "buffer_localvar_added",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ((ptr_value) ?
+ "buffer_localvar_changed" : "buffer_localvar_added",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
/*
@@ -194,8 +194,8 @@ gui_buffer_local_var_remove (struct t_gui_buffer *buffer, const char *name)
if (ptr_value)
{
hashtable_remove (buffer->local_variables, name);
- hook_signal_send ("buffer_localvar_removed",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_localvar_removed",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
}
@@ -209,8 +209,8 @@ gui_buffer_local_var_remove_all (struct t_gui_buffer *buffer)
if (buffer && buffer->local_variables)
{
hashtable_remove_all (buffer->local_variables);
- hook_signal_send ("buffer_localvar_removed",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_localvar_removed",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
}
@@ -713,8 +713,8 @@ gui_buffer_new (struct t_weechat_plugin *plugin,
}
else
{
- hook_signal_send ("buffer_opened",
- WEECHAT_HOOK_SIGNAL_POINTER, new_buffer);
+ (void) hook_signal_send ("buffer_opened",
+ WEECHAT_HOOK_SIGNAL_POINTER, new_buffer);
}
return new_buffer;
@@ -1125,8 +1125,8 @@ gui_buffer_set_name (struct t_gui_buffer *buffer, const char *name)
gui_buffer_local_var_add (buffer, "name", name);
- hook_signal_send ("buffer_renamed",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_renamed",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
}
@@ -1149,8 +1149,8 @@ gui_buffer_set_short_name (struct t_gui_buffer *buffer, const char *short_name)
buffer->mixed_lines->buffer_max_length_refresh = 1;
gui_buffer_ask_chat_refresh (buffer, 1);
- hook_signal_send ("buffer_renamed",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_renamed",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
/*
@@ -1168,8 +1168,8 @@ gui_buffer_set_type (struct t_gui_buffer *buffer, enum t_gui_buffer_type type)
buffer->type = type;
gui_buffer_ask_chat_refresh (buffer, 2);
- hook_signal_send ("buffer_type_changed",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_type_changed",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
/*
@@ -1183,8 +1183,8 @@ gui_buffer_set_title (struct t_gui_buffer *buffer, const char *new_title)
free (buffer->title);
buffer->title = (new_title && new_title[0]) ? strdup (new_title) : NULL;
- hook_signal_send ("buffer_title_changed",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_title_changed",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
/*
@@ -2401,8 +2401,8 @@ gui_buffer_clear (struct t_gui_buffer *buffer)
gui_buffer_ask_chat_refresh (buffer, 2);
- hook_signal_send ("buffer_cleared",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_cleared",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
/*
@@ -2435,8 +2435,8 @@ gui_buffer_close (struct t_gui_buffer *buffer)
int index, i;
struct t_gui_buffer_visited *ptr_buffer_visited;
- hook_signal_send ("buffer_closing",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_closing",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
if (buffer->close_callback)
{
@@ -2624,8 +2624,8 @@ gui_buffer_close (struct t_gui_buffer *buffer)
if (gui_buffers_count > 0)
gui_buffers_count--;
- hook_signal_send ("buffer_closed",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_closed",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
free (buffer);
}
@@ -2850,8 +2850,9 @@ gui_buffer_renumber (int number1, int number2, int start_number)
}
if (ptr_buffer_moved)
{
- hook_signal_send ("buffer_moved",
- WEECHAT_HOOK_SIGNAL_POINTER, ptr_buffer_moved);
+ (void) hook_signal_send ("buffer_moved",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ ptr_buffer_moved);
}
ptr_buffer = ptr_buffer2;
if (ptr_buffer == ptr_last_buffer)
@@ -2982,8 +2983,8 @@ gui_buffer_move_to_number (struct t_gui_buffer *buffer, int number)
last_gui_buffer = ptr_last_buffer;
}
- hook_signal_send ("buffer_moved",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_moved",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
/*
@@ -3074,10 +3075,10 @@ gui_buffer_swap (int number1, int number2)
}
/* send signals */
- hook_signal_send ("buffer_moved",
- WEECHAT_HOOK_SIGNAL_POINTER, ptr_first_buffer[0]);
- hook_signal_send ("buffer_moved",
- WEECHAT_HOOK_SIGNAL_POINTER, ptr_first_buffer[1]);
+ (void) hook_signal_send ("buffer_moved",
+ WEECHAT_HOOK_SIGNAL_POINTER, ptr_first_buffer[0]);
+ (void) hook_signal_send ("buffer_moved",
+ WEECHAT_HOOK_SIGNAL_POINTER, ptr_first_buffer[1]);
}
/*
@@ -3178,8 +3179,8 @@ gui_buffer_merge (struct t_gui_buffer *buffer,
gui_window_ask_refresh (1);
- hook_signal_send ("buffer_merged",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_merged",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
/*
@@ -3307,8 +3308,8 @@ gui_buffer_unmerge (struct t_gui_buffer *buffer, int number)
gui_window_ask_refresh (1);
- hook_signal_send ("buffer_unmerged",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_unmerged",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
/*
diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c
index 8078e6a45..18b51ccb3 100644
--- a/src/gui/gui-completion.c
+++ b/src/gui/gui-completion.c
@@ -209,8 +209,8 @@ gui_completion_stop (struct t_gui_completion *completion)
if (completion->partial_completion_list)
{
gui_completion_partial_list_free_all (completion);
- hook_signal_send ("partial_completion",
- WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) hook_signal_send ("partial_completion",
+ WEECHAT_HOOK_SIGNAL_STRING, NULL);
}
}
@@ -1052,8 +1052,8 @@ gui_completion_complete (struct t_gui_completion *completion)
*/
gui_completion_partial_build_list (completion,
common_prefix_size);
- hook_signal_send ("partial_completion",
- WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) hook_signal_send ("partial_completion",
+ WEECHAT_HOOK_SIGNAL_STRING, NULL);
return;
}
diff --git a/src/gui/gui-filter.c b/src/gui/gui-filter.c
index 510731907..dc2342efe 100644
--- a/src/gui/gui-filter.c
+++ b/src/gui/gui-filter.c
@@ -154,8 +154,8 @@ gui_filter_buffer (struct t_gui_buffer *buffer,
if (buffer->lines->lines_hidden != lines_hidden)
{
buffer->lines->lines_hidden = lines_hidden;
- hook_signal_send ("buffer_lines_hidden",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_lines_hidden",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
if (lines_changed)
@@ -210,8 +210,8 @@ gui_filter_global_enable ()
{
gui_filters_enabled = 1;
gui_filter_all_buffers ();
- hook_signal_send ("filters_enabled",
- WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) hook_signal_send ("filters_enabled",
+ WEECHAT_HOOK_SIGNAL_STRING, NULL);
}
}
@@ -226,8 +226,8 @@ gui_filter_global_disable ()
{
gui_filters_enabled = 0;
gui_filter_all_buffers ();
- hook_signal_send ("filters_disabled",
- WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) hook_signal_send ("filters_disabled",
+ WEECHAT_HOOK_SIGNAL_STRING, NULL);
}
}
@@ -380,8 +380,8 @@ gui_filter_new (int enabled, const char *name, const char *buffer_name,
last_gui_filter = new_filter;
new_filter->next_filter = NULL;
- hook_signal_send ("filter_added",
- WEECHAT_HOOK_SIGNAL_POINTER, new_filter);
+ (void) hook_signal_send ("filter_added",
+ WEECHAT_HOOK_SIGNAL_POINTER, new_filter);
}
return new_filter;
@@ -419,8 +419,8 @@ gui_filter_free (struct t_gui_filter *filter)
{
int i;
- hook_signal_send ("filter_removing",
- WEECHAT_HOOK_SIGNAL_POINTER, filter);
+ (void) hook_signal_send ("filter_removing",
+ WEECHAT_HOOK_SIGNAL_POINTER, filter);
/* free data */
if (filter->name)
@@ -464,7 +464,7 @@ gui_filter_free (struct t_gui_filter *filter)
free (filter);
- hook_signal_send ("filter_removed", WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) hook_signal_send ("filter_removed", WEECHAT_HOOK_SIGNAL_STRING, NULL);
}
/*
diff --git a/src/gui/gui-hotlist.c b/src/gui/gui-hotlist.c
index 64f9f1a73..b1b570cdc 100644
--- a/src/gui/gui-hotlist.c
+++ b/src/gui/gui-hotlist.c
@@ -57,7 +57,8 @@ int gui_add_hotlist = 1; /* 0 is for temporarily disable */
void
gui_hotlist_changed_signal ()
{
- hook_signal_send ("hotlist_changed", WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) hook_signal_send ("hotlist_changed",
+ WEECHAT_HOOK_SIGNAL_STRING, NULL);
}
/*
diff --git a/src/gui/gui-input.c b/src/gui/gui-input.c
index 7105c5c5a..8836d957e 100644
--- a/src/gui/gui-input.c
+++ b/src/gui/gui-input.c
@@ -123,7 +123,8 @@ gui_input_replace_input (struct t_gui_buffer *buffer, const char *new_input)
void
gui_input_paste_pending_signal ()
{
- hook_signal_send ("input_paste_pending", WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) hook_signal_send ("input_paste_pending",
+ WEECHAT_HOOK_SIGNAL_STRING, NULL);
}
/*
@@ -166,7 +167,8 @@ gui_input_text_changed_modifier_and_signal (struct t_gui_buffer *buffer,
gui_completion_stop (buffer->completion);
/* send signal */
- hook_signal_send ("input_text_changed", WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("input_text_changed",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
/*
@@ -176,8 +178,8 @@ gui_input_text_changed_modifier_and_signal (struct t_gui_buffer *buffer,
void
gui_input_text_cursor_moved_signal (struct t_gui_buffer *buffer)
{
- hook_signal_send ("input_text_cursor_moved", WEECHAT_HOOK_SIGNAL_POINTER,
- buffer);
+ (void) hook_signal_send ("input_text_cursor_moved",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
/*
@@ -187,7 +189,8 @@ gui_input_text_cursor_moved_signal (struct t_gui_buffer *buffer)
void
gui_input_search_signal (struct t_gui_buffer *buffer)
{
- hook_signal_send ("input_search", WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("input_search",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
/*
@@ -1650,8 +1653,9 @@ gui_input_zoom_merged_buffer (struct t_gui_buffer *buffer)
gui_buffer_ask_chat_refresh (buffer, 2);
- hook_signal_send ((buffer_was_zoomed) ? "buffer_unzoomed" : "buffer_zoomed",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ((buffer_was_zoomed) ?
+ "buffer_unzoomed" : "buffer_zoomed",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
/*
diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c
index a9817b8de..a3b83cc87 100644
--- a/src/gui/gui-key.c
+++ b/src/gui/gui-key.c
@@ -666,8 +666,8 @@ gui_key_new (struct t_gui_buffer *buffer, int context, const char *key,
expanded_name = gui_key_get_expanded_name (new_key->key);
- hook_signal_send ("key_bind",
- WEECHAT_HOOK_SIGNAL_STRING, expanded_name);
+ (void) hook_signal_send ("key_bind",
+ WEECHAT_HOOK_SIGNAL_STRING, expanded_name);
if (gui_key_verbose)
{
@@ -886,8 +886,8 @@ gui_key_unbind (struct t_gui_buffer *buffer, int context, const char *key)
gui_key_free (&gui_keys[context], &last_gui_key[context],
&gui_keys_count[context], ptr_key);
}
- hook_signal_send ("key_unbind",
- WEECHAT_HOOK_SIGNAL_STRING, (char *)key);
+ (void) hook_signal_send ("key_unbind",
+ WEECHAT_HOOK_SIGNAL_STRING, (char *)key);
return 1;
}
@@ -1134,7 +1134,7 @@ gui_key_focus_command (const char *key, int context,
_("Sending hsignal: \"%s\""),
commands[i] + 8);
}
- hook_hsignal_send (commands[i] + 8, hashtable);
+ (void) hook_hsignal_send (commands[i] + 8, hashtable);
}
}
else
diff --git a/src/gui/gui-line.c b/src/gui/gui-line.c
index f3876101c..505be7b10 100644
--- a/src/gui/gui-line.c
+++ b/src/gui/gui-line.c
@@ -1246,9 +1246,9 @@ gui_line_add (struct t_gui_buffer *buffer, time_t date,
message_for_signal = gui_chat_build_string_prefix_message (new_line);
if (message_for_signal)
{
- hook_signal_send ("weechat_highlight",
- WEECHAT_HOOK_SIGNAL_STRING,
- message_for_signal);
+ (void) hook_signal_send ("weechat_highlight",
+ WEECHAT_HOOK_SIGNAL_STRING,
+ message_for_signal);
free (message_for_signal);
}
}
@@ -1260,9 +1260,9 @@ gui_line_add (struct t_gui_buffer *buffer, time_t date,
message_for_signal = gui_chat_build_string_prefix_message (new_line);
if (message_for_signal)
{
- hook_signal_send ("weechat_pv",
- WEECHAT_HOOK_SIGNAL_STRING,
- message_for_signal);
+ (void) hook_signal_send ("weechat_pv",
+ WEECHAT_HOOK_SIGNAL_STRING,
+ message_for_signal);
free (message_for_signal);
}
}
@@ -1275,8 +1275,8 @@ gui_line_add (struct t_gui_buffer *buffer, time_t date,
buffer->own_lines->lines_hidden++;
if (buffer->mixed_lines)
buffer->mixed_lines->lines_hidden++;
- hook_signal_send ("buffer_lines_hidden",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_lines_hidden",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
/* add mixed line, if buffer is attached to at least one other buffer */
@@ -1303,8 +1303,8 @@ gui_line_add (struct t_gui_buffer *buffer, time_t date,
}
}
- hook_signal_send ("buffer_line_added",
- WEECHAT_HOOK_SIGNAL_POINTER, new_line);
+ (void) hook_signal_send ("buffer_line_added",
+ WEECHAT_HOOK_SIGNAL_POINTER, new_line);
return new_line;
}
@@ -1408,8 +1408,8 @@ gui_line_add_y (struct t_gui_buffer *buffer, int y, const char *message)
if (!ptr_line->data->displayed)
{
buffer->own_lines->lines_hidden++;
- hook_signal_send ("buffer_lines_hidden",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) hook_signal_send ("buffer_lines_hidden",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
ptr_line->data->refresh_needed = 1;
diff --git a/src/gui/gui-nicklist.c b/src/gui/gui-nicklist.c
index f9921f7b1..7fac740d6 100644
--- a/src/gui/gui-nicklist.c
+++ b/src/gui/gui-nicklist.c
@@ -72,14 +72,15 @@ gui_nicklist_send_signal (const char *signal, struct t_gui_buffer *buffer,
"0x%lx,%s",
(long unsigned int)(buffer),
(arguments) ? arguments : "");
- hook_signal_send (signal, WEECHAT_HOOK_SIGNAL_STRING, str_args);
+ (void) hook_signal_send (signal,
+ WEECHAT_HOOK_SIGNAL_STRING, str_args);
free (str_args);
}
}
else
{
- hook_signal_send (signal, WEECHAT_HOOK_SIGNAL_STRING,
- (char *)arguments);
+ (void) hook_signal_send (signal,
+ WEECHAT_HOOK_SIGNAL_STRING, (char *)arguments);
}
}
@@ -114,7 +115,7 @@ gui_nicklist_send_hsignal (const char *signal, struct t_gui_buffer *buffer,
if (nick)
hashtable_set (gui_nicklist_hsignal, "nick", nick);
- hook_hsignal_send (signal, gui_nicklist_hsignal);
+ (void) hook_hsignal_send (signal, gui_nicklist_hsignal);
}
/*
diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c
index e11817522..7e9bc0619 100644
--- a/src/gui/gui-window.c
+++ b/src/gui/gui-window.c
@@ -662,8 +662,8 @@ gui_window_new (struct t_gui_window *parent_window, struct t_gui_buffer *buffer,
}
/* send signal */
- hook_signal_send ("window_opened",
- WEECHAT_HOOK_SIGNAL_POINTER, new_window);
+ (void) hook_signal_send ("window_opened",
+ WEECHAT_HOOK_SIGNAL_POINTER, new_window);
return new_window;
}
@@ -943,7 +943,8 @@ gui_window_free (struct t_gui_window *window)
old_current_window = gui_current_window;
- hook_signal_send ("window_closing", WEECHAT_HOOK_SIGNAL_POINTER, window);
+ (void) hook_signal_send ("window_closing",
+ WEECHAT_HOOK_SIGNAL_POINTER, window);
if (window->buffer)
gui_buffer_add_value_num_displayed (window->buffer, -1);
@@ -994,14 +995,16 @@ gui_window_free (struct t_gui_window *window)
i++;
}
- hook_signal_send ("window_closed", WEECHAT_HOOK_SIGNAL_POINTER, window);
+ (void) hook_signal_send ("window_closed",
+ WEECHAT_HOOK_SIGNAL_POINTER, window);
free (window);
if (gui_current_window != old_current_window)
{
- hook_signal_send ("window_switch",
- WEECHAT_HOOK_SIGNAL_POINTER, gui_current_window);
+ (void) hook_signal_send ("window_switch",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ gui_current_window);
}
}
@@ -1657,13 +1660,15 @@ gui_window_zoom (struct t_gui_window *window)
if (ptr_layout)
{
/* restore layout as it was before zooming a window */
- hook_signal_send ("window_unzoom",
- WEECHAT_HOOK_SIGNAL_POINTER, gui_current_window);
+ (void) hook_signal_send ("window_unzoom",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ gui_current_window);
gui_layout_window_apply (ptr_layout,
ptr_layout->internal_id_current_window);
gui_layout_remove (ptr_layout);
- hook_signal_send ("window_unzoomed",
- WEECHAT_HOOK_SIGNAL_POINTER, gui_current_window);
+ (void) hook_signal_send ("window_unzoomed",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ gui_current_window);
}
else
{
@@ -1672,12 +1677,14 @@ gui_window_zoom (struct t_gui_window *window)
if (ptr_layout)
{
gui_layout_add (ptr_layout);
- hook_signal_send ("window_zoom",
- WEECHAT_HOOK_SIGNAL_POINTER, gui_current_window);
+ (void) hook_signal_send ("window_zoom",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ gui_current_window);
gui_layout_window_store (ptr_layout);
gui_window_merge_all (window);
- hook_signal_send ("window_zoomed",
- WEECHAT_HOOK_SIGNAL_POINTER, gui_current_window);
+ (void) hook_signal_send ("window_zoomed",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ gui_current_window);
}
}
}
diff --git a/src/plugins/aspell/weechat-aspell.c b/src/plugins/aspell/weechat-aspell.c
index b461f2ffb..823bea179 100644
--- a/src/plugins/aspell/weechat-aspell.c
+++ b/src/plugins/aspell/weechat-aspell.c
@@ -912,8 +912,8 @@ weechat_aspell_modifier_cb (void *data, const char *modifier,
&& (strcmp (old_suggestions, ptr_suggestions) != 0)))
{
weechat_bar_item_update ("aspell_suggest");
- weechat_hook_signal_send ("aspell_suggest",
- WEECHAT_HOOK_SIGNAL_POINTER, buffer);
+ (void) weechat_hook_signal_send ("aspell_suggest",
+ WEECHAT_HOOK_SIGNAL_POINTER, buffer);
}
if (old_suggestions)
free (old_suggestions);
diff --git a/src/plugins/guile/weechat-guile-api.c b/src/plugins/guile/weechat-guile-api.c
index 0f9e40be0..2136092b7 100644
--- a/src/plugins/guile/weechat-guile-api.c
+++ b/src/plugins/guile/weechat-guile-api.c
@@ -2436,44 +2436,44 @@ weechat_guile_api_hook_signal (SCM signal, SCM function, SCM data)
SCM
weechat_guile_api_hook_signal_send (SCM signal, SCM type_data,
- SCM signal_data)
+ SCM signal_data)
{
- int number;
+ int number, rc;
- API_FUNC(1, "hook_signal_send", API_RETURN_ERROR);
+ API_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR));
if (!scm_is_string (signal) || !scm_is_string (type_data))
- API_WRONG_ARGS(API_RETURN_ERROR);
+ API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR));
if (strcmp (API_SCM_TO_STRING(type_data), WEECHAT_HOOK_SIGNAL_STRING) == 0)
{
if (!scm_is_string (signal_data))
- API_WRONG_ARGS(API_RETURN_ERROR);
- weechat_hook_signal_send (API_SCM_TO_STRING(signal),
- API_SCM_TO_STRING(type_data),
- (void *)API_SCM_TO_STRING(signal_data));
- API_RETURN_OK;
+ API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR));
+ rc = weechat_hook_signal_send (API_SCM_TO_STRING(signal),
+ API_SCM_TO_STRING(type_data),
+ (void *)API_SCM_TO_STRING(signal_data));
+ API_RETURN_INT(rc);
}
else if (strcmp (API_SCM_TO_STRING(type_data), WEECHAT_HOOK_SIGNAL_INT) == 0)
{
if (!scm_is_integer (signal_data))
- API_WRONG_ARGS(API_RETURN_ERROR);
+ API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR));
number = scm_to_int (signal_data);
- weechat_hook_signal_send (API_SCM_TO_STRING(signal),
- API_SCM_TO_STRING(type_data),
- &number);
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (API_SCM_TO_STRING(signal),
+ API_SCM_TO_STRING(type_data),
+ &number);
+ API_RETURN_INT(rc);
}
else if (strcmp (API_SCM_TO_STRING(type_data), WEECHAT_HOOK_SIGNAL_POINTER) == 0)
{
if (!scm_is_string (signal_data))
- API_WRONG_ARGS(API_RETURN_ERROR);
- weechat_hook_signal_send (API_SCM_TO_STRING(signal),
- API_SCM_TO_STRING(type_data),
- API_STR2PTR(API_SCM_TO_STRING(signal_data)));
- API_RETURN_OK;
+ API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR));
+ rc = weechat_hook_signal_send (API_SCM_TO_STRING(signal),
+ API_SCM_TO_STRING(type_data),
+ API_STR2PTR(API_SCM_TO_STRING(signal_data)));
+ API_RETURN_INT(rc);
}
- API_RETURN_ERROR;
+ API_RETURN_INT(WEECHAT_RC_ERROR);
}
int
@@ -2537,22 +2537,23 @@ SCM
weechat_guile_api_hook_hsignal_send (SCM signal, SCM hashtable)
{
struct t_hashtable *c_hashtable;
+ int rc;
- API_FUNC(1, "hook_hsignal_send", API_RETURN_ERROR);
+ API_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR));
if (!scm_is_string (signal) || !scm_list_p (hashtable))
- API_WRONG_ARGS(API_RETURN_ERROR);
+ API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR));
c_hashtable = weechat_guile_alist_to_hashtable (hashtable,
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING);
- weechat_hook_hsignal_send (API_SCM_TO_STRING(signal), c_hashtable);
+ rc = weechat_hook_hsignal_send (API_SCM_TO_STRING(signal), c_hashtable);
if (c_hashtable)
weechat_hashtable_free (c_hashtable);
- API_RETURN_OK;
+ API_RETURN_INT(rc);
}
int
diff --git a/src/plugins/guile/weechat-guile.c b/src/plugins/guile/weechat-guile.c
index 26d61df11..371b840e5 100644
--- a/src/plugins/guile/weechat-guile.c
+++ b/src/plugins/guile/weechat-guile.c
@@ -436,8 +436,9 @@ weechat_guile_load (const char *filename)
&weechat_guile_api_buffer_input_data_cb,
&weechat_guile_api_buffer_close_cb);
- weechat_hook_signal_send ("guile_script_loaded", WEECHAT_HOOK_SIGNAL_STRING,
- guile_current_script->filename);
+ (void) weechat_hook_signal_send ("guile_script_loaded",
+ WEECHAT_HOOK_SIGNAL_STRING,
+ guile_current_script->filename);
return 1;
}
@@ -494,8 +495,8 @@ weechat_guile_unload (struct t_plugin_script *script)
if (interpreter)
weechat_guile_catch (scm_gc_unprotect_object, interpreter);
- weechat_hook_signal_send ("guile_script_unloaded",
- WEECHAT_HOOK_SIGNAL_STRING, filename);
+ (void) weechat_hook_signal_send ("guile_script_unloaded",
+ WEECHAT_HOOK_SIGNAL_STRING, filename);
if (filename)
free (filename);
}
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c
index 5ed8287e0..2076acf0a 100644
--- a/src/plugins/irc/irc-channel.c
+++ b/src/plugins/irc/irc-channel.c
@@ -236,8 +236,9 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
weechat_buffer_set (new_buffer, "localvar_set_channel", channel_name);
if (server->is_away && server->away_message)
weechat_buffer_set (new_buffer, "localvar_set_away", server->away_message);
- weechat_hook_signal_send ("logger_backlog",
- WEECHAT_HOOK_SIGNAL_POINTER, new_buffer);
+ (void) weechat_hook_signal_send ("logger_backlog",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ new_buffer);
if (weechat_config_boolean (irc_config_network_send_unknown_commands))
weechat_buffer_set (new_buffer, "input_get_unknown_commands", "1");
if (channel_type == IRC_CHANNEL_TYPE_CHANNEL)
@@ -350,9 +351,9 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
free (channel_name_lower);
}
- weechat_hook_signal_send ((channel_type == IRC_CHANNEL_TYPE_CHANNEL) ?
- "irc_channel_opened" : "irc_pv_opened",
- WEECHAT_HOOK_SIGNAL_POINTER, new_buffer);
+ (void) weechat_hook_signal_send ((channel_type == IRC_CHANNEL_TYPE_CHANNEL) ?
+ "irc_channel_opened" : "irc_pv_opened",
+ WEECHAT_HOOK_SIGNAL_POINTER, new_buffer);
/* all is OK, return address of new channel */
return new_channel;
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index ae6dbedfa..35c3c554c 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -1434,9 +1434,9 @@ irc_command_dcc (void *data, struct t_gui_buffer *buffer, int argc,
weechat_infolist_new_var_string (item, "filename", argv_eol[3]);
weechat_infolist_new_var_string (item, "local_address", str_address);
weechat_infolist_new_var_integer (item, "socket", ptr_server->sock);
- weechat_hook_signal_send ("xfer_add",
- WEECHAT_HOOK_SIGNAL_POINTER,
- infolist);
+ (void) weechat_hook_signal_send ("xfer_add",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ infolist);
}
weechat_infolist_free (infolist);
}
@@ -1463,9 +1463,9 @@ irc_command_dcc (void *data, struct t_gui_buffer *buffer, int argc,
"irc.%s.%s", ptr_server->name, argv[2]);
weechat_infolist_new_var_string (item, "charset_modifier", charset_modifier);
weechat_infolist_new_var_string (item, "local_address", str_address);
- weechat_hook_signal_send ("xfer_add",
- WEECHAT_HOOK_SIGNAL_POINTER,
- infolist);
+ (void) weechat_hook_signal_send ("xfer_add",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ infolist);
}
weechat_infolist_free (infolist);
}
diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c
index f674db0b2..4c75a024a 100644
--- a/src/plugins/irc/irc-ctcp.c
+++ b/src/plugins/irc/irc-ctcp.c
@@ -629,16 +629,16 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick,
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_PROXY));
weechat_infolist_new_var_string (item, "remote_address", pos_addr);
weechat_infolist_new_var_integer (item, "port", atoi (pos_port));
- weechat_hook_signal_send ("xfer_add",
- WEECHAT_HOOK_SIGNAL_POINTER,
- infolist);
+ (void) weechat_hook_signal_send ("xfer_add",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ infolist);
}
weechat_infolist_free (infolist);
}
- weechat_hook_signal_send ("irc_dcc",
- WEECHAT_HOOK_SIGNAL_STRING,
- message);
+ (void) weechat_hook_signal_send ("irc_dcc",
+ WEECHAT_HOOK_SIGNAL_STRING,
+ message);
if (filename)
free (filename);
@@ -726,16 +726,16 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick,
(filename) ? filename : pos_file);
weechat_infolist_new_var_integer (item, "port", atoi (pos_port));
weechat_infolist_new_var_string (item, "start_resume", pos_start_resume);
- weechat_hook_signal_send ("xfer_accept_resume",
- WEECHAT_HOOK_SIGNAL_POINTER,
- infolist);
+ (void) weechat_hook_signal_send ("xfer_accept_resume",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ infolist);
}
weechat_infolist_free (infolist);
}
- weechat_hook_signal_send ("irc_dcc",
- WEECHAT_HOOK_SIGNAL_STRING,
- message);
+ (void) weechat_hook_signal_send ("irc_dcc",
+ WEECHAT_HOOK_SIGNAL_STRING,
+ message);
if (filename)
free (filename);
@@ -823,16 +823,16 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick,
(filename) ? filename : pos_file);
weechat_infolist_new_var_integer (item, "port", atoi (pos_port));
weechat_infolist_new_var_string (item, "start_resume", pos_start_resume);
- weechat_hook_signal_send ("xfer_start_resume",
- WEECHAT_HOOK_SIGNAL_POINTER,
- infolist);
+ (void) weechat_hook_signal_send ("xfer_start_resume",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ infolist);
}
weechat_infolist_free (infolist);
}
- weechat_hook_signal_send ("irc_dcc",
- WEECHAT_HOOK_SIGNAL_STRING,
- message);
+ (void) weechat_hook_signal_send ("irc_dcc",
+ WEECHAT_HOOK_SIGNAL_STRING,
+ message);
if (filename)
free (filename);
@@ -935,16 +935,16 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick,
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_PROXY));
weechat_infolist_new_var_string (item, "remote_address", pos_addr);
weechat_infolist_new_var_integer (item, "port", atoi (pos_port));
- weechat_hook_signal_send ("xfer_add",
- WEECHAT_HOOK_SIGNAL_POINTER,
- infolist);
+ (void) weechat_hook_signal_send ("xfer_add",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ infolist);
}
weechat_infolist_free (infolist);
}
- weechat_hook_signal_send ("irc_dcc",
- WEECHAT_HOOK_SIGNAL_STRING,
- message);
+ (void) weechat_hook_signal_send ("irc_dcc",
+ WEECHAT_HOOK_SIGNAL_STRING,
+ message);
free (dcc_args);
}
@@ -1053,9 +1053,9 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *command,
(pos_args) ? IRC_COLOR_RESET : "",
(pos_args) ? " " : "",
(pos_args) ? pos_args : "");
- weechat_hook_signal_send ("irc_pv",
- WEECHAT_HOOK_SIGNAL_STRING,
- message);
+ (void) weechat_hook_signal_send ("irc_pv",
+ WEECHAT_HOOK_SIGNAL_STRING,
+ message);
}
}
}
@@ -1126,9 +1126,9 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *command,
}
}
- weechat_hook_signal_send ("irc_ctcp",
- WEECHAT_HOOK_SIGNAL_STRING,
- message);
+ (void) weechat_hook_signal_send ("irc_ctcp",
+ WEECHAT_HOOK_SIGNAL_STRING,
+ message);
if (pos_space)
pos_space[0] = ' ';
diff --git a/src/plugins/irc/irc-ignore.c b/src/plugins/irc/irc-ignore.c
index e510ccf5f..b639d84ff 100644
--- a/src/plugins/irc/irc-ignore.c
+++ b/src/plugins/irc/irc-ignore.c
@@ -253,8 +253,8 @@ irc_ignore_free (struct t_irc_ignore *ignore)
{
struct t_irc_ignore *ptr_ignore;
- weechat_hook_signal_send ("irc_ignore_removing",
- WEECHAT_HOOK_SIGNAL_POINTER, ignore);
+ (void) weechat_hook_signal_send ("irc_ignore_removing",
+ WEECHAT_HOOK_SIGNAL_POINTER, ignore);
/* decrement number for all ignore after this one */
for (ptr_ignore = ignore->next_ignore; ptr_ignore;
@@ -288,8 +288,8 @@ irc_ignore_free (struct t_irc_ignore *ignore)
free (ignore);
- weechat_hook_signal_send ("irc_ignore_removed",
- WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) weechat_hook_signal_send ("irc_ignore_removed",
+ WEECHAT_HOOK_SIGNAL_STRING, NULL);
}
/*
diff --git a/src/plugins/irc/irc-notify.c b/src/plugins/irc/irc-notify.c
index 503a34cbe..9d0ca4883 100644
--- a/src/plugins/irc/irc-notify.c
+++ b/src/plugins/irc/irc-notify.c
@@ -434,8 +434,8 @@ void
irc_notify_free (struct t_irc_server *server, struct t_irc_notify *notify,
int remove_monitor)
{
- weechat_hook_signal_send ("irc_notify_removing",
- WEECHAT_HOOK_SIGNAL_POINTER, notify);
+ (void) weechat_hook_signal_send ("irc_notify_removing",
+ WEECHAT_HOOK_SIGNAL_POINTER, notify);
/* free data */
if (notify->nick)
@@ -468,8 +468,8 @@ irc_notify_free (struct t_irc_server *server, struct t_irc_notify *notify,
if (server->notify_count > 0)
server->notify_count--;
- weechat_hook_signal_send ("irc_notify_removed",
- WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ (void) weechat_hook_signal_send ("irc_notify_removed",
+ WEECHAT_HOOK_SIGNAL_STRING, NULL);
}
/*
@@ -650,7 +650,7 @@ irc_notify_send_signal (struct t_irc_notify *notify,
(away_message && away_message[0]) ? away_message : "");
}
- weechat_hook_signal_send (signal, WEECHAT_HOOK_SIGNAL_STRING, data);
+ (void) weechat_hook_signal_send (signal, WEECHAT_HOOK_SIGNAL_STRING, data);
if (data)
free (data);
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 0603b9dbf..bafd26c86 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -1764,9 +1764,9 @@ IRC_PROTOCOL_CALLBACK(privmsg)
if (ptr_channel->has_quit_server)
ptr_channel->has_quit_server = 0;
- weechat_hook_signal_send ("irc_pv",
- WEECHAT_HOOK_SIGNAL_STRING,
- argv_eol[0]);
+ (void) weechat_hook_signal_send ("irc_pv",
+ WEECHAT_HOOK_SIGNAL_STRING,
+ argv_eol[0]);
}
return WEECHAT_RC_OK;
@@ -2183,8 +2183,8 @@ IRC_PROTOCOL_CALLBACK(001)
}
/* send signal "irc_server_connected" with server name */
- weechat_hook_signal_send ("irc_server_connected",
- WEECHAT_HOOK_SIGNAL_STRING, server->name);
+ (void) weechat_hook_signal_send ("irc_server_connected",
+ WEECHAT_HOOK_SIGNAL_STRING, server->name);
/* execute command when connected */
server_command = weechat_string_eval_expression (IRC_SERVER_OPTION_STRING(server,
diff --git a/src/plugins/irc/irc-redirect.c b/src/plugins/irc/irc-redirect.c
index 9d3194711..2d3ab5456 100644
--- a/src/plugins/irc/irc-redirect.c
+++ b/src/plugins/irc/irc-redirect.c
@@ -748,7 +748,7 @@ irc_redirect_stop (struct t_irc_redirect *redirect, const char *error)
snprintf (signal_name, sizeof (signal_name), "irc_redirection_%s_%s",
redirect->signal, redirect->pattern);
- weechat_hook_hsignal_send (signal_name, hashtable);
+ (void) weechat_hook_hsignal_send (signal_name, hashtable);
if (hashtable)
weechat_hashtable_free (hashtable);
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c
index 3c42400f2..c9821ae59 100644
--- a/src/plugins/irc/irc-server.c
+++ b/src/plugins/irc/irc-server.c
@@ -1725,16 +1725,17 @@ irc_server_send_signal (struct t_irc_server *server, const char *signal,
{
snprintf (full_message_tags, length,
"%s;%s", tags, full_message);
- weechat_hook_signal_send (str_signal,
- WEECHAT_HOOK_SIGNAL_STRING,
- (void *)full_message_tags);
+ (void) weechat_hook_signal_send (str_signal,
+ WEECHAT_HOOK_SIGNAL_STRING,
+ (void *)full_message_tags);
free (full_message_tags);
}
}
else
{
- weechat_hook_signal_send (str_signal, WEECHAT_HOOK_SIGNAL_STRING,
- (void *)full_message);
+ (void) weechat_hook_signal_send (str_signal,
+ WEECHAT_HOOK_SIGNAL_STRING,
+ (void *)full_message);
}
free (str_signal);
}
@@ -3502,8 +3503,9 @@ irc_server_create_buffer (struct t_irc_server *server)
weechat_buffer_set (server->buffer, "localvar_set_charset_modifier",
charset_modifier);
- weechat_hook_signal_send ("logger_backlog",
- WEECHAT_HOOK_SIGNAL_POINTER, server->buffer);
+ (void) weechat_hook_signal_send ("logger_backlog",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ server->buffer);
if (weechat_config_boolean (irc_config_network_send_unknown_commands))
weechat_buffer_set (server->buffer, "input_get_unknown_commands", "1");
@@ -3531,8 +3533,9 @@ irc_server_create_buffer (struct t_irc_server *server)
weechat_buffer_merge (server->buffer, ptr_buffer_for_merge);
}
- weechat_hook_signal_send ("irc_server_opened",
- WEECHAT_HOOK_SIGNAL_POINTER, server->buffer);
+ (void) weechat_hook_signal_send ("irc_server_opened",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ server->buffer);
return server->buffer;
}
@@ -4162,8 +4165,8 @@ irc_server_connect (struct t_irc_server *server)
#endif
/* send signal "irc_server_connecting" with server name */
- weechat_hook_signal_send ("irc_server_connecting",
- WEECHAT_HOOK_SIGNAL_STRING, server->name);
+ (void) weechat_hook_signal_send ("irc_server_connecting",
+ WEECHAT_HOOK_SIGNAL_STRING, server->name);
return 1;
}
@@ -4299,8 +4302,8 @@ irc_server_disconnect (struct t_irc_server *server, int switch_address,
server->disconnected = 1;
/* send signal "irc_server_disconnected" with server name */
- weechat_hook_signal_send ("irc_server_disconnected",
- WEECHAT_HOOK_SIGNAL_STRING, server->name);
+ (void) weechat_hook_signal_send ("irc_server_disconnected",
+ WEECHAT_HOOK_SIGNAL_STRING, server->name);
}
/*
diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c
index e54cbcbcf..62c765b54 100644
--- a/src/plugins/lua/weechat-lua-api.c
+++ b/src/plugins/lua/weechat-lua-api.c
@@ -2643,13 +2643,13 @@ static int
weechat_lua_api_hook_signal_send (lua_State *L)
{
const char *signal, *type_data, *signal_data;
- int number;
+ int number, rc;
- API_FUNC(1, "hook_signal_send", API_RETURN_ERROR);
+ API_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR));
signal_data = NULL;
if (lua_gettop (L) < 3)
- API_WRONG_ARGS(API_RETURN_ERROR);
+ API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR));
signal = lua_tostring (L, -3);
type_data = lua_tostring (L, -2);
@@ -2657,24 +2657,24 @@ weechat_lua_api_hook_signal_send (lua_State *L)
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
{
signal_data = lua_tostring (L, -1);
- weechat_hook_signal_send (signal, type_data, (void *)signal_data);
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (signal, type_data, (void *)signal_data);
+ API_RETURN_INT(rc);
}
else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_INT) == 0)
{
number = lua_tonumber (L, -1);
- weechat_hook_signal_send (signal, type_data, &number);
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (signal, type_data, &number);
+ API_RETURN_INT(rc);
}
else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_POINTER) == 0)
{
signal_data = lua_tostring (L, -1);
- weechat_hook_signal_send (signal, type_data,
- API_STR2PTR(signal_data));
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (signal, type_data,
+ API_STR2PTR(signal_data));
+ API_RETURN_INT(rc);
}
- API_RETURN_ERROR;
+ API_RETURN_INT(WEECHAT_RC_ERROR);
}
int
@@ -2742,10 +2742,11 @@ weechat_lua_api_hook_hsignal_send (lua_State *L)
{
const char *signal;
struct t_hashtable *hashtable;
+ int rc;
- API_FUNC(1, "hook_hsignal_send", API_RETURN_ERROR);
+ API_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR));
if (lua_gettop (L) < 2)
- API_WRONG_ARGS(API_RETURN_ERROR);
+ API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR));
signal = lua_tostring (L, -2);
hashtable = weechat_lua_tohashtable (L, -1,
@@ -2753,12 +2754,12 @@ weechat_lua_api_hook_hsignal_send (lua_State *L)
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING);
- weechat_hook_hsignal_send (signal, hashtable);
+ rc = weechat_hook_hsignal_send (signal, hashtable);
if (hashtable)
weechat_hashtable_free (hashtable);
- API_RETURN_OK;
+ API_RETURN_INT(rc);
}
int
diff --git a/src/plugins/lua/weechat-lua.c b/src/plugins/lua/weechat-lua.c
index 4a3a73ea4..dfbf756b8 100644
--- a/src/plugins/lua/weechat-lua.c
+++ b/src/plugins/lua/weechat-lua.c
@@ -455,8 +455,9 @@ weechat_lua_load (const char *filename)
&weechat_lua_api_buffer_input_data_cb,
&weechat_lua_api_buffer_close_cb);
- weechat_hook_signal_send ("lua_script_loaded", WEECHAT_HOOK_SIGNAL_STRING,
- lua_current_script->filename);
+ (void) weechat_hook_signal_send ("lua_script_loaded",
+ WEECHAT_HOOK_SIGNAL_STRING,
+ lua_current_script->filename);
return 1;
}
@@ -514,8 +515,8 @@ weechat_lua_unload (struct t_plugin_script *script)
if (interpreter)
lua_close (interpreter);
- weechat_hook_signal_send ("lua_script_unloaded",
- WEECHAT_HOOK_SIGNAL_STRING, filename);
+ (void) weechat_hook_signal_send ("lua_script_unloaded",
+ WEECHAT_HOOK_SIGNAL_STRING, filename);
if (filename)
free (filename);
}
diff --git a/src/plugins/perl/weechat-perl-api.c b/src/plugins/perl/weechat-perl-api.c
index 6fb73f759..32e8f3e7b 100644
--- a/src/plugins/perl/weechat-perl-api.c
+++ b/src/plugins/perl/weechat-perl-api.c
@@ -2474,39 +2474,39 @@ XS (XS_weechat_api_hook_signal)
XS (XS_weechat_api_hook_signal_send)
{
char *signal, *type_data;
- int number;
+ int number, rc;
dXSARGS;
- API_FUNC(1, "hook_signal_send", API_RETURN_ERROR);
+ API_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR));
if (items < 3)
- API_WRONG_ARGS(API_RETURN_ERROR);
+ API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR));
signal = SvPV_nolen (ST (0));
type_data = SvPV_nolen (ST (1));
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
{
- weechat_hook_signal_send (signal,
- type_data,
- SvPV_nolen (ST (2))); /* signal_data */
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (signal,
+ type_data,
+ SvPV_nolen (ST (2))); /* signal_data */
+ API_RETURN_INT(rc);
}
else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_INT) == 0)
{
number = SvIV(ST (2));
- weechat_hook_signal_send (signal,
- type_data,
- &number); /* signal_data */
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (signal,
+ type_data,
+ &number); /* signal_data */
+ API_RETURN_INT(rc);
}
else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_POINTER) == 0)
{
- weechat_hook_signal_send (signal,
- type_data,
- API_STR2PTR(SvPV_nolen (ST (2)))); /* signal_data */
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (signal,
+ type_data,
+ API_STR2PTR(SvPV_nolen (ST (2)))); /* signal_data */
+ API_RETURN_INT(rc);
}
- API_RETURN_ERROR;
+ API_RETURN_INT(WEECHAT_RC_ERROR);
}
int
@@ -2572,11 +2572,12 @@ XS (XS_weechat_api_hook_hsignal_send)
{
char *signal;
struct t_hashtable *hashtable;
+ int rc;
dXSARGS;
- API_FUNC(1, "hook_hsignal_send", API_RETURN_ERROR);
+ API_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR));
if (items < 2)
- API_WRONG_ARGS(API_RETURN_ERROR);
+ API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR));
signal = SvPV_nolen (ST (0));
hashtable = weechat_perl_hash_to_hashtable (ST (1),
@@ -2584,12 +2585,12 @@ XS (XS_weechat_api_hook_hsignal_send)
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING);
- weechat_hook_hsignal_send (signal, hashtable);
+ rc = weechat_hook_hsignal_send (signal, hashtable);
if (hashtable)
weechat_hashtable_free (hashtable);
- API_RETURN_OK;
+ API_RETURN_INT(rc);
}
int
diff --git a/src/plugins/perl/weechat-perl.c b/src/plugins/perl/weechat-perl.c
index e26d3de86..ce3f5968e 100644
--- a/src/plugins/perl/weechat-perl.c
+++ b/src/plugins/perl/weechat-perl.c
@@ -468,8 +468,9 @@ weechat_perl_load (const char *filename)
&weechat_perl_api_buffer_input_data_cb,
&weechat_perl_api_buffer_close_cb);
- weechat_hook_signal_send ("perl_script_loaded", WEECHAT_HOOK_SIGNAL_STRING,
- perl_current_script->filename);
+ (void) weechat_hook_signal_send ("perl_script_loaded",
+ WEECHAT_HOOK_SIGNAL_STRING,
+ perl_current_script->filename);
return 1;
}
@@ -542,8 +543,8 @@ weechat_perl_unload (struct t_plugin_script *script)
free (interpreter);
#endif
- weechat_hook_signal_send ("perl_script_unloaded",
- WEECHAT_HOOK_SIGNAL_STRING, filename);
+ (void) weechat_hook_signal_send ("perl_script_unloaded",
+ WEECHAT_HOOK_SIGNAL_STRING, filename);
if (filename)
free (filename);
}
diff --git a/src/plugins/plugin-script.c b/src/plugins/plugin-script.c
index a4fd21a4a..fe80aecac 100644
--- a/src/plugins/plugin-script.c
+++ b/src/plugins/plugin-script.c
@@ -1088,8 +1088,8 @@ plugin_script_action_install (struct t_weechat_plugin *weechat_plugin,
snprintf (str_signal, sizeof (str_signal),
"%s_script_installed", weechat_plugin->name);
- weechat_hook_signal_send (str_signal, WEECHAT_HOOK_SIGNAL_STRING,
- ptr_list);
+ (void) weechat_hook_signal_send (str_signal, WEECHAT_HOOK_SIGNAL_STRING,
+ ptr_list);
free (*list);
*list = NULL;
@@ -1148,8 +1148,8 @@ plugin_script_action_remove (struct t_weechat_plugin *weechat_plugin,
snprintf (str_signal, sizeof (str_signal),
"%s_script_removed", weechat_plugin->name);
- weechat_hook_signal_send (str_signal, WEECHAT_HOOK_SIGNAL_STRING,
- ptr_list);
+ (void) weechat_hook_signal_send (str_signal, WEECHAT_HOOK_SIGNAL_STRING,
+ ptr_list);
free (*list);
*list = NULL;
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index a10c7874b..2cdfbfbbe 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -862,8 +862,8 @@ plugin_load (const char *filename, int argc, char **argv)
name);
}
- hook_signal_send ("plugin_loaded", WEECHAT_HOOK_SIGNAL_STRING,
- (char *)filename);
+ (void) hook_signal_send ("plugin_loaded",
+ WEECHAT_HOOK_SIGNAL_STRING, (char *)filename);
return new_plugin;
}
@@ -1046,7 +1046,8 @@ plugin_unload (struct t_weechat_plugin *plugin)
_("Plugin \"%s\" unloaded"),
(name) ? name : "???");
}
- hook_signal_send ("plugin_unloaded", WEECHAT_HOOK_SIGNAL_STRING, name);
+ (void) hook_signal_send ("plugin_unloaded",
+ WEECHAT_HOOK_SIGNAL_STRING, name);
if (name)
free (name);
}
diff --git a/src/plugins/python/weechat-python-api.c b/src/plugins/python/weechat-python-api.c
index 0a8df4c6e..91812fae1 100644
--- a/src/plugins/python/weechat-python-api.c
+++ b/src/plugins/python/weechat-python-api.c
@@ -2584,38 +2584,38 @@ static PyObject *
weechat_python_api_hook_signal_send (PyObject *self, PyObject *args)
{
char *signal, *type_data, *signal_data, *error;
- int number;
+ int number, rc;
- API_FUNC(1, "hook_signal_send", API_RETURN_ERROR);
+ API_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR));
signal = NULL;
type_data = NULL;
signal_data = NULL;
if (!PyArg_ParseTuple (args, "sss", &signal, &type_data, &signal_data))
- API_WRONG_ARGS(API_RETURN_ERROR);
+ API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR));
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
{
- weechat_hook_signal_send (signal, type_data, signal_data);
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (signal, type_data, signal_data);
+ API_RETURN_INT(rc);
}
else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_INT) == 0)
{
error = NULL;
number = (int)strtol (signal_data, &error, 10);
if (error && !error[0])
- {
- weechat_hook_signal_send (signal, type_data, &number);
- }
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (signal, type_data, &number);
+ else
+ rc = WEECHAT_RC_ERROR;
+ API_RETURN_INT(rc);
}
else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_POINTER) == 0)
{
- weechat_hook_signal_send (signal, type_data,
- API_STR2PTR(signal_data));
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (signal, type_data,
+ API_STR2PTR(signal_data));
+ API_RETURN_INT(rc);
}
- API_RETURN_ERROR;
+ API_RETURN_INT(WEECHAT_RC_ERROR);
}
int
@@ -2687,24 +2687,25 @@ weechat_python_api_hook_hsignal_send (PyObject *self, PyObject *args)
char *signal;
struct t_hashtable *hashtable;
PyObject *dict;
+ int rc;
- API_FUNC(1, "hook_hsignal_send", API_RETURN_ERROR);
+ API_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR));
signal = NULL;
dict = NULL;
if (!PyArg_ParseTuple (args, "sO", &signal, &dict))
- API_WRONG_ARGS(API_RETURN_ERROR);
+ API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR));
hashtable = weechat_python_dict_to_hashtable (dict,
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING);
- weechat_hook_hsignal_send (signal, hashtable);
+ rc = weechat_hook_hsignal_send (signal, hashtable);
if (hashtable)
weechat_hashtable_free (hashtable);
- API_RETURN_OK;
+ API_RETURN_INT(rc);
}
int
diff --git a/src/plugins/python/weechat-python.c b/src/plugins/python/weechat-python.c
index b40f5d323..e0b556cad 100644
--- a/src/plugins/python/weechat-python.c
+++ b/src/plugins/python/weechat-python.c
@@ -766,8 +766,9 @@ weechat_python_load (const char *filename)
&weechat_python_api_buffer_input_data_cb,
&weechat_python_api_buffer_close_cb);
- weechat_hook_signal_send ("python_script_loaded", WEECHAT_HOOK_SIGNAL_STRING,
- python_current_script->filename);
+ (void) weechat_hook_signal_send ("python_script_loaded",
+ WEECHAT_HOOK_SIGNAL_STRING,
+ python_current_script->filename);
return 1;
}
@@ -832,8 +833,8 @@ weechat_python_unload (struct t_plugin_script *script)
if (old_interpreter)
PyThreadState_Swap (old_interpreter);
- weechat_hook_signal_send ("python_script_unloaded",
- WEECHAT_HOOK_SIGNAL_STRING, filename);
+ (void) weechat_hook_signal_send ("python_script_unloaded",
+ WEECHAT_HOOK_SIGNAL_STRING, filename);
if (filename)
free (filename);
}
diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c
index 5b805e9f7..c2327158b 100644
--- a/src/plugins/relay/irc/relay-irc.c
+++ b/src/plugins/relay/irc/relay-irc.c
@@ -1146,9 +1146,8 @@ relay_irc_input_send (struct t_relay_client *client, const char *irc_channel,
RELAY_PLUGIN_NAME, buf);
}
- weechat_hook_signal_send ("irc_input_send",
- WEECHAT_HOOK_SIGNAL_STRING,
- buf);
+ (void) weechat_hook_signal_send ("irc_input_send",
+ WEECHAT_HOOK_SIGNAL_STRING, buf);
free (buf);
}
free (vbuffer);
@@ -1729,8 +1728,8 @@ relay_irc_recv (struct t_relay_client *client, const char *data)
*/
if (redirect_msg)
{
- weechat_hook_hsignal_send ("irc_redirect_command",
- hash_redirect);
+ (void) weechat_hook_hsignal_send ("irc_redirect_command",
+ hash_redirect);
}
weechat_hashtable_free (hash_redirect);
}
diff --git a/src/plugins/ruby/weechat-ruby-api.c b/src/plugins/ruby/weechat-ruby-api.c
index 5408b8ffc..96fe8824b 100644
--- a/src/plugins/ruby/weechat-ruby-api.c
+++ b/src/plugins/ruby/weechat-ruby-api.c
@@ -3011,11 +3011,11 @@ weechat_ruby_api_hook_signal_send (VALUE class, VALUE signal, VALUE type_data,
VALUE signal_data)
{
char *c_signal, *c_type_data, *c_signal_data;
- int number;
+ int number, rc;
- API_FUNC(1, "hook_signal_send", API_RETURN_ERROR);
+ API_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR));
if (NIL_P (signal) || NIL_P (type_data) || NIL_P (signal_data))
- API_WRONG_ARGS(API_RETURN_ERROR);
+ API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR));
Check_Type (signal, T_STRING);
Check_Type (type_data, T_STRING);
@@ -3027,26 +3027,26 @@ weechat_ruby_api_hook_signal_send (VALUE class, VALUE signal, VALUE type_data,
{
Check_Type (signal_data, T_STRING);
c_signal_data = StringValuePtr (signal_data);
- weechat_hook_signal_send (c_signal, c_type_data, c_signal_data);
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (c_signal, c_type_data, c_signal_data);
+ API_RETURN_INT(rc);
}
else if (strcmp (c_type_data, WEECHAT_HOOK_SIGNAL_INT) == 0)
{
Check_Type (signal_data, T_FIXNUM);
number = FIX2INT (signal_data);
- weechat_hook_signal_send (c_signal, c_type_data, &number);
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (c_signal, c_type_data, &number);
+ API_RETURN_INT(rc);
}
else if (strcmp (c_type_data, WEECHAT_HOOK_SIGNAL_POINTER) == 0)
{
Check_Type (signal_data, T_STRING);
c_signal_data = StringValuePtr (signal_data);
- weechat_hook_signal_send (c_signal, c_type_data,
- API_STR2PTR(c_signal_data));
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (c_signal, c_type_data,
+ API_STR2PTR(c_signal_data));
+ API_RETURN_INT(rc);
}
- API_RETURN_ERROR;
+ API_RETURN_INT(WEECHAT_RC_ERROR);
}
int
@@ -3119,10 +3119,11 @@ weechat_ruby_api_hook_hsignal_send (VALUE class, VALUE signal, VALUE hashtable)
{
char *c_signal;
struct t_hashtable *c_hashtable;
+ int rc;
- API_FUNC(1, "hook_hsignal_send", API_RETURN_ERROR);
+ API_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR));
if (NIL_P (signal) || NIL_P (hashtable))
- API_WRONG_ARGS(API_RETURN_ERROR);
+ API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR));
Check_Type (signal, T_STRING);
Check_Type (hashtable, T_HASH);
@@ -3133,12 +3134,12 @@ weechat_ruby_api_hook_hsignal_send (VALUE class, VALUE signal, VALUE hashtable)
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING);
- weechat_hook_hsignal_send (c_signal, c_hashtable);
+ rc = weechat_hook_hsignal_send (c_signal, c_hashtable);
if (c_hashtable)
weechat_hashtable_free (c_hashtable);
- API_RETURN_OK;
+ API_RETURN_INT(rc);
}
int
diff --git a/src/plugins/ruby/weechat-ruby.c b/src/plugins/ruby/weechat-ruby.c
index 38fa7f52c..cb392da1a 100644
--- a/src/plugins/ruby/weechat-ruby.c
+++ b/src/plugins/ruby/weechat-ruby.c
@@ -626,8 +626,9 @@ weechat_ruby_load (const char *filename)
&weechat_ruby_api_buffer_input_data_cb,
&weechat_ruby_api_buffer_close_cb);
- weechat_hook_signal_send ("ruby_script_loaded", WEECHAT_HOOK_SIGNAL_STRING,
- ruby_current_script->filename);
+ (void) weechat_hook_signal_send ("ruby_script_loaded",
+ WEECHAT_HOOK_SIGNAL_STRING,
+ ruby_current_script->filename);
return 1;
}
@@ -686,8 +687,8 @@ weechat_ruby_unload (struct t_plugin_script *script)
if (interpreter)
rb_gc_unregister_address (interpreter);
- weechat_hook_signal_send ("ruby_script_unloaded",
- WEECHAT_HOOK_SIGNAL_STRING, filename);
+ (void) weechat_hook_signal_send ("ruby_script_unloaded",
+ WEECHAT_HOOK_SIGNAL_STRING, filename);
if (filename)
free (filename);
}
diff --git a/src/plugins/script/script-action.c b/src/plugins/script/script-action.c
index 110f6fce5..992e01837 100644
--- a/src/plugins/script/script-action.c
+++ b/src/plugins/script/script-action.c
@@ -464,9 +464,9 @@ script_action_autoload (const char *name, int quiet, int autoload)
snprintf (str_signal, sizeof (str_signal),
"%s_script_autoload",
script_language[ptr_script->language]);
- weechat_hook_signal_send (str_signal,
- WEECHAT_HOOK_SIGNAL_STRING,
- filename);
+ (void) weechat_hook_signal_send (str_signal,
+ WEECHAT_HOOK_SIGNAL_STRING,
+ filename);
free (filename);
}
if (!quiet)
@@ -546,9 +546,9 @@ script_action_install_process_cb (void *data, const char *command,
snprintf (str_signal, sizeof (str_signal),
"%s_script_install",
script_language[ptr_script->language]);
- weechat_hook_signal_send (str_signal,
- WEECHAT_HOOK_SIGNAL_STRING,
- filename2);
+ (void) weechat_hook_signal_send (str_signal,
+ WEECHAT_HOOK_SIGNAL_STRING,
+ filename2);
free (filename2);
}
free (filename);
@@ -734,9 +734,9 @@ script_action_remove (const char *name, int quiet)
snprintf (str_signal, sizeof (str_signal),
"%s_script_remove",
script_language[ptr_script->language]);
- weechat_hook_signal_send (str_signal,
- WEECHAT_HOOK_SIGNAL_STRING,
- filename);
+ (void) weechat_hook_signal_send (str_signal,
+ WEECHAT_HOOK_SIGNAL_STRING,
+ filename);
free (filename);
}
}
diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c
index bcaecb999..804da959a 100644
--- a/src/plugins/tcl/weechat-tcl-api.c
+++ b/src/plugins/tcl/weechat-tcl-api.c
@@ -2918,42 +2918,41 @@ weechat_tcl_api_hook_signal_send (ClientData clientData, Tcl_Interp *interp,
{
Tcl_Obj *objp;
char *signal, *type_data;
- int number;
- int i;
+ int number, i, rc;
- API_FUNC(1, "hook_signal_send", API_RETURN_ERROR);
+ API_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR));
if (objc < 4)
- API_WRONG_ARGS(API_RETURN_ERROR);
+ API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR));
signal = Tcl_GetStringFromObj (objv[1], &i);
type_data = Tcl_GetStringFromObj (objv[2], &i);
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
{
- weechat_hook_signal_send (signal,
- type_data,
- Tcl_GetStringFromObj (objv[3], &i)); /* signal_data */
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (signal,
+ type_data,
+ Tcl_GetStringFromObj (objv[3], &i)); /* signal_data */
+ API_RETURN_INT(rc);
}
else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_INT) == 0)
{
if (Tcl_GetIntFromObj (interp, objv[3], &number) != TCL_OK)
{
- API_RETURN_ERROR;
+ API_RETURN_INT(WEECHAT_RC_ERROR);
}
- weechat_hook_signal_send (signal,
- type_data,
- &number); /* signal_data */
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (signal,
+ type_data,
+ &number); /* signal_data */
+ API_RETURN_INT(rc);
}
else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_POINTER) == 0)
{
- weechat_hook_signal_send (signal,
- type_data,
- API_STR2PTR(Tcl_GetStringFromObj (objv[3], &i))); /* signal_data */
- API_RETURN_OK;
+ rc = weechat_hook_signal_send (signal,
+ type_data,
+ API_STR2PTR(Tcl_GetStringFromObj (objv[3], &i))); /* signal_data */
+ API_RETURN_INT(rc);
}
- API_RETURN_ERROR;
+ API_RETURN_INT(WEECHAT_RC_ERROR);
}
int
@@ -3025,11 +3024,11 @@ weechat_tcl_api_hook_hsignal_send (ClientData clientData, Tcl_Interp *interp,
Tcl_Obj *objp;
char *signal;
struct t_hashtable *hashtable;
- int i;
+ int i, rc;
- API_FUNC(1, "hook_hsignal_send", API_RETURN_ERROR);
+ API_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR));
if (objc < 3)
- API_WRONG_ARGS(API_RETURN_ERROR);
+ API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR));
signal = Tcl_GetStringFromObj (objv[1], &i);
hashtable = weechat_tcl_dict_to_hashtable (interp, objv[2],
@@ -3037,12 +3036,12 @@ weechat_tcl_api_hook_hsignal_send (ClientData clientData, Tcl_Interp *interp,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING);
- weechat_hook_hsignal_send (signal, hashtable);
+ rc = weechat_hook_hsignal_send (signal, hashtable);
if (hashtable)
weechat_hashtable_free (hashtable);
- API_RETURN_OK;
+ API_RETURN_INT(rc);
}
int
diff --git a/src/plugins/tcl/weechat-tcl.c b/src/plugins/tcl/weechat-tcl.c
index f057f008d..c3dcad7d0 100644
--- a/src/plugins/tcl/weechat-tcl.c
+++ b/src/plugins/tcl/weechat-tcl.c
@@ -364,8 +364,9 @@ weechat_tcl_load (const char *filename)
&weechat_tcl_api_buffer_input_data_cb,
&weechat_tcl_api_buffer_close_cb);
- weechat_hook_signal_send ("tcl_script_loaded", WEECHAT_HOOK_SIGNAL_STRING,
- tcl_current_script->filename);
+ (void) weechat_hook_signal_send ("tcl_script_loaded",
+ WEECHAT_HOOK_SIGNAL_STRING,
+ tcl_current_script->filename);
return 1;
}
@@ -422,8 +423,8 @@ weechat_tcl_unload (struct t_plugin_script *script)
Tcl_DeleteInterp(interp);
- weechat_hook_signal_send ("tcl_script_unloaded",
- WEECHAT_HOOK_SIGNAL_STRING, filename);
+ (void) weechat_hook_signal_send ("tcl_script_unloaded",
+ WEECHAT_HOOK_SIGNAL_STRING, filename);
if (filename)
free (filename);
}
diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h
index 87df384aa..38f1f964d 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 "20140122-01"
+#define WEECHAT_PLUGIN_API_VERSION "20140210-01"
/* macros for defining plugin infos */
#define WEECHAT_PLUGIN_NAME(__name) \
@@ -591,16 +591,16 @@ struct t_weechat_plugin
const char *type_data,
void *signal_data),
void *callback_data);
- void (*hook_signal_send) (const char *signal, const char *type_data,
- void *signal_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,
const char *signal,
struct t_hashtable *hashtable),
void *callback_data);
- void (*hook_hsignal_send) (const char *signal,
- struct t_hashtable *hashtable);
+ 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,
diff --git a/src/plugins/xfer/xfer.c b/src/plugins/xfer/xfer.c
index 51621d82c..fd191f51c 100644
--- a/src/plugins/xfer/xfer.c
+++ b/src/plugins/xfer/xfer.c
@@ -424,8 +424,9 @@ xfer_send_signal (struct t_xfer *xfer, const char *signal)
{
if (xfer_add_to_infolist (infolist, xfer))
{
- weechat_hook_signal_send (signal, WEECHAT_HOOK_SIGNAL_POINTER,
- infolist);
+ (void) weechat_hook_signal_send (signal,
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ infolist);
}
weechat_infolist_free (infolist);
}