* eval.c (RETURN): Wrap in do{}while(0) in order to make it
[bpt/guile.git] / libguile / init.c
index dacd1ee..5c96be4 100644 (file)
@@ -39,8 +39,6 @@
  * whether to permit this exception to apply to your modifications.
  * If you do not wish that, delete this exception notice.  */
 
-/* Software engineering face-lift by Greg J. Badros, 11-Dec-1999,
-   gjb@cs.washington.edu, http://www.cs.washington.edu/homes/gjb */
 
 \f
 /* Include the headers for just about everything.
 #include "libguile/strports.h"
 #include "libguile/struct.h"
 #include "libguile/symbols.h"
-#include "libguile/tag.h"
 #include "libguile/throw.h"
 #include "libguile/unif.h"
 #include "libguile/values.h"
 #include "libguile/vports.h"
 #include "libguile/weaks.h"
 #include "libguile/guardians.h"
+#include "libguile/extensions.h"
 
 #include "libguile/init.h"
 
@@ -164,7 +162,6 @@ restart_stack (void *base)
   SCM_DFRAME (scm_rootcont) = scm_last_debug_frame = 0;
 #endif
   SCM_BASE (scm_rootcont) = base;
-  scm_continuation_stack_ptr = SCM_MAKINUM (0);
 }
 
 static void
@@ -178,29 +175,17 @@ start_stack (void *base)
 
   scm_exitval = SCM_BOOL_F;    /* vestigial */
 
-#if SCM_DEBUG_DEPRECATED == 0
-  scm_top_level_lookup_closure_var = SCM_BOOL_F;
-  scm_system_transformer = SCM_BOOL_F;
-#endif
-
   scm_root->fluids = scm_make_initial_fluids ();
 
   /* Create an object to hold the root continuation.
    */
   {
-    scm_contregs *contregs = scm_must_malloc (sizeof (scm_contregs),
+    scm_t_contregs *contregs = scm_must_malloc (sizeof (scm_t_contregs),
                                              "continuation");
     contregs->num_stack_items = 0;
     contregs->seq = 0;
     SCM_NEWSMOB (scm_rootcont, scm_tc16_continuation, contregs);
   }
-  /* The root continuation is further initialized by restart_stack. */
-
-  /* Create the look-aside stack for variables that are shared between
-   * captured continuations.
-   */
-  scm_continuation_stack = scm_c_make_vector (512, SCM_UNDEFINED);
-  /* The continuation stack is further initialized by restart_stack. */
 
   /* The remainder of stack initialization is factored out to another
    * function so that if this stack is ever exitted, it can be
@@ -228,7 +213,7 @@ fixconfig (char *s1,char *s2,int s)
 static void
 check_config (void)
 {
-  scm_sizet j;
+  size_t j;
 
   j = HEAP_SEG_SIZE;
   if (HEAP_SEG_SIZE != j)
@@ -278,7 +263,9 @@ stream_body (void *data)
 
 /* exception handler for stream_body.  */
 static SCM
-stream_handler (void *data, SCM tag, SCM throw_args)
+stream_handler (void *data SCM_UNUSED,
+               SCM tag SCM_UNUSED,
+               SCM throw_args SCM_UNUSED)
 {
   return SCM_BOOL_F;
 }
@@ -366,8 +353,6 @@ scm_load_startup_files ()
       /* Load the init.scm file.  */
       if (SCM_NFALSEP (init_path))
        scm_primitive_load (init_path);
-  
-      scm_post_boot_init_modules ();
     }
 }
 
@@ -477,6 +462,8 @@ scm_init_guile_1 (SCM_STACKITEM *base)
   scm_weaks_prehistory ();       /* requires storage */
   scm_init_subr_table ();
   scm_environments_prehistory (); /* requires storage */
+  scm_modules_prehistory ();      /* requires storage */
+  scm_init_variable ();           /* all bindings need variables */
   scm_init_continuations ();
   scm_init_root ();              /* requires continuations */
 #ifdef USE_THREADS
@@ -545,7 +532,6 @@ scm_init_guile_1 (SCM_STACKITEM *base)
   scm_init_struct ();   /* Requires strings */
   scm_init_stacks ();   /* Requires strings, struct */
   scm_init_symbols ();
-  scm_init_tag ();
   scm_init_values ();   /* Requires struct */
   scm_init_load ();     /* Requires strings */
   scm_init_objects (); /* Requires struct */
@@ -555,7 +541,6 @@ scm_init_guile_1 (SCM_STACKITEM *base)
   scm_init_strorder ();
   scm_init_strop ();
   scm_init_throw ();
-  scm_init_variable ();
   scm_init_vectors ();
   scm_init_version ();
   scm_init_weaks ();
@@ -578,7 +563,7 @@ scm_init_guile_1 (SCM_STACKITEM *base)
   scm_init_lang ();
   scm_init_script ();
 
-  scm_init_oop_goops_goopscore_module ();
+  scm_init_goops ();
   
   scm_initialized_p = 1;
 
@@ -589,13 +574,11 @@ scm_init_guile_1 (SCM_STACKITEM *base)
   scm_stack_checking_enabled_p = SCM_STACK_CHECKING_P;
 #endif
 
-  scm_load_startup_files ();
-
-  /* these are located here, not from a deep understanding of the
-     module system, but as a way of avoiding segv and other
-     undesirable side effects that arise from various alternatives.  */
   scm_init_rdelim ();
   scm_init_rw ();
+  scm_init_extensions ();
+
+  scm_load_startup_files ();
 }
 
 /* Record here whether SCM_BOOT_GUILE_1 has already been called.  This