summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/lua/weechat-lua-api.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-04-16 14:44:02 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-04-16 14:44:02 +0200
commitae98666bc6111d1940d3b14fc4566b262cba2c87 (patch)
tree3bf80e92854c46b8fcef0270cf3df94cad028b6c /src/plugins/scripts/lua/weechat-lua-api.c
parent7489ec9a4041039719334c9d0406e31775132cc7 (diff)
downloadweechat-ae98666bc6111d1940d3b14fc4566b262cba2c87.zip
Added "toggle" value for /set on boolean options, fixed refresh bugs, added option type for infolist "options"
Diffstat (limited to 'src/plugins/scripts/lua/weechat-lua-api.c')
-rw-r--r--src/plugins/scripts/lua/weechat-lua-api.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c
index 04a6eeb8e..2cf5a3ee0 100644
--- a/src/plugins/scripts/lua/weechat-lua-api.c
+++ b/src/plugins/scripts/lua/weechat-lua-api.c
@@ -3013,12 +3013,12 @@ weechat_lua_api_unhook_all (lua_State *L)
}
/*
- * weechat_lua_api_input_data_cb: callback for input data in a buffer
+ * weechat_lua_api_buffer_input_data_cb: callback for input data in a buffer
*/
int
-weechat_lua_api_input_data_cb (void *data, struct t_gui_buffer *buffer,
- char *input_data)
+weechat_lua_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
+ char *input_data)
{
struct t_script_callback *script_callback;
char *lua_argv[3];
@@ -3049,11 +3049,11 @@ weechat_lua_api_input_data_cb (void *data, struct t_gui_buffer *buffer,
}
/*
- * weechat_lua_api_close_cb: callback for buffer closed
+ * weechat_lua_api_buffer_close_cb: callback for buffer closed
*/
int
-weechat_lua_api_close_cb (void *data, struct t_gui_buffer *buffer)
+weechat_lua_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
{
struct t_script_callback *script_callback;
char *lua_argv[2];
@@ -3124,9 +3124,9 @@ weechat_lua_api_buffer_new (lua_State *L)
lua_current_script,
(char *)category,
(char *)name,
- &weechat_lua_api_input_data_cb,
+ &weechat_lua_api_buffer_input_data_cb,
(char *)function_input,
- &weechat_lua_api_close_cb,
+ &weechat_lua_api_buffer_close_cb,
(char *)function_close));
LUA_RETURN_STRING_FREE(result);
@@ -4121,7 +4121,7 @@ weechat_lua_api_info_get (lua_State *L)
static int
weechat_lua_api_infolist_get (lua_State *L)
{
- const char *name, *pointer;
+ const char *name, *pointer, *arguments;
char *value;
int n;
@@ -4136,20 +4136,23 @@ weechat_lua_api_infolist_get (lua_State *L)
name = NULL;
pointer = NULL;
+ arguments = NULL;
n = lua_gettop (lua_current_interpreter);
- if (n < 2)
+ if (n < 3)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("infolist_get");
LUA_RETURN_EMPTY;
}
- name = lua_tostring (lua_current_interpreter, -2);
- pointer = lua_tostring (lua_current_interpreter, -1);
+ name = lua_tostring (lua_current_interpreter, -3);
+ pointer = lua_tostring (lua_current_interpreter, -2);
+ arguments = lua_tostring (lua_current_interpreter, -1);
value = script_ptr2str (weechat_infolist_get ((char *)name,
- script_str2ptr ((char *)pointer)));
+ script_str2ptr ((char *)pointer),
+ (char *)arguments));
LUA_RETURN_STRING_FREE(value);
}