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

scripts: fix return code of function bar_set in python/perl/ruby/lua/tcl/guile plugins

This commit is contained in:
Sébastien Helleu
2015-03-01 09:57:35 +01:00
parent 72b8674193
commit 5e886961bd
7 changed files with 35 additions and 33 deletions
+2
View File
@@ -39,6 +39,8 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
* python: fix name of function "bar_update" in case of error
* python: fix restore of old interpreter when a function is not found in the
script
* scripts: fix return code of function bar_set in
python/perl/ruby/lua/tcl/guile plugins
* scripts: fix type of value returned by function hdata_time (from string to
long integer) in perl/ruby/lua/tcl/guile plugins
+8 -6
View File
@@ -3837,16 +3837,18 @@ weechat_guile_api_bar_new (SCM args)
SCM
weechat_guile_api_bar_set (SCM bar, SCM property, SCM value)
{
API_INIT_FUNC(1, "bar_set", API_RETURN_ERROR);
int rc;
API_INIT_FUNC(1, "bar_set", API_RETURN_INT(0));
if (!scm_is_string (bar) || !scm_is_string (property)
|| !scm_is_string (value))
API_WRONG_ARGS(API_RETURN_ERROR);
API_WRONG_ARGS(API_RETURN_INT(0));
weechat_bar_set (API_STR2PTR(API_SCM_TO_STRING(bar)),
API_SCM_TO_STRING(property),
API_SCM_TO_STRING(value));
rc = weechat_bar_set (API_STR2PTR(API_SCM_TO_STRING(bar)),
API_SCM_TO_STRING(property),
API_SCM_TO_STRING(value));
API_RETURN_OK;
API_RETURN_INT(rc);
}
SCM
+5 -6
View File
@@ -4055,20 +4055,19 @@ API_FUNC(bar_new)
API_FUNC(bar_set)
{
const char *bar, *property, *value;
int rc;
API_INIT_FUNC(1, "bar_set", API_RETURN_ERROR);
API_INIT_FUNC(1, "bar_set", API_RETURN_INT(0));
if (lua_gettop (L) < 3)
API_WRONG_ARGS(API_RETURN_ERROR);
API_WRONG_ARGS(API_RETURN_INT(0));
bar = lua_tostring (L, -3);
property = lua_tostring (L, -2);
value = lua_tostring (L, -1);
weechat_bar_set (API_STR2PTR(bar),
property,
value);
rc = weechat_bar_set (API_STR2PTR(bar), property, value);
API_RETURN_OK;
API_RETURN_INT(rc);
}
API_FUNC(bar_update)
+5 -4
View File
@@ -3976,19 +3976,20 @@ API_FUNC(bar_new)
API_FUNC(bar_set)
{
char *bar, *property, *value;
int rc;
dXSARGS;
API_INIT_FUNC(1, "bar_set", API_RETURN_ERROR);
API_INIT_FUNC(1, "bar_set", API_RETURN_INT(0));
if (items < 3)
API_WRONG_ARGS(API_RETURN_ERROR);
API_WRONG_ARGS(API_RETURN_INT(0));
bar = SvPV_nolen (ST (0));
property = SvPV_nolen (ST (1));
value = SvPV_nolen (ST (2));
weechat_bar_set (API_STR2PTR(bar), property, value);
rc = weechat_bar_set (API_STR2PTR(bar), property, value);
API_RETURN_OK;
API_RETURN_INT(rc);
}
API_FUNC(bar_update)
+5 -6
View File
@@ -4006,19 +4006,18 @@ API_FUNC(bar_new)
API_FUNC(bar_set)
{
char *bar, *property, *value;
int rc;
API_INIT_FUNC(1, "bar_set", API_RETURN_ERROR);
API_INIT_FUNC(1, "bar_set", API_RETURN_INT(0));
bar = NULL;
property = NULL;
value = NULL;
if (!PyArg_ParseTuple (args, "sss", &bar, &property, &value))
API_WRONG_ARGS(API_RETURN_ERROR);
API_WRONG_ARGS(API_RETURN_INT(0));
weechat_bar_set (API_STR2PTR(bar),
property,
value);
rc = weechat_bar_set (API_STR2PTR(bar), property, value);
API_RETURN_OK;
API_RETURN_INT(rc);
}
API_FUNC(bar_update)
+5 -6
View File
@@ -4836,10 +4836,11 @@ static VALUE
weechat_ruby_api_bar_set (VALUE class, VALUE bar, VALUE property, VALUE value)
{
char *c_bar, *c_property, *c_value;
int rc;
API_INIT_FUNC(1, "bar_set", API_RETURN_ERROR);
API_INIT_FUNC(1, "bar_set", API_RETURN_INT(0));
if (NIL_P (bar) || NIL_P (property) || NIL_P (value))
API_WRONG_ARGS(API_RETURN_ERROR);
API_WRONG_ARGS(API_RETURN_INT(0));
Check_Type (bar, T_STRING);
Check_Type (property, T_STRING);
@@ -4849,11 +4850,9 @@ weechat_ruby_api_bar_set (VALUE class, VALUE bar, VALUE property, VALUE value)
c_property = StringValuePtr (property);
c_value = StringValuePtr (value);
weechat_bar_set (API_STR2PTR(c_bar),
c_property,
c_value);
rc = weechat_bar_set (API_STR2PTR(c_bar), c_property, c_value);
API_RETURN_OK;
API_RETURN_INT(rc);
}
static VALUE
+5 -5
View File
@@ -4315,19 +4315,19 @@ API_FUNC(bar_set)
{
Tcl_Obj *objp;
char *bar, *property, *value;
int i;
int i, rc;
API_INIT_FUNC(1, "bar_set", API_RETURN_ERROR);
API_INIT_FUNC(1, "bar_set", API_RETURN_INT(0));
if (objc < 4)
API_WRONG_ARGS(API_RETURN_ERROR);
API_WRONG_ARGS(API_RETURN_INT(0));
bar = Tcl_GetStringFromObj (objv[1], &i);
property = Tcl_GetStringFromObj (objv[2], &i);
value = Tcl_GetStringFromObj (objv[3], &i);
weechat_bar_set (API_STR2PTR(bar), property, value);
rc = weechat_bar_set (API_STR2PTR(bar), property, value);
API_RETURN_OK;
API_RETURN_INT(rc);
}
API_FUNC(bar_update)