summaryrefslogtreecommitdiffhomepage
path: root/mixguile/mixguile.c
diff options
context:
space:
mode:
Diffstat (limited to 'mixguile/mixguile.c')
-rw-r--r--mixguile/mixguile.c41
1 files changed, 35 insertions, 6 deletions
diff --git a/mixguile/mixguile.c b/mixguile/mixguile.c
index 478c3d8..52321ca 100644
--- a/mixguile/mixguile.c
+++ b/mixguile/mixguile.c
@@ -1,7 +1,7 @@
/* -*-c-*- -------------- mixguile.c :
* Implementation of the functions declared in mixguile.h
* ------------------------------------------------------------------
- * Last change: Time-stamp: "01/08/21 02:26:10 jao"
+ * Last change: Time-stamp: "01/08/22 01:10:33 jao"
* ------------------------------------------------------------------
* Copyright (C) 2001 Free Software Foundation, Inc.
*
@@ -21,17 +21,16 @@
*
*/
-
+#include "mixguile_cmd_dispatcher.h"
#include "mixguile.h"
-static mixguile_cmd_dispatcher_t *dispatcher_;
+static mixguile_cmd_dispatcher_t *dispatcher_ = NULL;
static main_func_t main_fun_;
/* do local initialisation and enter the user provided main */
static void
real_main_ (int argc, char *argv[])
{
- dispatcher_ = mixguile_cmd_dispatcher_new ();
(*main_fun_)(argc, argv);
}
@@ -47,10 +46,40 @@ mixguile_init (int argc, char *argv[], main_func_t main_fun)
gh_enter (argc, argv, real_main_);
}
+/* enter the guile repl */
+void
+mixguile_enter_repl (int argc, char *argv[])
+{
+ mixguile_cmd_dispatcher_prepare (dispatcher_);
+ gh_repl (argc, argv);
+}
+
+/* set the command dispatcher */
+void
+mixguile_set_cmd_dispatcher (mix_vm_cmd_dispatcher_t *dis)
+{
+ g_return_if_fail (dis != NULL);
+ if (dispatcher_) mixguile_cmd_dispatcher_delete (dispatcher_);
+ dispatcher_ = mixguile_cmd_dispatcher_new (dis);
+ g_assert (dispatcher_);
+}
+
/* access the mixguile comand dispatcher */
-mixguile_cmd_dispatcher_t *
+mix_vm_cmd_dispatcher_t *
mixguile_get_cmd_dispatcher (void)
{
- return dispatcher_;
+ return mixguile_cmd_dispatcher_get_vm_dispatcher (dispatcher_);
+}
+
+/* execute a string or file using the guile interpreter */
+void
+mixguile_interpret_file (const gchar *path)
+{
+ mixguile_cmd_dispatcher_interpret_file (dispatcher_, path);
}
+void
+mixguile_interpret_command (const gchar *command)
+{
+ mixguile_cmd_dispatcher_interpret_command (dispatcher_, command);
+}