diff -ruN klic-3.003-2002-01-01/ChangeLog klic-3.003-2002-01-02/ChangeLog
--- klic-3.003-2002-01-01/ChangeLog	Mon Dec 31 12:04:47 2001
+++ klic-3.003-2002-01-02/ChangeLog	Tue Jan  1 17:09:10 2002
@@ -1,3 +1,9 @@
+2002-01-02 TAKAGI Yusuke <takagi@ueda.info.waseda.ac.jp>
+
+	* runtime/step.h: new file.
+
+	* runtime/timing.c: remove.
+
 2001-12-31 TAKAGI Yusuke <takagi@ueda.info.waseda.ac.jp>
 
 	* include/klic/stdc.h: new file.
diff -ruN klic-3.003-2002-01-01/MANIFEST klic-3.003-2002-01-02/MANIFEST
--- klic-3.003-2002-01-01/MANIFEST	Tue Jan  1 14:17:47 2002
+++ klic-3.003-2002-01-02/MANIFEST	Tue Jan  1 17:09:10 2002
@@ -378,6 +378,7 @@
 ./runtime/stack.ext
 ./runtime/stack.kl1
 ./runtime/step.c
+./runtime/step.h
 ./runtime/susp.h
 ./runtime/sysc.c
 ./runtime/sysc.ext
@@ -387,7 +388,6 @@
 ./runtime/termio.kl1
 ./runtime/timer.c
 ./runtime/timer.h
-./runtime/timing.c
 ./runtime/timing.h
 ./runtime/trace.c
 ./runtime/trace.h
diff -ruN klic-3.003-2002-01-01/runtime/step.c klic-3.003-2002-01-02/runtime/step.c
--- klic-3.003-2002-01-01/runtime/step.c	Sat Dec 29 12:46:20 2001
+++ klic-3.003-2002-01-02/runtime/step.c	Tue Jan  1 17:09:10 2002
@@ -14,6 +14,7 @@
 #include <klic/generic.h>
 #include "atom.h"
 #include "funct.h"
+#include "step.h"  /* stepping_flag */
 
 /* Global flag for stepping */
 int stepping_flag = 0;
@@ -73,7 +74,7 @@
 const struct predicate step_trigger_pred = {
   module_step__trigger, 0, 5 };
 
-module module_step__trigger(glbl, qp, allocp, toppred)
+static module module_step__trigger(glbl, qp, allocp, toppred)
      struct global_variables *glbl;
      struct goalrec *qp;
      q *allocp;
@@ -110,7 +111,8 @@
   return allocp;
 }
 
-struct goalrec *step_after(qp, allocp)
+extern struct goalrec*
+step_after(qp, allocp)
      struct goalrec *qp;
      q *allocp;
 {
@@ -232,7 +234,8 @@
   return qp;
 }
 
-q *step_susp(allocp, goal, reasonp, spontaneous)
+extern q*
+step_susp(allocp, goal, reasonp, spontaneous)
      q *allocp;
      struct goalrec *goal;
      q *reasonp;
@@ -259,24 +262,8 @@
   return allocp;
 }
 
-void step_enqueue(goal, prio)
-     struct goalrec *goal;
-     long prio;
-{
-  if (num_queued >= max_queued) {
-    int newmax = max_queued * 2;
-    queued_goals = (struct goalrec **)
-      realloc_check(queued_goals, newmax*sizeof(struct goalrec *));
-    queued_prio = (long *)
-      realloc_check(queued_prio, newmax*sizeof(long));
-    max_queued = newmax;
-  }
-  queued_goals[num_queued] = goal;
-  queued_prio[num_queued] = prio;
-  num_queued++;
-}
-
-void step_wokenup(goal, prio)
+extern void
+step_wokenup(goal, prio)
      struct goalrec *goal;
      long prio;
 {
@@ -293,27 +280,8 @@
   num_wokenup++;
 }
 
-void step_thrown(goal, node, prio)
-     struct goalrec *goal;
-     long node, prio;
-{
-  if (num_thrown >= max_thrown) {
-    int newmax = max_thrown * 2;
-    thrown_goals = (struct goalrec **)
-      realloc_check(thrown_goals, newmax*sizeof(struct goalrec *));
-    thrown_node = (long *)
-      realloc_check(thrown_node, newmax*sizeof(long));
-    thrown_prio = (long *)
-      realloc_check(thrown_prio, newmax*sizeof(long));
-    max_thrown = newmax;
-  }
-  thrown_goals[num_thrown] = goal;
-  thrown_node[num_thrown] = node;
-  thrown_prio[num_thrown] = prio;
-  num_wokenup++;
-}
-
-void step_failure(goal)
+extern void
+step_failure(goal)
      struct goalrec *goal;
 {
   if (num_failed >= max_failed) {
diff -ruN klic-3.003-2002-01-01/runtime/step.h klic-3.003-2002-01-02/runtime/step.h
--- klic-3.003-2002-01-01/runtime/step.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2002-01-02/runtime/step.h	Tue Jan  1 17:09:10 2002
@@ -0,0 +1,20 @@
+/* -------------------------------------------------------------
+% Copyright 2002, TAKAGI Yusuke
+%   (Read COPYRIGHT for detailed information.)
+------------------------------------------------------------- */
+
+#ifndef STEP_H
+#define STEP_H
+
+
+/* step.c */
+
+extern int stepping_flag;
+
+extern struct goalrec* step_after(struct goalrec* qp, q* allocp);
+extern q* step_susp(q* allocp, struct goalrec* goal, q* reasonp, int spontaneous);
+extern void step_wokenup(struct goalrec* goal, long prio);
+extern void step_failure(struct goalrec* goal);
+
+
+#endif  /* STEP_H */
diff -ruN klic-3.003-2002-01-01/runtime/timer.c klic-3.003-2002-01-02/runtime/timer.c
--- klic-3.003-2002-01-01/runtime/timer.c	Sat Dec 29 12:46:20 2001
+++ klic-3.003-2002-01-02/runtime/timer.c	Tue Jan  1 17:09:56 2002
@@ -7,6 +7,7 @@
 
 #include <klic/alloc.h>  /* malloc_check */
 #include <klic/basic.h>  /* fatalp */
+
 #ifdef USETIMER
 #include <signal.h>
 #include <sys/time.h>
@@ -42,7 +43,8 @@
   }
 }
 
