summaryrefslogtreecommitdiffhomepage
path: root/mixutils/mixvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'mixutils/mixvm.c')
-rw-r--r--mixutils/mixvm.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/mixutils/mixvm.c b/mixutils/mixvm.c
index 8c02095..4cb589f 100644
--- a/mixutils/mixvm.c
+++ b/mixutils/mixvm.c
@@ -1,9 +1,9 @@
/* -*-c-*- -------------- mixvm.c :
* Main function for mixvm, the mix vm simulator
* ------------------------------------------------------------------
- * $Id: mixvm.c,v 1.6 2001/09/28 23:10:45 jao Exp $
+ * $Id: mixvm.c,v 1.7 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
@@ -41,7 +41,7 @@ mix_vmloop (int argc, char *argv[], gboolean initfile,
const gchar *code_file, gboolean use_emacs);
extern void
-mix_vmrun (const gchar *code_file, gboolean dump);
+mix_vmrun (const gchar *code_file, gboolean dump, gboolean ptime);
enum {
VER_OPT = 'v',
@@ -49,11 +49,12 @@ enum {
USAGE_OPT = 'u',
RUN_OPT = 'r',
DUMP_OPT = 'd',
+ TIME_OPT = 't',
EMACS_OPT = 'e', /* used by mixvm-gud only */
NOINIT_OPT = 'q'
};
-static const char *options_ = "vhurd"; /* no short opt for --emacs */
+static const char *options_ = "vhurdt"; /* no short opt for --emacs */
static struct option long_options_[] =
{
@@ -62,6 +63,7 @@ static struct option long_options_[] =
{"usage", no_argument, 0, USAGE_OPT},
{"run", required_argument, 0, RUN_OPT},
{"dump", no_argument, 0, DUMP_OPT},
+ {"time", no_argument, 0, TIME_OPT},
/* pek: yo! */
{"emacs", no_argument, 0, EMACS_OPT},
{"noinit", no_argument, 0, NOINIT_OPT},
@@ -69,7 +71,8 @@ static struct option long_options_[] =
};
static const gchar *USAGE_ =
-N_("Usage: %s [-vhurdq] [--version] [--help] [--noinit] [--usage] [--run] [--dump] [MIX_FILE]\n");
+N_("Usage: %s [-vhurdqt] [--version] [--help] [--noinit] [--usage]"
+ "\n\t[--run] [--dump] [--time] [MIX_FILE]\n");
int
main (int argc, char **argv)
@@ -81,7 +84,8 @@ main (int argc, char **argv)
gboolean dump = FALSE;
gboolean emacs = FALSE;
gboolean initfile = TRUE;
-
+ gboolean ptime = FALSE;
+
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
@@ -109,6 +113,9 @@ main (int argc, char **argv)
case DUMP_OPT:
dump = TRUE;
break;
+ case TIME_OPT:
+ ptime = TRUE;
+ break;
case '?':
/* getopt already handles the output of a warning message */
fprintf (stderr, _("(Try: %s -h)\n"), prog_name);
@@ -134,7 +141,7 @@ main (int argc, char **argv)
mix_init_lib ();
- if (run) mix_vmrun(in, dump);
+ if (run) mix_vmrun(in, dump, ptime);
else mix_vmloop (argc, argv, initfile, in, emacs);
mix_release_lib ();