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:
parent
e72780d4d6
commit
3005cad5c3
@ -21,6 +21,7 @@
|
|||||||
#include "module.h"
|
#include "module.h"
|
||||||
#include "modules.h"
|
#include "modules.h"
|
||||||
#include "signals.h"
|
#include "signals.h"
|
||||||
|
#include "core.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
@ -156,6 +157,13 @@ char *perl_get_use_list(void)
|
|||||||
|
|
||||||
str = g_string_new(NULL);
|
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)
|
for (tmp = use_protocols; tmp != NULL; tmp = tmp->next)
|
||||||
g_string_sprintfa(str, "use Irssi::%s;", (char *) tmp->data);
|
g_string_sprintfa(str, "use Irssi::%s;", (char *) tmp->data);
|
||||||
|
|
||||||
|
@ -94,12 +94,12 @@ static void irssi_perl_start(void)
|
|||||||
|
|
||||||
perl_parse(my_perl, xs_init, 3, args, NULL);
|
perl_parse(my_perl, xs_init, 3, args, NULL);
|
||||||
|
|
||||||
use_code = *PERL_LIB_DIR == '\0' ? "" :
|
use_code = perl_get_use_list();
|
||||||
"use lib \""PERL_LIB_DIR"\";";
|
|
||||||
|
|
||||||
code = g_strdup_printf(eval_file_code, use_code);
|
code = g_strdup_printf(eval_file_code, use_code);
|
||||||
perl_eval_pv(code, TRUE);
|
perl_eval_pv(code, TRUE);
|
||||||
g_free(code);
|
|
||||||
|
g_free(code);
|
||||||
|
g_free(use_code);
|
||||||
|
|
||||||
perl_common_init();
|
perl_common_init();
|
||||||
}
|
}
|
||||||
@ -249,7 +249,7 @@ static void cmd_perl(const char *data)
|
|||||||
code = g_string_new(NULL);
|
code = g_string_new(NULL);
|
||||||
|
|
||||||
uses = perl_get_use_list();
|
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);
|
sv = perl_eval_pv(code->str, TRUE);
|
||||||
perl_call_sv(sv, G_VOID|G_NOARGS|G_EVAL|G_DISCARD);
|
perl_call_sv(sv, G_VOID|G_NOARGS|G_EVAL|G_DISCARD);
|
||||||
|
Loading…
Reference in New Issue
Block a user