summaryrefslogtreecommitdiffhomepage
path: root/mixlib/mix_vm_clock.h
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2001-03-22 03:01:01 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2001-03-22 03:01:01 +0000
commit1c345e559710ec6200f7d508629bd24457a20a80 (patch)
tree4ebccd7c4719cf56da7151af6659992bd1dbb276 /mixlib/mix_vm_clock.h
parent50375f34b611281a3b05a37221e2baa143f5f5ca (diff)
downloadmdk-1c345e559710ec6200f7d508629bd24457a20a80.tar.gz
mdk-1c345e559710ec6200f7d508629bd24457a20a80.tar.bz2
initial import (sf 0.3beta)
Diffstat (limited to 'mixlib/mix_vm_clock.h')
-rw-r--r--mixlib/mix_vm_clock.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/mixlib/mix_vm_clock.h b/mixlib/mix_vm_clock.h
new file mode 100644
index 0000000..706115e
--- /dev/null
+++ b/mixlib/mix_vm_clock.h
@@ -0,0 +1,55 @@
+/* -*-c-*- ---------------- mix_vm_clock.h :
+ * Declaration of mix_vm_clock_t, a clock for the MIX virtual machine.
+ * ------------------------------------------------------------------
+ * Last change: Time-stamp: <01/02/20 00:23:58 jose>
+ * ------------------------------------------------------------------
+ * Copyright (C) 2000 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+
+#ifndef MIX_VM_CLOCK_H
+#define MIX_VM_CLOCK_H
+
+#include "mix.h"
+#include "mix_ins.h"
+
+/* the type of time unit */
+typedef gulong mix_time_t;
+
+/* the clock type */
+typedef struct mix_vm_clock_t
+{
+ mix_time_t time;
+} mix_vm_clock_t;
+
+/* Create/delete a clock */
+extern mix_vm_clock_t *
+mix_vm_clock_new ();
+
+extern void
+mix_vm_clock_delete (mix_vm_clock_t *clock);
+
+/* Increase time with the units needed to execute ins */
+extern mix_time_t /* the added lapse */
+mix_vm_clock_add_lapse (mix_vm_clock_t *clock, const mix_ins_t *ins);
+
+/* Get the time since creation */
+#define mix_vm_clock_get_time(clock) (clock? clock->time:0)
+
+#endif /* MIX_VM_CLOCK_H */
+