1 /* General scripting system functionality */
9 #include "intl/gettext/libintl.h"
10 #include "main/module.h"
11 #include "scripting/scripting.h"
12 #include "session/session.h"
13 #include "terminal/terminal.h"
14 #include "terminal/window.h"
17 /* Backends dynamic area: */
19 #include "scripting/guile/guile.h"
20 #include "scripting/lua/lua.h"
21 #include "scripting/perl/perl.h"
22 #include "scripting/python/python.h"
23 #include "scripting/ruby/ruby.h"
24 #include "scripting/smjs/smjs.h"
27 /* Error reporting. */
29 #if defined(CONFIG_RUBY) || defined(CONFIG_SEE) || defined(CONFIG_SM_SCRIPTING)
31 report_scripting_error(struct module
*module
, struct session
*ses
,
34 struct terminal
*term
;
38 if (list_empty(terminals
)) {
39 usrerror("[%s error] %s", module
->name
, msg
);
43 term
= terminals
.next
;
46 term
= ses
->tab
->term
;
49 if (!init_string(&string
))
52 add_format_to_string(&string
,
53 _("An error occurred while running a %s script", term
),
56 add_format_to_string(&string
, ":\n\n%s", msg
);
58 info_box(term
, MSGBOX_NO_TEXT_INTL
| MSGBOX_FREE_TEXT
,
59 N_("Browser scripting error"), ALIGN_LEFT
, string
.source
);
64 static struct module
*scripting_modules
[] = {
66 &lua_scripting_module
,
69 &guile_scripting_module
,
72 &perl_scripting_module
,
75 &python_scripting_module
,
78 &ruby_scripting_module
,
80 #ifdef CONFIG_SM_SCRIPTING
81 &smjs_scripting_module
,
86 struct module scripting_module
= struct_module(
87 /* name: */ N_("Scripting"),
90 /* submodules: */ scripting_modules
,