summaryrefslogtreecommitdiffhomepage
path: root/mixutils/mixvm_loop.c
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2002-03-20 01:30:11 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2002-03-20 01:30:11 +0000
commitb349777b348cabfe6a24d0036bf3620651947386 (patch)
tree4d402e996081c86960f20ba6625e90c25c7ded05 /mixutils/mixvm_loop.c
parentea15f81d133178baaeb22ed98b3b04c5e970bfc4 (diff)
downloadmdk-b349777b348cabfe6a24d0036bf3620651947386.tar.gz
mdk-b349777b348cabfe6a24d0036bf3620651947386.tar.bz2
new option -t (--time)
Diffstat (limited to 'mixutils/mixvm_loop.c')
-rw-r--r--mixutils/mixvm_loop.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/mixutils/mixvm_loop.c b/mixutils/mixvm_loop.c
index 74ea8f8..a158427 100644
--- a/mixutils/mixvm_loop.c
+++ b/mixutils/mixvm_loop.c
@@ -1,9 +1,9 @@
/* -*-c-*- -------------- mixvm_loop.c :
* Implementation of mix vm command loop.
* ------------------------------------------------------------------
- * $Id: mixvm_loop.c,v 1.7 2001/09/24 23:27:02 jao Exp $
+ * $Id: mixvm_loop.c,v 1.8 2002/03/20 01:30:11 jao Exp $
* ------------------------------------------------------------------
- * Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ * 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
@@ -127,12 +127,18 @@ mix_vmloop (int argc, char *argv[], gboolean initfile,
/* run a program and exit */
void
-mix_vmrun (const gchar *code_file, gboolean dump)
+mix_vmrun (const gchar *code_file, gboolean dump, gboolean ptime)
{
+ gchar *time_cmd = ptime? g_strdup("stime on") : g_strdup("stime off");
+ gchar *run_cmd = g_strdup("run");
+ gchar *dump_cmd = dump? g_strdup("pall") : NULL;
gboolean result;
init_mixvm_ (code_file, FALSE);
- result = mixvm_cmd_exec (g_strdup ("run"));
- if (result && dump) mixvm_cmd_exec (g_strdup ("pall"));
+ result = mixvm_cmd_exec (time_cmd) && mixvm_cmd_exec (run_cmd);
+ if (result && dump) mixvm_cmd_exec (dump_cmd);
mix_config_delete (config_);
+ g_free(time_cmd);
+ g_free(run_cmd);
+ if (dump_cmd) g_free(dump_cmd);
}