1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-29 03:17:53 -04:00

Delegate ECMAScript submodule initialisation the right way

Replace the ECMAScript module initialisation and de-initialisation
routines that wrapped the SMJS and SEE module initialisation and
de-initialisation routines by having the module system call the SMJS
and SEE routines its own darned self.
This commit is contained in:
Miciah Dashiel Butler Masters 2006-02-26 08:51:36 +00:00 committed by Miciah Dashiel Butler Masters
parent 368504f736
commit 4b3d88dd6e
6 changed files with 14 additions and 42 deletions

View File

@ -62,26 +62,6 @@ static struct option_info ecmascript_options[] = {
NULL_OPTION_INFO,
};
void
ecmascript_init(struct module *module)
{
#ifdef CONFIG_ECMASCRIPT_SEE
see_init();
#else
spidermonkey_init();
#endif
}
void
ecmascript_done(struct module *module)
{
#ifdef CONFIG_ECMASCRIPT_SEE
see_done();
#else
spidermonkey_done();
#endif
}
struct ecmascript_interpreter *
ecmascript_get_interpreter(struct view_state *vs)
{
@ -249,6 +229,6 @@ struct module ecmascript_module = struct_module(
/* events: */ NULL,
/* submodules: */ ecmascript_modules,
/* data: */ NULL,
/* init: */ ecmascript_init,
/* done: */ ecmascript_done
/* init: */ NULL,
/* done: */ NULL
);

View File

@ -68,8 +68,6 @@ int ecmascript_eval_boolback(struct ecmascript_interpreter *interpreter, struct
* follows a link with this synstax. */
void ecmascript_protocol_handler(struct session *ses, struct uri *uri);
void ecmascript_init(struct module *);
void ecmascript_done(struct module *);
void ecmascript_timeout_dialog(struct terminal *term, int max_exec_time);

View File

@ -56,14 +56,14 @@
/* TODO? Are there any which need to be implemented? */
void
see_init(void)
static void
see_init(struct module *xxx)
{
init_intern_strings();
}
void
see_done(void)
static void
see_done(struct module *xxx)
{
}
@ -183,6 +183,6 @@ struct module see_module = struct_module(
/* events: */ NULL,
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* init: */ see_init,
/* done: */ see_done
);

View File

@ -4,9 +4,6 @@
struct ecmascript_interpreter;
struct string;
void see_init();
void see_done();
void *see_get_interpreter(struct ecmascript_interpreter *interpreter);
void see_put_interpreter(struct ecmascript_interpreter *interpreter);

View File

@ -134,14 +134,14 @@ setup_safeguard(struct ecmascript_interpreter *interpreter,
}
void
spidermonkey_init(void)
static void
spidermonkey_init(struct module *xxx)
{
jsrt = JS_NewRuntime(0x400000UL);
}
void
spidermonkey_done(void)
static void
spidermonkey_done(struct module *xxx)
{
JS_DestroyRuntime(jsrt);
JS_ShutDown();
@ -312,6 +312,6 @@ struct module spidermonkey_module = struct_module(
/* events: */ NULL,
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* init: */ spidermonkey_init,
/* done: */ spidermonkey_done
);

View File

@ -4,9 +4,6 @@
struct ecmascript_interpreter;
struct string;
void spidermonkey_init();
void spidermonkey_done();
void *spidermonkey_get_interpreter(struct ecmascript_interpreter *interpreter);
void spidermonkey_put_interpreter(struct ecmascript_interpreter *interpreter);