mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 04:16:38 +02:00
api: add missing function infolist_search_var() in script API (issue #484)
This commit is contained in:
@@ -58,6 +58,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
||||
* core: fix bar item "scroll" after /buffer clear (issue #448)
|
||||
* core: fix display of time in bare display when option
|
||||
weechat.look.buffer_time_format is set to empty string (issue #441)
|
||||
* api: add missing function infolist_search_var() in script API (issue #484)
|
||||
* api: add missing function hook_completion_get_string() in script API
|
||||
(issue #484)
|
||||
* api: fix type of value returned by functions strcasestr, utf8_prev_char,
|
||||
|
||||
@@ -4093,6 +4093,22 @@ weechat_guile_api_infolist_new_var_time (SCM item, SCM name, SCM value)
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
SCM
|
||||
weechat_guile_api_infolist_search_var (SCM infolist, SCM name)
|
||||
{
|
||||
char *result;
|
||||
SCM return_value;
|
||||
|
||||
API_INIT_FUNC(1, "infolist_search_var", API_RETURN_EMPTY);
|
||||
if (!scm_is_string (infolist) || !scm_is_string (name))
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
result = API_PTR2STR(weechat_infolist_search_var (API_STR2PTR(API_SCM_TO_STRING(infolist)),
|
||||
API_SCM_TO_STRING(name)));
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
SCM
|
||||
weechat_guile_api_infolist_get (SCM name, SCM pointer, SCM arguments)
|
||||
{
|
||||
@@ -4860,6 +4876,7 @@ weechat_guile_api_module_init (void *data)
|
||||
API_DEF_FUNC(infolist_new_var_string, 3);
|
||||
API_DEF_FUNC(infolist_new_var_pointer, 3);
|
||||
API_DEF_FUNC(infolist_new_var_time, 3);
|
||||
API_DEF_FUNC(infolist_search_var, 2);
|
||||
API_DEF_FUNC(infolist_get, 3);
|
||||
API_DEF_FUNC(infolist_next, 1);
|
||||
API_DEF_FUNC(infolist_prev, 1);
|
||||
|
||||
@@ -4050,6 +4050,23 @@ API_FUNC(infolist_new_var_time)
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
API_FUNC(infolist_search_var)
|
||||
{
|
||||
char *result;
|
||||
|
||||
API_INIT_FUNC(1, "infolist_search_var", "ss", API_RETURN_EMPTY);
|
||||
|
||||
v8::String::Utf8Value infolist(args[0]);
|
||||
v8::String::Utf8Value name(args[1]);
|
||||
|
||||
result = API_PTR2STR(
|
||||
weechat_infolist_search_var (
|
||||
(struct t_infolist *)API_STR2PTR(*infolist),
|
||||
*name));
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
API_FUNC(infolist_get)
|
||||
{
|
||||
char *result;
|
||||
@@ -4872,6 +4889,7 @@ WeechatJsV8::loadLibs()
|
||||
API_DEF_FUNC(infolist_new_var_string);
|
||||
API_DEF_FUNC(infolist_new_var_pointer);
|
||||
API_DEF_FUNC(infolist_new_var_time);
|
||||
API_DEF_FUNC(infolist_search_var);
|
||||
API_DEF_FUNC(infolist_get);
|
||||
API_DEF_FUNC(infolist_next);
|
||||
API_DEF_FUNC(infolist_prev);
|
||||
|
||||
@@ -4326,6 +4326,24 @@ API_FUNC(infolist_new_var_time)
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
API_FUNC(infolist_search_var)
|
||||
{
|
||||
const char *infolist, *name;
|
||||
char *result;
|
||||
|
||||
API_INIT_FUNC(1, "infolist_search_var", API_RETURN_EMPTY);
|
||||
if (lua_gettop (L) < 2)
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
infolist = lua_tostring (L, -2);
|
||||
name = lua_tostring (L, -1);
|
||||
|
||||
result = API_PTR2STR(weechat_infolist_search_var (API_STR2PTR(infolist),
|
||||
name));
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
API_FUNC(infolist_get)
|
||||
{
|
||||
const char *name, *pointer, *arguments;
|
||||
@@ -5152,6 +5170,7 @@ const struct luaL_Reg weechat_lua_api_funcs[] = {
|
||||
API_DEF_FUNC(infolist_new_var_string),
|
||||
API_DEF_FUNC(infolist_new_var_pointer),
|
||||
API_DEF_FUNC(infolist_new_var_time),
|
||||
API_DEF_FUNC(infolist_search_var),
|
||||
API_DEF_FUNC(infolist_get),
|
||||
API_DEF_FUNC(infolist_next),
|
||||
API_DEF_FUNC(infolist_prev),
|
||||
|
||||
@@ -4251,6 +4251,24 @@ API_FUNC(infolist_new_var_time)
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
API_FUNC(infolist_search_var)
|
||||
{
|
||||
char *infolist, *name, *result;
|
||||
dXSARGS;
|
||||
|
||||
API_INIT_FUNC(1, "infolist_search_var", API_RETURN_EMPTY);
|
||||
if (items < 2)
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
infolist = SvPV_nolen (ST (0));
|
||||
name = SvPV_nolen (ST (1));
|
||||
|
||||
result = API_PTR2STR(weechat_infolist_search_var (API_STR2PTR(infolist),
|
||||
name));
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
API_FUNC(infolist_get)
|
||||
{
|
||||
char *result, *name, *pointer, *arguments;
|
||||
@@ -5096,6 +5114,7 @@ weechat_perl_api_init (pTHX)
|
||||
API_DEF_FUNC(infolist_new_var_string);
|
||||
API_DEF_FUNC(infolist_new_var_pointer);
|
||||
API_DEF_FUNC(infolist_new_var_time);
|
||||
API_DEF_FUNC(infolist_search_var);
|
||||
API_DEF_FUNC(infolist_get);
|
||||
API_DEF_FUNC(infolist_next);
|
||||
API_DEF_FUNC(infolist_prev);
|
||||
|
||||
@@ -4273,6 +4273,23 @@ API_FUNC(infolist_new_var_time)
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
API_FUNC(infolist_search_var)
|
||||
{
|
||||
char *infolist, *name, *result;
|
||||
PyObject *return_value;
|
||||
|
||||
API_INIT_FUNC(1, "infolist_search_var", API_RETURN_EMPTY);
|
||||
infolist = NULL;
|
||||
name = NULL;
|
||||
if (!PyArg_ParseTuple (args, "ss", &infolist, &name))
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
result = API_PTR2STR(weechat_infolist_search_var (API_STR2PTR(infolist),
|
||||
name));
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
API_FUNC(infolist_get)
|
||||
{
|
||||
char *name, *pointer, *arguments, *result;
|
||||
@@ -5077,6 +5094,7 @@ PyMethodDef weechat_python_funcs[] =
|
||||
API_DEF_FUNC(infolist_new_var_string),
|
||||
API_DEF_FUNC(infolist_new_var_pointer),
|
||||
API_DEF_FUNC(infolist_new_var_time),
|
||||
API_DEF_FUNC(infolist_search_var),
|
||||
API_DEF_FUNC(infolist_get),
|
||||
API_DEF_FUNC(infolist_next),
|
||||
API_DEF_FUNC(infolist_prev),
|
||||
|
||||
@@ -5178,6 +5178,28 @@ weechat_ruby_api_infolist_new_var_time (VALUE class, VALUE item,
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
weechat_ruby_api_infolist_search_var (VALUE class, VALUE infolist, VALUE name)
|
||||
{
|
||||
char *c_infolist, *c_name, *result;
|
||||
VALUE return_value;
|
||||
|
||||
API_INIT_FUNC(1, "infolist_search_var", API_RETURN_EMPTY);
|
||||
if (NIL_P (infolist) || NIL_P (name))
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
Check_Type (infolist, T_STRING);
|
||||
Check_Type (name, T_STRING);
|
||||
|
||||
c_infolist = StringValuePtr (infolist);
|
||||
c_name = StringValuePtr (name);
|
||||
|
||||
result = API_PTR2STR(weechat_infolist_search_var (API_STR2PTR(c_infolist),
|
||||
c_name));
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
weechat_ruby_api_infolist_get (VALUE class, VALUE name, VALUE pointer,
|
||||
VALUE arguments)
|
||||
@@ -6218,6 +6240,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
|
||||
API_DEF_FUNC(infolist_new_var_string, 3);
|
||||
API_DEF_FUNC(infolist_new_var_pointer, 3);
|
||||
API_DEF_FUNC(infolist_new_var_time, 3);
|
||||
API_DEF_FUNC(infolist_search_var, 2);
|
||||
API_DEF_FUNC(infolist_get, 3);
|
||||
API_DEF_FUNC(infolist_next, 1);
|
||||
API_DEF_FUNC(infolist_prev, 1);
|
||||
|
||||
@@ -4589,6 +4589,22 @@ API_FUNC(infolist_new_var_time)
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
API_FUNC(infolist_search_var)
|
||||
{
|
||||
Tcl_Obj *objp;
|
||||
char *result;
|
||||
int i;
|
||||
|
||||
API_INIT_FUNC(1, "infolist_search_var", API_RETURN_EMPTY);
|
||||
if (objc < 3)
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
result = API_PTR2STR(weechat_infolist_search_var (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i)), /* infolist */
|
||||
Tcl_GetStringFromObj (objv[2], &i))); /* name */
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
API_FUNC(infolist_get)
|
||||
{
|
||||
Tcl_Obj *objp;
|
||||
@@ -5558,6 +5574,7 @@ void weechat_tcl_api_init (Tcl_Interp *interp)
|
||||
API_DEF_FUNC(infolist_new_var_string);
|
||||
API_DEF_FUNC(infolist_new_var_pointer);
|
||||
API_DEF_FUNC(infolist_new_var_time);
|
||||
API_DEF_FUNC(infolist_search_var);
|
||||
API_DEF_FUNC(infolist_get);
|
||||
API_DEF_FUNC(infolist_next);
|
||||
API_DEF_FUNC(infolist_prev);
|
||||
|
||||
Reference in New Issue
Block a user