1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

Allow script functions "prefix" and "color" when script is not yet registered with "register"

This commit is contained in:
Sebastien Helleu
2010-10-10 10:04:37 +02:00
parent 85f6444fef
commit e2f58820fe
5 changed files with 1 additions and 67 deletions
-12
View File
@@ -3044,12 +3044,6 @@ weechat_lua_api_prefix (lua_State *L)
/* make C compiler happy */
(void) L;
if (!lua_current_script || !lua_current_script->name)
{
WEECHAT_SCRIPT_MSG_NOT_INIT(LUA_CURRENT_SCRIPT_NAME, "prefix");
LUA_RETURN_EMPTY;
}
prefix = NULL;
n = lua_gettop (lua_current_interpreter);
@@ -3080,12 +3074,6 @@ weechat_lua_api_color (lua_State *L)
/* make C compiler happy */
(void) L;
if (!lua_current_script || !lua_current_script->name)
{
WEECHAT_SCRIPT_MSG_NOT_INIT(LUA_CURRENT_SCRIPT_NAME, "color");
LUA_RETURN_EMPTY;
}
color = NULL;
n = lua_gettop (lua_current_interpreter);
@@ -2556,12 +2556,6 @@ XS (XS_weechat_api_prefix)
/* make C compiler happy */
(void) cv;
if (!perl_current_script || !perl_current_script->name)
{
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "prefix");
PERL_RETURN_EMPTY;
}
if (items < 1)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGS(PERL_CURRENT_SCRIPT_NAME, "prefix");
@@ -2585,12 +2579,6 @@ XS (XS_weechat_api_color)
/* make C compiler happy */
(void) cv;
if (!perl_current_script || !perl_current_script->name)
{
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "color");
PERL_RETURN_EMPTY;
}
if (items < 1)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGS(PERL_CURRENT_SCRIPT_NAME, "color");
@@ -2702,12 +2702,6 @@ weechat_python_api_prefix (PyObject *self, PyObject *args)
/* make C compiler happy */
(void) self;
if (!python_current_script || !python_current_script->name)
{
WEECHAT_SCRIPT_MSG_NOT_INIT(PYTHON_CURRENT_SCRIPT_NAME, "prefix");
PYTHON_RETURN_EMPTY;
}
prefix = NULL;
if (!PyArg_ParseTuple (args, "s", &prefix))
@@ -2734,12 +2728,6 @@ weechat_python_api_color (PyObject *self, PyObject *args)
/* make C compiler happy */
(void) self;
if (!python_current_script || !python_current_script->name)
{
WEECHAT_SCRIPT_MSG_NOT_INIT(PYTHON_CURRENT_SCRIPT_NAME, "color");
PYTHON_RETURN_EMPTY;
}
color = NULL;
if (!PyArg_ParseTuple (args, "s", &color))
@@ -3110,12 +3110,6 @@ weechat_ruby_api_prefix (VALUE class, VALUE prefix)
/* make C compiler happy */
(void) class;
if (!ruby_current_script || !ruby_current_script->name)
{
WEECHAT_SCRIPT_MSG_NOT_INIT(RUBY_CURRENT_SCRIPT_NAME, "prefix");
RUBY_RETURN_EMPTY;
}
c_prefix = NULL;
if (NIL_P (prefix))
@@ -3146,12 +3140,6 @@ weechat_ruby_api_color (VALUE class, VALUE color)
/* make C compiler happy */
(void) class;
if (!ruby_current_script || !ruby_current_script->name)
{
WEECHAT_SCRIPT_MSG_NOT_INIT(RUBY_CURRENT_SCRIPT_NAME, "color");
RUBY_RETURN_EMPTY;
}
c_color = NULL;
if (NIL_P (color))
+1 -19
View File
@@ -2924,12 +2924,6 @@ weechat_tcl_api_prefix (ClientData clientData, Tcl_Interp *interp,
/* make C compiler happy */
(void) clientData;
if (!tcl_current_script || !tcl_current_script->name)
{
WEECHAT_SCRIPT_MSG_NOT_INIT(TCL_CURRENT_SCRIPT_NAME, "prefix");
TCL_RETURN_EMPTY;
}
if (objc < 2)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGS(TCL_CURRENT_SCRIPT_NAME, "prefix");
@@ -2956,12 +2950,6 @@ weechat_tcl_api_color (ClientData clientData, Tcl_Interp *interp,
/* make C compiler happy */
(void) clientData;
if (!tcl_current_script || !tcl_current_script->name)
{
WEECHAT_SCRIPT_MSG_NOT_INIT(TCL_CURRENT_SCRIPT_NAME, "color");
TCL_RETURN_EMPTY;
}
if (objc < 2)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGS(TCL_CURRENT_SCRIPT_NAME, "color");
@@ -2984,16 +2972,10 @@ weechat_tcl_api_print (ClientData clientData, Tcl_Interp *interp,
Tcl_Obj* objp;
char *buffer, *message;
int i;
/* make C compiler happy */
(void) clientData;
if (!tcl_current_script || !tcl_current_script->name)
{
WEECHAT_SCRIPT_MSG_NOT_INIT(TCL_CURRENT_SCRIPT_NAME, "print");
TCL_RETURN_ERROR;
}
if (objc < 3)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGS(TCL_CURRENT_SCRIPT_NAME, "print");