diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2002-03-20 01:30:11 +0000 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2002-03-20 01:30:11 +0000 |
commit | e00e6ee269ce017c7a625d2ddd9a877e77ccd87e (patch) | |
tree | 69edd0ac635eeb330a5a397688009c6c889b6e6a /mixutils/mixvm_loop.c | |
parent | 2900968e629400cded8c2b0730128c957f73c9ea (diff) | |
download | mdk-e00e6ee269ce017c7a625d2ddd9a877e77ccd87e.tar.gz mdk-e00e6ee269ce017c7a625d2ddd9a877e77ccd87e.tar.bz2 |
new option -t (--time)
Diffstat (limited to 'mixutils/mixvm_loop.c')
-rw-r--r-- | mixutils/mixvm_loop.c | 16 |
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); } |