From 1f371787487c6cd1c36726bd70090cc712e9e2c7 Mon Sep 17 00:00:00 2001 From: jsancho Date: Mon, 30 May 2011 22:56:40 +0000 Subject: [PATCH] --- src/gacela.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/gacela.c b/src/gacela.c index 14a318f..49e83a7 100644 --- a/src/gacela.c +++ b/src/gacela.c @@ -22,11 +22,20 @@ #include "gacela_FTGL.h" static void* -register_functions (void* data) +init_gacela (void *data, int argc, char **argv) { + // Guile configuration + scm_c_eval_string ("(set-repl-prompt! \"gacela>\")"); + scm_c_eval_string ("(use-modules (ice-9 readline))"); + scm_c_eval_string ("(activate-readline)"); + scm_c_eval_string ("(use-modules (ice-9 optargs))"); + scm_c_eval_string ("(use-modules (ice-9 receive))"); + + // Bindings for C functions and structs SDL_register_functions (NULL); GL_register_functions (NULL); FTGL_register_functions (NULL); + return NULL; } @@ -54,13 +63,6 @@ load_scheme_files (char *path) int main (int argc, char *argv[]) { - scm_with_guile (®ister_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_c_eval_string ("(use-modules (ice-9 optargs))"); - scm_c_eval_string ("(use-modules (ice-9 receive))"); - load_scheme_files (dirname (argv[0])); + scm_with_guile (&init_gacela, NULL); scm_shell (argc, argv); } -- 2.39.5