1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 21:36:37 +02:00

Remove "category" for buffers (keep only name).

This commit is contained in:
Sebastien Helleu
2008-09-18 18:44:03 +02:00
parent c3df7da641
commit c572e393e7
81 changed files with 1645 additions and 11842 deletions
+9 -19
View File
@@ -100,7 +100,7 @@ weechat_lua_api_register (lua_State *L)
weechat_gettext ("%s%s: unable to register script "
"\"%s\" (another script already "
"exists with this name)"),
weechat_prefix ("error"), "lua", name);
weechat_prefix ("error"), LUA_PLUGIN_NAME, name);
LUA_RETURN_ERROR;
}
@@ -121,7 +121,7 @@ weechat_lua_api_register (lua_State *L)
weechat_printf (NULL,
weechat_gettext ("%s: registered script \"%s\", "
"version %s (%s)"),
"lua", name, version, description);
LUA_PLUGIN_NAME, name, version, description);
}
else
{
@@ -2092,12 +2092,6 @@ weechat_lua_api_print (lua_State *L)
/* make C compiler happy */
(void) L;
if (!lua_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("print");
LUA_RETURN_ERROR;
}
buffer = NULL;
message = NULL;
@@ -3354,7 +3348,7 @@ weechat_lua_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
static int
weechat_lua_api_buffer_new (lua_State *L)
{
const char *category, *name, *function_input, *function_close;
const char *name, *function_input, *function_close;
char *result;
int n;
@@ -3367,27 +3361,24 @@ weechat_lua_api_buffer_new (lua_State *L)
LUA_RETURN_EMPTY;
}
category = NULL;
name = NULL;
function_input = NULL;
function_close = NULL;
n = lua_gettop (lua_current_interpreter);
if (n < 4)
if (n < 3)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_new");
LUA_RETURN_EMPTY;
}
category = lua_tostring (lua_current_interpreter, -4);
name = lua_tostring (lua_current_interpreter, -3);
function_input = lua_tostring (lua_current_interpreter, -2);
function_close = lua_tostring (lua_current_interpreter, -1);
result = script_ptr2str (script_api_buffer_new (weechat_lua_plugin,
lua_current_script,
category,
name,
&weechat_lua_api_buffer_input_data_cb,
function_input,
@@ -3404,20 +3395,20 @@ weechat_lua_api_buffer_new (lua_State *L)
static int
weechat_lua_api_buffer_search (lua_State *L)
{
const char *category, *name;
const char *plugin, *name;
char *result;
int n;
/* make C compiler happy */
(void) L;
if (!lua_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("buffer_search");
LUA_RETURN_EMPTY;
}
category = NULL;
plugin = NULL;
name = NULL;
n = lua_gettop (lua_current_interpreter);
@@ -3428,11 +3419,10 @@ weechat_lua_api_buffer_search (lua_State *L)
LUA_RETURN_EMPTY;
}
category = lua_tostring (lua_current_interpreter, -2);
plugin = lua_tostring (lua_current_interpreter, -2);
name = lua_tostring (lua_current_interpreter, -1);
result = script_ptr2str (weechat_buffer_search (category,
name));
result = script_ptr2str (weechat_buffer_search (plugin, name));
LUA_RETURN_STRING_FREE(result);
}
+16 -16
View File
@@ -32,7 +32,7 @@
#include "weechat-lua-api.h"
WEECHAT_PLUGIN_NAME("lua");
WEECHAT_PLUGIN_NAME(LUA_PLUGIN_NAME);
WEECHAT_PLUGIN_DESCRIPTION("Lua plugin for WeeChat");
WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>");
WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION);
@@ -96,10 +96,10 @@ weechat_lua_exec (struct t_plugin_script *script,
{
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to run function \"%s\""),
weechat_prefix ("error"), "lua", function);
weechat_prefix ("error"), LUA_PLUGIN_NAME, function);
weechat_printf (NULL,
weechat_gettext ("%s%s: error: %s"),
weechat_prefix ("error"), "lua",
weechat_prefix ("error"), LUA_PLUGIN_NAME,
lua_tostring (lua_current_interpreter, -1));
lua_current_script = old_lua_current_script;
return NULL;
@@ -144,13 +144,13 @@ weechat_lua_load (const char *filename)
{
weechat_printf (NULL,
weechat_gettext ("%s%s: script \"%s\" not found"),
weechat_prefix ("error"), "lua", filename);
weechat_prefix ("error"), LUA_PLUGIN_NAME, filename);
return 0;
}
weechat_printf (NULL,
weechat_gettext ("%s: loading script \"%s\""),
"lua", filename);
LUA_PLUGIN_NAME, filename);
lua_current_script = NULL;
@@ -161,7 +161,7 @@ weechat_lua_load (const char *filename)
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to create new "
"sub-interpreter"),
weechat_prefix ("error"), "lua");
weechat_prefix ("error"), LUA_PLUGIN_NAME);
fclose (fp);
return 0;
}
@@ -188,7 +188,7 @@ weechat_lua_load (const char *filename)
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to redirect stdout "
"and stderr"),
weechat_prefix ("error"), "lua");
weechat_prefix ("error"), LUA_PLUGIN_NAME);
}
lua_current_script_filename = filename;
@@ -197,10 +197,10 @@ weechat_lua_load (const char *filename)
{
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to load file \"%s\""),
weechat_prefix ("error"), "lua", filename);
weechat_prefix ("error"), LUA_PLUGIN_NAME, filename);
weechat_printf (NULL,
weechat_gettext ("%s%s: error: %s"),
weechat_prefix ("error"), "lua",
weechat_prefix ("error"), LUA_PLUGIN_NAME,
lua_tostring (lua_current_interpreter, -1));
lua_close (lua_current_interpreter);
fclose (fp);
@@ -212,10 +212,10 @@ weechat_lua_load (const char *filename)
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to execute file "
"\"%s\""),
weechat_prefix ("error"), "lua", filename);
weechat_prefix ("error"), LUA_PLUGIN_NAME, filename);
weechat_printf (NULL,
weechat_gettext ("%s%s: error: %s"),
weechat_prefix ("error"), "lua",
weechat_prefix ("error"), LUA_PLUGIN_NAME,
lua_tostring (lua_current_interpreter, -1));
lua_close (lua_current_interpreter);
fclose (fp);
@@ -232,7 +232,7 @@ weechat_lua_load (const char *filename)
weechat_printf (NULL,
weechat_gettext ("%s%s: function \"register\" not "
"found (or failed) in file \"%s\""),
weechat_prefix ("error"), "lua", filename);
weechat_prefix ("error"), LUA_PLUGIN_NAME, filename);
lua_close (lua_current_interpreter);
return 0;
}
@@ -268,7 +268,7 @@ weechat_lua_unload (struct t_plugin_script *script)
weechat_printf (NULL,
weechat_gettext ("%s: unloading script \"%s\""),
"lua", script->name);
LUA_PLUGIN_NAME, script->name);
if (script->shutdown_func && script->shutdown_func[0])
{
@@ -302,13 +302,13 @@ weechat_lua_unload_name (const char *name)
weechat_lua_unload (ptr_script);
weechat_printf (NULL,
weechat_gettext ("%s: script \"%s\" unloaded"),
"lua", name);
LUA_PLUGIN_NAME, name);
}
else
{
weechat_printf (NULL,
weechat_gettext ("%s%s: script \"%s\" not loaded"),
weechat_prefix ("error"), "lua", name);
weechat_prefix ("error"), LUA_PLUGIN_NAME, name);
}
}
@@ -401,7 +401,7 @@ weechat_lua_command_cb (void *data, struct t_gui_buffer *buffer,
weechat_printf (NULL,
weechat_gettext ("%s%s: unknown option for "
"command \"%s\""),
weechat_prefix ("error"), "lua", "lua");
weechat_prefix ("error"), LUA_PLUGIN_NAME, "lua");
}
}
+1
View File
@@ -21,6 +21,7 @@
#define __WEECHAT_LUA_H 1
#define weechat_plugin weechat_lua_plugin
#define LUA_PLUGIN_NAME "lua"
extern struct t_weechat_plugin *weechat_lua_plugin;