1 /* General scripting system functionality */
9 #include "bfu/msgbox.h"
10 #include "intl/gettext/libintl.h"
11 #include "main/module.h"
12 #include "scripting/scripting.h"
13 #include "session/session.h"
14 #include "terminal/terminal.h"
15 #include "terminal/window.h"
18 /* Backends dynamic area: */
20 #include "scripting/guile/guile.h"
21 #include "scripting/lua/lua.h"
22 #include "scripting/perl/perl.h"
23 #include "scripting/python/python.h"
24 #include "scripting/ruby/ruby.h"
25 #include "scripting/smjs/smjs.h"
32 /* Error reporting. */
34 #if defined(CONFIG_SCRIPTING_RUBY) || defined(CONFIG_SCRIPTING_SPIDERMONKEY) || defined(CONFIG_SCRIPTING_PYTHON)
36 report_scripting_error(struct module
*module
, struct session
*ses
,
39 struct terminal
*term
;
43 term
= get_default_terminal();
45 usrerror(gettext("[%s error] %s"),
46 gettext(module
->name
), msg
);
52 term
= ses
->tab
->term
;
55 if (!init_string(&string
))
58 add_format_to_string(&string
,
59 _("An error occurred while running a %s script", term
),
60 _(module
->name
, term
));
62 add_format_to_string(&string
, ":\n\n%s", msg
);
64 info_box(term
, MSGBOX_NO_TEXT_INTL
| MSGBOX_FREE_TEXT
,
65 N_("Browser scripting error"), ALIGN_LEFT
, string
.source
);
70 static struct module
*scripting_modules
[] = {
71 #ifdef CONFIG_SCRIPTING_LUA
72 &lua_scripting_module
,
74 #ifdef CONFIG_SCRIPTING_GUILE
75 &guile_scripting_module
,
77 #ifdef CONFIG_SCRIPTING_PERL
78 &perl_scripting_module
,
80 #ifdef CONFIG_SCRIPTING_PYTHON
81 &python_scripting_module
,
83 #ifdef CONFIG_SCRIPTING_RUBY
84 &ruby_scripting_module
,
86 #ifdef CONFIG_SCRIPTING_SPIDERMONKEY
87 &smjs_scripting_module
,
92 struct module scripting_module
= struct_module(
93 /* name: */ N_("Scripting"),
96 /* submodules: */ scripting_modules
,