1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

Add description for info and infolist hooks

This commit is contained in:
Sebastien Helleu
2008-09-02 17:02:59 +02:00
parent e756f4770a
commit e7dcf13764
24 changed files with 970 additions and 227 deletions
+10 -6
View File
@@ -3105,7 +3105,7 @@ weechat_lua_api_hook_info_cb (void *data, const char *info_name,
static int
weechat_lua_api_hook_info (lua_State *L)
{
const char *info_name, *function;
const char *info_name, *description, *function;
char *result;
int n;
@@ -3123,18 +3123,20 @@ weechat_lua_api_hook_info (lua_State *L)
n = lua_gettop (lua_current_interpreter);
if (n < 2)
if (n < 3)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_info");
LUA_RETURN_EMPTY;
}
info_name = lua_tostring (lua_current_interpreter, -2);
info_name = lua_tostring (lua_current_interpreter, -3);
description = lua_tostring (lua_current_interpreter, -2);
function = lua_tostring (lua_current_interpreter, -1);
result = script_ptr2str (script_api_hook_info (weechat_lua_plugin,
lua_current_script,
info_name,
description,
&weechat_lua_api_hook_info_cb,
function));
@@ -3178,7 +3180,7 @@ weechat_lua_api_hook_infolist_cb (void *data, const char *info_name,
static int
weechat_lua_api_hook_infolist (lua_State *L)
{
const char *infolist_name, *function;
const char *infolist_name, *description, *function;
char *result;
int n;
@@ -3196,18 +3198,20 @@ weechat_lua_api_hook_infolist (lua_State *L)
n = lua_gettop (lua_current_interpreter);
if (n < 2)
if (n < 3)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_infolist");
LUA_RETURN_EMPTY;
}
infolist_name = lua_tostring (lua_current_interpreter, -2);
infolist_name = lua_tostring (lua_current_interpreter, -3);
description = lua_tostring (lua_current_interpreter, -2);
function = lua_tostring (lua_current_interpreter, -1);
result = script_ptr2str (script_api_hook_infolist (weechat_lua_plugin,
lua_current_script,
infolist_name,
description,
&weechat_lua_api_hook_infolist_cb,
function));