-void klic_gettod(now)
+extern void
+klic_gettod(now)
      struct timeval *now;
 {
   if (gettimeofday(now, 0) != 0) {
@@ -115,7 +117,7 @@
   }
 }
 
-void
+extern void
 call_at_specified_time(sec, usec, func)
      long sec, usec;
      void (*func)();
@@ -126,7 +128,7 @@
   schedule_timer_interrupt(&at, &interval, func);
 }
 
-void
+extern void
 call_after_specified_interval(sec, usec, func)
      long sec, usec;
      void (*func)();
@@ -139,7 +141,7 @@
   schedule_timer_interrupt(&at, &interval, func);
 }
 
-void
+extern void
 call_at_time_intervals(sec, usec, func)
      long sec, usec;
      void (*func)();
@@ -152,7 +154,7 @@
   schedule_timer_interrupt(&at, &interval, func);
 }
 
-void
+extern void
 init_virtualized_timer()
 {
   struct sigaction act;
@@ -165,4 +167,4 @@
     fatalp("sigation", "Error in initiating handler for SIGALRM");
   }
 }
-#endif
+#endif  /* USETIMER */
diff -ruN klic-3.003-2002-01-01/runtime/timing.c klic-3.003-2002-01-02/runtime/timing.c
--- klic-3.003-2002-01-01/runtime/timing.c	Sat Dec 29 12:46:20 2001
+++ klic-3.003-2002-01-02/runtime/timing.c	Thu Jan  1 09:00:00 1970
@@ -1,18 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1993,1994 Institute for New Generation Computer Technology 
-%       (Read COPYRIGHT for detailed information.) 
-%   (C)1996, 1997, 1998, 1999 Japan Information Processing Development Center
-%       (Read COPYRIGHT-JIPDEC for detailed information.)
------------------------------------------------------------ */
-#include <sys/types.h>
-#include <sys/times.h>
-#include <klic/basic.h>  /* fatal */
-
-long blt_times()
-{
-  struct tms times_buf;
-  if (times(&times_buf) < 0) {
-    fatal("times failed");
-  }
-  return times_buf.tms_utime + times_buf.tms_stime;
-}
diff -ruN klic-3.003-2002-01-01/runtime/timing.h klic-3.003-2002-01-02/runtime/timing.h
--- klic-3.003-2002-01-01/runtime/timing.h	Fri Dec 28 13:46:47 2001
+++ klic-3.003-2002-01-02/runtime/timing.h	Tue Jan  1 17:09:10 2002
@@ -12,6 +12,7 @@
 
 #define  field_diff(field)	(after.field - before.field)
 
+
 #ifdef GETRUSAGE
 
 #include <sys/time.h>
@@ -23,7 +24,8 @@
 typedef struct rusage timerstruct;
 #define	 measure(x)	getrusage(RUSAGE_SELF, &(x))
 
-#else 
+
+#else  /* not GETRUSAGE */
 
 #include <sys/times.h>
 #include <sys/param.h>
@@ -33,7 +35,8 @@
 typedef struct tms timerstruct;
 #define	 measure(x)	times(&(x))
 
-#endif
+#endif  /* not GETRUSAGE */
+
 
 Extern int gctimes Init(0);
 Extern int gcums Init(0);
diff -ruN klic-3.003-2002-01-01/runtime/xio.c klic-3.003-2002-01-02/runtime/xio.c
--- klic-3.003-2002-01-01/runtime/xio.c	Tue Jan  1 14:17:47 2002
+++ klic-3.003-2002-01-02/runtime/xio.c	Tue Jan  1 17:09:10 2002
@@ -50,7 +50,7 @@
   }
 }
 
-extern Inline int
+extern int
 debug_fputc(c, f)
   int c;
   FILE* f;
@@ -63,7 +63,7 @@
   }
 }
 
-extern Inline int
+extern int
 debug_fwrite(pt, size, items, f)
   const void* pt;
   size_t size, items;
@@ -72,7 +72,7 @@
   return fwrite(pt, size, items, f);
 }
 
-extern Inline int
+extern int
 debug_fflush(f)
   FILE* f;
 {
