summaryrefslogtreecommitdiff
path: root/src/plugins/lua/weechat-lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/lua/weechat-lua.c')
-rw-r--r--src/plugins/lua/weechat-lua.c70
1 files changed, 33 insertions, 37 deletions
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;