summaryrefslogtreecommitdiffhomepage
path: root/mixguile/mixguile_cmd_dispatcher.c
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-10-02 00:51:40 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-10-02 00:51:40 +0200
commit0f4a66511d4d84d28f365ad301628cf8bfbb9024 (patch)
treea6150b015c0d88bee750b7b4915a3b5797d4d8d7 /mixguile/mixguile_cmd_dispatcher.c
parentd0a07491e459c33273a2efeaf403851c5df4e39d (diff)
downloadmdk-0f4a66511d4d84d28f365ad301628cf8bfbb9024.tar.gz
mdk-0f4a66511d4d84d28f365ad301628cf8bfbb9024.tar.bz2
Guile: not using the deprecated gh_* interface.
Diffstat (limited to 'mixguile/mixguile_cmd_dispatcher.c')
-rw-r--r--mixguile/mixguile_cmd_dispatcher.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/mixguile/mixguile_cmd_dispatcher.c b/mixguile/mixguile_cmd_dispatcher.c
index e5b9cce..b302f39 100644
--- a/mixguile/mixguile_cmd_dispatcher.c
+++ b/mixguile/mixguile_cmd_dispatcher.c
@@ -1,7 +1,7 @@
/* -*-c-*- -------------- mixguile_cmd_dispatcher.c :
* Implementation of the functions declared in mixguile_cmd_dispatcher.h
* ------------------------------------------------------------------
- * Copyright (C) 2001, 2007 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2007, 2009 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -32,23 +32,38 @@
#define SCMF_CMD "scmf"
/*local commands */
+
+static SCM eval_ (void *code)
+{
+ scm_c_eval_string ((char *)code);
+ return SCM_BOOL_T;
+}
+
static gboolean
cmd_scm_ (mix_vm_cmd_dispatcher_t *dis, const gchar *arg)
{
- (void) gh_eval_str_with_catch ((char *)arg, scm_handle_by_message_noexit);
+ scm_c_catch (SCM_BOOL_T, eval_, (void*) arg,
+ scm_handle_by_message_noexit, NULL, NULL, NULL);
return TRUE;
}
+static SCM load_ (void *path)
+{
+ scm_c_primitive_load ((char *)path);
+ return SCM_BOOL_T;
+}
+
static gboolean
cmd_scmf_ (mix_vm_cmd_dispatcher_t *dis, const gchar *arg)
{
- (void) gh_eval_file_with_catch ((char *)arg, scm_handle_by_message_noexit);
+ scm_c_catch (SCM_BOOL_T, load_, (void*) arg,
+ scm_handle_by_message_noexit, NULL, NULL, NULL);
return TRUE;
}
static mix_vm_command_info_t commands_[] = {
{ SCM_CMD, cmd_scm_, N_("Eval Scheme command using Guile"), "scm COMMAND"},
- { SCMF_CMD, cmd_scmf_, N_("Eval Scheme file using Guile"), "scm PATH"},
+ { SCMF_CMD, cmd_scmf_, N_("Eval Scheme file using Guile"), "scmf PATH"},
{NULL}
};
@@ -82,7 +97,6 @@ mixguile_cmd_dispatcher_new (mix_vm_cmd_dispatcher_t *dis)
return result;
}
-
void
mixguile_cmd_dispatcher_delete (mixguile_cmd_dispatcher_t *dis)
{