mirror of
https://github.com/weechat/weechat.git
synced 2026-07-01 23:36:37 +02:00
api: return integer in function gui_completion_search (issue #1484)
This commit is contained in:
@@ -4122,17 +4122,19 @@ SCM
|
||||
weechat_guile_api_completion_search (SCM completion, SCM data, SCM position,
|
||||
SCM direction)
|
||||
{
|
||||
API_INIT_FUNC(1, "completion_search", API_RETURN_ERROR);
|
||||
int rc;
|
||||
|
||||
API_INIT_FUNC(1, "completion_search", API_RETURN_INT(0));
|
||||
if (!scm_is_string (completion) || !scm_is_string (data)
|
||||
|| !scm_is_integer (position) || !scm_is_integer (direction))
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
weechat_completion_search (API_STR2PTR(API_SCM_TO_STRING(completion)),
|
||||
API_SCM_TO_STRING(data),
|
||||
scm_to_int (position),
|
||||
scm_to_int (direction));
|
||||
rc = weechat_completion_search (API_STR2PTR(API_SCM_TO_STRING(completion)),
|
||||
API_SCM_TO_STRING(data),
|
||||
scm_to_int (position),
|
||||
scm_to_int (direction));
|
||||
|
||||
API_RETURN_OK;
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
SCM
|
||||
|
||||
@@ -4015,22 +4015,22 @@ API_FUNC(completion_new)
|
||||
|
||||
API_FUNC(completion_search)
|
||||
{
|
||||
int position, direction;
|
||||
int position, direction, rc;
|
||||
|
||||
API_INIT_FUNC(1, "completion_search", "ssii", API_RETURN_ERROR);
|
||||
API_INIT_FUNC(1, "completion_search", "ssii", API_RETURN_INT(0));
|
||||
|
||||
v8::String::Utf8Value completion(args[0]);
|
||||
v8::String::Utf8Value data(args[1]);
|
||||
position = args[2]->IntegerValue();
|
||||
direction = args[3]->IntegerValue();
|
||||
|
||||
weechat_completion_search (
|
||||
rc = weechat_completion_search (
|
||||
(struct t_gui_completion *)API_STR2PTR(*completion),
|
||||
(const char *)(*data),
|
||||
position,
|
||||
direction);
|
||||
|
||||
API_RETURN_OK;
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
API_FUNC(completion_free)
|
||||
|
||||
@@ -4356,21 +4356,21 @@ API_FUNC(completion_new)
|
||||
API_FUNC(completion_search)
|
||||
{
|
||||
const char *completion, *data;
|
||||
int position, direction;
|
||||
int position, direction, rc;
|
||||
|
||||
API_INIT_FUNC(1, "completion_search", API_RETURN_ERROR);
|
||||
API_INIT_FUNC(1, "completion_search", API_RETURN_INT(0));
|
||||
if (lua_gettop (L) < 4)
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
completion = lua_tostring (L, -4);
|
||||
data = lua_tostring (L, -3);
|
||||
position = lua_tonumber (L, -2);
|
||||
direction = lua_tonumber (L, -1);
|
||||
|
||||
weechat_completion_search (API_STR2PTR(completion), data, position,
|
||||
direction);
|
||||
rc = weechat_completion_search (API_STR2PTR(completion), data, position,
|
||||
direction);
|
||||
|
||||
API_RETURN_OK;
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
API_FUNC(completion_free)
|
||||
|
||||
@@ -4278,21 +4278,22 @@ API_FUNC(completion_new)
|
||||
API_FUNC(completion_search)
|
||||
{
|
||||
char *completion, *data;
|
||||
int rc;
|
||||
dXSARGS;
|
||||
|
||||
API_INIT_FUNC(1, "completion_search", API_RETURN_ERROR);
|
||||
API_INIT_FUNC(1, "completion_search", API_RETURN_INT(0));
|
||||
if (items < 4)
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
completion = SvPV_nolen (ST (0));
|
||||
data = SvPV_nolen (ST (1));
|
||||
|
||||
weechat_completion_search (API_STR2PTR(completion),
|
||||
data,
|
||||
SvIV (ST (2)), /* position */
|
||||
SvIV (ST (3))); /* direction */
|
||||
rc = weechat_completion_search (API_STR2PTR(completion),
|
||||
data,
|
||||
SvIV (ST (2)), /* position */
|
||||
SvIV (ST (3))); /* direction */
|
||||
|
||||
API_RETURN_OK;
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
API_FUNC(completion_free)
|
||||
|
||||
@@ -4291,21 +4291,21 @@ API_FUNC(completion_search)
|
||||
zend_long z_position, z_direction;
|
||||
char *data;
|
||||
struct t_gui_completion *completion;
|
||||
int position, direction;
|
||||
int position, direction, rc;
|
||||
|
||||
API_INIT_FUNC(1, "completion_search", API_RETURN_ERROR);
|
||||
API_INIT_FUNC(1, "completion_search", API_RETURN_INT(0));
|
||||
if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSll", &z_completion, &z_data,
|
||||
&z_position, &z_direction) == FAILURE)
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
completion = (struct t_gui_completion *)API_STR2PTR(ZSTR_VAL(z_completion));
|
||||
data = ZSTR_VAL(z_data);
|
||||
position = (int)z_position;
|
||||
direction = (int)z_direction;
|
||||
|
||||
weechat_completion_search (completion, data, position, direction);
|
||||
rc = weechat_completion_search (completion, data, position, direction);
|
||||
|
||||
API_RETURN_OK;
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
API_FUNC(completion_free)
|
||||
|
||||
@@ -4290,22 +4290,22 @@ API_FUNC(completion_new)
|
||||
API_FUNC(completion_search)
|
||||
{
|
||||
char *completion, *data;
|
||||
int position, direction;
|
||||
int position, direction, rc;
|
||||
|
||||
API_INIT_FUNC(1, "completion_search", API_RETURN_ERROR);
|
||||
API_INIT_FUNC(1, "completion_search", API_RETURN_INT(0));
|
||||
completion = NULL;
|
||||
position = 0;
|
||||
direction = 1;
|
||||
if (!PyArg_ParseTuple (args, "ssii", &completion, &data, &position,
|
||||
&direction))
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
weechat_completion_search (API_STR2PTR(completion),
|
||||
data,
|
||||
position,
|
||||
direction);
|
||||
rc = weechat_completion_search (API_STR2PTR(completion),
|
||||
data,
|
||||
position,
|
||||
direction);
|
||||
|
||||
API_RETURN_OK;
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
API_FUNC(completion_free)
|
||||
|
||||
@@ -5174,12 +5174,12 @@ weechat_ruby_api_completion_search (VALUE class, VALUE completion, VALUE data,
|
||||
VALUE position, VALUE direction)
|
||||
{
|
||||
char *c_completion, *c_data;
|
||||
int c_position, c_direction;
|
||||
int c_position, c_direction, rc;
|
||||
|
||||
API_INIT_FUNC(1, "completion_search", API_RETURN_ERROR);
|
||||
API_INIT_FUNC(1, "completion_search", API_RETURN_INT(0));
|
||||
if (NIL_P (completion) || NIL_P (data) || NIL_P(position)
|
||||
|| NIL_P(direction))
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
Check_Type (completion, T_STRING);
|
||||
Check_Type (data, T_STRING);
|
||||
@@ -5191,10 +5191,10 @@ weechat_ruby_api_completion_search (VALUE class, VALUE completion, VALUE data,
|
||||
c_position = NUM2INT (position);
|
||||
c_direction = NUM2INT (direction);
|
||||
|
||||
weechat_completion_search (API_STR2PTR(c_completion), c_data, c_position,
|
||||
c_direction);
|
||||
rc = weechat_completion_search (API_STR2PTR(c_completion), c_data,
|
||||
c_position, c_direction);
|
||||
|
||||
API_RETURN_OK;
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
||||
@@ -4646,11 +4646,11 @@ API_FUNC(completion_search)
|
||||
{
|
||||
Tcl_Obj *objp;
|
||||
char *completion, *data;
|
||||
int i, position, direction;
|
||||
int i, position, direction, rc;
|
||||
|
||||
API_INIT_FUNC(1, "completion_search", API_RETURN_ERROR);
|
||||
API_INIT_FUNC(1, "completion_search", API_RETURN_INT(0));
|
||||
if (objc < 5)
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
completion = Tcl_GetStringFromObj (objv[1], &i);
|
||||
data = Tcl_GetStringFromObj (objv[2], &i);
|
||||
@@ -4659,10 +4659,10 @@ API_FUNC(completion_search)
|
||||
|| (Tcl_GetIntFromObj (interp, objv[4], &direction) != TCL_OK))
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
|
||||
weechat_completion_search (API_STR2PTR(completion), data, position,
|
||||
direction);
|
||||
rc = weechat_completion_search (API_STR2PTR(completion), data, position,
|
||||
direction);
|
||||
|
||||
API_RETURN_OK;
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
API_FUNC(info_get)
|
||||
|
||||
@@ -67,7 +67,7 @@ struct timeval;
|
||||
* please change the date with current one; for a second change at same
|
||||
* date, increment the 01, otherwise please keep 01.
|
||||
*/
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20200426-01"
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20200428-01"
|
||||
|
||||
/* macros for defining plugin infos */
|
||||
#define WEECHAT_PLUGIN_NAME(__name) \
|
||||
@@ -1012,8 +1012,8 @@ struct t_weechat_plugin
|
||||
/* completion */
|
||||
struct t_gui_completion *(*completion_new) (struct t_weechat_plugin *plugin,
|
||||
struct t_gui_buffer *buffer);
|
||||
void (*completion_search) (struct t_gui_completion *completion,
|
||||
const char *data, int position, int direction);
|
||||
int (*completion_search) (struct t_gui_completion *completion,
|
||||
const char *data, int position, int direction);
|
||||
void (*completion_free) (struct t_gui_completion *completion);
|
||||
|
||||
/* network */
|
||||
|
||||
Reference in New Issue
Block a user