diff options
author | Jim Blandy <jimb@red-bean.com> | 1996-10-23 02:14:52 +0000 |
---|---|---|
committer | Jim Blandy <jimb@red-bean.com> | 1996-10-23 02:14:52 +0000 |
commit | 2941efc5d10cca9595a60e4aa89e3c91181c14f6 (patch) | |
tree | a159831d51b05bc1ebf82cd905e3e0d976cf8d84 | |
parent | 1cdaaafb7320e922ff2510c2f7bba8b49a220818 (diff) | |
download | guile-2941efc5d10cca9595a60e4aa89e3c91181c14f6.tar.gz |
* init.c: (scm_boot_guile, scm_boot_guile_1): New, simplified
initialization procedure.
- Delete in, out, err arguments; there are other perfectly good
ways to override these when desired.
- Delete result argument; this function shouldn't ever return.
- Rename init_func argument to main_func, for less confusion.
- Delete boot_cmd argument; main_func is more general.
-Add 'closure' argument, to help people pass data to main_func
without resorting to global variables.
- Abort if reentered; don't bother returning an error code.
- Call scm_init_standard_ports to set up the default/current
standard ports; no need to pass them to scm_start_stack.
- Remove code to evaluate the boot_cmd, and start the repl; let
the user do something like that in main_func if they want.
- Remove code to package up a return value; main_func can do any
of that as needed.
- Call exit (0), instead of returning.
(scm_start_stack): Don't initialize the I/O ports here; that's
weird. Delete in, out, err arguments. Move guts to
scm_init_standard_ports, scm_stdio_to_port.
(scm_init_standard_ports): New function, to set up current and
default standard ports.
(scm_start_stack, scm_restart_stack): Make these static.
* init.h (scm_boot_guile): Adjust declaration.
(scm_start_stack, scm_restart_stack): Remove externally
visible declarations for these.
(enum scm_boot_status): Removed; now scm_boot_guile never returns.
-rw-r--r-- | libguile/init.h | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/libguile/init.h b/libguile/init.h index 083259648..97fb5e182 100644 --- a/libguile/init.h +++ b/libguile/init.h @@ -47,24 +47,10 @@ #include "libguile/__scm.h" - -enum scm_boot_status -{ - scm_boot_ok = 0, - scm_boot_error, - scm_boot_emem, - scm_boot_ereenter -}; - - - -extern void scm_start_stack SCM_P ((void *base, - FILE *in, FILE *out, FILE *err)); -extern void scm_restart_stack SCM_P ((void * base)); -extern int scm_boot_guile SCM_P ((char **result, - int argc, char **argv, - FILE *in, FILE *out, FILE *err, - void (*init_func) (), - char *boot_cmd)); +extern void scm_boot_guile SCM_P ((int argc, char **argv, + void (*main_func) (void *closure, + int argc, + char **argv), + void *closure)); #endif /* INITH */ |