]> git.jsancho.org Git - gacela.git/blobdiff - gacela.c
(no commit message)
[gacela.git] / gacela.c
index 343f1ba87a751600b3601b47511be60b8fe2cae9..45c83a114e0770c02a82e4d998d76b199dfe65e2 100644 (file)
--- a/gacela.c
+++ b/gacela.c
@@ -1,33 +1,21 @@
-#include <stdio.h>
-#include <readline/readline.h>
+#include <GL/gl.h>
+#include <libguile.h>
+#include "gacela_SDL.h"
 
-/* Read-Send-Print-Loop */
-void rspl ()
+static void*
+register_functions (void* data)
 {
-  static char *line = (char *)NULL;
-  int exit = 0;
-
-  while (!exit)
-    {
-      if (line)
-       {
-         free (line);
-         line = (char *)NULL;
-       }
-      
-      line = readline ("gacela>");
-
-      if (line && *line)
-       {
-         add_history (line);
-         if (strcmp (line, "(quit)") == 0)
-           exit = 1;
-       }
-    }
+  SDL_register_functions (NULL);
+  return NULL;
 }
 
-int main (int argc, char *argv[])
+int
+main (int argc, char *argv[])
 {
-  rspl ();
-  return 0;
+  scm_with_guile (&register_functions, NULL);
+  scm_init_guile ();
+  scm_c_eval_string ("(set-repl-prompt! \"gacela>\")");
+  scm_c_eval_string ("(use-modules (ice-9 readline))");
+  scm_c_eval_string ("(activate-readline)");
+  scm_shell (argc, argv);
 }