Home | History | Annotate | Download | only in guile
      1 /* -----------------------------------------------------------------------------
      2  * guilemain.i
      3  *
      4  * The main functions for a user augmented guile
      5  * version that can handle wrapped calls as generated by SWIG
      6  * ----------------------------------------------------------------------------- */
      7 
      8 %{
      9 #include <libguile.h>
     10 
     11 #ifdef __cplusplus
     12 extern "C" {
     13 #endif
     14 
     15 /* Debugger interface (don't change the order of the following lines) */
     16 #define GDB_TYPE SCM
     17 #include <libguile/gdb_interface.h>
     18 GDB_INTERFACE;
     19 
     20 static void
     21 inner_main(void *closure, int argc, char **argv)
     22 {
     23 #ifdef SWIGINIT
     24   SWIGINIT
     25 #else
     26   SWIG_init();			/* SWIG init function */
     27 #endif
     28   scm_shell(argc, argv);	/* scheme interpreter */
     29   /* never reached: scm_shell will perform an exit */
     30 }
     31 
     32 #ifdef __cplusplus
     33 }
     34 #endif
     35 
     36 int
     37 main(int argc, char **argv)
     38 {
     39   /* put any default initialisation code here: e.g. exit handlers */
     40   scm_boot_guile(argc, argv, inner_main, 0); /* make a stack entry for the
     41 						garbage collector */
     42   return 0; /* never reached, but avoids a warning */
     43 }
     44 %}
     45