1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

use Irssi; use Irssi::Irc and use Irssi::UI are now automatically called so

you won't need to add those to scripts.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1603 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-06-30 11:53:03 +00:00 committed by cras
parent e72780d4d6
commit 3005cad5c3
2 changed files with 13 additions and 5 deletions

View File

@ -21,6 +21,7 @@
#include "module.h"
#include "modules.h"
#include "signals.h"
#include "core.h"
#include "misc.h"
#include "settings.h"
@ -156,6 +157,13 @@ char *perl_get_use_list(void)
str = g_string_new(NULL);
if (*PERL_LIB_DIR != '\0')
g_string_append(str, "use lib \""PERL_LIB_DIR"\";");
g_string_append(str, "use Irssi;");
if (irssi_gui != IRSSI_GUI_NONE)
g_string_append(str, "use Irssi::UI;");
for (tmp = use_protocols; tmp != NULL; tmp = tmp->next)
g_string_sprintfa(str, "use Irssi::%s;", (char *) tmp->data);

View File

@ -94,12 +94,12 @@ static void irssi_perl_start(void)
perl_parse(my_perl, xs_init, 3, args, NULL);
use_code = *PERL_LIB_DIR == '\0' ? "" :
"use lib \""PERL_LIB_DIR"\";";
use_code = perl_get_use_list();
code = g_strdup_printf(eval_file_code, use_code);
perl_eval_pv(code, TRUE);
g_free(code);
g_free(code);
g_free(use_code);
perl_common_init();
}
@ -249,7 +249,7 @@ static void cmd_perl(const char *data)
code = g_string_new(NULL);
uses = perl_get_use_list();
g_string_sprintf(code, "sub { use Irssi;%s\n%s }", uses, data);
g_string_sprintf(code, "sub { %s\n%s }", uses, data);
sv = perl_eval_pv(code->str, TRUE);
perl_call_sv(sv, G_VOID|G_NOARGS|G_EVAL|G_DISCARD);