1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 16:45:41 +02:00

Restore buffer callbacks for scripts after /upgrade

This commit is contained in:
Sebastien Helleu
2009-04-16 14:25:44 +02:00
parent 771be1a316
commit 44003c2dae
13 changed files with 182 additions and 30 deletions
@@ -22,4 +22,10 @@
extern struct luaL_reg weechat_lua_api_funcs[];
extern int weechat_lua_api_buffer_input_data_cb (void *data,
struct t_gui_buffer *buffer,
const char *input_data);
extern int weechat_lua_api_buffer_close_cb (void *data,
struct t_gui_buffer *buffer);
#endif /* weechat-lua.h */
+7 -6
View File
@@ -600,21 +600,22 @@ weechat_lua_signal_script_action_cb (void *data, const char *signal,
int
weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
{
/* make C compiler happy */
(void) argc;
(void) argv;
weechat_lua_plugin = plugin;
lua_quiet = 1;
script_init (weechat_lua_plugin,
argc,
argv,
&lua_scripts,
&weechat_lua_command_cb,
&weechat_lua_completion_cb,
&weechat_lua_infolist_cb,
&weechat_lua_signal_debug_dump_cb,
&weechat_lua_signal_buffer_closed_cb,
&weechat_lua_signal_script_action_cb,
&weechat_lua_load_cb);
&weechat_lua_load_cb,
&weechat_lua_api_buffer_input_data_cb,
&weechat_lua_api_buffer_close_cb);
lua_quiet = 0;
script_display_short_list (weechat_lua_plugin,
@@ -20,6 +20,11 @@
#ifndef __WEECHAT_PERL_API_H
#define __WEECHAT_PERL_API_H 1
extern int weechat_perl_api_buffer_input_data_cb (void *data,
struct t_gui_buffer *buffer,
const char *input_data);
extern int weechat_perl_api_buffer_close_cb (void *data,
struct t_gui_buffer *buffer);
extern void weechat_perl_api_init (pTHX);
#endif /* weechat-perl.h */
+6 -6
View File
@@ -772,11 +772,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
char **perl_args_local;
char *perl_env[] = {};
#endif
/* make C compiler happy */
(void) argc;
(void) argv;
#ifdef PERL_SYS_INIT3
a = perl_args_count;
perl_args_local = perl_args;
@@ -806,13 +801,18 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
perl_quiet = 1;
script_init (weechat_perl_plugin,
argc,
argv,
&perl_scripts,
&weechat_perl_command_cb,
&weechat_perl_completion_cb,
&weechat_perl_infolist_cb,
&weechat_perl_signal_debug_dump_cb,
&weechat_perl_signal_buffer_closed_cb,
&weechat_perl_signal_script_action_cb,
&weechat_perl_load_cb);
&weechat_perl_load_cb,
&weechat_perl_api_buffer_input_data_cb,
&weechat_perl_api_buffer_close_cb);
perl_quiet = 0;
script_display_short_list (weechat_perl_plugin,
@@ -22,4 +22,10 @@
extern PyMethodDef weechat_python_funcs[];
extern int weechat_python_api_buffer_input_data_cb (void *data,
struct t_gui_buffer *buffer,
const char *input_data);
extern int weechat_python_api_buffer_close_cb (void *data,
struct t_gui_buffer *buffer);
#endif /* weechat-python.h */
+6 -5
View File
@@ -834,10 +834,6 @@ weechat_python_signal_script_action_cb (void *data, const char *signal,
int
weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
{
/* make C compiler happy */
(void) argc;
(void) argv;
weechat_python_plugin = plugin;
/* init stdout/stderr buffer */
@@ -869,13 +865,18 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
python_quiet = 1;
script_init (weechat_python_plugin,
argc,
argv,
&python_scripts,
&weechat_python_command_cb,
&weechat_python_completion_cb,
&weechat_python_infolist_cb,
&weechat_python_signal_debug_dump_cb,
&weechat_python_signal_buffer_closed_cb,
&weechat_python_signal_script_action_cb,
&weechat_python_load_cb);
&weechat_python_load_cb,
&weechat_python_api_buffer_input_data_cb,
&weechat_python_api_buffer_close_cb);
python_quiet = 0;
script_display_short_list (weechat_python_plugin,
@@ -20,6 +20,11 @@
#ifndef __WEECHAT_RUBY_API_H
#define __WEECHAT_RUBY_API_H 1
extern int weechat_ruby_api_buffer_input_data_cb (void *data,
struct t_gui_buffer *buffer,
const char *input_data);
extern int weechat_ruby_api_buffer_close_cb (void *data,
struct t_gui_buffer *buffer);
extern void weechat_ruby_api_init (VALUE ruby_mWeechat);
#endif /* weechat-ruby.h */
+6 -5
View File
@@ -843,10 +843,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
"end\n"
};
/* make C compiler happy */
(void) argc;
(void) argv;
weechat_ruby_plugin = plugin;
ruby_error = 0;
@@ -889,13 +885,18 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
ruby_quiet = 1;
script_init (weechat_ruby_plugin,
argc,
argv,
&ruby_scripts,
&weechat_ruby_command_cb,
&weechat_ruby_completion_cb,
&weechat_ruby_infolist_cb,
&weechat_ruby_signal_debug_dump_cb,
&weechat_ruby_signal_buffer_closed_cb,
&weechat_ruby_signal_script_action_cb,
&weechat_ruby_load_cb);
&weechat_ruby_load_cb,
&weechat_ruby_api_buffer_input_data_cb,
&weechat_ruby_api_buffer_close_cb);
ruby_quiet = 0;
script_display_short_list (weechat_ruby_plugin,
+7
View File
@@ -1364,6 +1364,13 @@ script_api_buffer_new (struct t_weechat_plugin *weechat_plugin,
script_callback_add (script, new_script_callback_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_close_cb",
function_close);
return new_buffer;
}
File diff suppressed because it is too large Load Diff
+9 -1
View File
@@ -57,6 +57,9 @@ struct t_plugin_script
};
extern void script_init (struct t_weechat_plugin *weechat_plugin,
int argc,
char *argv[],
struct t_plugin_script **scripts,
int (*callback_command)(void *data,
struct t_gui_buffer *buffer,
int argc, char **argv,
@@ -81,7 +84,12 @@ extern void script_init (struct t_weechat_plugin *weechat_plugin,
const char *signal,
const char *type_data,
void *signal_data),
void (*callback_load_file)(void *data, const char *filename));
void (*callback_load_file)(void *data, const char *filename),
int (*callback_buffer_input) (void *data,
struct t_gui_buffer *buffer,
const char *input_data),
int (*callback_buffer_close) (void *data,
struct t_gui_buffer *buffer));
extern int script_valid (struct t_plugin_script *scripts,
struct t_plugin_script *script);
extern char *script_ptr2str (void *pointer);
@@ -20,6 +20,11 @@
#ifndef __WEECHAT_TCL_API_H
#define __WEECHAT_TCL_API_H 1
extern int weechat_tcl_api_buffer_input_data_cb (void *data,
struct t_gui_buffer *buffer,
const char *input_data);
extern int weechat_tcl_api_buffer_close_cb (void *data,
struct t_gui_buffer *buffer);
extern void weechat_tcl_api_init (Tcl_Interp *interp);
#endif /* weechat-tcl.h */
+6 -5
View File
@@ -540,21 +540,22 @@ weechat_tcl_signal_script_action_cb (void *data, const char *signal,
int
weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
{
/* make C compiler happy */
(void) argc;
(void) argv;
weechat_tcl_plugin = plugin;
tcl_quiet = 1;
script_init (weechat_tcl_plugin,
argc,
argv,
&tcl_scripts,
&weechat_tcl_command_cb,
&weechat_tcl_completion_cb,
&weechat_tcl_infolist_cb,
&weechat_tcl_signal_debug_dump_cb,
&weechat_tcl_signal_buffer_closed_cb,
&weechat_tcl_signal_script_action_cb,
&weechat_tcl_load_cb);
&weechat_tcl_load_cb,
&weechat_tcl_api_buffer_input_data_cb,
&weechat_tcl_api_buffer_close_cb);
tcl_quiet = 0;
script_display_short_list (weechat_tcl_plugin,