mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
* init.c (scm_boot_guile): Don't call scm_init_rgx; it's a plugin,
and should be called by the final client. * init.h (scm_start_stack, scm_restart_stack): Use PROTO; eliminate all the __STDC__ conditionals. (scm_boot_guile): Add declaration. * init.c (scm_start_stack, scm_restart_stack, scm_boot_guile): Remove __STDC__ conditionals around function definitions; the declarations in init.h will provide the same information, more usefully. * init.c (scm_boot_guile): Add init_func argument; call (*init_func) instead of calling scm_appinit; it's ucky to hard-code names for the user's procedures. * init.h (scm_boot_guile): Adjust declaration.
This commit is contained in:
parent
ac335fa89d
commit
47b44240b9
1 changed files with 10 additions and 20 deletions
|
@ -51,17 +51,12 @@
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
void
|
||||
scm_start_stack (void * base, FILE * in, FILE * out, FILE * err)
|
||||
#else
|
||||
void
|
||||
scm_start_stack (base, in, out, err)
|
||||
void * base;
|
||||
FILE * in;
|
||||
FILE * out;
|
||||
FILE * err;
|
||||
#endif
|
||||
{
|
||||
struct scm_port_table * pt;
|
||||
|
||||
|
@ -148,14 +143,9 @@ scm_start_stack (base, in, out, err)
|
|||
}
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
void
|
||||
scm_restart_stack (void * base)
|
||||
#else
|
||||
void
|
||||
scm_restart_stack (base)
|
||||
void * base;
|
||||
#endif
|
||||
{
|
||||
scm_dynwinds = SCM_EOL;
|
||||
SCM_DYNENV (scm_rootcont) = SCM_EOL;
|
||||
|
@ -235,7 +225,7 @@ typedef long setjmp_type;
|
|||
* argc and argv are made the return values of program-arguments.
|
||||
*
|
||||
* in, out, and err, if not NULL, become the standard ports.
|
||||
* If NULL is passed, your "scm_appinit" should set up the
|
||||
* If NULL is passed, your "initfunc" should set up the
|
||||
* standard ports.
|
||||
*
|
||||
* boot_cmd is a string containing a Scheme expression to evaluate
|
||||
|
@ -248,23 +238,20 @@ typedef long setjmp_type;
|
|||
* scm_boot_ok - evaluation concluded normally
|
||||
* scm_boot_error - evaluation concluded with a Scheme error
|
||||
* scm_boot_emem - allocation error mallocing *result
|
||||
* scm_boot_ereenter - scm_boot_guile was called re-entrantly, which is prohibited.
|
||||
* scm_boot_ereenter - scm_boot_guile was called re-entrantly, which is
|
||||
* prohibited.
|
||||
*/
|
||||
|
||||
#ifdef __STDC__
|
||||
int
|
||||
scm_boot_guile (char ** result, int argc, char ** argv, FILE * in, FILE * out, FILE * err, char * boot_cmd)
|
||||
#else
|
||||
int
|
||||
scm_boot_guile (result, argc, argv, in, out, err, boot_cmd)
|
||||
scm_boot_guile (result, argc, argv, in, out, err, init_func, boot_cmd)
|
||||
char ** result;
|
||||
int argc;
|
||||
char ** argv;
|
||||
FILE * in;
|
||||
FILE * out;
|
||||
FILE * err;
|
||||
void (*init_func) ();
|
||||
char * boot_cmd;
|
||||
#endif
|
||||
{
|
||||
static int initialized = 0;
|
||||
static int live = 0;
|
||||
|
@ -323,7 +310,6 @@ scm_boot_guile (result, argc, argv, in, out, err, boot_cmd)
|
|||
scm_init_posix ();
|
||||
scm_init_procs ();
|
||||
scm_init_procprop ();
|
||||
scm_init_rgx ();
|
||||
scm_init_scmsigs ();
|
||||
scm_init_socket ();
|
||||
scm_init_stackchk ();
|
||||
|
@ -349,7 +335,6 @@ scm_boot_guile (result, argc, argv, in, out, err, boot_cmd)
|
|||
scm_init_ramap ();
|
||||
scm_init_unif ();
|
||||
scm_init_simpos ();
|
||||
scm_appinit ();
|
||||
scm_progargs = scm_makfromstrs (argc, argv);
|
||||
initialized = 1;
|
||||
}
|
||||
|
@ -369,6 +354,11 @@ scm_boot_guile (result, argc, argv, in, out, err, boot_cmd)
|
|||
SCM last;
|
||||
scm_init_signals ();
|
||||
|
||||
/* Call the initialization function passed in by the user, if
|
||||
present. */
|
||||
if (init_func) (*init_func) ();
|
||||
|
||||
/* Evaluate boot_cmd string. */
|
||||
{
|
||||
SCM p;
|
||||
SCM form;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue