diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-11-27 17:05:59 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-11-27 17:05:59 +0100 |
commit | 3c51c0e7c484d2c3efa72e5373ce7fb81de8d4db (patch) | |
tree | 3adaea1fa3c98278e43d8025a233d245c95b6c1a /src/plugins/scripts | |
parent | aa77b482adce234207d9954850df0f6da6d61711 (diff) | |
download | weechat-3c51c0e7c484d2c3efa72e5373ce7fb81de8d4db.zip |
Remove argument "switch_to_another" for function gui_buffer_close()
Diffstat (limited to 'src/plugins/scripts')
-rw-r--r-- | src/plugins/scripts/lua/weechat-lua-api.c | 11 | ||||
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl-api.c | 5 | ||||
-rw-r--r-- | src/plugins/scripts/python/weechat-python-api.c | 7 | ||||
-rw-r--r-- | src/plugins/scripts/ruby/weechat-ruby-api.c | 12 | ||||
-rw-r--r-- | src/plugins/scripts/script-api.c | 5 | ||||
-rw-r--r-- | src/plugins/scripts/script-api.h | 3 | ||||
-rw-r--r-- | src/plugins/scripts/script.c | 2 | ||||
-rw-r--r-- | src/plugins/scripts/tcl/weechat-tcl-api.c | 15 |
8 files changed, 19 insertions, 41 deletions
diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c index 30b6577d9..338f721d5 100644 --- a/src/plugins/scripts/lua/weechat-lua-api.c +++ b/src/plugins/scripts/lua/weechat-lua-api.c @@ -3797,7 +3797,7 @@ static int weechat_lua_api_buffer_close (lua_State *L) { const char *buffer; - int n, switch_to_another; + int n; /* make C compiler happy */ (void) L; @@ -3809,23 +3809,20 @@ weechat_lua_api_buffer_close (lua_State *L) } buffer = NULL; - switch_to_another = 0; n = lua_gettop (lua_current_interpreter); - if (n < 2) + if (n < 1) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_close"); LUA_RETURN_ERROR; } - buffer = lua_tostring (lua_current_interpreter, -2); - switch_to_another = lua_tonumber (lua_current_interpreter, -1); + buffer = lua_tostring (lua_current_interpreter, -1); script_api_buffer_close (weechat_lua_plugin, lua_current_script, - script_str2ptr (buffer), - switch_to_another); + script_str2ptr (buffer)); LUA_RETURN_OK; } diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c index 5507136a1..0c01452b1 100644 --- a/src/plugins/scripts/perl/weechat-perl-api.c +++ b/src/plugins/scripts/perl/weechat-perl-api.c @@ -3223,7 +3223,7 @@ static XS (XS_weechat_api_buffer_close) PERL_RETURN_ERROR; } - if (items < 2) + if (items < 1) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_close"); PERL_RETURN_ERROR; @@ -3231,8 +3231,7 @@ static XS (XS_weechat_api_buffer_close) script_api_buffer_close (weechat_perl_plugin, perl_current_script, - script_str2ptr (SvPV (ST (0), PL_na)), /* buffer */ - SvIV (ST (1))); /* switch_to_another */ + script_str2ptr (SvPV (ST (0), PL_na))); /* buffer */ PERL_RETURN_OK; } diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index ab629def6..e299255bc 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -3409,7 +3409,6 @@ static PyObject * weechat_python_api_buffer_close (PyObject *self, PyObject *args) { char *buffer; - int switch_to_another; /* make C compiler happy */ (void) self; @@ -3421,9 +3420,8 @@ weechat_python_api_buffer_close (PyObject *self, PyObject *args) } buffer = NULL; - switch_to_another = 0; - if (!PyArg_ParseTuple (args, "si", &buffer, &switch_to_another)) + if (!PyArg_ParseTuple (args, "s", &buffer)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_close"); PYTHON_RETURN_ERROR; @@ -3431,8 +3429,7 @@ weechat_python_api_buffer_close (PyObject *self, PyObject *args) script_api_buffer_close (weechat_python_plugin, python_current_script, - script_str2ptr (buffer), - switch_to_another); + script_str2ptr (buffer)); PYTHON_RETURN_OK; } diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c index 2e1209e71..2d80aac8a 100644 --- a/src/plugins/scripts/ruby/weechat-ruby-api.c +++ b/src/plugins/scripts/ruby/weechat-ruby-api.c @@ -3895,11 +3895,9 @@ weechat_ruby_api_buffer_clear (VALUE class, VALUE buffer) */ static VALUE -weechat_ruby_api_buffer_close (VALUE class, VALUE buffer, - VALUE switch_to_another) +weechat_ruby_api_buffer_close (VALUE class, VALUE buffer) { char *c_buffer; - int c_switch_to_another; /* make C compiler happy */ (void) class; @@ -3911,24 +3909,20 @@ weechat_ruby_api_buffer_close (VALUE class, VALUE buffer, } c_buffer = NULL; - c_switch_to_another = 0; - if (NIL_P (buffer) || NIL_P (switch_to_another)) + if (NIL_P (buffer)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_close"); RUBY_RETURN_ERROR; } Check_Type (buffer, T_STRING); - Check_Type (switch_to_another, T_FIXNUM); c_buffer = STR2CSTR (buffer); - c_switch_to_another = FIX2INT (switch_to_another); script_api_buffer_close (weechat_ruby_plugin, ruby_current_script, - script_str2ptr (c_buffer), - c_switch_to_another); + script_str2ptr (c_buffer)); RUBY_RETURN_OK; } diff --git a/src/plugins/scripts/script-api.c b/src/plugins/scripts/script-api.c index 40434ed62..25cdad711 100644 --- a/src/plugins/scripts/script-api.c +++ b/src/plugins/scripts/script-api.c @@ -1198,15 +1198,14 @@ script_api_buffer_new (struct t_weechat_plugin *weechat_plugin, void script_api_buffer_close (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script, - struct t_gui_buffer *buffer, - int switch_to_another) + struct t_gui_buffer *buffer) { struct t_script_callback *ptr_script_callback, *next_callback; if (!weechat_plugin || !script || !buffer) return; - weechat_buffer_close (buffer, switch_to_another); + weechat_buffer_close (buffer); ptr_script_callback = script->callbacks; while (ptr_script_callback) diff --git a/src/plugins/scripts/script-api.h b/src/plugins/scripts/script-api.h index a3dafe8af..c1a379d30 100644 --- a/src/plugins/scripts/script-api.h +++ b/src/plugins/scripts/script-api.h @@ -210,8 +210,7 @@ extern struct t_gui_buffer *script_api_buffer_new (struct t_weechat_plugin *weec const char *function_close); extern void script_api_buffer_close (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script, - struct t_gui_buffer *buffer, - int switch_to_another); + struct t_gui_buffer *buffer); extern struct t_gui_bar_item *script_api_bar_item_new (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script, const char *name, diff --git a/src/plugins/scripts/script.c b/src/plugins/scripts/script.c index 9407456bc..9095bca28 100644 --- a/src/plugins/scripts/script.c +++ b/src/plugins/scripts/script.c @@ -486,7 +486,7 @@ script_remove (struct t_weechat_plugin *weechat_plugin, if (next_script_callback->buffer != ptr_script_callback->buffer) break; } - weechat_buffer_close (ptr_script_callback->buffer, 1); + weechat_buffer_close (ptr_script_callback->buffer); } ptr_script_callback = next_script_callback; diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c index 382d0b5f5..59b9448c5 100644 --- a/src/plugins/scripts/tcl/weechat-tcl-api.c +++ b/src/plugins/scripts/tcl/weechat-tcl-api.c @@ -3650,7 +3650,7 @@ weechat_tcl_api_buffer_close (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { Tcl_Obj *objp; - int i,switch_to_another; + int i; /* make C compiler happy */ (void) clientData; @@ -3661,22 +3661,15 @@ weechat_tcl_api_buffer_close (ClientData clientData, Tcl_Interp *interp, TCL_RETURN_ERROR; } - if (objc < 3) - { - WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_close"); - TCL_RETURN_ERROR; - } - - if (Tcl_GetIntFromObj (interp, objv[2], &switch_to_another) != TCL_OK) + if (objc < 2) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_close"); TCL_RETURN_ERROR; } - + script_api_buffer_close (weechat_tcl_plugin, tcl_current_script, - script_str2ptr (Tcl_GetStringFromObj (objv[1], &i)), /* buffer */ - switch_to_another); /* switch_to_another */ + script_str2ptr (Tcl_GetStringFromObj (objv[1], &i))); /* buffer */ TCL_RETURN_OK; } |