summaryrefslogtreecommitdiffhomepage
path: root/mixutils
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2002-04-08 00:32:32 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2002-04-08 00:32:32 +0000
commite9a299e61c3b52905bdd0277374e49011d1b2b5e (patch)
treebe049bf2a3486deae63da14940ef6d097ed5c782 /mixutils
parent5047d9e9e0471fad201a9b49dee0d07895e93cb9 (diff)
downloadmdk-e9a299e61c3b52905bdd0277374e49011d1b2b5e.tar.gz
mdk-e9a299e61c3b52905bdd0277374e49011d1b2b5e.tar.bz2
new command: prompt
Diffstat (limited to 'mixutils')
-rw-r--r--mixutils/mixvm_command.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/mixutils/mixvm_command.c b/mixutils/mixvm_command.c
index 0818abe..f85550a 100644
--- a/mixutils/mixvm_command.c
+++ b/mixutils/mixvm_command.c
@@ -1,7 +1,9 @@
/* -*-c-*- -------------- mixvm_command.c :
* Implementation of the functions declared in mixvm_command.h
* ------------------------------------------------------------------
- * Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ * $Id: mixvm_command.c,v 1.8 2002/04/08 00:32:32 jao Exp $
+ * ------------------------------------------------------------------
+ * Copyright (C) 2000, 2001, 2002 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
@@ -60,6 +62,7 @@ try_guile_ (char *line)
# define try_guile_(ignored) FALSE
#endif /* MAKE_GUILE */
+#include "mixvm_loop.h"
#include "mixvm_command.h"
/* mixvm dispatcher */
@@ -72,8 +75,10 @@ static gboolean cmd_##name (mix_vm_cmd_dispatcher_t *dis, const char *arg)
DEC_FUN (shell_);
DEC_FUN (quit_);
+DEC_FUN (prompt_);
mix_vm_command_info_t commands[] = {
+ { "prompt", cmd_prompt_, N_("Set command prompt"), "prompt PROMPT" },
{ "shell", cmd_shell_, N_("Execute shell command"), "shell COMMAND" },
{ "quit", cmd_quit_, N_("Quit the program"), "quit" },
{ (char *)NULL, (Function *)NULL, (char *)NULL }
@@ -167,7 +172,6 @@ cmd_quit_ (mix_vm_cmd_dispatcher_t *dis, const char *arg)
return FALSE;
}
-
static int
cmd_shell_ (mix_vm_cmd_dispatcher_t *dis, const char *arg)
{
@@ -175,7 +179,13 @@ cmd_shell_ (mix_vm_cmd_dispatcher_t *dis, const char *arg)
return TRUE;
}
-
+static int
+cmd_prompt_ (mix_vm_cmd_dispatcher_t *dis, const char *arg)
+{
+ if (arg && strlen (arg)) mix_vmloop_set_prompt (arg);
+ return TRUE;
+}
+
/* external interface */
static void