1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 20:36:38 +02:00

Remove argument "switch_to_another" for function gui_buffer_close()

This commit is contained in:
Sebastien Helleu
2008-11-27 17:05:59 +01:00
parent aa77b482ad
commit 3c51c0e7c4
19 changed files with 34 additions and 59 deletions
+4 -7
View File
@@ -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;
}
+2 -3
View File
@@ -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;
}
@@ -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;
}
+3 -9
View File
@@ -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;
}
+2 -3
View File
@@ -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)
+1 -2
View File
@@ -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,
+1 -1
View File
@@ -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;
+4 -11
View File
@@ -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)
if (objc < 2)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_close");
TCL_RETURN_ERROR;
}
if (Tcl_GetIntFromObj (interp, objv[2], &switch_to_another) != TCL_OK)
{
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;
}