36 |
|
|
37 |
t_plugin_script *perl_scripts = NULL; |
t_plugin_script *perl_scripts = NULL; |
38 |
t_plugin_script *perl_current_script = NULL; |
t_plugin_script *perl_current_script = NULL; |
39 |
|
char *perl_current_script_filename = NULL; |
40 |
|
|
41 |
extern void boot_DynaLoader (pTHX_ CV* cv); |
extern void boot_DynaLoader (pTHX_ CV* cv); |
42 |
|
|
226 |
/* register script */ |
/* register script */ |
227 |
perl_current_script = weechat_script_add (perl_plugin, |
perl_current_script = weechat_script_add (perl_plugin, |
228 |
&perl_scripts, |
&perl_scripts, |
229 |
"", |
(perl_current_script_filename) ? |
230 |
|
perl_current_script_filename : "", |
231 |
name, version, shutdown_func, |
name, version, shutdown_func, |
232 |
description); |
description); |
233 |
if (perl_current_script) |
if (perl_current_script) |
861 |
return 0; |
return 0; |
862 |
} |
} |
863 |
|
|
864 |
|
perl_current_script_filename = strdup (filename); |
865 |
|
|
866 |
PERL_SET_CONTEXT (perl_current_interpreter); |
PERL_SET_CONTEXT (perl_current_interpreter); |
867 |
perl_construct (perl_current_interpreter); |
perl_construct (perl_current_interpreter); |
868 |
tempscript.interpreter = (PerlInterpreter *) perl_current_interpreter; |
tempscript.interpreter = (PerlInterpreter *) perl_current_interpreter; |
870 |
|
|
871 |
eval_pv (weechat_perl_code, TRUE); |
eval_pv (weechat_perl_code, TRUE); |
872 |
eval = weechat_perl_exec (plugin, &tempscript, "weechat_perl_load_eval_file", filename, ""); |
eval = weechat_perl_exec (plugin, &tempscript, "weechat_perl_load_eval_file", filename, ""); |
873 |
|
|
874 |
|
free (perl_current_script_filename); |
875 |
|
|
876 |
#endif |
#endif |
877 |
|
|
878 |
if ( eval != 0) |
if ( eval != 0) |
907 |
#endif |
#endif |
908 |
if (perl_current_script != NULL) |
if (perl_current_script != NULL) |
909 |
weechat_script_remove (plugin, &perl_scripts, perl_current_script); |
weechat_script_remove (plugin, &perl_scripts, perl_current_script); |
910 |
|
|
911 |
return 0; |
return 0; |
912 |
} |
} |
913 |
|
|
914 |
if (perl_current_script == NULL) { |
if (perl_current_script == NULL) { |
915 |
plugin->printf_server (plugin, |
plugin->printf_server (plugin, |
916 |
"Perl error: function \"register\" not found " |
"Perl error: function \"register\" not found " |