#include <stdio.h>

#include <gh.h>

#include "c_builtins.h"

void main_prog(int argc, char *argv[]);

main(int argc, char *argv[])
{
  printf ("loading Guile .. please wait\n");
  gh_enter(argc, argv, main_prog);
}

void main_prog(int argc, char *argv[])
{
  /* gh_startup();		/* no longer needed in guile 1.2? */

  /* now try to define some new builtins, coded in C, so that they are
     available in Scheme. */

  gh_new_procedure1_0("c-random", c_rand);
  gh_new_procedure0_0("c-randomize", c_srand);

  /* execute a Scheme file */

  printf ("running foo.scm ..\n");
  printf ("--------------------------------------------------------\n");
  gh_eval_file ("foo.scm");

  printf ("\n--------------------------------------------------------\n");
  printf ("done\n");

  /* done */

  exit(0);
}
