diff -ruN klic-3.003-2001-12-27/ChangeLog klic-3.003-2001-12-28/ChangeLog
--- klic-3.003-2001-12-27/ChangeLog	Thu Dec 27 19:30:38 2001
+++ klic-3.003-2001-12-28/ChangeLog	Fri Dec 28 13:46:47 2001
@@ -1,3 +1,14 @@
+2001-12-28 TAKAGI Yusuke <takagi@ueda.info.waseda.ac.jp>
+
+	* include/klic/asyncio.h, include/klic/g_pointer.h,
+	include/klic/g_termarray.h, include/klic/ge_exref.h,
+	include/klic/goalobj.h, include/klic/gobj.h, include/klic/interpe.h,
+	include/klic/options.h, include/klic/rmon.h, include/klic/schedule.h,
+	include/klic/shm.h, include/klic/shm_machine.h, include/klic/susp.h,
+	include/klic/timer.h, include/klic/timing.h,
+	include/klic/trace.h, include/klic/traceio.h:
+	move to 'runtime/'.
+
 2001-12-27 TAKAGI Yusuke <takagi@ueda.info.waseda.ac.jp>
 
 	* include/klic/gobjutil.h, include/klic/msgfmt.h: remove.
diff -ruN klic-3.003-2001-12-27/include/Makefile.tail klic-3.003-2001-12-28/include/Makefile.tail
--- klic-3.003-2001-12-27/include/Makefile.tail	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/Makefile.tail	Fri Dec 28 13:49:32 2001
@@ -5,28 +5,28 @@
 #       (Read COPYRIGHT-JIPDEC for detailed information.)
 # ----------------------------------------------------------
 
-DISTHEADERS = klic/interpe.h klic/distio.h klic/distproc.h klic/distpkt.h \
-	      klic/rmon.h $(DISTMHEADERS)
+DISTHEADERS = klic/distio.h klic/distproc.h klic/distpkt.h $(DISTMHEADERS)
+              # klic/interpe.h klic/rmon.h
 
-SHMHEADERS = klic/shm.h klic/shm_machine.h
+SHMHEADERS = # klic/shm.h klic/shm_machine.h
 
 HEADERS = klic/config.h klic/alloc.h klic/atomstuffs.h \
-	klic/klichdr.h klic/options.h \
+	klic/klichdr.h \
 	klic/basic.h klic/bb.h klic/control.h \
 	klic/functorstuffs.h klic/predinfo.h \
-	klic/gb.h klic/gobj.h \
+	klic/gb.h \
 	klic/g_methtab.h klic/index.h \
-	klic/param.h klic/primitives.h klic/schedule.h klic/susp.h \
-	klic/struct.h klic/timing.h klic/unify.h klic/sighndl.h klic/trace.h \
-	klic/traceio.h klic/timer.h \
+	klic/param.h klic/primitives.h \
+	klic/struct.h klic/unify.h klic/sighndl.h \
 	klic/g_basic.h klic/g_extern.h klic/g_extinl.h \
 	klic/gd_macro.h klic/gd_methtab.h klic/gdobject.h \
 	klic/generic.h klic/newatom.h \
 	klic/gc_macro.h klic/gc_methtab.h klic/gcobject.h \
 	klic/gg_macro.h klic/gg_methtab.h \
-	klic/gmodule.h klic/g_pointer.h klic/g_string.h klic/g_vector.h \
-	klic/g_float.h 	klic/g_termarray.h \
-	klic/asyncio.h
+	klic/gmodule.h klic/g_string.h klic/g_vector.h klic/g_float.h
+	# klic/options.h klic/gobj.h klic/schedule.h klic/susp.h klic/timing.h
+	# klic/trace.h klic/traceio.h klic/timer.h
+	# klic/g_pointer.h klic/g_termarray.h klic/asyncio.h
 
 
 #ls:
diff -ruN klic-3.003-2001-12-27/include/klic/asyncio.h klic-3.003-2001-12-28/include/klic/asyncio.h
--- klic-3.003-2001-12-27/include/klic/asyncio.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/asyncio.h	Thu Jan  1 09:00:00 1970
@@ -1,26 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1994, 1995 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.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_ASYNCIO_H_
-#define _KLIC_ASYNCIO_H_
-
-enum sigiotype {
-  KLIC_SIGIO_NONE,
-  KLIC_SIGIO_IN,
-  KLIC_SIGIO_OUT,
-  KLIC_SIGIO_INOUT
-};
-
-/* runtime/asyncio.c */
-extern void add_sigio_handler(long fd, int (*func)(), enum sigiotype sigio_type);
-extern void init_sigio_handler(void);
-extern void init_asynchronous_io(void);
-extern void close_asynchronous_io_stream(long fd);
-extern void register_asynchronous_io_stream(long fd, q stream);
-extern int poll_read_available(int fd);
-
-#endif /* _KLIC_ASYNCIO_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/g_pointer.h klic-3.003-2001-12-28/include/klic/g_pointer.h
--- klic-3.003-2001-12-27/include/klic/g_pointer.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/g_pointer.h	Thu Jan  1 09:00:00 1970
@@ -1,16 +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.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_G_POINTER_H_
-#define _KLIC_G_POINTER_H_
-
-struct pointer_object {
-  struct data_object_method_table *method_table;
-  char *pointer;
-};
-
-#endif /* _KLIC_G_POINTER_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/g_termarray.h klic-3.003-2001-12-28/include/klic/g_termarray.h
--- klic-3.003-2001-12-27/include/klic/g_termarray.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/g_termarray.h	Thu Jan  1 09:00:00 1970
@@ -1,17 +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.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_G_TERMARRAY_H_
-#define _KLIC_G_TERMARRAY_H_
-
-struct termarray_object {
-  struct data_object_method_table *method_table;
-  unsigned long nterm;
-  q terms[1];
-};
-
-#endif /* _KLIC_G_TERMARRAY_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/ge_exref.h klic-3.003-2001-12-28/include/klic/ge_exref.h
--- klic-3.003-2001-12-27/include/klic/ge_exref.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/ge_exref.h	Thu Jan  1 09:00:00 1970
@@ -1,20 +0,0 @@
-/* ----------------------------------------------------------
-%   (C)1995 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.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_GE_EXREF_H_
-#define _KLIC_GE_EXREF_H_
-
-struct exref_object{
-  struct generator_object_method_table *method_table;
-  long node;
-  long index;
-  long wec;
-  q    to_exref;
-  long gc_flag;
-};
-
-#endif /* _KLIC_GE_EXREF_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/goalobj.h klic-3.003-2001-12-28/include/klic/goalobj.h
--- klic-3.003-2001-12-27/include/klic/goalobj.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/goalobj.h	Thu Jan  1 09:00:00 1970
@@ -1,15 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1995 Takashi Chikayama
-%       (Read COPYRIGHT for detailed information.) 
------------------------------------------------------------ */
-
-#ifndef _KLIC_GOALOBJ_H_
-#define _KLIC_GOALOBJ_H_
-
-struct goal_object {
-  struct data_object_method_table *method_table;
-  struct goalrec *goal;
-  unsigned long id;
-};
-
-#endif /* _KLIC_GOALOBJ_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/gobj.h klic-3.003-2001-12-28/include/klic/gobj.h
--- klic-3.003-2001-12-27/include/klic/gobj.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/gobj.h	Thu Jan  1 09:00:00 1970
@@ -1,92 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1993,1994,1995 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.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_GOBJ_H_
-#define _KLIC_GOBJ_H_
-
-#include <klic/g_methtab.h>
-
-/*
-  macros which call methods
-*/
-
-#define method_table_of(obj) ((obj)->method_table)
-#define generic_passive_unify(obj, anothor) \
-  (method_table_of(obj)->passive_unify((obj), (anothor)))
-#define generic_active_unify(obj, anothor, allocp) \
-do{ \
-  (allocp) = method_table_of(obj)->active_unify((obj), (anothor), (allocp)); \
-}while(0)
-#define generic_print(obj, stream, depth, length) \
-  (method_table_of(obj)->print((obj), (stream), (depth), (length)))
-#define generic_gc(obj, allocp, sp) \
-  (method_table_of(obj)->gc((obj), (allocp), (sp)))
-#define generic_regist(obj) \
-  (method_table_of(obj)->regist(obj))
-#define generic_deallocate(obj) \
-  (method_table_of(obj)->deallocate(obj))
-#define generic_close(obj, allocp) \
-  (method_table_of(obj)->close(obj))
-
-#define generic_generate(obj, allocp) \
-  (method_table_of(obj)->generate((obj), (allocp)))
-
-#define generic_suspend(obj, ref, goal) \
-  (method_table_of(obj)->suspend((ref), (goal)))
-
-/*** for Distributed KLIC system ***/
-#define generic_encode(obj, pe, depth) \
-  (method_table_of(obj)->encode((obj), (pe), (depth)))
-
-/*** for Shared-memory KLIC system ***/
-#define generic_shmcopy(obj) \
-  (method_table_of(obj)->shmcopy(obj))
-
-#define generic_new(class, n, args) \
-  (((struct data_object_method_table *)(class))->new((n), (args)))
-
-/**** header file for using data and functions defined in kernel ****/ 
-
-/* temporary */
-
-#define general_passive_unify(obj, anothor) \
-  eq_terms_body((obj), (anothor))
-
-#define general_active_unify(obj, anothor, allocp) \
-  ((allocp) = do_shallow_unify((allocp), (obj), (anothor)))
-
-/*
-  datas for general utility with consumer object
-*/
-
-/****************
-  suspension_reason
-
-  shows result of the processing for consumer object.
-
-  0: normal;
-  1: GC request;
-  other: the process is suspended. pointer of the reason of the prosess.
-******************/
-extern q suspension_reason;
-
-/************
-  rest_of_stream
-
-  indicates the next hooked term. This variable is meaningful
-  just `suspension_reason' is 0.
-
-  0: normal;
-  other: the next hooked term
-**************/
-extern q rest_of_stream;
-
-
-extern q method_result;
-
-
-#endif /* _KLIC_GOBJ_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/interpe.h klic-3.003-2001-12-28/include/klic/interpe.h
--- klic-3.003-2001-12-27/include/klic/interpe.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/interpe.h	Thu Jan  1 09:00:00 1970
@@ -1,204 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C) 1994,1995 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.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_INTERPE_H_
-#define _KLIC_INTERPE_H_
-
-#include <malloc.h>
-#ifdef __alpha
-/* dec malloc.h does not supply function return value decralations */
-extern void* malloc();
-extern void* calloc();
-extern void* realloc();
-#endif
-#include <string.h>
-
-#include <klic/distpkt.h>
-
-/********** for debugging output control */
-/*#define INT_CL_DEBUG*/
-#define INT_CL_PROBE
-
-#ifdef	INT_CL_DEBUG
-#  define INT_CL_DEBUG_X(X)  (X)
-#else
-#  define INT_CL_DEBUG_X(X)
-#endif
-
-#ifdef	INT_CL_PROBE
-#  define INT_CL_PROBE_X(X)  (X)
-#else
-#  define INT_CL_PROBE_X(X)
-#endif
-
-/*********** for bsd libraries */
-#ifdef USEBCOPY
-#  define BCOPY(from,to,len)	bcopy((from), (to), (len))
-#else
-#  define BCOPY(from,to,len)	memcpy((to), (from), (len))
-#endif
-#ifdef USEBZERO
-#  define BZERO(from,len)		bzero((from), (len))
-#else
-#  define BZERO(from,len)		memset((from), 0, (len))
-#endif
-
-/*********** Some convenient macros **************/
-/* Extern long total_node, my_node; */
-#define MASTER_NODE		0L
-#define SHOEN_NODE		total_node
-#define IS_MASTER_NODE(node)	((node) == MASTER_NODE)
-#define IS_SHOEN_NODE(node)	((node) == SHOEN_NODE)
-
-/* Constants */
-#define EXPORT_UNIT_WEC		0x10000
-#define MIN_WEC			0x2
-
-#define EXP_TABLE_INC_SIZE	0x1000
-#define IMP_TABLE_INC_SIZE	0x1000
-
-#define EXP_TABLE_HASH_SIZE	0x1
-
-#define END_IMP_FREELIST	(-1)
-#define END_IMP_TABLE		(-1)
-
-#define IMPREC_NOT_COPIED	12345
-#define IMPREC_COPIED		54321
-#define IMPREC_RELEASED		98765
-
-/* Temporary. for PVM-TCP bug */
-#ifndef TRANSFER_CNT
-#define TRANSFER_CNT            0x1000L
-#endif
-
-/************* WTC related definition ***************/
-Extern long shoen_wtc;
-Extern long node_wtc;
-
-#define SUPPLY_WTC_UNIT		0x1000000L
-#define THROW_WTC_UNIT		0x1000L
-#define UNIFY_WTC_UNIT		0x10L
-
-
-/* if defined, optional eager requesting is activated. */
-/*#define REQUEST_WTC_THRESHOLD	0x3L*/
-
-/*#define CONTROL_WTC_UNIT	0x1L	/*This value implicitly assumed. */
-
-#define NODE_WTC_LIMIT		0x10000000L
-#define RETURN_WTC_UNIT		0x08000000L
-
-#define MIN_WTC			2L /* one for wtc_request,
-				      another for node existence */
-#define READ_WTC_UNIT		10L
-#define ANSWER_WTC_UNIT		10L
-
-enum get_wtc_type {
-    get_wtc_normal_request,
-    get_wtc_full_request,
-    get_wtc_force_request
-};
-/************* Export Table *********************/
-struct exp_entry{
-    long index;
-    long wec;
-    q data;
-    struct exp_entry* next;
-};
-
-Extern struct exp_entry* exp_table;
-Extern long current_exp_size;
-Extern long active_exp_entry;
-
-#define UNUSED_EXPREC 0xf0f0f0ff /* This value is curious!! */
-#define UNUSED_IMPREC 0xf0f0f0ff /* it too. */
-
-/* Export Hash Table */
-Extern struct exp_entry* exp_hash_table[EXP_TABLE_HASH_SIZE];
-
-Extern struct exp_entry* top_of_exp_freelist;
-
-/************** Import Table ********************/
-
-struct imp_entry{
-    long next;
-    q object;
-};
-
-Extern struct imp_entry* imp_table;
-Extern long current_imp_size;
-
-Extern struct imp_entry top_of_imp_freelist;
-
-Extern long active_imp_rec;
-Extern long free_imp_rec;
-
-Extern long receive_answer_flag;
-Extern long answer_return_exp_index;
-Extern q decode_data;		/* Un natural way of value passing. */
-
-/* Options set by program arguments */
-Extern long eager_transfer_level	Init(0);
-Extern int network_statistics_flag	Init(0);
-Extern int msg_busywait_flag		Init(0);
-
-/************* message suspend record **************/
-
-struct susp_msg_rec {
-    struct susp_msg_rec* next;
-    long node;
-    long wtc_needed;
-    combuf* outbuf;
-};
-
-Extern struct susp_msg_rec* susp_msg_list;
-
-/************* Message decoder stack ****************/
-
-#define INIT_DECODE_STACK_SIZE 0x1000
-
-Extern q* decode_stack;
-Extern q* decode_stack_ptr;
-Extern q* decode_stack_limit;
-Extern int decode_stack_size;
-
-/************* Network Statistics Measurement *******/
-
-struct netstat {
-    long start_sec;		/* only SHOEN uses this field */
-    long start_usec;		/* only SHOEN uses this field */
-
-    long send_throw_cnt;
-    long send_read_cnt;
-    long send_unify_cnt;
-    long send_answer_cnt;
-    long send_release_cnt;
-    long send_request_wtc_cnt;
-    long send_supply_wtc_cnt;
-    long send_return_wtc_cnt;
-    
-    long recv_throw_cnt;
-    long recv_read_cnt;
-    long recv_unify_cnt;
-    long recv_release_cnt;
-    long recv_answer_cnt;
-    long recv_request_wtc_cnt;
-    long recv_supply_wtc_cnt;
-    long recv_return_wtc_cnt;
-
-    long msg_suspend_cnt;
-    long msg_resume_cnt;
-    
-    long send_data_siz;
-    long recv_data_siz;
-};
-
-Extern struct netstat netstat;
-
-#define ERROR_STOP for(;;)
-
-#endif /* _KLIC_INTERPE_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/options.h klic-3.003-2001-12-28/include/klic/options.h
--- klic-3.003-2001-12-27/include/klic/options.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/options.h	Thu Jan  1 09:00:00 1970
@@ -1,126 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1994,1995 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.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_OPTIONS_H_
-#define _KLIC_OPTIONS_H_
-
-union all_type {
-    int i;
-    long l;
-    double d;
-    char* s;
-};
-
-enum argtype {
-    ARG_DOUBLE,
-    ARG_SIZE,
-    ARG_RESET,
-    ARG_SET,
-    ARG_STRING,
-    ARG_NOT_USED
-};
-
-extern const struct opttable opttable[];
-
-/* runtime/options.c */
-extern char* parse_opts(const struct opttable* opttbl, int* acp, char*** avp);
-
-/* not copied when spawned */
-#define ARG_SHOULD_NOT_COPY(X)	((int)(X) >= (int)ARG_NOT_USED)
-#define ARG_NOT_COPIED(X) \
-  ((enum argtype) ((int)(X) + (int)ARG_NOT_USED))
-
-#define ARG_ORIGINAL_TYPE(X) \
-  ((enum argtype) \
-    (ARG_SHOULD_NOT_COPY(X) ? (int)(X)-(int)ARG_NOT_USED : (int)(X)))
-
-struct opttable {
-    char* opt_str;
-    union all_type* opt_dest;
-    enum argtype opt_type;
-    char* opt_usage;
-};
-
-#ifndef MAIN
-extern const struct opttable opttable[];
-#else  /* MAIN */
-static long num_pes;
-static double max_a_ratio;
-static unsigned long h_size;
-static unsigned long max_h_size;
-static unsigned long inc_size;
-static int verbose;
-extern int start_tracing;
-extern int count_suspension;
-#ifdef USETIMER
-static unsigned long dl_det_interval;
-#endif /*USETIMER*/
-const struct opttable opttable[] = {
-#ifdef USER_OPTIONS
-    USER_OPTIONS
-#endif
-#ifdef POLLING_OPTIONS
-    POLLING_OPTIONS
-#endif
-#ifdef PARALLEL
-    "p",        (union all_type*) &num_pes, ARG_SIZE,
-    "-p <# of workers>: number of worker processes ",
-#endif
-#ifdef DIST_OPTIONS
-    DIST_OPTIONS
-#endif
-#ifdef DIST
-#ifdef SHM_DIST
-    "B",	(union all_type*) &shared_buffer_size, ARG_SIZE,
-    "-B <communication buffer size>",
-#endif
-#endif
-#ifdef SHM
-    "S",        (union all_type*) &SHM_SIZE, ARG_SIZE,
-    "-S <shared-memory heap size>: shared-memory heap size, never expand",
-
-    "D",        (union all_type*) &Disp_child, ARG_SET,
-    "-D: display child process number on UNIX",
-
-#endif
-    "a",	(union all_type*) &max_a_ratio, ARG_DOUBLE,
-    "-a <ratio>: active cell ratio to triger heap extension\n"
-    "\t  <ratio> should be a floating point number >0 and <1",
-
-    "h",	(union all_type*) &h_size, ARG_SIZE,
-    "-h <initial heap size>: initial size of heap",
-
-    "H",	(union all_type*) &max_h_size, ARG_SIZE,
-    "-H <max heap size>: maximum possible heap size",
-
-    "i",	(union all_type*) &inc_size, ARG_SIZE,
-    "-i <increment>: gap between heap top and bottom\n"
-    "\t  for -h, -H and -i, 32k means 32KW and 2m means 2MW",
-
-    "g",	(union all_type*) &measure_gc, ARG_SET,
-    "-g: set garbage collection measurement on",
-
-    "v",	(union all_type*) &verbose, ARG_SET,
-    "-v: display KLIC runtime version",
-#ifdef DEBUGLIB
-    "t",	(union all_type*) &start_tracing, ARG_SET,
-    "-t: start execution with tracing",
-
-    "s",	(union all_type*) &count_suspension, ARG_SET,
-    "-s: count suspension",
-#endif /* DEBUGLIB */
-#ifdef USETIMER
-    "deadlock-detection-interval",
-		(union all_type*) &dl_det_interval, ARG_SIZE,
-    "-deadlock-detection-interval <interval>:\n"
-    "\t  specify deadlock detect interval in micro sec.\n"
-    "\t  Set <interval> to 0 to supress early deadlock detection completely.",
-#endif /*USETIMER*/
-    0, 0 };
-#endif /* MAIN */
-
-#endif /* _KLIC_OPTIONS_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/rmon.h klic-3.003-2001-12-28/include/klic/rmon.h
--- klic-3.003-2001-12-27/include/klic/rmon.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/rmon.h	Thu Jan  1 09:00:00 1970
@@ -1,65 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C) 1995 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.)
----------------------------------------------------------- */
-
-#ifndef _KLIC_RMON_H_
-#define _KLIC_RMON_H_
-
-/************* For profiling ************************/
-
-#define PROF_GATHER_INTERVAL_SEC 2
-#define PROF_SAMPLE_INTERVAL_uSEC 10111
-
-#define SHOEN_START_TAG       0
-#define SHOEN_OUTPUT_PROF_TAG 100
-#define SHOEN_TERMINATE_TAG   200
-
-struct perfmon_state {
-    int idle_on;
-    int gc_on;
-    int ms_on;
-    int mr_on;
-};
-
-Extern volatile struct perfmon_state perfmon_state;
-
-struct perfmon_counter {
-    long intr_count;
-    long idle_count;
-    long gc_count;
-    long ms_count;
-    long mr_count;
-};
-
-Extern volatile struct perfmon_counter perfmon_counter;
-
-Extern char* rmonnode;
-Extern int rmon_tid;
-
-#define IDLE_ON()  (perfmon_state.idle_on = 1)
-#define IDLE_OFF() (perfmon_state.idle_on = 0)
-#define GC_ON()    (perfmon_state.gc_on = 1)
-#define GC_OFF()   (perfmon_state.gc_on = 0)
-#define SEND_ON()  (perfmon_state.ms_on = 1)
-#define SEND_OFF() (perfmon_state.ms_on = 0)
-#define RECV_ON()  (perfmon_state.mr_on = 1)
-#define RECV_OFF() (perfmon_state.mr_on = 0)
-
-Extern int gather_prof_ready Init(1);
-struct profile_rec {
-    long stimes;  /* sampling times */
-    long itimes;  /* idle times */
-    long gctimes; /* GC times */
-    long mstimes; /* message sending times */
-    long mrtimes; /* message receiving times */
-};
-
-Extern struct profile_rec* shoen_profile;
-Extern int gathered_count Init(0);
-
-Extern long* send_pbuf;
-
-#endif /* _KLIC_RMON_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/schedule.h klic-3.003-2001-12-28/include/klic/schedule.h
--- klic-3.003-2001-12-27/include/klic/schedule.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/schedule.h	Thu Jan  1 09:00:00 1970
@@ -1,29 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1993 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.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_SCHEDULE_H_
-#define _KLIC_SCHEDULE_H_
-
-
-/* runtime/sched.c */
-
-extern struct prioqrec* more_prioqrec(void);
-
-extern struct goalrec* enqueue_goal(
-  struct goalrec* qp, long prio,
-  struct goalrec* gp, struct global_variables* glbl );
-
-extern struct goalrec* get_top_priority_queue(void);
-extern void put_priority_queue(struct goalrec* qp, long prio);
-
-
-/* runtime/kmain.c */
-extern module topsucceed(
-  struct global_variables* glbl, struct goalrec* qp,
-  q* allocp, const struct predicate* toppred );
-
-#endif /* _KLIC_SCHEDULE_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/shm.h klic-3.003-2001-12-28/include/klic/shm.h
--- klic-3.003-2001-12-27/include/klic/shm.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/shm.h	Thu Jan  1 09:00:00 1970
@@ -1,311 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1994,1995 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.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_SHM_H_
-#define _KLIC_SHM_H_
-
-/* Machine depending Dec */
-#include <klic/shm_machine.h>
-
-#define currid (glbl->par.aux.shm.currid0)
-#define oldid  (glbl->par.aux.shm.oldid0)
-
-#define SHM_HEAP_TOP (glbl->par.aux.shm.shm_htop0)
-#define SHP_SIZE     (glbl->par.aux.shm.shm_hbyte0)
-
-  /* number of Planes */
-extern long N_PLNE;
-  /* size of 1 Shared-memory plane */
-extern long SHM_SIZE;
-  /* last PE for Profile */
-extern long LAST_PE;
-extern long Disp_child;
-
-Extern int shm_trace_lock Init(0);
-
-#define MASTER 0
-
-#define MAX_N_PE  32
-#define MAX_N_PLNE 8
-
-#define is_shmconnect(X) (1)
-
-#define is_locala(X) \
-    ( (unsigned long)((long)(X)-(long)heaptop) < real_heapbytesize )
-
-  /* Shared-memory address or no */
-#define is_shma(X) \
-    ( (unsigned long)((long)(X)-(long)SHM_HEAP_TOP ) < SHP_SIZE )
-
-/* calculates a hash key for lock
-*/
-#define HTBL_base 0
-  /* allocating shared-memory */
-#define g_key()      HTBL_base
-  /* updating the shared-memory management table */
-#define m_key()      (HTBL_base+1)
-  /* for Sequential GC */
-#define gc_key()     (HTBL_base+2)
-  /* updating atom table */
-#define a_key()     (HTBL_base+3)
-  /* updating functor table */
-#define f_key()     (HTBL_base+4)
-#define tr_key()    (HTBL_base+5)
-  /* queuing a goal to external process */
-#define p_key(penum)  (HTBL_base + 6 + (penum))
-
-  /* global generator hook */
-#define is_genhook(X) ((long)(X) & 0x01)
-#define tag_genhook(X) ((Sinfo*)((long)(X)+1))
-#define untag_genhook(X) ((Sinfo*)((long)(X)-1))
-  /* local consumer or generator */
-#define tag_local(x)	((q)((char*)(x) + ATOMIC))
-#define untag_local(x)	((q)((char*)(x) - ATOMIC))
-#define ext_queued (glbl->par.aux.shm.queued0)
-#define ex_qp (glbl->par.aux.shm.ex_qp0)
-
-  /* adjusts the memory boundary */
-#define reckon(sz) ((long)((((sz)+sizeof(long)-1)/sizeof(long))*sizeof(long)))
-#define get_adjust_addr(type,top,inc) \
-  (((type)*) (((char*) (top)) + (reckon(sizeof(type)) * (inc))))
-#define get_otherPE_glbl(n) \
-  get_adjust_addr(struct global_variables, top_shm_glbl, (n))
-
-  /* shared memory alloc */
-#define galloc(Siz) ( { q* addr = gallocp; \
-  ((gallocp+=(Siz)) <= glimit)?addr:shm_galloc(Siz);})
-
-
-#define free_local_tbl(ptr) \
-do{ \
-  TADDRtbl* sl = (TADDRtbl*) (ptr); \
-  (sl->prev)->next = sl->next; \
-  (sl->next)->prev = sl->prev; \
-  sl->next = ADDRtbl_free; \
-  ADDRtbl_free = sl; \
-}while(0)
-
-#define makeshvar(svar) \
-do{ \
-  struct generator_susp* vcell; \
-  (svar) = (q) galloc((sizeof(struct generator_susp) / sizeof(q)) + 1); \
-  vcell = (struct generator_susp*) (((q*) svar) + 1); \
-  vcell->backpt = (q) (svar); \
-  vcell->u.o = tag_generator_susp(pSHM_VAR); \
-  *((q*) svar) = (q) vcell; \
-}while(0)
-
-
-#define get_space(X) ( {\
-    int cid = currid;\
-    int cnt = 1;\
-    int no = 0;\
-    do { \
-      if ( (unsigned long)((long)(X)-(long)(PLNE_ptr[cid]->top_addr)) < SHM_SIZE ) \
-        { no = cnt; break; } \
-      cnt++; \
-    } while( (cid = PLNE_ptr[cid]->direct) != (-1) ); \
-    no; } )
-
-#define cmp_forward_ptr(x,y) ( {\
-    int xv;                 \
-    int yv;                 \
-    int ret;                \
-    xv = get_space(x);      \
-    yv = get_space(y);      \
-    if ( xv == yv ) {       \
-      if ((x) < (y)) ret = 1; \
-      else         ret = 0; \
-    } else if ( xv < yv ) { \
-       ret = 1;             \
-    } else {                \
-       ret = 0;             \
-    }                       \
-    ret;} )
-
-#define ck_new_galloc(X) \
-do{ \
-    int cid = currid;\
-    while ( (cid = PLNE_ptr[cid]->direct) != (-1) ) { \
-       if ( (unsigned long)((long)(X)-(long)(PLNE_ptr[cid]->top_addr) ) < SHM_SIZE ) { new_galloc(cid); break; }\
-    }\
-}while(0)
-
-
-#define is_cur_space_ptr(X) ( \
-    (unsigned long)((long)(X)-(long)(PLNE_ptr[currid]->top_addr) ) < SHM_SIZE )
-
-#define is_forward_space_ptr(X) ( {\
-    int ok = 0;\
-    int cid = currid;\
-    while ( (cid = PLNE_ptr[cid]->direct) != (-1) ) {\
-       if ( (unsigned long)((long)(X)-(long)(PLNE_ptr[cid]->top_addr) ) < SHM_SIZE ) {\
-	 ok = 1; break;\
-       }\
-    }\
-    ok; } )
-
-#define is_cur_or_forward_ptr(X) ( {\
-    int ok = 0;\
-    int cid = currid;\
-    do {\
-       if ( (unsigned long)((long)(X)-(long)(PLNE_ptr[cid]->top_addr) ) < SHM_SIZE ) {\
-	 ok = 1; break;\
-       }\
-    } while ( (cid = PLNE_ptr[cid]->direct) != (-1) ) ;\
-    ok; } )
-
-#define ck_throw_new_galloc(num) \
-do{ \
-    int cid = currid;\
-    while( (cid=PLNE_ptr[cid]->direct) != -1 ) { \
-       if ( PLNE_ptr[cid]->proc[num] ) {new_galloc(cid);} \
-    }\
-}while(0)
-
-
-
-
-  /* Structures */
-typedef struct addr_tbl {
-   struct addr_tbl* next;
-   struct addr_tbl* prev;
-   q* localA;
-   q* globalA;
-} TADDRtbl;
-
-struct ex_goalrec {
-   struct ex_goalrec* next;
-   long prio;
-   struct goalrec goal;
-} ;
-
-typedef struct PE_shook {
-   struct PE_shook*   next;
-   long               PE_num;
-   long               prio;
-   TADDRtbl*          indp;
-} Sinfo;
-
-typedef struct shvar {
-   struct generator_object_method_table* method;
-   Sinfo* chain;
-} Shvar;
-
-/* Management table of a shared memory plain */
-typedef struct {
-   long* top_addr;
-   long* caddr;
-   long  direct;
-   long  demand;
-   long  proc[MAX_N_PE];
-   long* limit1;
-   long* limit2;
-   long* limit3;
-} PLNE;
-
-/* External declarations */
-
-/* lock table address */
-extern int* lockp[];
-
-/* common variables */
-extern int F_shm_gc;
-
-extern volatile PLNE* PLNE_ptr[];
-
-extern int* volatile pe_status;
-extern int* volatile cur_status;
-
-extern long* volatile Prof_measure;
-
-extern struct global_variables* top_shm_glbl;
-
-extern int* top_shm_pid;
-
-extern struct ex_goalrec** volatile top_shm_qp;
-
-/* runtime/shm_rsv.c */
-extern char* shm_start_addr;
-extern int ATOM_TABLE_SIZE;
-
-/* memorized the last generated variable on shm */
-extern q last_shm_var;
-
-extern struct generator_object* qSHM_BUSY;
-extern struct generator_object* pSHM_VAR;
-extern struct generator_object_method_table* SHM_BUSY;
-extern struct generator_object_method_table* SHM_VAR;
-
-/* current shared memory top address, limit of myself */
-extern q* gallocp;
-extern q* glimit;
-
-extern TADDRtbl ADDRtbl;
-extern TADDRtbl* ADDRtbl_free;
-
-
-/* Declarations of functions */
-
-/* runtime/shm_rsv.c */
-
-/* common routines */
-extern struct global_variables* shm_init(struct global_variables* glbl);
-
-/* allocate shared memory routines */
-extern q* shm_galloc(int siz);
-
-
-/* runtime/shm_throw.c */
- 
-/* convert real PE number from Logical PE number */
-extern int phisc_pe(int NO);
-
-/* copy into shared memory */
-extern struct ex_goalrec* shm_goal_copy(struct goalrec* qp, long prio);
-
-/* copy argument into shared memory */
-extern q shm_copy(q src);
-
-/* stack a goal */
-extern int shm_goal_stack(struct ex_goalrec* goal, int num);
-
-
-/* runtime/shm_obj.c */
-
-extern Shvar* create_genhook(q* la, q* ga);
-
-extern Shvar* shm_add_consumer(
-  q shv, Shvar* shobj, q cvar, struct global_variables* glbl );
-
-extern q* shm_ck_request(q* allocp, Sinfo* chain);
-extern q* shm_resume_goals(q* allocp, Sinfo* hook);
-
-extern TADDRtbl* create_local_tbl(q* lcl, q* gbl);
-
-
-/* runtime/newatom.c */
-extern void init_shm_atom(void);
-
-/* runtime/sched.c */
-extern struct goalrec* get_invoked_goals(struct goalrec* qp);
-
-/* runtime/shm_gc.c  GC routines */
-extern int ck_shm_gc(void);
-extern struct goalrec* shm_gc(struct goalrec* qp);
-
-/* for GC */
-
-extern q** shm_gcstack;
-extern q** shm_gcmax;
-extern q** shm_sp;
-extern int shm_gcstack_size;
-
-/* for debugging */
-#define debug_wait()  do{ while(!*pe_status) {} }while(0)
-
-#endif /* _KLIC_SHM_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/shm_machine.h klic-3.003-2001-12-28/include/klic/shm_machine.h
--- klic-3.003-2001-12-27/include/klic/shm_machine.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/shm_machine.h	Thu Jan  1 09:00:00 1970
@@ -1,229 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1994,1995 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.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_SHM_MACHINE_H_
-#define _KLIC_SHM_MACHINE_H_
-
-  /* lock-unlock */
-#ifdef SPARC
-
-#define n_lock(shvp,sadp) ( { \
-    register int* s1 asm ("g4") = (int*) (shvp); \
-    register int* s2 asm ("g3") = (int*) (sadp); \
-    register struct generator_object* befp asm ("g2");          \
-    register struct generator_object* genp asm ("g5") = qSHM_BUSY; \
-    asm ( "                   \
-0:                            \
-        mov %%g5,%%g2;        \
-        swap [%%g3 + 4],%%g2; \
-        cmp %%g2,%%g5;        \
-        bne 4f;               \
-        nop;                  \
-2:                            \
-        ld [%%g4],%%g2;       \
-        cmp %%g3,%%g2;        \
-        bne 3f;               \
-        nop;                  \
-        ld [%%g3 + 4],%%g2;   \
-        cmp %%g2,%%g5;        \
-        bne 0b;               \
-        nop;                  \
-        b 2b;                 \
-        nop;                  \
-3:                            \
-        mov %%g5,%%g2;        \
-4:                            \
-" : "=g" (befp), "=g" (s1) : "g" (s1), "g" (s2), "g" (genp)  );    \
-  (shvp) = (q)s1;               \
-  befp;                       \
-  } )
-
-#define n_unlock(sadp, genh) \
-do{ \
-    register int* n1 asm ("g3") = (int*) (sadp); \
-    register struct generator_object* n2 asm ("g4") = (genh); \
-    asm volatile ( "         \
-        stbar;               \
-        st %%g4,[%%g3 + 4];  \
-" :  : "g" (n1), "g" (n2) ) ;\
-}while(0)
-
-#define s_lock(key) \
-do{ \
-    register int* val asm ("g3") = lockp[key]; \
-    asm volatile ( "         \
-0:                           \
-        mov -1,%%g2;         \
-        swap [%%g3],%%g2;    \
-        cmp %%g2,0;          \
-        be 3f;               \
-        nop;                 \
-2:                           \
-        ld [%%g3],%%g2;      \
-        cmp %%g2,0;          \
-        be 0b;               \
-        nop;                 \
-        b 2b;                \
-        nop;                 \
-3:                           \
-" :  : "g" (val) : "g2" );   \
-}while(0)
-
-#define s_unlock(key) 
-do{ \
-    register int* val asm ("g3") = lockp[key]; \
-    asm volatile ( "         \
-        stbar;               \
-        st %%g0,[%%g3];      \
-" :  : "g" (val) ) ;         \
-}while(0)
-
-#define klic_barrier()  do{ asm volatile ( "stbar;" : : ); }while(0)
-
-#endif
-
-#ifdef ALPHA
-
-#define n_lock(shvp,sadp) ( { \
-    register long* s1 asm ("$4") = (long*) (shvp); \
-    register long* s2 asm ("$3") = (long*) (sadp); \
-    register struct generator_object* genp asm ("$5") = qSHM_BUSY; \
-    register struct generator_object* befp asm ("$2");           \
-    asm volatile ( "          \
-1:                            \
-        ldq_l $2,8($3);       \
-        cmpeq $2,$5,$1;       \
-        bne   $1,2f;          \
-        bis   $5,$5,$1;       \
-        stq_c $1,8($3);       \
-        bne   $1,3f;          \
-2:                            \
-        ldq   $2,8($3);       \
-        cmpeq $2,$5,$1;       \
-        beq   $1,1b;          \
-        ldq   $1,($4);        \
-        cmpeq $3,$1,$1;       \
-        beq   $1,3f;          \
-        br    2b;             \
-3:                            \
-        mb;                   \
-" : "=g" (befp), "=g" (s1) : "g" (s1), "g" (s2), "g" (genp) : "$1" );    \
-  (shvp) = (q)s1;               \
-  befp;                       \
-  } )
-
-#define n_unlock(sadp, genh) \
-do{ \
-    register long* n1 asm ("$3") = (long*) (sadp); \
-    register struct generator_object* n2 asm ("$4") = (genh); \
-    asm volatile ( "         \
-        mb;                  \
-        stq $4,8($3);        \
-" :  : "g" (n1), "g" (n2) ) ;\
-}while(0)
-
-#define s_lock(key) \
-do{ \
-    register int* val asm ("$3") = lockp[key]; \
-    asm volatile ( "        \
-1:                          \
-        ldl_l $1,0($3);     \
-        blbs  $1,2f;        \
-        or    $1,1,$2;      \
-        stl_c $2,0($3);     \
-        beq   $2,2f;        \
-        br    3f;           \
-2:                          \
-        ldl   $1,0($3);     \
-        blbc  $1,1b;        \
-        br    2b;           \
-3:                          \
-" :  : "g" (val) : "$1","$2" ); \
-}while(0)
-
-#define s_unlock(key) \
-do{ \
-    register int* val asm ("$3") = lockp[key]; \
-    asm volatile ( "        \
-        mb;                 \
-        stl $31,0($3);      \
-" :  : "g" (val) ) ;        \
-}while(0)
-
-
-#define klic_barrier()  do{ asm volatile ( "mb;" : : ); }while(0)
-
-#endif
-
-#ifdef INTEL
-#define n_lock(shvp, sadp) ({ \
-    register int* s1 asm ("%edx") =  (int *) (shvp);  \
-    register int* s2 asm ("%ecx") =  (int *) (sadp);  \
-    register struct generator_object* befp asm ("%ebx"); \
-    register struct generator_object* genp asm ("%eax") = qSHM_BUSY; \
-    asm ( "                     \
-0:                              \
-        movl  %%eax,%%ebx;      \
-        xchgl 4(%%ecx),%%ebx;   \
-        cmpl  %%ebx,%%eax;      \
-        jne   4f;               \
-2:                              \
-        movl  (%%edx),%%ebx;    \
-        cmpl  %%ecx,%%ebx;      \
-        jne   3f;               \
-        movl  4(%%ecx),%%ebx;   \
-        cmpl  %%ebx,%%eax;      \
-        jne   0b;               \
-        jmp   2b;               \
-3:                              \
-        movl  %%eax,%%ebx;      \
-4:                              \
-" : "=g" (befp), "=g" (s1) : "g" (s1), "g" (s2), "g" (genp)  );    \
-  (shvp) = (q)s1;               \
-  befp;                       \
-  } )
-
-#define n_unlock(sadp,genh) \
-do{ \
-    register int* n1 asm ("%ecx") = (int*) (sadp); \
-    register struct generator_object* n2 asm ("%edx") = (genh); \
-    asm volatile ( "         \
-        movl %%edx,4(%%ecx);  \
-" :  : "g" (n1), "g" (n2) ) ;\
-}while(0)
-
-#define s_lock(key) { \
-    register int* val asm ("%ecx") = lockp[key]; \
-    asm volatile ( "         \
-        movl $0,%%edx;       \
-6:                           \
-        movl $-1,%%ebx;      \
-        xchgl (%%ecx),%%ebx; \
-        cmpl %%ebx,%%edx;    \
-        je  8f;              \
-7:                           \
-        movl (%%ecx),%%ebx;  \
-        cmpl %%ebx,%%edx;    \
-        je  6b;              \
-        jmp 7b;              \
-8:                           \
-" :  : "g" (val) : "%ebx","%edx" );   \
-}while(0)
-
-#define s_unlock(key) \
-do{      \
-    register int* val asm ("ecx") = lockp[key]; \
-    asm volatile ( "         \
-        movl $0,(%%ecx);     \
-" :  : "g" (val) ) ;         \
-}while(0)
-
-#define klic_barrier()  do{;}while(0)
-
-#endif
-
-#endif /* _KLIC_SHM_MACHINE_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/susp.h klic-3.003-2001-12-28/include/klic/susp.h
--- klic-3.003-2001-12-27/include/klic/susp.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/susp.h	Thu Jan  1 09:00:00 1970
@@ -1,139 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)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.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_SUSP_H_
-#define _KLIC_SUSP_H_
-
-/******************************
-  Suspension Structures
-*******************************/
-
-/*
-  Variables _with_ suspended goals are represented as
-    a two-word pointer loop,
-    the second word being the suspension record structure.
-*/
-
-struct hook {
-  struct hook* next;		/* next suspension structure */
-  union goal_or_consumer {
-    long l;			/* long integer for tag manipulation */
-    struct goalrec* g;		/* pointer to a goal record */
-    struct consumer_object* o;	/* pointer to a consumer object */
-  } u;
-};
-
-#define CONSUMER_HOOK_TAG 1
-
-#define is_consumer_hook(u) \
-  ((u.l&CONSUMER_HOOK_TAG) == 1)
-
-#define tag_consumer_hook(obj) \
-  ((struct consumer_object*) ((long)(obj)+CONSUMER_HOOK_TAG))
-
-#define untag_consumer_hook(obj) \
-  ((struct consumer_object*) ((long)(obj)-CONSUMER_HOOK_TAG))
-
-struct susprec {
-  q backpt;
-  union {
-    struct hook first_hook;
-    long l;
-  } u;
-};
-
-#define suspp(x)	((struct susprec*) ((unsigned long)(x) - VARREF))
-
-#define allocnewsusp(var,srec)						\
-do{									\
-  q* temp;								\
-  heapalloc(temp, (sizeof(struct susprec))/sizeof(q)+1, (q*));		\
-  initnewsusp(temp, (var), (srec));					\
-}while(0)
-
-#define makenewsusp(var,srec,allocp)					\
-do{									\
-  initnewsusp((allocp), (var), (srec));					\
-  (allocp) += sizeof(struct susprec)/sizeof(q)+1;			\
-}while(0)
-
-#define initnewsusp(temp,var,srec)					\
-do{									\
-  (var) = makeref(temp);						\
-  (srec) = (struct susprec*) ((temp) + 1);				\
-  derefone(var) = (q) (srec);						\
-  (srec)->backpt = (var);						\
-  (srec)->u.first_hook.next = &(srec)->u.first_hook;			\
-}while(0)
-
-#define allochook(oldhook,newhook)					\
-do{									\
-  heapalloc((newhook), sizeof(struct hook)/sizeof(q), (struct hook*));	\
-  initnewhook((oldhook), (newhook));					\
-}while(0)
-
-#define addhook(oldhook,newhook,allocp)					\
-do{									\
-  (newhook) = (struct hook*) (allocp);					\
-  initnewhook((oldhook), (newhook));					\
-  (allocp) += sizeof(struct hook) / sizeof(q);				\
-}while(0)
-
-#define initnewhook(oldhook,newhook)					\
-do{									\
-  (newhook)->next= (oldhook)->next;					\
-  (oldhook)->next = (newhook);						\
-}while(0)
-
-/*
-  generator object support
-*/
-
-struct generator_susp {
-  q backpt;
-  union {
-    struct generator_object* o;
-    long l;
-  } u;
-};
-
-#define generator_suspp(susp) ((struct generator_susp*) (susp))
-
-#define GENERATOR_OBJECT_TAG 1
-
-#define is_generator_susp(u) \
-  ((u.l)&GENERATOR_OBJECT_TAG == 1)
-
-#define tag_generator_susp(obj) \
-  ((struct generator_object*) ((long)(obj) + GENERATOR_OBJECT_TAG))
-
-#define untag_generator_susp(obj) \
-  ((struct generator_object*) ((long)(obj) - GENERATOR_OBJECT_TAG))
-
-#define allocnewgensusp(var,gsusp) \
-do{ \
-  q* tmp; \
-  heapalloc(tmp, (sizeof(struct generator_susp))/sizeof(q)+1, (q*)); \
-  initnewgensusp(tmp, (var), (gsusp)); \
-}while(0)
-
-#define initnewgensusp(tmp, var, gsusp) \
-do{ \
-  (var) = makeref(tmp); \
-  (gsusp) = (struct generator_susp*) ((tmp) + 1); \
-  derefone(var) = (q) (gsusp); \
-  (gsusp)->backpt = (var); \
-}while(0)
-
-/* Perpetual Suspension Detection */
-
-struct suspended_goal_rec {
-  struct goalrec* goal;
-  struct suspended_goal_rec* next;
-};
-
-#endif /* _KLIC_SUSP_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/timer.h klic-3.003-2001-12-28/include/klic/timer.h
--- klic-3.003-2001-12-27/include/klic/timer.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/timer.h	Thu Jan  1 09:00:00 1970
@@ -1,59 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1995 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.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_TIMER_H_
-#define _KLIC_TIMER_H_
-
-struct klic_timer_wait_rec {
-  struct klic_timer_wait_rec* next;
-  struct timeval on_at;
-  struct timeval interval;
-  void(* func)();
-};
-
-#define NotLaterThan(x, y) 				\
-((x).tv_sec < (y).tv_sec ||				\
- ((x).tv_sec == (y).tv_sec && (x).tv_usec <= (y).tv_usec))
-
-#define Million 1000000
-
-#define TimeSet(x, s, u)				\
-do{ (x).tv_sec = (s); (x).tv_usec = (u); }while(0)
-
-#define TimeIsZero(x)					\
-((x).tv_sec == 0 && (x).tv_usec == 0)
-
-#define TimeSub(x, y, z)				\
-do{ \
-  if ((x).tv_usec-(y).tv_usec >= 0) {			\
-    (z).tv_sec = (x).tv_sec - (y).tv_sec;			\
-    (z).tv_usec = (x).tv_usec - (y).tv_usec;		\
-  } else {						\
-    (z).tv_sec = (x).tv_sec - (y).tv_sec - 1;		\
-    (z).tv_usec = Million + (x).tv_usec - (y).tv_usec;	\
-  } \
-}while(0)
-
-#define TimeAdd(x, y, z)				\
-do{ \
-  if ((x).tv_usec+(y).tv_usec < Million) {		\
-    (z).tv_sec = (x).tv_sec + (y).tv_sec;			\
-    (z).tv_usec = (x).tv_usec + (y).tv_usec;		\
-  } else {						\
-    (z).tv_sec = (x).tv_sec + (y).tv_sec + 1;		\
-    (z).tv_usec = (x).tv_usec + (y).tv_usec - Million;	\
-  } \
-}while(0)
-
-/* runtime/timer.c */
-extern void klic_gettod(struct timeval* now);
-extern void call_at_specified_time(long sec, long usec, void(* func)());
-extern void call_after_specified_interval(long sec, long usec, void(* func)());
-extern void call_at_time_intervals(long sec, long usec, void(* func)());
-extern void init_virtualized_timer(void);
-
-#endif /* _KLIC_TIMER_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/timing.h klic-3.003-2001-12-28/include/klic/timing.h
--- klic-3.003-2001-12-27/include/klic/timing.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/timing.h	Thu Jan  1 09:00:00 1970
@@ -1,43 +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.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_TIMING_H_
-#define _KLIC_TIMING_H_
-
-#include <sys/types.h>
-
-#define  field_diff(field)	(after.field - before.field)
-
-#ifdef GETRUSAGE
-
-#include <sys/time.h>
-#include <sys/resource.h>
-
-#define  diff_usec(field)\
-(field_diff(field.tv_sec) * 1000000 + field_diff(field.tv_usec))
-
-typedef struct rusage timerstruct;
-#define	 measure(x)	getrusage(RUSAGE_SELF, &(x))
-
-#else 
-
-#include <sys/times.h>
-#include <sys/param.h>
-
-#define	 tick2msec(n)	((n)*1000.0/HZ)
-
-typedef struct tms timerstruct;
-#define	 measure(x)	times(&(x))
-
-#endif
-
-Extern int gctimes Init(0);
-Extern int gcums Init(0);
-Extern int gcsms Init(0);
-Extern int measure_gc Init(0);
-
-#endif /* _KLIC_TIMING_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/trace.h klic-3.003-2001-12-28/include/klic/trace.h
--- klic-3.003-2001-12-27/include/klic/trace.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/trace.h	Thu Jan  1 09:00:00 1970
@@ -1,71 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1994,1995 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.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_TRACE_H_
-#define _KLIC_TRACE_H_
-
-/*
-  Tracer Status Information
-*/
-
-struct trace_info_rec {
-  FILE* in;
-  FILE* out;
-  q original_arg;
-  int enabled, leashed, leaping, spying;
-  int verbose;
-  unsigned long print_depth, print_length;
-};
-
-#define Leaping(info)		((info)->leaping)
-#define Spying(info)		((info)->spying)
-#define EnabledPorts(info)	((info)->enabled)
-#define LeashedPorts(info)	((info)->leashed)
-#define Enabled(info,port)	((EnabledPorts(info) >> (int)(port)) & 1)
-#define Leashed(info,port)	((LeashedPorts(info) >> (int)(port)) & 1)
-#define Verbose(info)		((info)->verbose)
-#define Depth(info)		((info)->print_depth)
-#define Length(info)		((info)->print_length)
-
-#define InStream(info)		((info)->in)
-#define OutStream(info)		((info)->out)
-
-/*
-  Info on Enqueued Goals
-*/
-
-struct enqueue_trace_rec {
-  struct enqueue_trace_rec* next;
-  struct goalrec* g;
-  long prio;
-};
-
-/*
-  Name Tables
-*/
-
-struct mod_table_entry {
-  module(* func)();
-  const unsigned char* name;
-};
-
-struct pred_table_entry {
-  const struct predicate* pred;
-  const struct mod_table_entry* mte;
-  const unsigned char* name;
-  char spied;
-  char default_trace;
-};
-
-/*
-  Trace Control
-*/
-
-enum trace_port {
-  Call, Susp, Reduce, Fail, AllPorts, NoMorePort, UnknownPort };
-
-#endif /* _KLIC_TRACE_H_ */
diff -ruN klic-3.003-2001-12-27/include/klic/traceio.h klic-3.003-2001-12-28/include/klic/traceio.h
--- klic-3.003-2001-12-27/include/klic/traceio.h	Thu Dec 27 19:15:58 2001
+++ klic-3.003-2001-12-28/include/klic/traceio.h	Thu Jan  1 09:00:00 1970
@@ -1,26 +0,0 @@
-/* ---------------------------------------------------------- 
-%   (C)1993,1994,1995 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.)
------------------------------------------------------------ */
-
-#ifndef _KLIC_TRACEIO_H_
-#define _KLIC_TRACEIO_H_
-
-#ifdef DIST
-#define TRACE_ATTACHIO()	AttachIO()
-#define TRACE_DETACHIO()	DetachIO()
-#else
-# ifdef SHM
-#define TRACE_ATTACHIO() \
-  do{ if (!shm_trace_lock) {s_lock(tr_key()); shm_trace_lock=1;} }while(0)
-#define TRACE_DETACHIO() \
-  do{ shm_trace_lock=0; s_unlock(tr_key()); }while(0)
-# else
-#define TRACE_ATTACHIO()
-#define TRACE_DETACHIO()
-# endif
-#endif
-
-#endif /* _KLIC_TRACEIO_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/Makefile.tail klic-3.003-2001-12-28/runtime/Makefile.tail
--- klic-3.003-2001-12-27/runtime/Makefile.tail	Thu Dec 27 19:17:37 2001
+++ klic-3.003-2001-12-28/runtime/Makefile.tail	Fri Dec 28 13:46:47 2001
@@ -258,10 +258,10 @@
 intrpt-d.c: intrpt.c
 	rm -f $@; $(LN) $? $@
 
-kmain-d.o: kmain-d.c ../include/klic/distproc.h ../include/klic/interpe.h \
+kmain-d.o: kmain-d.c interpe.h ../include/klic/distproc.h \
 	../include/klic/distio.h ../include/klic/distpkt.h
 	$(CC) $(DISTCFLAGS) -c kmain-d.c
-debug-d.o: debug-d.c ../include/klic/interpe.h ../include/klic/distio.h
+debug-d.o: debug-d.c interpe.h ../include/klic/distio.h
 	$(CC) $(DISTCFLAGS) -c debug-d.c
 gio-d.o: gio-d.c
 	$(CC) $(DISTCFLAGS) -c gio-d.c
@@ -311,7 +311,7 @@
 pipedio: pipedio.c
 	$(CC) $(CFLAGS) $(LDFLAGS) -I../include -o pipedio pipedio.c
 
-kmain-s.o: kmain.c ../include/klic/options.h
+kmain-s.o: kmain.c options.h
 	$(CC) $(SHMCFLAGS) -c -o kmain-s.o kmain.c
 options-s.o: options.c
 	$(CC) $(SHMCFLAGS) -c -o options-s.o options.c
@@ -478,19 +478,20 @@
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h
 gc.o: gc.c \
+    timing.h gobj.h susp.h \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
-    ../include/klic/control.h ../include/klic/timing.h \
-    ../include/klic/functorstuffs.h ../include/klic/gobj.h \
-    ../include/klic/g_methtab.h ../include/klic/susp.h
+    ../include/klic/control.h ../include/klic/functorstuffs.h \
+    ../include/klic/g_methtab.h
 unify2.o: unify2.c \
+    gobj.h \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/unify.h \
     ../include/klic/index.h ../include/klic/gb.h \
-    ../include/klic/functorstuffs.h ../include/klic/gobj.h \
+    ../include/klic/functorstuffs.h \
     ../include/klic/g_methtab.h
 version.o: version.c
 cmphsh.o: cmphsh.c \
@@ -515,36 +516,36 @@
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/sighndl.h 
 asyncio.o: asyncio.c \
+    asyncio.h \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/unify.h ../include/klic/asyncio.h 
+    ../include/klic/unify.h
 faisus.o: faisus.c \
+    susp.h gobj.h \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/alloc.h ../include/klic/control.h \
-    ../include/klic/susp.h ../include/klic/generic.h \
-    ../include/klic/g_methtab.h ../include/klic/gobj.h
+    ../include/klic/generic.h ../include/klic/g_methtab.h
 intrpt.o: intrpt.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/sighndl.h ../include/klic/primitives.h \
     ../include/klic/alloc.h ../include/klic/control.h \
-    ../include/klic/schedule.h
+    schedule.h
 print.o: print.c \
+    gobj.h susp.h \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/index.h ../include/klic/gb.h \
     ../include/klic/functorstuffs.h ../include/klic/atomstuffs.h \
-    ../include/klic/gobj.h ../include/klic/g_methtab.h \
-    ../include/klic/susp.h
+    ../include/klic/g_methtab.h
 unify.o: unify.c \
+    schedule.h gobj.h susp.h \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
-    ../include/klic/control.h ../include/klic/schedule.h \
-    ../include/klic/gb.h ../include/klic/gobj.h \
-    ../include/klic/g_methtab.h ../include/klic/susp.h
+    ../include/klic/control.h ../include/klic/gb.h ../include/klic/g_methtab.h
 bb.o: bb.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
@@ -563,15 +564,15 @@
     ../include/klic/g_extern.h ../include/klic/g_extinl.h \
     ../include/klic/g_methtab.h ../include/klic/functorstuffs.h \
     ../include/klic/atomstuffs.h ../include/klic/gd_macro.h \
-    ../include/klic/susp.h
+    susp.h
 trace.o: trace.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/predinfo.h \
     ../include/klic/generic.h ../include/klic/g_methtab.h \
-    ../include/klic/functorstuffs.h ../include/klic/susp.h \
-    ../include/klic/trace.h ../include/klic/traceio.h 
+    ../include/klic/functorstuffs.h \
+    susp.h trace.h traceio.h 
 otbl.o: otbl.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
@@ -582,77 +583,75 @@
 gg_shvar.o: gg_shvar.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h
+    shm.h shm_machine.h
 gg_shbusy.o: gg_shbusy.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h 
+    shm.h shm_machine.h 
 shm_rsv.o: shm_rsv.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h
+    shm.h shm_machine.h
 shm_throw.o: shm_throw.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h
+    shm.h shm_machine.h
 shm_obj.o: shm_obj.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h
+    shm.h shm_machine.h
 shm_gc.o: shm_gc.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h
+    shm.h shm_machine.h
 bodyblt-s.o: bodyblt.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h
+    shm.h shm_machine.h
 gunix-s.o: gunix.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h
+    shm.h shm_machine.h
 kaim-s.o: kmain.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h \
-    ../include/klic/options.h
+    shm.h shm_machine.h options.h
 options-s.o: options.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h \
-    ../include/klic/options.h
+    shm.h shm_machine.h options.h
 debug-s.o: debug.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h
+    shm.h shm_machine.h
 sched-s.o: sched.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h
+    shm.h shm_machine.h
 intrpt-s.o: intrpt.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h
+    shm.h shm_machine.h
 gc-s.o: gc.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h 
+    shm.h shm_machine.h 
 gmvv-s.o: gmvv.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h 
+    shm.h shm_machine.h 
 gstring-s.o: gstring.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/shm.h ../include/klic/shm_machine.h 
+    shm.h shm_machine.h 
 main.o: main.c
 timer.o: timer.c \
     ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/timer.h
+    timer.h
 ktimer.o: ktimer.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/timer.h ../include/klic/sighndl.h 
+    timer.h ../include/klic/sighndl.h 
 xio.o: xio.c \
     ../include/klic/basic.h ../include/klic/config.h 
 kmain.o: kmain.c \
@@ -660,8 +659,8 @@
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/unify.h \
-    ../include/klic/timing.h ../include/klic/functorstuffs.h \
-    ../include/klic/options.h
+    ../include/klic/functorstuffs.h \
+    timing.h options.h
 debug.o: debug.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
@@ -678,7 +677,7 @@
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/sighndl.h ../include/klic/primitives.h \
     ../include/klic/alloc.h ../include/klic/control.h \
-    ../include/klic/schedule.h
+    schedule.h
 gmvv.o: gmvv.c \
     ../include/klic/gdobject.h ../include/klic/basic.h \
     ../include/klic/config.h ../include/klic/struct.h \
@@ -698,7 +697,7 @@
     ../include/klic/unify.h ../include/klic/index.h ../include/klic/gb.h \
     ../include/klic/bb.h ../include/klic/g_basic.h \
     ../include/klic/g_methtab.h ../include/klic/g_extern.h \
-    ../include/klic/g_extinl.h ../include/klic/g_pointer.h \
+    ../include/klic/g_extinl.h g_pointer.h \
     ../include/klic/g_string.h ../include/klic/gd_macro.h \
     ../include/klic/atomstuffs.h ../include/klic/functorstuffs.h \
     ../include/klic/gc_macro.h ../include/klic/gc_methtab.h
@@ -721,7 +720,7 @@
     ../include/klic/unify.h ../include/klic/index.h ../include/klic/gb.h \
     ../include/klic/bb.h ../include/klic/g_basic.h \
     ../include/klic/g_extern.h ../include/klic/g_extinl.h \
-    ../include/klic/g_methtab.h ../include/klic/g_termarray.h \
+    ../include/klic/g_methtab.h g_termarray.h \
     ../include/klic/gd_macro.h ../include/klic/gd_methtab.h
 gfloat.o: gfloat.c \
     ../include/klic/gdobject.h ../include/klic/basic.h \
@@ -780,7 +779,7 @@
     ../include/klic/g_methtab.h ../include/klic/predinfo.h \
     ../include/klic/atomstuffs.h ../include/klic/functorstuffs.h \
     ../include/klic/gd_macro.h ../include/klic/gmodule.h \
-    ../include/klic/goalobj.h ../include/klic/gd_methtab.h
+    goalobj.h ../include/klic/gd_methtab.h
 gpointer.o: gpointer.c \
     ../include/klic/gdobject.h ../include/klic/basic.h \
     ../include/klic/config.h ../include/klic/struct.h \
@@ -789,13 +788,13 @@
     ../include/klic/unify.h ../include/klic/index.h ../include/klic/gb.h \
     ../include/klic/bb.h ../include/klic/g_basic.h \
     ../include/klic/g_extern.h ../include/klic/g_extinl.h \
-    ../include/klic/g_methtab.h ../include/klic/g_pointer.h \
+    ../include/klic/g_methtab.h g_pointer.h \
     ../include/klic/gd_macro.h ../include/klic/gd_methtab.h
 random.o: random.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/g_methtab.h ../include/klic/g_basic.h \
-    ../include/klic/gg_macro.h ../include/klic/susp.h \
+    ../include/klic/gg_macro.h susp.h \
     ../include/klic/gg_methtab.h
 atomt.o: atomt.c \
     ../include/klic/klichdr.h ../include/klic/basic.h \
@@ -840,8 +839,8 @@
     ../include/klic/g_methtab.h ../include/klic/g_string.h \
     ../include/klic/g_vector.h ../include/klic/g_float.h \
     ../include/klic/gmodule.h ../include/klic/atomstuffs.h \
-    ../include/klic/functorstuffs.h ../include/klic/gobj.h \
-    ../include/klic/g_pointer.h ../include/klic/g_termarray.h
+    ../include/klic/functorstuffs.h \
+    gobj.h g_pointer.h g_termarray.h
 iarith.o: iarith.c \
     ../include/klic/klichdr.h ../include/klic/basic.h \
     ../include/klic/config.h ../include/klic/struct.h \
@@ -874,7 +873,7 @@
     ../include/klic/g_methtab.h ../include/klic/g_string.h \
     ../include/klic/g_vector.h ../include/klic/g_float.h \
     ../include/klic/gmodule.h ../include/klic/atomstuffs.h \
-    ../include/klic/functorstuffs.h ../include/klic/gobj.h
+    ../include/klic/functorstuffs.h gobj.h
 sysc.o: sysc.c \
     ../include/klic/klichdr.h ../include/klic/basic.h \
     ../include/klic/config.h ../include/klic/struct.h \
@@ -1072,7 +1071,7 @@
     ../include/klic/g_methtab.h ../include/klic/g_string.h \
     ../include/klic/g_vector.h ../include/klic/g_float.h \
     ../include/klic/gmodule.h ../include/klic/atomstuffs.h \
-    ../include/klic/functorstuffs.h ../include/klic/timer.h
+    ../include/klic/functorstuffs.h timer.h
 bodyblt-d.o: bodyblt-d.c \
     ../include/klic/klichdr.h ../include/klic/basic.h \
     ../include/klic/config.h ../include/klic/struct.h \
@@ -1083,7 +1082,7 @@
     ../include/klic/g_methtab.h ../include/klic/g_string.h \
     ../include/klic/g_vector.h ../include/klic/g_float.h \
     ../include/klic/gmodule.h ../include/klic/atomstuffs.h \
-    ../include/klic/functorstuffs.h ../include/klic/timing.h 
+    ../include/klic/functorstuffs.h timing.h 
 gunix-d.o: gunix-d.c \
     ../include/klic/klichdr.h ../include/klic/basic.h \
     ../include/klic/config.h ../include/klic/struct.h \
@@ -1094,8 +1093,8 @@
     ../include/klic/g_methtab.h ../include/klic/g_string.h \
     ../include/klic/g_vector.h ../include/klic/g_float.h \
     ../include/klic/gmodule.h ../include/klic/atomstuffs.h \
-    ../include/klic/functorstuffs.h ../include/klic/gobj.h \
-    ../include/klic/g_pointer.h ../include/klic/gd_macro.h 
+    ../include/klic/functorstuffs.h \
+    gobj.h g_pointer.h ../include/klic/gd_macro.h 
 io-d.o: io-d.c \
     ../include/klic/klichdr.h ../include/klic/basic.h \
     ../include/klic/config.h ../include/klic/struct.h \
@@ -1106,30 +1105,27 @@
     ../include/klic/g_methtab.h ../include/klic/g_string.h \
     ../include/klic/g_vector.h ../include/klic/g_float.h \
     ../include/klic/gmodule.h ../include/klic/atomstuffs.h \
-    ../include/klic/functorstuffs.h ../include/klic/gobj.h \
-    ../include/klic/g_pointer.h
+    ../include/klic/functorstuffs.h \
+    gobj.h g_pointer.h
 cntlmsg.o: cntlmsg.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/unify.h \
-    ../include/klic/functorstuffs.h ../include/klic/timing.h \
-    ../include/klic/gb.h ../include/klic/gobj.h \
-    ../include/klic/g_methtab.h ../include/klic/susp.h \
-    ../include/klic/atomstuffs.h ../include/klic/interpe.h \
-    ../include/klic/distpkt.h ../include/klic/rmon.h \
+    ../include/klic/functorstuffs.h timing.h \
+    ../include/klic/gb.h ../include/klic/g_methtab.h \
+    ../include/klic/atomstuffs.h ../include/klic/distpkt.h \
     ../include/klic/generic.h ../include/klic/index.h \
     ../include/klic/distio.h ../include/klic/distproc.h \
-    ../include/klic/ge_exref.h
+    gobj.h susp.h interpe.h rmon.h ge_exref.h
 datamsg.o: datamsg.c \
+    timing.h gobj.h susp.h interpe.h \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/unify.h \
-    ../include/klic/functorstuffs.h ../include/klic/timing.h \
-    ../include/klic/gb.h ../include/klic/gobj.h \
-    ../include/klic/g_methtab.h ../include/klic/susp.h \
-    ../include/klic/atomstuffs.h ../include/klic/interpe.h \
+    ../include/klic/functorstuffs.h ../include/klic/gb.h \
+    ../include/klic/g_methtab.h ../include/klic/atomstuffs.h \
     ../include/klic/distpkt.h ../include/klic/generic.h \
     ../include/klic/index.h ../include/klic/distio.h \
     ../include/klic/distproc.h
@@ -1138,8 +1134,8 @@
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/unify.h \
-    ../include/klic/timing.h ../include/klic/index.h \
-    ../include/klic/interpe.h ../include/klic/distpkt.h \
+    timing.h interpe.h \
+    ../include/klic/index.h ../include/klic/distpkt.h \
     ../include/klic/distio.h ../include/klic/distproc.h
 ge_exref.o: ge_exref.c \
     ../include/klic/basic.h ../include/klic/config.h \
@@ -1148,11 +1144,11 @@
     ../include/klic/control.h ../include/klic/unify.h \
     ../include/klic/index.h ../include/klic/gb.h ../include/klic/bb.h \
     ../include/klic/g_basic.h ../include/klic/g_extern.h \
-    ../include/klic/g_extinl.h ../include/klic/susp.h \
-    ../include/klic/gg_macro.h ../include/klic/interpe.h \
+    ../include/klic/g_extinl.h susp.h \
+    ../include/klic/gg_macro.h interpe.h \
     ../include/klic/distpkt.h ../include/klic/distio.h \
     ../include/klic/distproc.h ../include/klic/atomstuffs.h \
-    ../include/klic/functorstuffs.h ../include/klic/ge_exref.h \
+    ../include/klic/functorstuffs.h ge_exref.h \
     ../include/klic/gc_macro.h ../include/klic/gd_macro.h \
     ../include/klic/generic.h ../include/klic/g_methtab.h \
     ../include/klic/gg_methtab.h
@@ -1164,7 +1160,7 @@
     ../include/klic/unify.h ../include/klic/index.h ../include/klic/gb.h \
     ../include/klic/bb.h ../include/klic/g_basic.h \
     ../include/klic/g_extern.h ../include/klic/g_extinl.h \
-    ../include/klic/g_methtab.h ../include/klic/interpe.h \
+    ../include/klic/g_methtab.h interpe.h \
     ../include/klic/distpkt.h ../include/klic/distio.h \
     ../include/klic/distproc.h ../include/klic/atomstuffs.h \
     ../include/klic/functorstuffs.h ../include/klic/gc_macro.h \
@@ -1185,42 +1181,41 @@
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/unify.h \
-    ../include/klic/timing.h ../include/klic/index.h \
-    ../include/klic/interpe.h ../include/klic/distpkt.h \
+    timing.h interpe.h \
+    ../include/klic/index.h ../include/klic/distpkt.h \
     ../include/klic/distio.h ../include/klic/distproc.h
 init_dist.o: init_dist.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/unify.h \
-    ../include/klic/timing.h ../include/klic/index.h \
-    ../include/klic/interpe.h ../include/klic/distpkt.h \
+    ../include/klic/index.h ../include/klic/distpkt.h \
     ../include/klic/distio.h ../include/klic/distproc.h \
-    ../include/klic/rmon.h 
+    timing.h interpe.h rmon.h 
 sendrecv.o: sendrecv.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/unify.h \
-    ../include/klic/timing.h ../include/klic/distio.h \
-    ../include/klic/distproc.h ../include/klic/interpe.h \
-    ../include/klic/distpkt.h ../include/klic/rmon.h
+    ../include/klic/distio.h ../include/klic/distproc.h \
+    ../include/klic/distpkt.h \
+    timing.h interpe.h rmon.h
 distrmon.o: distrmon.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
-    ../include/klic/control.h ../include/klic/timing.h \
+    ../include/klic/control.h \
     ../include/klic/distio.h ../include/klic/distproc.h \
-    ../include/klic/interpe.h ../include/klic/distpkt.h \
-    ../include/klic/rmon.h
+    ../include/klic/distpkt.h \
+    timing.h interpe.h rmon.h
 profile.o: profile.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
-    ../include/klic/control.h ../include/klic/timing.h \
+    ../include/klic/control.h \
     ../include/klic/distio.h ../include/klic/distproc.h \
-    ../include/klic/interpe.h ../include/klic/distpkt.h \
-    ../include/klic/rmon.h
+    ../include/klic/distpkt.h \
+    timing.h interpe.h rmon.h
 gio-d.o: gio-d.c \
     ../include/klic/gcobject.h ../include/klic/basic.h \
     ../include/klic/config.h ../include/klic/struct.h \
@@ -1229,7 +1224,7 @@
     ../include/klic/unify.h ../include/klic/index.h ../include/klic/gb.h \
     ../include/klic/bb.h ../include/klic/g_basic.h \
     ../include/klic/g_methtab.h ../include/klic/g_extern.h \
-    ../include/klic/g_extinl.h ../include/klic/g_pointer.h \
+    ../include/klic/g_extinl.h g_pointer.h \
     ../include/klic/g_string.h ../include/klic/gd_macro.h \
     ../include/klic/distio.h ../include/klic/distproc.h \
     ../include/klic/atomstuffs.h ../include/klic/functorstuffs.h \
@@ -1243,7 +1238,7 @@
     ../include/klic/bb.h ../include/klic/g_basic.h \
     ../include/klic/g_extern.h ../include/klic/g_extinl.h \
     ../include/klic/g_methtab.h ../include/klic/g_vector.h \
-    ../include/klic/interpe.h ../include/klic/distpkt.h \
+    interpe.h ../include/klic/distpkt.h \
     ../include/klic/atomstuffs.h ../include/klic/functorstuffs.h \
     ../include/klic/gd_macro.h ../include/klic/gd_methtab.h
 gstring-d.o: gstring-d.c \
@@ -1256,7 +1251,7 @@
     ../include/klic/g_extern.h ../include/klic/g_extinl.h \
     ../include/klic/g_methtab.h ../include/klic/g_string.h \
     ../include/klic/atomstuffs.h ../include/klic/functorstuffs.h \
-    ../include/klic/interpe.h ../include/klic/distpkt.h \
+    interpe.h ../include/klic/distpkt.h \
     ../include/klic/gd_macro.h ../include/klic/gd_methtab.h
 trace-d.o: trace-d.c \
     ../include/klic/basic.h ../include/klic/config.h \
@@ -1264,13 +1259,13 @@
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/predinfo.h \
     ../include/klic/generic.h ../include/klic/g_methtab.h \
-    ../include/klic/functorstuffs.h ../include/klic/susp.h \
-    ../include/klic/trace.h ../include/klic/traceio.h \
+    ../include/klic/functorstuffs.h \
+    susp.h trace.h traceio.h \
     ../include/klic/distio.h ../include/klic/distproc.h 
 sched-d.o: sched-d.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/alloc.h ../include/klic/trace.h
+    ../include/klic/alloc.h trace.h
 newatom.o: newatom.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/newatom.h ../include/klic/struct.h \
@@ -1280,17 +1275,16 @@
     ../include/klic/atomstuffs.h 
 options.o: options.c \
     ../include/klic/basic.h ../include/klic/config.h \
-    ../include/klic/options.h
+    options.h
 kmain-d.o: kmain-d.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/unify.h \
-    ../include/klic/timing.h ../include/klic/functorstuffs.h \
+    ../include/klic/functorstuffs.h \
     ../include/klic/distio.h ../include/klic/distproc.h \
-    ../include/klic/interpe.h ../include/klic/distpkt.h \
-    ../include/klic/sighndl.h ../include/klic/rmon.h \
-    ../include/klic/options.h
+    ../include/klic/distpkt.h ../include/klic/sighndl.h \
+    timing.h interpe.h rmon.h options.h
 debug-d.o: debug-d.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
@@ -1298,34 +1292,34 @@
     ../include/klic/control.h ../include/klic/unify.h \
     ../include/klic/index.h ../include/klic/atomstuffs.h \
     ../include/klic/functorstuffs.h ../include/klic/distio.h \
-    ../include/klic/distproc.h ../include/klic/interpe.h \
+    ../include/klic/distproc.h interpe.h \
     ../include/klic/distpkt.h
 sched-d.o: sched-d.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/alloc.h ../include/klic/trace.h
+    ../include/klic/alloc.h trace.h
 intrpt-d.o: intrpt-d.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/sighndl.h ../include/klic/primitives.h \
     ../include/klic/alloc.h ../include/klic/control.h \
-    ../include/klic/schedule.h ../include/klic/rmon.h
+    schedule.h rmon.h
 trace-d.o: trace-d.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/predinfo.h \
     ../include/klic/generic.h ../include/klic/g_methtab.h \
-    ../include/klic/functorstuffs.h ../include/klic/susp.h \
-    ../include/klic/trace.h ../include/klic/traceio.h \
+    ../include/klic/functorstuffs.h \
+    susp.h trace.h traceio.h \
     ../include/klic/distio.h ../include/klic/distproc.h 
 kmain-t.o: kmain-t.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/unify.h \
-    ../include/klic/timing.h ../include/klic/functorstuffs.h \
-    ../include/klic/options.h
+    ../include/klic/functorstuffs.h \
+    timing.h options.h
 debug-t.o: debug-t.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
@@ -1336,49 +1330,47 @@
 sched-t.o: sched-t.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
-    ../include/klic/alloc.h ../include/klic/trace.h
+    ../include/klic/alloc.h trace.h
 intrpt-t.o: intrpt-t.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/sighndl.h ../include/klic/primitives.h \
     ../include/klic/alloc.h ../include/klic/control.h \
-    ../include/klic/schedule.h
+    schedule.h
 trace.o: trace.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/predinfo.h \
     ../include/klic/generic.h ../include/klic/g_methtab.h \
-    ../include/klic/functorstuffs.h ../include/klic/susp.h \
-    ../include/klic/trace.h ../include/klic/traceio.h 
+    ../include/klic/functorstuffs.h \
+    susp.h trace.h traceio.h 
 gc-t.o: gc-t.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
-    ../include/klic/control.h ../include/klic/timing.h \
-    ../include/klic/functorstuffs.h ../include/klic/gobj.h \
-    ../include/klic/g_methtab.h ../include/klic/susp.h
+    ../include/klic/control.h ../include/klic/functorstuffs.h \
+    ../include/klic/g_methtab.h timing.h gobj.h susp.h
 faisus-t.o: faisus-t.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/alloc.h ../include/klic/control.h \
-    ../include/klic/susp.h ../include/klic/generic.h \
-    ../include/klic/g_methtab.h ../include/klic/gobj.h
+    ../include/klic/generic.h ../include/klic/g_methtab.h \
+    susp.h gobj.h
 print-t.o: print-t.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/index.h ../include/klic/gb.h \
     ../include/klic/functorstuffs.h ../include/klic/atomstuffs.h \
-    ../include/klic/gobj.h ../include/klic/g_methtab.h \
-    ../include/klic/susp.h
+    ../include/klic/g_methtab.h \
+    gobj.h susp.h
 unify-t.o: unify-t.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
-    ../include/klic/control.h ../include/klic/schedule.h \
-    ../include/klic/gb.h ../include/klic/gobj.h \
-    ../include/klic/g_methtab.h ../include/klic/susp.h
+    ../include/klic/control.h ../include/klic/gb.h \
+    ../include/klic/g_methtab.h schedule.h gobj.h susp.h
 recsusp.o: recsusp.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h 
diff -ruN klic-3.003-2001-12-27/runtime/asyncio.c klic-3.003-2001-12-28/runtime/asyncio.c
--- klic-3.003-2001-12-27/runtime/asyncio.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/asyncio.c	Fri Dec 28 13:46:47 2001
@@ -7,9 +7,9 @@
 #include <klic/basic.h>
 #include <klic/struct.h>
 #include <klic/unify.h>
-#include <klic/asyncio.h>  /* externs */
 #include <klic/alloc.h>  /* register_gc_hook */
 #include <klic/sighndl.h>  /* add_signal_handler */
+#include "asyncio.h"  /* externs */
 
 #ifdef USESIG
 #include <unistd.h>
diff -ruN klic-3.003-2001-12-27/runtime/asyncio.h klic-3.003-2001-12-28/runtime/asyncio.h
--- klic-3.003-2001-12-27/runtime/asyncio.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/asyncio.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,26 @@
+/* ---------------------------------------------------------- 
+%   (C)1994, 1995 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.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_ASYNCIO_H_
+#define _KLIC_ASYNCIO_H_
+
+enum sigiotype {
+  KLIC_SIGIO_NONE,
+  KLIC_SIGIO_IN,
+  KLIC_SIGIO_OUT,
+  KLIC_SIGIO_INOUT
+};
+
+/* runtime/asyncio.c */
+extern void add_sigio_handler(long fd, int (*func)(), enum sigiotype sigio_type);
+extern void init_sigio_handler(void);
+extern void init_asynchronous_io(void);
+extern void close_asynchronous_io_stream(long fd);
+extern void register_asynchronous_io_stream(long fd, q stream);
+extern int poll_read_available(int fd);
+
+#endif /* _KLIC_ASYNCIO_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/bodyblt.kl1 klic-3.003-2001-12-28/runtime/bodyblt.kl1
--- klic-3.003-2001-12-27/runtime/bodyblt.kl1	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/bodyblt.kl1	Fri Dec 28 13:46:47 2001
@@ -8,7 +8,7 @@
 :- inline:"
 #include <stdio.h>
 #include <stdlib.h>
-#include <klic/timing.h>
+#include \"timing.h\"
 
 extern print();
 timerstruct before, after;
diff -ruN klic-3.003-2001-12-27/runtime/cntlmsg.c klic-3.003-2001-12-28/runtime/cntlmsg.c
--- klic-3.003-2001-12-27/runtime/cntlmsg.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/cntlmsg.c	Fri Dec 28 13:46:47 2001
@@ -9,24 +9,26 @@
 #include <klic/primitives.h>
 #include <klic/unify.h>
 #include <klic/functorstuffs.h> 
-#include <klic/timing.h>
 
 #include <klic/gb.h>
-#include <klic/gobj.h>
-#include <klic/susp.h>
+
 #include <klic/functorstuffs.h>
 #include <klic/atomstuffs.h>
 
 #include <stdio.h>
 #include <setjmp.h>
 
-#include <klic/interpe.h>
-#include <klic/rmon.h>
-
 #include <klic/generic.h> 
 #include <klic/index.h> 
 #include <klic/alloc.h>
 
+#include "timing.h"
+#include "gobj.h"
+#include "susp.h"
+#include "interpe.h"
+#include "rmon.h"
+#include "ge_exref.h"
+
 /*
   Distributed unification
   ANSWER VALUE		void send_answer_value(data, node, index, wec)
@@ -140,17 +142,6 @@
 }
 
 struct generator_object_method_table* get_exref_methtab();
-
-/*struct exref_object{
-  struct generator_object_method_table *method_table;
-  long node;
-  long index;
-  long wec;
-  q    to_exref;
-  long gc_flag;
-};*/
-
-#include<klic/ge_exref.h>
 
 static int transfer_read();
 
diff -ruN klic-3.003-2001-12-27/runtime/config/pvm/distpkt.c klic-3.003-2001-12-28/runtime/config/pvm/distpkt.c
--- klic-3.003-2001-12-27/runtime/config/pvm/distpkt.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/config/pvm/distpkt.c	Fri Dec 28 13:46:47 2001
@@ -10,14 +10,14 @@
 #include <klic/struct.h>
 #include <klic/primitives.h>
 #include <klic/unify.h>
-#include <klic/timing.h>
+#include "timing.h"
 
 #include <stdio.h>
 #include <signal.h>
 
 #include <klic/distio.h>
-#include <klic/interpe.h>
-#include <klic/rmon.h>
+#include "interpe.h"
+#include "rmon.h"
 
 /*
   Communication buffer management
diff -ruN klic-3.003-2001-12-27/runtime/config/pvm/distproc.c klic-3.003-2001-12-28/runtime/config/pvm/distproc.c
--- klic-3.003-2001-12-27/runtime/config/pvm/distproc.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/config/pvm/distproc.c	Fri Dec 28 13:46:47 2001
@@ -11,8 +11,8 @@
 #include <klic/struct.h>
 #include <klic/primitives.h>
 #include <klic/distio.h>
-#include <klic/interpe.h>
-#include <klic/rmon.h>
+#include "interpe.h"
+#include "rmon.h"
 #include <signal.h>
 #ifdef USEPROCBIND
 #include <unistd.h>
@@ -25,7 +25,7 @@
 #include <strings.h>
 #endif
 
-#include <klic/options.h>
+#include "options.h"
 
 #include <stdlib.h>
 
diff -ruN klic-3.003-2001-12-27/runtime/config/pvm/distrmon.c klic-3.003-2001-12-28/runtime/config/pvm/distrmon.c
--- klic-3.003-2001-12-27/runtime/config/pvm/distrmon.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/config/pvm/distrmon.c	Fri Dec 28 13:46:47 2001
@@ -8,14 +8,14 @@
 #include <klic/basic.h>
 #include <klic/struct.h>
 #include <klic/primitives.h>
-#include <klic/timing.h>
+#include "timing.h"
 
 #include <stdio.h>
 #include <signal.h>
 
 #include <klic/distio.h>
-#include <klic/interpe.h>
-#include <klic/rmon.h>
+#include "interpe.h"
+#include "rmon.h"
 
 #if defined(VPP) || defined(AP3000)
 #include <sys/socket.h>
diff -ruN klic-3.003-2001-12-27/runtime/config/pvm/rmon_server.c klic-3.003-2001-12-28/runtime/config/pvm/rmon_server.c
--- klic-3.003-2001-12-27/runtime/config/pvm/rmon_server.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/config/pvm/rmon_server.c	Fri Dec 28 13:46:47 2001
@@ -14,7 +14,7 @@
 #include <signal.h>
 #include <klic/config.h>
 #include <klic/basic.h>
-#include <klic/rmon.h>
+#include "rmon.h"
 #ifdef VPPAP
 #include <sys/param.h>
 #include <sys/types.h>
diff -ruN klic-3.003-2001-12-27/runtime/config/pvm/runtimedep.mk klic-3.003-2001-12-28/runtime/config/pvm/runtimedep.mk
--- klic-3.003-2001-12-27/runtime/config/pvm/runtimedep.mk	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/config/pvm/runtimedep.mk	Fri Dec 28 13:46:47 2001
@@ -9,9 +9,8 @@
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/unify.h \
-    ../include/klic/timing.h ../include/klic/distio.h \
-    ../include/klic/distproc.h ../include/klic/interpe.h \
-    ../include/klic/distpkt.h ../include/klic/rmon.h
+    ../include/klic/distio.h ../include/klic/distproc.h \
+    ../include/klic/distpkt.h timing.h interpe.h rmon.h
 distio.o: distio.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
@@ -21,6 +20,5 @@
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/distio.h \
-    ../include/klic/distproc.h ../include/klic/interpe.h \
-    ../include/klic/distpkt.h ../include/klic/rmon.h \
-    ../include/klic/options.h
+    ../include/klic/distproc.h ../include/klic/distpkt.h \
+    interpe.h rmon.h options.h
diff -ruN klic-3.003-2001-12-27/runtime/config/pvm-tcp/distpkt.c klic-3.003-2001-12-28/runtime/config/pvm-tcp/distpkt.c
--- klic-3.003-2001-12-27/runtime/config/pvm-tcp/distpkt.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/config/pvm-tcp/distpkt.c	Fri Dec 28 13:46:47 2001
@@ -11,14 +11,14 @@
 #include <klic/struct.h>
 #include <klic/primitives.h>
 #include <klic/unify.h>
-#include <klic/timing.h>
+#include "timing.h"
 
 #include <stdio.h>
 #include <signal.h>
 
-#include <klic/asyncio.h>
+#include "asyncio.h"
 #include <klic/distio.h>
-#include <klic/interpe.h>
+#include "interpe.h"
 
 #include <fcntl.h>
 #ifdef ISASTREAM
diff -ruN klic-3.003-2001-12-27/runtime/config/shm/distpkt.c klic-3.003-2001-12-28/runtime/config/shm/distpkt.c
--- klic-3.003-2001-12-27/runtime/config/shm/distpkt.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/config/shm/distpkt.c	Fri Dec 28 13:46:47 2001
@@ -8,15 +8,15 @@
 #include <klic/struct.h>
 #include <klic/primitives.h>
 #include <klic/unify.h>
-#include <klic/timing.h>
+#include "timing.h"
 
 #include <stdio.h>
 #include <signal.h>
 
 #include <klic/sighndl.h>
 #include <klic/distio.h>
-#include <klic/interpe.h>
-#include <klic/rmon.h>
+#include "interpe.h"
+#include "rmon.h"
 
 #include <sys/param.h>
 #include <sys/stat.h>
diff -ruN klic-3.003-2001-12-27/runtime/config/shm/distproc.c klic-3.003-2001-12-28/runtime/config/shm/distproc.c
--- klic-3.003-2001-12-27/runtime/config/shm/distproc.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/config/shm/distproc.c	Fri Dec 28 13:46:47 2001
@@ -17,8 +17,8 @@
 #include <klic/primitives.h>
 #include <klic/sighndl.h>
 #include <klic/distio.h>
-#include <klic/interpe.h>
-#include <klic/rmon.h>
+#include "interpe.h"
+#include "rmon.h"
 #include <signal.h>
 #include <unistd.h>
 #ifdef USEPROCBIND
@@ -31,7 +31,7 @@
 #include <strings.h>
 #endif
 
-#include <klic/options.h>
+#include "options.h"
 #include <klic/distpkt.h>
 #include <klic/distproc.h>
 
diff -ruN klic-3.003-2001-12-27/runtime/config/shm/distrmon.c klic-3.003-2001-12-28/runtime/config/shm/distrmon.c
--- klic-3.003-2001-12-27/runtime/config/shm/distrmon.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/config/shm/distrmon.c	Fri Dec 28 13:46:47 2001
@@ -8,15 +8,15 @@
 #include <klic/basic.h>
 #include <klic/struct.h>
 #include <klic/primitives.h>
-#include <klic/timing.h>
+#include "timing.h"
 
 #include <stdio.h>
 #include <signal.h>
 
 #include <klic/sighndl.h>
 #include <klic/distio.h>
-#include <klic/interpe.h>
-#include <klic/rmon.h>
+#include "interpe.h"
+#include "rmon.h"
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
diff -ruN klic-3.003-2001-12-27/runtime/config/shm/rmon_server.c klic-3.003-2001-12-28/runtime/config/shm/rmon_server.c
--- klic-3.003-2001-12-27/runtime/config/shm/rmon_server.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/config/shm/rmon_server.c	Fri Dec 28 13:46:47 2001
@@ -7,7 +7,7 @@
 #include <stdio.h>
 #include <signal.h>
 #include <klic/basic.h>
-#include <klic/rmon.h>
+#include "rmon.h"
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/stat.h>
diff -ruN klic-3.003-2001-12-27/runtime/config/shm/runtimedep.mk klic-3.003-2001-12-28/runtime/config/shm/runtimedep.mk
--- klic-3.003-2001-12-27/runtime/config/shm/runtimedep.mk	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/config/shm/runtimedep.mk	Fri Dec 28 13:46:47 2001
@@ -9,9 +9,8 @@
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/unify.h \
-    ../include/klic/timing.h ../include/klic/distio.h \
-    ../include/klic/distproc.h ../include/klic/interpe.h \
-    ../include/klic/distpkt.h ../include/klic/rmon.h
+    ../include/klic/distio.h ../include/klic/distproc.h \
+    ../include/klic/distpkt.h timing.h interpe.h rmon.h
 distio.o: distio.c \
     ../include/klic/basic.h ../include/klic/config.h \
     ../include/klic/struct.h ../include/klic/param.h \
@@ -21,6 +20,5 @@
     ../include/klic/struct.h ../include/klic/param.h \
     ../include/klic/primitives.h ../include/klic/alloc.h \
     ../include/klic/control.h ../include/klic/distio.h \
-    ../include/klic/distproc.h ../include/klic/interpe.h \
-    ../include/klic/distpkt.h ../include/klic/rmon.h \
-    ../include/klic/options.h
+    ../include/klic/distproc.h ../include/klic/distpkt.h \
+    interpe.h rmon.h options.h
diff -ruN klic-3.003-2001-12-27/runtime/datamsg.c klic-3.003-2001-12-28/runtime/datamsg.c
--- klic-3.003-2001-12-27/runtime/datamsg.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/datamsg.c	Fri Dec 28 13:46:47 2001
@@ -9,17 +9,17 @@
 #include <klic/primitives.h>
 #include <klic/unify.h>
 #include <klic/functorstuffs.h> 
-#include <klic/timing.h>
+#include "timing.h"
 
 #include <klic/gb.h>
-#include <klic/gobj.h>
-#include <klic/susp.h>
+#include "gobj.h"
+#include "susp.h"
 #include <klic/functorstuffs.h>
 #include <klic/atomstuffs.h>
 
 #include <stdio.h>
 
-#include <klic/interpe.h>
+#include "interpe.h"
 
 #include <klic/generic.h> 
 #include <klic/index.h> 
diff -ruN klic-3.003-2001-12-27/runtime/debug.c klic-3.003-2001-12-28/runtime/debug.c
--- klic-3.003-2001-12-27/runtime/debug.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/debug.c	Fri Dec 28 13:46:47 2001
@@ -19,11 +19,11 @@
 
 #ifdef DIST
 #include <klic/distio.h>
-#include <klic/interpe.h>
+#include "interpe.h"
 #endif
 
 #ifdef SHM
-#include <klic/shm.h>
+#include "shm.h"
 #endif
 
 /*
diff -ruN klic-3.003-2001-12-27/runtime/export_table.c klic-3.003-2001-12-28/runtime/export_table.c
--- klic-3.003-2001-12-27/runtime/export_table.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/export_table.c	Fri Dec 28 13:46:47 2001
@@ -8,12 +8,12 @@
 #include <klic/struct.h>
 #include <klic/primitives.h>
 #include <klic/unify.h>
-#include <klic/timing.h>
+#include "timing.h"
 #include <klic/index.h>
 
 #include <stdio.h>
 
-#include <klic/interpe.h>
+#include "interpe.h"
 #include <klic/distio.h>
 
 static void initiate_allocated_exp_table()
diff -ruN klic-3.003-2001-12-27/runtime/faisus.c klic-3.003-2001-12-28/runtime/faisus.c
--- klic-3.003-2001-12-27/runtime/faisus.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/faisus.c	Fri Dec 28 13:46:47 2001
@@ -7,11 +7,10 @@
 #include <stdio.h>
 #include <klic/basic.h>
 #include <klic/struct.h>
-#include <klic/alloc.h>
-#include <klic/control.h>
-#include <klic/susp.h>
+#include <klic/primitives.h>
+#include "susp.h"
 #include <klic/generic.h>
-#include <klic/gobj.h>
+#include "gobj.h"
 
 #ifdef DEBUGLIB
 extern int count_suspension;
diff -ruN klic-3.003-2001-12-27/runtime/g_pointer.h klic-3.003-2001-12-28/runtime/g_pointer.h
--- klic-3.003-2001-12-27/runtime/g_pointer.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/g_pointer.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,16 @@
+/* ---------------------------------------------------------- 
+%   (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.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_G_POINTER_H_
+#define _KLIC_G_POINTER_H_
+
+struct pointer_object {
+  struct data_object_method_table *method_table;
+  char *pointer;
+};
+
+#endif /* _KLIC_G_POINTER_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/g_termarray.h klic-3.003-2001-12-28/runtime/g_termarray.h
--- klic-3.003-2001-12-27/runtime/g_termarray.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/g_termarray.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,17 @@
+/* ---------------------------------------------------------- 
+%   (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.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_G_TERMARRAY_H_
+#define _KLIC_G_TERMARRAY_H_
+
+struct termarray_object {
+  struct data_object_method_table *method_table;
+  unsigned long nterm;
+  q terms[1];
+};
+
+#endif /* _KLIC_G_TERMARRAY_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/gc.c klic-3.003-2001-12-28/runtime/gc.c
--- klic-3.003-2001-12-27/runtime/gc.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/gc.c	Fri Dec 28 13:46:47 2001
@@ -7,17 +7,17 @@
 #include <klic/basic.h>
 #include <klic/struct.h>
 #include <klic/primitives.h>
-#include <klic/timing.h>
+#include "timing.h"
 #include <stdio.h>
 #include <klic/functorstuffs.h>
-#include <klic/gobj.h>
-#include <klic/susp.h>
+#include "gobj.h"
+#include "susp.h"
 
 #ifdef DIST
-#include <klic/interpe.h>
+#include "interpe.h"
 #endif
 #ifdef SHM
-#include <klic/shm.h>
+#include "shm.h"
 /* a following line is for debugging of reverse pointer problem. */
 static int hirata_bug1;
   
diff -ruN klic-3.003-2001-12-27/runtime/ge_exref.c klic-3.003-2001-12-28/runtime/ge_exref.c
--- klic-3.003-2001-12-27/runtime/ge_exref.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/ge_exref.c	Fri Dec 28 13:46:47 2001
@@ -16,24 +16,15 @@
 #include <klic/g_basic.h>
 #include <klic/g_extern.h>
 #include <klic/g_extinl.h>
-#include <klic/susp.h>
+#include "susp.h"
 #include <klic/gg_macro.h>
 
-#include <klic/interpe.h>
+#include "interpe.h"
 #include <klic/distio.h>
 
 #include "atom.h"
 #include "funct.h"
-
-#include <klic/ge_exref.h>
-/*struct exref_object{
-  struct generator_object_method_table *method_table;
-  long node;
-  long index;
-  long wec;
-  q    to_exref;
-  long gc_flag;
-};*/
+#include "ge_exref.h"
 
 #define GG_CLASS_NAME() exref
 #define GG_OBJ_TYPE struct exref_object
diff -ruN klic-3.003-2001-12-27/runtime/ge_exref.h klic-3.003-2001-12-28/runtime/ge_exref.h
--- klic-3.003-2001-12-27/runtime/ge_exref.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/ge_exref.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,20 @@
+/* ----------------------------------------------------------
+%   (C)1995 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.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_GE_EXREF_H_
+#define _KLIC_GE_EXREF_H_
+
+struct exref_object{
+  struct generator_object_method_table* method_table;
+  long node;
+  long index;
+  long wec;
+  q    to_exref;
+  long gc_flag;
+};
+
+#endif /* _KLIC_GE_EXREF_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/ge_readhook.c klic-3.003-2001-12-28/runtime/ge_readhook.c
--- klic-3.003-2001-12-27/runtime/ge_readhook.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/ge_readhook.c	Fri Dec 28 13:46:47 2001
@@ -6,7 +6,7 @@
 ----------------------------------------------------------- */
 #include <stdio.h>
 #include <klic/gdobject.h>
-#include <klic/interpe.h>
+#include "interpe.h"
 #include <klic/distio.h>
 
 #include "atom.h"
diff -ruN klic-3.003-2001-12-27/runtime/gen.kl1 klic-3.003-2001-12-28/runtime/gen.kl1
--- klic-3.003-2001-12-27/runtime/gen.kl1	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/gen.kl1	Fri Dec 28 13:46:47 2001
@@ -5,9 +5,9 @@
 %       (Read COPYRIGHT-JIPDEC for detailed information.)
 ----------------------------------------------------------- */
 
-:- inline:"#include <klic/gobj.h>".
-:- inline:"#include <klic/g_pointer.h>".
-:- inline:"#include <klic/g_termarray.h>".
+:- inline:"#include \"gobj.h\"".
+:- inline:"#include \"g_pointer.h\"".
+:- inline:"#include \"g_termarray.h\"".
 :- inline:"typedef q * (*gd_func)();".
 
 :- module generic.
diff -ruN klic-3.003-2001-12-27/runtime/generic.c klic-3.003-2001-12-28/runtime/generic.c
--- klic-3.003-2001-12-27/runtime/generic.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/generic.c	Fri Dec 28 13:46:47 2001
@@ -10,7 +10,7 @@
 #include <klic/atomstuffs.h>
 #include <stdio.h>
 #include <klic/gd_macro.h>
-#include <klic/susp.h>
+#include "susp.h"
 
 extern q *suspend_goal();
 extern q gd_new_pointer();
diff -ruN klic-3.003-2001-12-27/runtime/gfloat.c klic-3.003-2001-12-28/runtime/gfloat.c
--- klic-3.003-2001-12-27/runtime/gfloat.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/gfloat.c	Fri Dec 28 13:46:47 2001
@@ -11,7 +11,7 @@
 #include <klic/gd_macro.h>
 
 #ifdef DIST
-#include <klic/interpe.h>
+#include "interpe.h"
 #endif
 
 #include "atom.h"
@@ -47,7 +47,7 @@
 		  & (-sizeof(double))); \
 }
 
-#include <klic/shm.h>
+#include "shm.h"
 GDDEF_SHMCOPY()
 {
   G_STD_DECL;
diff -ruN klic-3.003-2001-12-27/runtime/gg_shbusy.c klic-3.003-2001-12-28/runtime/gg_shbusy.c
--- klic-3.003-2001-12-27/runtime/gg_shbusy.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/gg_shbusy.c	Fri Dec 28 13:46:47 2001
@@ -14,8 +14,8 @@
 #include <klic/g_methtab.h>
 #include <klic/g_basic.h>
 #include <klic/gg_macro.h>
-#include <klic/susp.h>
-#include <klic/shm.h>
+#include "susp.h"
+#include "shm.h"
 
 #define GG_CLASS_NAME() shbusy
 #define GG_OBJ_TYPE struct Shbusy
diff -ruN klic-3.003-2001-12-27/runtime/gg_shvar.c klic-3.003-2001-12-28/runtime/gg_shvar.c
--- klic-3.003-2001-12-27/runtime/gg_shvar.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/gg_shvar.c	Fri Dec 28 13:46:47 2001
@@ -11,9 +11,9 @@
 #include <klic/g_methtab.h>
 #include <klic/g_basic.h>
 #include <klic/gg_macro.h>
-#include <klic/susp.h>
-#include <klic/gobj.h>
-#include <klic/shm.h>
+#include "susp.h"
+#include "gobj.h"
+#include "shm.h"
 
 #define GENHOOK
 #define GENHOPT
diff -ruN klic-3.003-2001-12-27/runtime/ggoal.c klic-3.003-2001-12-28/runtime/ggoal.c
--- klic-3.003-2001-12-27/runtime/ggoal.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/ggoal.c	Fri Dec 28 13:46:47 2001
@@ -8,7 +8,7 @@
 */
 
 #include <klic/gdobject.h>
-#include <klic/goalobj.h>
+#include "goalobj.h"
 #include "atom.h"
 #include "funct.h"
 
diff -ruN klic-3.003-2001-12-27/runtime/gio.c klic-3.003-2001-12-28/runtime/gio.c
--- klic-3.003-2001-12-27/runtime/gio.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/gio.c	Fri Dec 28 13:46:47 2001
@@ -7,7 +7,7 @@
 
 #include <stdio.h>
 #include <klic/gcobject.h>
-#include <klic/g_pointer.h>
+#include "g_pointer.h"
 #include <klic/g_string.h>
 #include <klic/gd_macro.h>
 #ifdef DIST
diff -ruN klic-3.003-2001-12-27/runtime/gmvv.c klic-3.003-2001-12-28/runtime/gmvv.c
--- klic-3.003-2001-12-27/runtime/gmvv.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/gmvv.c	Fri Dec 28 13:46:47 2001
@@ -14,10 +14,10 @@
 #include <klic/g_vector.h>
 
 #ifdef DIST
-#include <klic/interpe.h>
+#include "interpe.h"
 #endif
 #ifdef SHM
-#include <klic/shm.h>
+#include "shm.h"
 #endif
 
 #include "atom.h"
diff -ruN klic-3.003-2001-12-27/runtime/goalobj.h klic-3.003-2001-12-28/runtime/goalobj.h
--- klic-3.003-2001-12-27/runtime/goalobj.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/goalobj.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,15 @@
+/* ---------------------------------------------------------- 
+%   (C)1995 Takashi Chikayama
+%       (Read COPYRIGHT for detailed information.) 
+----------------------------------------------------------- */
+
+#ifndef _KLIC_GOALOBJ_H_
+#define _KLIC_GOALOBJ_H_
+
+struct goal_object {
+  struct data_object_method_table *method_table;
+  struct goalrec *goal;
+  unsigned long id;
+};
+
+#endif /* _KLIC_GOALOBJ_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/gobj.h klic-3.003-2001-12-28/runtime/gobj.h
--- klic-3.003-2001-12-27/runtime/gobj.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/gobj.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,92 @@
+/* ---------------------------------------------------------- 
+%   (C)1993,1994,1995 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.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_GOBJ_H_
+#define _KLIC_GOBJ_H_
+
+#include <klic/g_methtab.h>
+
+/*
+  macros which call methods
+*/
+
+#define method_table_of(obj) ((obj)->method_table)
+#define generic_passive_unify(obj, anothor) \
+  (method_table_of(obj)->passive_unify((obj), (anothor)))
+#define generic_active_unify(obj, anothor, allocp) \
+do{ \
+  (allocp) = method_table_of(obj)->active_unify((obj), (anothor), (allocp)); \
+}while(0)
+#define generic_print(obj, stream, depth, length) \
+  (method_table_of(obj)->print((obj), (stream), (depth), (length)))
+#define generic_gc(obj, allocp, sp) \
+  (method_table_of(obj)->gc((obj), (allocp), (sp)))
+#define generic_regist(obj) \
+  (method_table_of(obj)->regist(obj))
+#define generic_deallocate(obj) \
+  (method_table_of(obj)->deallocate(obj))
+#define generic_close(obj, allocp) \
+  (method_table_of(obj)->close(obj))
+
+#define generic_generate(obj, allocp) \
+  (method_table_of(obj)->generate((obj), (allocp)))
+
+#define generic_suspend(obj, ref, goal) \
+  (method_table_of(obj)->suspend((ref), (goal)))
+
+/*** for Distributed KLIC system ***/
+#define generic_encode(obj, pe, depth) \
+  (method_table_of(obj)->encode((obj), (pe), (depth)))
+
+/*** for Shared-memory KLIC system ***/
+#define generic_shmcopy(obj) \
+  (method_table_of(obj)->shmcopy(obj))
+
+#define generic_new(class, n, args) \
+  (((struct data_object_method_table *)(class))->new((n), (args)))
+
+/**** header file for using data and functions defined in kernel ****/ 
+
+/* temporary */
+
+#define general_passive_unify(obj, anothor) \
+  eq_terms_body((obj), (anothor))
+
+#define general_active_unify(obj, anothor, allocp) \
+  ((allocp) = do_shallow_unify((allocp), (obj), (anothor)))
+
+/*
+  datas for general utility with consumer object
+*/
+
+/****************
+  suspension_reason
+
+  shows result of the processing for consumer object.
+
+  0: normal;
+  1: GC request;
+  other: the process is suspended. pointer of the reason of the prosess.
+******************/
+extern q suspension_reason;
+
+/************
+  rest_of_stream
+
+  indicates the next hooked term. This variable is meaningful
+  just `suspension_reason' is 0.
+
+  0: normal;
+  other: the next hooked term
+**************/
+extern q rest_of_stream;
+
+
+extern q method_result;
+
+
+#endif /* _KLIC_GOBJ_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/gpointer.c klic-3.003-2001-12-28/runtime/gpointer.c
--- klic-3.003-2001-12-27/runtime/gpointer.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/gpointer.c	Fri Dec 28 13:46:47 2001
@@ -6,7 +6,7 @@
 ----------------------------------------------------------- */
 
 #include <klic/gdobject.h>
-#include <klic/g_pointer.h>
+#include "g_pointer.h"
 
 #define GD_CLASS_NAME() pointer
 #define GD_OBJ_TYPE struct pointer_object
diff -ruN klic-3.003-2001-12-27/runtime/gstring.c klic-3.003-2001-12-28/runtime/gstring.c
--- klic-3.003-2001-12-27/runtime/gstring.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/gstring.c	Fri Dec 28 13:46:47 2001
@@ -18,11 +18,11 @@
 #endif
 
 #ifdef SHM
-#include <klic/shm.h>
+#include "shm.h"
 #endif
 
 #ifdef DIST
-#include <klic/interpe.h>
+#include "interpe.h"
 #endif
 
 #define GD_CLASS_NAME() byte__string
diff -ruN klic-3.003-2001-12-27/runtime/gtermarray.c klic-3.003-2001-12-28/runtime/gtermarray.c
--- klic-3.003-2001-12-27/runtime/gtermarray.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/gtermarray.c	Fri Dec 28 13:46:47 2001
@@ -6,7 +6,7 @@
 ----------------------------------------------------------- */
 
 #include <klic/gdobject.h>
-#include <klic/g_termarray.h>
+#include "g_termarray.h"
 
 #define GD_CLASS_NAME() termarray
 #define GD_OBJ_TYPE struct termarray_object
diff -ruN klic-3.003-2001-12-27/runtime/gunix.kl1 klic-3.003-2001-12-28/runtime/gunix.kl1
--- klic-3.003-2001-12-27/runtime/gunix.kl1	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/gunix.kl1	Fri Dec 28 13:46:47 2001
@@ -22,8 +22,8 @@
 #include <errno.h>
 #include <sys/time.h>
 #include <sys/times.h>
-#include <klic/gobj.h>
-#include <klic/g_pointer.h>
+#include \"gobj.h\"
+#include \"g_pointer.h\"
 #include <klic/gd_macro.h>
 
 #ifdef USESIG
diff -ruN klic-3.003-2001-12-27/runtime/import_table.c klic-3.003-2001-12-28/runtime/import_table.c
--- klic-3.003-2001-12-27/runtime/import_table.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/import_table.c	Fri Dec 28 13:46:47 2001
@@ -8,12 +8,12 @@
 #include <klic/struct.h>
 #include <klic/primitives.h>
 #include <klic/unify.h>
-#include <klic/timing.h>
+#include "timing.h"
 #include <klic/index.h>
 
 #include <stdio.h>
 
-#include <klic/interpe.h>
+#include "interpe.h"
 #include <klic/distio.h>
 
 extern int exref_g_generator_method_table;
diff -ruN klic-3.003-2001-12-27/runtime/init_dist.c klic-3.003-2001-12-28/runtime/init_dist.c
--- klic-3.003-2001-12-27/runtime/init_dist.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/init_dist.c	Fri Dec 28 13:46:47 2001
@@ -8,14 +8,14 @@
 #include <klic/struct.h>
 #include <klic/primitives.h>
 #include <klic/unify.h>
-#include <klic/timing.h>
+#include "timing.h"
 #include <klic/index.h>
 
 #include <stdio.h>
 
-#include <klic/interpe.h>
+#include "interpe.h"
 #include <klic/distio.h>
-#include <klic/rmon.h>
+#include "rmon.h"
 
 #include <signal.h>
 #include <sys/types.h>
diff -ruN klic-3.003-2001-12-27/runtime/interpe.h klic-3.003-2001-12-28/runtime/interpe.h
--- klic-3.003-2001-12-27/runtime/interpe.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/interpe.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,204 @@
+/* ---------------------------------------------------------- 
+%   (C) 1994,1995 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.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_INTERPE_H_
+#define _KLIC_INTERPE_H_
+
+#include <malloc.h>
+#ifdef __alpha
+/* dec malloc.h does not supply function return value decralations */
+extern void* malloc();
+extern void* calloc();
+extern void* realloc();
+#endif
+#include <string.h>
+
+#include <klic/distpkt.h>
+
+/********** for debugging output control */
+/*#define INT_CL_DEBUG*/
+#define INT_CL_PROBE
+
+#ifdef	INT_CL_DEBUG
+#  define INT_CL_DEBUG_X(X)  (X)
+#else
+#  define INT_CL_DEBUG_X(X)
+#endif
+
+#ifdef	INT_CL_PROBE
+#  define INT_CL_PROBE_X(X)  (X)
+#else
+#  define INT_CL_PROBE_X(X)
+#endif
+
+/*********** for bsd libraries */
+#ifdef USEBCOPY
+#  define BCOPY(from,to,len)	bcopy((from), (to), (len))
+#else
+#  define BCOPY(from,to,len)	memcpy((to), (from), (len))
+#endif
+#ifdef USEBZERO
+#  define BZERO(from,len)		bzero((from), (len))
+#else
+#  define BZERO(from,len)		memset((from), 0, (len))
+#endif
+
+/*********** Some convenient macros **************/
+/* Extern long total_node, my_node; */
+#define MASTER_NODE		0L
+#define SHOEN_NODE		total_node
+#define IS_MASTER_NODE(node)	((node) == MASTER_NODE)
+#define IS_SHOEN_NODE(node)	((node) == SHOEN_NODE)
+
+/* Constants */
+#define EXPORT_UNIT_WEC		0x10000
+#define MIN_WEC			0x2
+
+#define EXP_TABLE_INC_SIZE	0x1000
+#define IMP_TABLE_INC_SIZE	0x1000
+
+#define EXP_TABLE_HASH_SIZE	0x1
+
+#define END_IMP_FREELIST	(-1)
+#define END_IMP_TABLE		(-1)
+
+#define IMPREC_NOT_COPIED	12345
+#define IMPREC_COPIED		54321
+#define IMPREC_RELEASED		98765
+
+/* Temporary. for PVM-TCP bug */
+#ifndef TRANSFER_CNT
+#define TRANSFER_CNT            0x1000L
+#endif
+
+/************* WTC related definition ***************/
+Extern long shoen_wtc;
+Extern long node_wtc;
+
+#define SUPPLY_WTC_UNIT		0x1000000L
+#define THROW_WTC_UNIT		0x1000L
+#define UNIFY_WTC_UNIT		0x10L
+
+
+/* if defined, optional eager requesting is activated. */
+/*#define REQUEST_WTC_THRESHOLD	0x3L*/
+
+/*#define CONTROL_WTC_UNIT	0x1L	/*This value implicitly assumed. */
+
+#define NODE_WTC_LIMIT		0x10000000L
+#define RETURN_WTC_UNIT		0x08000000L
+
+#define MIN_WTC			2L /* one for wtc_request,
+				      another for node existence */
+#define READ_WTC_UNIT		10L
+#define ANSWER_WTC_UNIT		10L
+
+enum get_wtc_type {
+    get_wtc_normal_request,
+    get_wtc_full_request,
+    get_wtc_force_request
+};
+/************* Export Table *********************/
+struct exp_entry{
+    long index;
+    long wec;
+    q data;
+    struct exp_entry* next;
+};
+
+Extern struct exp_entry* exp_table;
+Extern long current_exp_size;
+Extern long active_exp_entry;
+
+#define UNUSED_EXPREC 0xf0f0f0ff /* This value is curious!! */
+#define UNUSED_IMPREC 0xf0f0f0ff /* it too. */
+
+/* Export Hash Table */
+Extern struct exp_entry* exp_hash_table[EXP_TABLE_HASH_SIZE];
+
+Extern struct exp_entry* top_of_exp_freelist;
+
+/************** Import Table ********************/
+
+struct imp_entry{
+    long next;
+    q object;
+};
+
+Extern struct imp_entry* imp_table;
+Extern long current_imp_size;
+
+Extern struct imp_entry top_of_imp_freelist;
+
+Extern long active_imp_rec;
+Extern long free_imp_rec;
+
+Extern long receive_answer_flag;
+Extern long answer_return_exp_index;
+Extern q decode_data;		/* Un natural way of value passing. */
+
+/* Options set by program arguments */
+Extern long eager_transfer_level	Init(0);
+Extern int network_statistics_flag	Init(0);
+Extern int msg_busywait_flag		Init(0);
+
+/************* message suspend record **************/
+
+struct susp_msg_rec {
+    struct susp_msg_rec* next;
+    long node;
+    long wtc_needed;
+    combuf* outbuf;
+};
+
+Extern struct susp_msg_rec* susp_msg_list;
+
+/************* Message decoder stack ****************/
+
+#define INIT_DECODE_STACK_SIZE 0x1000
+
+Extern q* decode_stack;
+Extern q* decode_stack_ptr;
+Extern q* decode_stack_limit;
+Extern int decode_stack_size;
+
+/************* Network Statistics Measurement *******/
+
+struct netstat {
+    long start_sec;		/* only SHOEN uses this field */
+    long start_usec;		/* only SHOEN uses this field */
+
+    long send_throw_cnt;
+    long send_read_cnt;
+    long send_unify_cnt;
+    long send_answer_cnt;
+    long send_release_cnt;
+    long send_request_wtc_cnt;
+    long send_supply_wtc_cnt;
+    long send_return_wtc_cnt;
+    
+    long recv_throw_cnt;
+    long recv_read_cnt;
+    long recv_unify_cnt;
+    long recv_release_cnt;
+    long recv_answer_cnt;
+    long recv_request_wtc_cnt;
+    long recv_supply_wtc_cnt;
+    long recv_return_wtc_cnt;
+
+    long msg_suspend_cnt;
+    long msg_resume_cnt;
+    
+    long send_data_siz;
+    long recv_data_siz;
+};
+
+Extern struct netstat netstat;
+
+#define ERROR_STOP for(;;)
+
+#endif /* _KLIC_INTERPE_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/intrpt.c klic-3.003-2001-12-28/runtime/intrpt.c
--- klic-3.003-2001-12-27/runtime/intrpt.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/intrpt.c	Fri Dec 28 13:46:47 2001
@@ -8,15 +8,15 @@
 #include <klic/struct.h>
 #include <klic/sighndl.h>
 #include <klic/primitives.h>
-#include <klic/schedule.h>
+#include "schedule.h"
 #ifdef DIST
-#include <klic/rmon.h>
+#include "rmon.h"
 #else
 #define GC_ON()
 #define GC_OFF()
 #endif
 #ifdef SHM
-#include <klic/shm.h>
+#include "shm.h"
 #endif
 
 int sigint_interrupt = 0;
diff -ruN klic-3.003-2001-12-27/runtime/io.kl1 klic-3.003-2001-12-28/runtime/io.kl1
--- klic-3.003-2001-12-27/runtime/io.kl1	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/io.kl1	Fri Dec 28 13:46:47 2001
@@ -6,8 +6,8 @@
 ----------------------------------------------------------- */
 :- inline:"
 #include <stdio.h>
-#include <klic/gobj.h>
-#include <klic/g_pointer.h>
+#include \"gobj.h\"
+#include \"g_pointer.h\"
 #ifdef DIST
 #include <klic/distio.h>
 #endif
diff -ruN klic-3.003-2001-12-27/runtime/itimer.kl1 klic-3.003-2001-12-28/runtime/itimer.kl1
--- klic-3.003-2001-12-27/runtime/itimer.kl1	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/itimer.kl1	Fri Dec 28 13:46:47 2001
@@ -7,7 +7,7 @@
 
 :- inline:"
 #include <sys/time.h>
-#include <klic/timer.h>
+#include \"timer.h\"
 #define Twotime2time(X,Y) (((X) * 86400 + (Y)))
 
 extern q *reserve_klic_timer_interrupt();
diff -ruN klic-3.003-2001-12-27/runtime/kmain.c klic-3.003-2001-12-28/runtime/kmain.c
--- klic-3.003-2001-12-27/runtime/kmain.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/kmain.c	Fri Dec 28 13:46:47 2001
@@ -12,7 +12,7 @@
 #include <klic/struct.h>
 #include <klic/primitives.h>
 #include <klic/unify.h>
-#include <klic/timing.h>
+#include "timing.h"
 #include <klic/functorstuffs.h>
 
 #include <string.h>
@@ -24,18 +24,18 @@
 #endif
 
 #ifdef SHM
-#include <klic/shm.h>
+#include "shm.h"
 #endif
 
 #ifdef DIST
-/*#include <klic/trace.h>*/
+/* #include "trace.h" */
 #include <time.h>
 #include <sys/types.h>
 #include <unistd.h>
 #include <klic/sighndl.h>
 #include <klic/distio.h>
-#include <klic/interpe.h>
-#include <klic/rmon.h>
+#include "interpe.h"
+#include "rmon.h"
 
 int receive_message();
 q* gc_exp_table();
@@ -43,7 +43,7 @@
 q* scan_imp_table();
 
 #endif
-#include <klic/options.h>
+#include "options.h"
 
 
 extern char *runtime_version, *runtime_date;
diff -ruN klic-3.003-2001-12-27/runtime/ktimer.c klic-3.003-2001-12-28/runtime/ktimer.c
--- klic-3.003-2001-12-27/runtime/ktimer.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/ktimer.c	Fri Dec 28 13:46:47 2001
@@ -9,7 +9,7 @@
 #ifdef USETIMER
 #include <sys/time.h>
 #include <klic/struct.h>
-#include <klic/timer.h>
+#include "timer.h"
 #include <klic/sighndl.h>
 
 extern char *malloc_check();
diff -ruN klic-3.003-2001-12-27/runtime/newatom.c klic-3.003-2001-12-28/runtime/newatom.c
--- klic-3.003-2001-12-27/runtime/newatom.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/newatom.c	Fri Dec 28 13:46:47 2001
@@ -48,7 +48,7 @@
 #ifndef SHM
 #include <klic/alloc.h>  /* malloc_check */
 #else  /* SHM */
-#include <klic/shm.h>
+#include "shm.h"
 
 static char* Buff_S;
 static char* Buff_E;
diff -ruN klic-3.003-2001-12-27/runtime/options.c klic-3.003-2001-12-28/runtime/options.c
--- klic-3.003-2001-12-27/runtime/options.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/options.c	Fri Dec 28 13:46:47 2001
@@ -6,7 +6,7 @@
 ----------------------------------------------------------- */
 #include <string.h>
 #include <klic/basic.h>
-#include <klic/options.h>
+#include "options.h"
 static char *
 parse_size(str, retp)
 long *retp;
diff -ruN klic-3.003-2001-12-27/runtime/options.h klic-3.003-2001-12-28/runtime/options.h
--- klic-3.003-2001-12-27/runtime/options.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/options.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,126 @@
+/* ---------------------------------------------------------- 
+%   (C)1994,1995 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.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_OPTIONS_H_
+#define _KLIC_OPTIONS_H_
+
+union all_type {
+    int i;
+    long l;
+    double d;
+    char* s;
+};
+
+enum argtype {
+    ARG_DOUBLE,
+    ARG_SIZE,
+    ARG_RESET,
+    ARG_SET,
+    ARG_STRING,
+    ARG_NOT_USED
+};
+
+extern const struct opttable opttable[];
+
+/* runtime/options.c */
+extern char* parse_opts(const struct opttable* opttbl, int* acp, char*** avp);
+
+/* not copied when spawned */
+#define ARG_SHOULD_NOT_COPY(X)	((int)(X) >= (int)ARG_NOT_USED)
+#define ARG_NOT_COPIED(X) \
+  ((enum argtype) ((int)(X) + (int)ARG_NOT_USED))
+
+#define ARG_ORIGINAL_TYPE(X) \
+  ((enum argtype) \
+    (ARG_SHOULD_NOT_COPY(X) ? (int)(X)-(int)ARG_NOT_USED : (int)(X)))
+
+struct opttable {
+    char* opt_str;
+    union all_type* opt_dest;
+    enum argtype opt_type;
+    char* opt_usage;
+};
+
+#ifndef MAIN
+extern const struct opttable opttable[];
+#else  /* MAIN */
+static long num_pes;
+static double max_a_ratio;
+static unsigned long h_size;
+static unsigned long max_h_size;
+static unsigned long inc_size;
+static int verbose;
+extern int start_tracing;
+extern int count_suspension;
+#ifdef USETIMER
+static unsigned long dl_det_interval;
+#endif /*USETIMER*/
+const struct opttable opttable[] = {
+#ifdef USER_OPTIONS
+    USER_OPTIONS
+#endif
+#ifdef POLLING_OPTIONS
+    POLLING_OPTIONS
+#endif
+#ifdef PARALLEL
+    "p",        (union all_type*) &num_pes, ARG_SIZE,
+    "-p <# of workers>: number of worker processes ",
+#endif
+#ifdef DIST_OPTIONS
+    DIST_OPTIONS
+#endif
+#ifdef DIST
+#ifdef SHM_DIST
+    "B",	(union all_type*) &shared_buffer_size, ARG_SIZE,
+    "-B <communication buffer size>",
+#endif
+#endif
+#ifdef SHM
+    "S",        (union all_type*) &SHM_SIZE, ARG_SIZE,
+    "-S <shared-memory heap size>: shared-memory heap size, never expand",
+
+    "D",        (union all_type*) &Disp_child, ARG_SET,
+    "-D: display child process number on UNIX",
+
+#endif
+    "a",	(union all_type*) &max_a_ratio, ARG_DOUBLE,
+    "-a <ratio>: active cell ratio to triger heap extension\n"
+    "\t  <ratio> should be a floating point number >0 and <1",
+
+    "h",	(union all_type*) &h_size, ARG_SIZE,
+    "-h <initial heap size>: initial size of heap",
+
+    "H",	(union all_type*) &max_h_size, ARG_SIZE,
+    "-H <max heap size>: maximum possible heap size",
+
+    "i",	(union all_type*) &inc_size, ARG_SIZE,
+    "-i <increment>: gap between heap top and bottom\n"
+    "\t  for -h, -H and -i, 32k means 32KW and 2m means 2MW",
+
+    "g",	(union all_type*) &measure_gc, ARG_SET,
+    "-g: set garbage collection measurement on",
+
+    "v",	(union all_type*) &verbose, ARG_SET,
+    "-v: display KLIC runtime version",
+#ifdef DEBUGLIB
+    "t",	(union all_type*) &start_tracing, ARG_SET,
+    "-t: start execution with tracing",
+
+    "s",	(union all_type*) &count_suspension, ARG_SET,
+    "-s: count suspension",
+#endif /* DEBUGLIB */
+#ifdef USETIMER
+    "deadlock-detection-interval",
+		(union all_type*) &dl_det_interval, ARG_SIZE,
+    "-deadlock-detection-interval <interval>:\n"
+    "\t  specify deadlock detect interval in micro sec.\n"
+    "\t  Set <interval> to 0 to supress early deadlock detection completely.",
+#endif /*USETIMER*/
+    0, 0 };
+#endif /* MAIN */
+
+#endif /* _KLIC_OPTIONS_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/print.c klic-3.003-2001-12-28/runtime/print.c
--- klic-3.003-2001-12-27/runtime/print.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/print.c	Fri Dec 28 13:46:47 2001
@@ -12,8 +12,8 @@
 #include <klic/functorstuffs.h>
 #include <klic/atomstuffs.h>
 #include <stdio.h>
-#include <klic/gobj.h>
-#include <klic/susp.h>
+#include "gobj.h"
+#include "susp.h"
 
 print_partially(x, depth, length)
      q x;
diff -ruN klic-3.003-2001-12-27/runtime/profile.c klic-3.003-2001-12-28/runtime/profile.c
--- klic-3.003-2001-12-27/runtime/profile.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/profile.c	Fri Dec 28 13:46:47 2001
@@ -8,13 +8,13 @@
 #include <klic/basic.h>
 #include <klic/struct.h>
 #include <klic/primitives.h>
-#include <klic/timing.h>
+#include "timing.h"
 
 #include <stdio.h>
 #include <signal.h>
 
-#include <klic/interpe.h>
-#include <klic/rmon.h>
+#include "interpe.h"
+#include "rmon.h"
 
 /* 
   SEND_PROFILE (from WORKERs to SHOEN)
diff -ruN klic-3.003-2001-12-27/runtime/random.c klic-3.003-2001-12-28/runtime/random.c
--- klic-3.003-2001-12-27/runtime/random.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/random.c	Fri Dec 28 13:46:47 2001
@@ -14,7 +14,7 @@
 #include <klic/g_methtab.h>
 #include <klic/g_basic.h>
 #include <klic/gg_macro.h>
-#include <klic/susp.h>
+#include "susp.h"
 
 #include <stdio.h>
 
diff -ruN klic-3.003-2001-12-27/runtime/rmon.h klic-3.003-2001-12-28/runtime/rmon.h
--- klic-3.003-2001-12-27/runtime/rmon.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/rmon.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,65 @@
+/* ---------------------------------------------------------- 
+%   (C) 1995 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.)
+---------------------------------------------------------- */
+
+#ifndef _KLIC_RMON_H_
+#define _KLIC_RMON_H_
+
+/************* For profiling ************************/
+
+#define PROF_GATHER_INTERVAL_SEC 2
+#define PROF_SAMPLE_INTERVAL_uSEC 10111
+
+#define SHOEN_START_TAG       0
+#define SHOEN_OUTPUT_PROF_TAG 100
+#define SHOEN_TERMINATE_TAG   200
+
+struct perfmon_state {
+    int idle_on;
+    int gc_on;
+    int ms_on;
+    int mr_on;
+};
+
+Extern volatile struct perfmon_state perfmon_state;
+
+struct perfmon_counter {
+    long intr_count;
+    long idle_count;
+    long gc_count;
+    long ms_count;
+    long mr_count;
+};
+
+Extern volatile struct perfmon_counter perfmon_counter;
+
+Extern char* rmonnode;
+Extern int rmon_tid;
+
+#define IDLE_ON()  (perfmon_state.idle_on = 1)
+#define IDLE_OFF() (perfmon_state.idle_on = 0)
+#define GC_ON()    (perfmon_state.gc_on = 1)
+#define GC_OFF()   (perfmon_state.gc_on = 0)
+#define SEND_ON()  (perfmon_state.ms_on = 1)
+#define SEND_OFF() (perfmon_state.ms_on = 0)
+#define RECV_ON()  (perfmon_state.mr_on = 1)
+#define RECV_OFF() (perfmon_state.mr_on = 0)
+
+Extern int gather_prof_ready Init(1);
+struct profile_rec {
+    long stimes;  /* sampling times */
+    long itimes;  /* idle times */
+    long gctimes; /* GC times */
+    long mstimes; /* message sending times */
+    long mrtimes; /* message receiving times */
+};
+
+Extern struct profile_rec* shoen_profile;
+Extern int gathered_count Init(0);
+
+Extern long* send_pbuf;
+
+#endif /* _KLIC_RMON_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/sched.c klic-3.003-2001-12-28/runtime/sched.c
--- klic-3.003-2001-12-27/runtime/sched.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/sched.c	Fri Dec 28 13:46:47 2001
@@ -10,11 +10,11 @@
 
 #include <stdio.h>
 #ifdef DEBUGLIB
-#include <klic/trace.h>
+#include "trace.h"
 #endif
 #ifdef SHM
 #include <setjmp.h>
-#include <klic/shm.h>
+#include "shm.h"
 extern jmp_buf klic_topmost;
 #endif
 
diff -ruN klic-3.003-2001-12-27/runtime/schedule.h klic-3.003-2001-12-28/runtime/schedule.h
--- klic-3.003-2001-12-27/runtime/schedule.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/schedule.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,29 @@
+/* ---------------------------------------------------------- 
+%   (C)1993 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.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_SCHEDULE_H_
+#define _KLIC_SCHEDULE_H_
+
+
+/* runtime/sched.c */
+
+extern struct prioqrec* more_prioqrec(void);
+
+extern struct goalrec* enqueue_goal(
+  struct goalrec* qp, long prio,
+  struct goalrec* gp, struct global_variables* glbl );
+
+extern struct goalrec* get_top_priority_queue(void);
+extern void put_priority_queue(struct goalrec* qp, long prio);
+
+
+/* runtime/kmain.c */
+extern module topsucceed(
+  struct global_variables* glbl, struct goalrec* qp,
+  q* allocp, const struct predicate* toppred );
+
+#endif /* _KLIC_SCHEDULE_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/sendrecv.c klic-3.003-2001-12-28/runtime/sendrecv.c
--- klic-3.003-2001-12-27/runtime/sendrecv.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/sendrecv.c	Fri Dec 28 13:46:47 2001
@@ -8,14 +8,14 @@
 #include <klic/struct.h>
 #include <klic/primitives.h>
 #include <klic/unify.h>
-#include <klic/timing.h>
+#include "timing.h"
 
 #include <stdio.h>
 #include <signal.h>
 
 #include <klic/distio.h>
-#include <klic/interpe.h>
-#include <klic/rmon.h>
+#include "interpe.h"
+#include "rmon.h"
 
 static void send_request_wtc();
 void add_node_wtc();
diff -ruN klic-3.003-2001-12-27/runtime/shm.h klic-3.003-2001-12-28/runtime/shm.h
--- klic-3.003-2001-12-27/runtime/shm.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/shm.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,311 @@
+/* ---------------------------------------------------------- 
+%   (C)1994,1995 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.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_SHM_H_
+#define _KLIC_SHM_H_
+
+/* Machine depending Dec */
+#include "shm_machine.h"
+
+#define currid (glbl->par.aux.shm.currid0)
+#define oldid  (glbl->par.aux.shm.oldid0)
+
+#define SHM_HEAP_TOP (glbl->par.aux.shm.shm_htop0)
+#define SHP_SIZE     (glbl->par.aux.shm.shm_hbyte0)
+
+  /* number of Planes */
+extern long N_PLNE;
+  /* size of 1 Shared-memory plane */
+extern long SHM_SIZE;
+  /* last PE for Profile */
+extern long LAST_PE;
+extern long Disp_child;
+
+Extern int shm_trace_lock Init(0);
+
+#define MASTER 0
+
+#define MAX_N_PE  32
+#define MAX_N_PLNE 8
+
+#define is_shmconnect(X) (1)
+
+#define is_locala(X) \
+    ( (unsigned long)((long)(X)-(long)heaptop) < real_heapbytesize )
+
+  /* Shared-memory address or no */
+#define is_shma(X) \
+    ( (unsigned long)((long)(X)-(long)SHM_HEAP_TOP ) < SHP_SIZE )
+
+/* calculates a hash key for lock
+*/
+#define HTBL_base 0
+  /* allocating shared-memory */
+#define g_key()      HTBL_base
+  /* updating the shared-memory management table */
+#define m_key()      (HTBL_base+1)
+  /* for Sequential GC */
+#define gc_key()     (HTBL_base+2)
+  /* updating atom table */
+#define a_key()     (HTBL_base+3)
+  /* updating functor table */
+#define f_key()     (HTBL_base+4)
+#define tr_key()    (HTBL_base+5)
+  /* queuing a goal to external process */
+#define p_key(penum)  (HTBL_base + 6 + (penum))
+
+  /* global generator hook */
+#define is_genhook(X) ((long)(X) & 0x01)
+#define tag_genhook(X) ((Sinfo*)((long)(X)+1))
+#define untag_genhook(X) ((Sinfo*)((long)(X)-1))
+  /* local consumer or generator */
+#define tag_local(x)	((q)((char*)(x) + ATOMIC))
+#define untag_local(x)	((q)((char*)(x) - ATOMIC))
+#define ext_queued (glbl->par.aux.shm.queued0)
+#define ex_qp (glbl->par.aux.shm.ex_qp0)
+
+  /* adjusts the memory boundary */
+#define reckon(sz) ((long)((((sz)+sizeof(long)-1)/sizeof(long))*sizeof(long)))
+#define get_adjust_addr(type,top,inc) \
+  (((type)*) (((char*) (top)) + (reckon(sizeof(type)) * (inc))))
+#define get_otherPE_glbl(n) \
+  get_adjust_addr(struct global_variables, top_shm_glbl, (n))
+
+  /* shared memory alloc */
+#define galloc(Siz) ( { q* addr = gallocp; \
+  ((gallocp+=(Siz)) <= glimit)?addr:shm_galloc(Siz);})
+
+
+#define free_local_tbl(ptr) \
+do{ \
+  TADDRtbl* sl = (TADDRtbl*) (ptr); \
+  (sl->prev)->next = sl->next; \
+  (sl->next)->prev = sl->prev; \
+  sl->next = ADDRtbl_free; \
+  ADDRtbl_free = sl; \
+}while(0)
+
+#define makeshvar(svar) \
+do{ \
+  struct generator_susp* vcell; \
+  (svar) = (q) galloc((sizeof(struct generator_susp) / sizeof(q)) + 1); \
+  vcell = (struct generator_susp*) (((q*) svar) + 1); \
+  vcell->backpt = (q) (svar); \
+  vcell->u.o = tag_generator_susp(pSHM_VAR); \
+  *((q*) svar) = (q) vcell; \
+}while(0)
+
+
+#define get_space(X) ( {\
+    int cid = currid;\
+    int cnt = 1;\
+    int no = 0;\
+    do { \
+      if ( (unsigned long)((long)(X)-(long)(PLNE_ptr[cid]->top_addr)) < SHM_SIZE ) \
+        { no = cnt; break; } \
+      cnt++; \
+    } while( (cid = PLNE_ptr[cid]->direct) != (-1) ); \
+    no; } )
+
+#define cmp_forward_ptr(x,y) ( {\
+    int xv;                 \
+    int yv;                 \
+    int ret;                \
+    xv = get_space(x);      \
+    yv = get_space(y);      \
+    if ( xv == yv ) {       \
+      if ((x) < (y)) ret = 1; \
+      else         ret = 0; \
+    } else if ( xv < yv ) { \
+       ret = 1;             \
+    } else {                \
+       ret = 0;             \
+    }                       \
+    ret;} )
+
+#define ck_new_galloc(X) \
+do{ \
+    int cid = currid;\
+    while ( (cid = PLNE_ptr[cid]->direct) != (-1) ) { \
+       if ( (unsigned long)((long)(X)-(long)(PLNE_ptr[cid]->top_addr) ) < SHM_SIZE ) { new_galloc(cid); break; }\
+    }\
+}while(0)
+
+
+#define is_cur_space_ptr(X) ( \
+    (unsigned long)((long)(X)-(long)(PLNE_ptr[currid]->top_addr) ) < SHM_SIZE )
+
+#define is_forward_space_ptr(X) ( {\
+    int ok = 0;\
+    int cid = currid;\
+    while ( (cid = PLNE_ptr[cid]->direct) != (-1) ) {\
+       if ( (unsigned long)((long)(X)-(long)(PLNE_ptr[cid]->top_addr) ) < SHM_SIZE ) {\
+	 ok = 1; break;\
+       }\
+    }\
+    ok; } )
+
+#define is_cur_or_forward_ptr(X) ( {\
+    int ok = 0;\
+    int cid = currid;\
+    do {\
+       if ( (unsigned long)((long)(X)-(long)(PLNE_ptr[cid]->top_addr) ) < SHM_SIZE ) {\
+	 ok = 1; break;\
+       }\
+    } while ( (cid = PLNE_ptr[cid]->direct) != (-1) ) ;\
+    ok; } )
+
+#define ck_throw_new_galloc(num) \
+do{ \
+    int cid = currid;\
+    while( (cid=PLNE_ptr[cid]->direct) != -1 ) { \
+       if ( PLNE_ptr[cid]->proc[num] ) {new_galloc(cid);} \
+    }\
+}while(0)
+
+
+
+
+  /* Structures */
+typedef struct addr_tbl {
+   struct addr_tbl* next;
+   struct addr_tbl* prev;
+   q* localA;
+   q* globalA;
+} TADDRtbl;
+
+struct ex_goalrec {
+   struct ex_goalrec* next;
+   long prio;
+   struct goalrec goal;
+} ;
+
+typedef struct PE_shook {
+   struct PE_shook*   next;
+   long               PE_num;
+   long               prio;
+   TADDRtbl*          indp;
+} Sinfo;
+
+typedef struct shvar {
+   struct generator_object_method_table* method;
+   Sinfo* chain;
+} Shvar;
+
+/* Management table of a shared memory plain */
+typedef struct {
+   long* top_addr;
+   long* caddr;
+   long  direct;
+   long  demand;
+   long  proc[MAX_N_PE];
+   long* limit1;
+   long* limit2;
+   long* limit3;
+} PLNE;
+
+/* External declarations */
+
+/* lock table address */
+extern int* lockp[];
+
+/* common variables */
+extern int F_shm_gc;
+
+extern volatile PLNE* PLNE_ptr[];
+
+extern int* volatile pe_status;
+extern int* volatile cur_status;
+
+extern long* volatile Prof_measure;
+
+extern struct global_variables* top_shm_glbl;
+
+extern int* top_shm_pid;
+
+extern struct ex_goalrec** volatile top_shm_qp;
+
+/* runtime/shm_rsv.c */
+extern char* shm_start_addr;
+extern int ATOM_TABLE_SIZE;
+
+/* memorized the last generated variable on shm */
+extern q last_shm_var;
+
+extern struct generator_object* qSHM_BUSY;
+extern struct generator_object* pSHM_VAR;
+extern struct generator_object_method_table* SHM_BUSY;
+extern struct generator_object_method_table* SHM_VAR;
+
+/* current shared memory top address, limit of myself */
+extern q* gallocp;
+extern q* glimit;
+
+extern TADDRtbl ADDRtbl;
+extern TADDRtbl* ADDRtbl_free;
+
+
+/* Declarations of functions */
+
+/* runtime/shm_rsv.c */
+
+/* common routines */
+extern struct global_variables* shm_init(struct global_variables* glbl);
+
+/* allocate shared memory routines */
+extern q* shm_galloc(int siz);
+
+
+/* runtime/shm_throw.c */
+ 
+/* convert real PE number from Logical PE number */
+extern int phisc_pe(int NO);
+
+/* copy into shared memory */
+extern struct ex_goalrec* shm_goal_copy(struct goalrec* qp, long prio);
+
+/* copy argument into shared memory */
+extern q shm_copy(q src);
+
+/* stack a goal */
+extern int shm_goal_stack(struct ex_goalrec* goal, int num);
+
+
+/* runtime/shm_obj.c */
+
+extern Shvar* create_genhook(q* la, q* ga);
+
+extern Shvar* shm_add_consumer(
+  q shv, Shvar* shobj, q cvar, struct global_variables* glbl );
+
+extern q* shm_ck_request(q* allocp, Sinfo* chain);
+extern q* shm_resume_goals(q* allocp, Sinfo* hook);
+
+extern TADDRtbl* create_local_tbl(q* lcl, q* gbl);
+
+
+/* runtime/newatom.c */
+extern void init_shm_atom(void);
+
+/* runtime/sched.c */
+extern struct goalrec* get_invoked_goals(struct goalrec* qp);
+
+/* runtime/shm_gc.c  GC routines */
+extern int ck_shm_gc(void);
+extern struct goalrec* shm_gc(struct goalrec* qp);
+
+/* for GC */
+
+extern q** shm_gcstack;
+extern q** shm_gcmax;
+extern q** shm_sp;
+extern int shm_gcstack_size;
+
+/* for debugging */
+#define debug_wait()  do{ while(!*pe_status) {} }while(0)
+
+#endif /* _KLIC_SHM_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/shm_gc.c klic-3.003-2001-12-28/runtime/shm_gc.c
--- klic-3.003-2001-12-27/runtime/shm_gc.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/shm_gc.c	Fri Dec 28 13:46:47 2001
@@ -8,12 +8,12 @@
 #include <stdio.h>
 #include <klic/basic.h>
 #include <klic/struct.h>
-#include <klic/timing.h>
+#include "timing.h"
 #include <klic/primitives.h>
 #include <klic/functorstuffs.h>
-#include <klic/gobj.h>
-#include <klic/susp.h>
-#include <klic/shm.h>
+#include "gobj.h"
+#include "susp.h"
+#include "shm.h"
 #include <time.h>
 
 /* ------- Optinal Flags --------------------------------- */
diff -ruN klic-3.003-2001-12-27/runtime/shm_machine.h klic-3.003-2001-12-28/runtime/shm_machine.h
--- klic-3.003-2001-12-27/runtime/shm_machine.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/shm_machine.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,229 @@
+/* ---------------------------------------------------------- 
+%   (C)1994,1995 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.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_SHM_MACHINE_H_
+#define _KLIC_SHM_MACHINE_H_
+
+  /* lock-unlock */
+#ifdef SPARC
+
+#define n_lock(shvp,sadp) ( { \
+    register int* s1 asm ("g4") = (int*) (shvp); \
+    register int* s2 asm ("g3") = (int*) (sadp); \
+    register struct generator_object* befp asm ("g2");          \
+    register struct generator_object* genp asm ("g5") = qSHM_BUSY; \
+    asm ( "                   \
+0:                            \
+        mov %%g5,%%g2;        \
+        swap [%%g3 + 4],%%g2; \
+        cmp %%g2,%%g5;        \
+        bne 4f;               \
+        nop;                  \
+2:                            \
+        ld [%%g4],%%g2;       \
+        cmp %%g3,%%g2;        \
+        bne 3f;               \
+        nop;                  \
+        ld [%%g3 + 4],%%g2;   \
+        cmp %%g2,%%g5;        \
+        bne 0b;               \
+        nop;                  \
+        b 2b;                 \
+        nop;                  \
+3:                            \
+        mov %%g5,%%g2;        \
+4:                            \
+" : "=g" (befp), "=g" (s1) : "g" (s1), "g" (s2), "g" (genp)  );    \
+  (shvp) = (q)s1;               \
+  befp;                       \
+  } )
+
+#define n_unlock(sadp, genh) \
+do{ \
+    register int* n1 asm ("g3") = (int*) (sadp); \
+    register struct generator_object* n2 asm ("g4") = (genh); \
+    asm volatile ( "         \
+        stbar;               \
+        st %%g4,[%%g3 + 4];  \
+" :  : "g" (n1), "g" (n2) ) ;\
+}while(0)
+
+#define s_lock(key) \
+do{ \
+    register int* val asm ("g3") = lockp[key]; \
+    asm volatile ( "         \
+0:                           \
+        mov -1,%%g2;         \
+        swap [%%g3],%%g2;    \
+        cmp %%g2,0;          \
+        be 3f;               \
+        nop;                 \
+2:                           \
+        ld [%%g3],%%g2;      \
+        cmp %%g2,0;          \
+        be 0b;               \
+        nop;                 \
+        b 2b;                \
+        nop;                 \
+3:                           \
+" :  : "g" (val) : "g2" );   \
+}while(0)
+
+#define s_unlock(key) 
+do{ \
+    register int* val asm ("g3") = lockp[key]; \
+    asm volatile ( "         \
+        stbar;               \
+        st %%g0,[%%g3];      \
+" :  : "g" (val) ) ;         \
+}while(0)
+
+#define klic_barrier()  do{ asm volatile ( "stbar;" : : ); }while(0)
+
+#endif
+
+#ifdef ALPHA
+
+#define n_lock(shvp,sadp) ( { \
+    register long* s1 asm ("$4") = (long*) (shvp); \
+    register long* s2 asm ("$3") = (long*) (sadp); \
+    register struct generator_object* genp asm ("$5") = qSHM_BUSY; \
+    register struct generator_object* befp asm ("$2");           \
+    asm volatile ( "          \
+1:                            \
+        ldq_l $2,8($3);       \
+        cmpeq $2,$5,$1;       \
+        bne   $1,2f;          \
+        bis   $5,$5,$1;       \
+        stq_c $1,8($3);       \
+        bne   $1,3f;          \
+2:                            \
+        ldq   $2,8($3);       \
+        cmpeq $2,$5,$1;       \
+        beq   $1,1b;          \
+        ldq   $1,($4);        \
+        cmpeq $3,$1,$1;       \
+        beq   $1,3f;          \
+        br    2b;             \
+3:                            \
+        mb;                   \
+" : "=g" (befp), "=g" (s1) : "g" (s1), "g" (s2), "g" (genp) : "$1" );    \
+  (shvp) = (q)s1;               \
+  befp;                       \
+  } )
+
+#define n_unlock(sadp, genh) \
+do{ \
+    register long* n1 asm ("$3") = (long*) (sadp); \
+    register struct generator_object* n2 asm ("$4") = (genh); \
+    asm volatile ( "         \
+        mb;                  \
+        stq $4,8($3);        \
+" :  : "g" (n1), "g" (n2) ) ;\
+}while(0)
+
+#define s_lock(key) \
+do{ \
+    register int* val asm ("$3") = lockp[key]; \
+    asm volatile ( "        \
+1:                          \
+        ldl_l $1,0($3);     \
+        blbs  $1,2f;        \
+        or    $1,1,$2;      \
+        stl_c $2,0($3);     \
+        beq   $2,2f;        \
+        br    3f;           \
+2:                          \
+        ldl   $1,0($3);     \
+        blbc  $1,1b;        \
+        br    2b;           \
+3:                          \
+" :  : "g" (val) : "$1","$2" ); \
+}while(0)
+
+#define s_unlock(key) \
+do{ \
+    register int* val asm ("$3") = lockp[key]; \
+    asm volatile ( "        \
+        mb;                 \
+        stl $31,0($3);      \
+" :  : "g" (val) ) ;        \
+}while(0)
+
+
+#define klic_barrier()  do{ asm volatile ( "mb;" : : ); }while(0)
+
+#endif
+
+#ifdef INTEL
+#define n_lock(shvp, sadp) ({ \
+    register int* s1 asm ("%edx") =  (int *) (shvp);  \
+    register int* s2 asm ("%ecx") =  (int *) (sadp);  \
+    register struct generator_object* befp asm ("%ebx"); \
+    register struct generator_object* genp asm ("%eax") = qSHM_BUSY; \
+    asm ( "                     \
+0:                              \
+        movl  %%eax,%%ebx;      \
+        xchgl 4(%%ecx),%%ebx;   \
+        cmpl  %%ebx,%%eax;      \
+        jne   4f;               \
+2:                              \
+        movl  (%%edx),%%ebx;    \
+        cmpl  %%ecx,%%ebx;      \
+        jne   3f;               \
+        movl  4(%%ecx),%%ebx;   \
+        cmpl  %%ebx,%%eax;      \
+        jne   0b;               \
+        jmp   2b;               \
+3:                              \
+        movl  %%eax,%%ebx;      \
+4:                              \
+" : "=g" (befp), "=g" (s1) : "g" (s1), "g" (s2), "g" (genp)  );    \
+  (shvp) = (q)s1;               \
+  befp;                       \
+  } )
+
+#define n_unlock(sadp,genh) \
+do{ \
+    register int* n1 asm ("%ecx") = (int*) (sadp); \
+    register struct generator_object* n2 asm ("%edx") = (genh); \
+    asm volatile ( "         \
+        movl %%edx,4(%%ecx);  \
+" :  : "g" (n1), "g" (n2) ) ;\
+}while(0)
+
+#define s_lock(key) { \
+    register int* val asm ("%ecx") = lockp[key]; \
+    asm volatile ( "         \
+        movl $0,%%edx;       \
+6:                           \
+        movl $-1,%%ebx;      \
+        xchgl (%%ecx),%%ebx; \
+        cmpl %%ebx,%%edx;    \
+        je  8f;              \
+7:                           \
+        movl (%%ecx),%%ebx;  \
+        cmpl %%ebx,%%edx;    \
+        je  6b;              \
+        jmp 7b;              \
+8:                           \
+" :  : "g" (val) : "%ebx","%edx" );   \
+}while(0)
+
+#define s_unlock(key) \
+do{      \
+    register int* val asm ("ecx") = lockp[key]; \
+    asm volatile ( "         \
+        movl $0,(%%ecx);     \
+" :  : "g" (val) ) ;         \
+}while(0)
+
+#define klic_barrier()  do{;}while(0)
+
+#endif
+
+#endif /* _KLIC_SHM_MACHINE_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/shm_obj.c klic-3.003-2001-12-28/runtime/shm_obj.c
--- klic-3.003-2001-12-27/runtime/shm_obj.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/shm_obj.c	Fri Dec 28 13:46:47 2001
@@ -12,9 +12,9 @@
 #include <klic/functorstuffs.h>
 #include <klic/index.h>
 #include <klic/unify.h>
-#include <klic/susp.h>
+#include "susp.h"
 #include <klic/gg_macro.h>
-#include <klic/shm.h>
+#include "shm.h"
 
 /* unbound variable in shared memory (representating by a generic object)
         +-------------------+
diff -ruN klic-3.003-2001-12-27/runtime/shm_rsv.c klic-3.003-2001-12-28/runtime/shm_rsv.c
--- klic-3.003-2001-12-27/runtime/shm_rsv.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/shm_rsv.c	Fri Dec 28 13:46:47 2001
@@ -12,7 +12,7 @@
 #include <sys/mman.h>
 #include <klic/basic.h>
 #include <klic/struct.h>
-#include <klic/shm.h>
+#include "shm.h"
 #include <signal.h>
 
 /*
diff -ruN klic-3.003-2001-12-27/runtime/shm_throw.c klic-3.003-2001-12-28/runtime/shm_throw.c
--- klic-3.003-2001-12-27/runtime/shm_throw.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/shm_throw.c	Fri Dec 28 13:46:47 2001
@@ -10,9 +10,9 @@
 #include <klic/primitives.h>
 #include <klic/unify.h>
 #include <klic/functorstuffs.h>
-#include <klic/susp.h>
-#include <klic/gobj.h>
-#include <klic/shm.h>
+#include "susp.h"
+#include "gobj.h"
+#include "shm.h"
 #include <signal.h>
 
 q last_shm_var;
diff -ruN klic-3.003-2001-12-27/runtime/step.c klic-3.003-2001-12-28/runtime/step.c
--- klic-3.003-2001-12-27/runtime/step.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/step.c	Fri Dec 28 13:46:47 2001
@@ -10,7 +10,7 @@
 #include <klic/basic.h>
 #include <klic/struct.h>
 #include <klic/primitives.h>
-#include <klic/goalobj.h>
+#include "goalobj.h"
 #include <klic/generic.h>
 #include "atom.h"
 #include "funct.h"
diff -ruN klic-3.003-2001-12-27/runtime/susp.h klic-3.003-2001-12-28/runtime/susp.h
--- klic-3.003-2001-12-27/runtime/susp.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/susp.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,139 @@
+/* ---------------------------------------------------------- 
+%   (C)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.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_SUSP_H_
+#define _KLIC_SUSP_H_
+
+/******************************
+  Suspension Structures
+*******************************/
+
+/*
+  Variables _with_ suspended goals are represented as
+    a two-word pointer loop,
+    the second word being the suspension record structure.
+*/
+
+struct hook {
+  struct hook* next;		/* next suspension structure */
+  union goal_or_consumer {
+    long l;			/* long integer for tag manipulation */
+    struct goalrec* g;		/* pointer to a goal record */
+    struct consumer_object* o;	/* pointer to a consumer object */
+  } u;
+};
+
+#define CONSUMER_HOOK_TAG 1
+
+#define is_consumer_hook(u) \
+  ((u.l&CONSUMER_HOOK_TAG) == 1)
+
+#define tag_consumer_hook(obj) \
+  ((struct consumer_object*) ((long)(obj)+CONSUMER_HOOK_TAG))
+
+#define untag_consumer_hook(obj) \
+  ((struct consumer_object*) ((long)(obj)-CONSUMER_HOOK_TAG))
+
+struct susprec {
+  q backpt;
+  union {
+    struct hook first_hook;
+    long l;
+  } u;
+};
+
+#define suspp(x)	((struct susprec*) ((unsigned long)(x) - VARREF))
+
+#define allocnewsusp(var,srec)						\
+do{									\
+  q* temp;								\
+  heapalloc(temp, (sizeof(struct susprec))/sizeof(q)+1, (q*));		\
+  initnewsusp(temp, (var), (srec));					\
+}while(0)
+
+#define makenewsusp(var,srec,allocp)					\
+do{									\
+  initnewsusp((allocp), (var), (srec));					\
+  (allocp) += sizeof(struct susprec)/sizeof(q)+1;			\
+}while(0)
+
+#define initnewsusp(temp,var,srec)					\
+do{									\
+  (var) = makeref(temp);						\
+  (srec) = (struct susprec*) ((temp) + 1);				\
+  derefone(var) = (q) (srec);						\
+  (srec)->backpt = (var);						\
+  (srec)->u.first_hook.next = &(srec)->u.first_hook;			\
+}while(0)
+
+#define allochook(oldhook,newhook)					\
+do{									\
+  heapalloc((newhook), sizeof(struct hook)/sizeof(q), (struct hook*));	\
+  initnewhook((oldhook), (newhook));					\
+}while(0)
+
+#define addhook(oldhook,newhook,allocp)					\
+do{									\
+  (newhook) = (struct hook*) (allocp);					\
+  initnewhook((oldhook), (newhook));					\
+  (allocp) += sizeof(struct hook) / sizeof(q);				\
+}while(0)
+
+#define initnewhook(oldhook,newhook)					\
+do{									\
+  (newhook)->next= (oldhook)->next;					\
+  (oldhook)->next = (newhook);						\
+}while(0)
+
+/*
+  generator object support
+*/
+
+struct generator_susp {
+  q backpt;
+  union {
+    struct generator_object* o;
+    long l;
+  } u;
+};
+
+#define generator_suspp(susp) ((struct generator_susp*) (susp))
+
+#define GENERATOR_OBJECT_TAG 1
+
+#define is_generator_susp(u) \
+  ((u.l)&GENERATOR_OBJECT_TAG == 1)
+
+#define tag_generator_susp(obj) \
+  ((struct generator_object*) ((long)(obj) + GENERATOR_OBJECT_TAG))
+
+#define untag_generator_susp(obj) \
+  ((struct generator_object*) ((long)(obj) - GENERATOR_OBJECT_TAG))
+
+#define allocnewgensusp(var,gsusp) \
+do{ \
+  q* tmp; \
+  heapalloc(tmp, (sizeof(struct generator_susp))/sizeof(q)+1, (q*)); \
+  initnewgensusp(tmp, (var), (gsusp)); \
+}while(0)
+
+#define initnewgensusp(tmp, var, gsusp) \
+do{ \
+  (var) = makeref(tmp); \
+  (gsusp) = (struct generator_susp*) ((tmp) + 1); \
+  derefone(var) = (q) (gsusp); \
+  (gsusp)->backpt = (var); \
+}while(0)
+
+/* Perpetual Suspension Detection */
+
+struct suspended_goal_rec {
+  struct goalrec* goal;
+  struct suspended_goal_rec* next;
+};
+
+#endif /* _KLIC_SUSP_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/timer.c klic-3.003-2001-12-28/runtime/timer.c
--- klic-3.003-2001-12-27/runtime/timer.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/timer.c	Fri Dec 28 13:46:47 2001
@@ -9,7 +9,7 @@
 #ifdef USETIMER
 #include <signal.h>
 #include <sys/time.h>
-#include <klic/timer.h>
+#include "timer.h"
 
 extern char *malloc_check();
 
diff -ruN klic-3.003-2001-12-27/runtime/timer.h klic-3.003-2001-12-28/runtime/timer.h
--- klic-3.003-2001-12-27/runtime/timer.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/timer.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,59 @@
+/* ---------------------------------------------------------- 
+%   (C)1995 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.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_TIMER_H_
+#define _KLIC_TIMER_H_
+
+struct klic_timer_wait_rec {
+  struct klic_timer_wait_rec* next;
+  struct timeval on_at;
+  struct timeval interval;
+  void(* func)();
+};
+
+#define NotLaterThan(x, y) 				\
+((x).tv_sec < (y).tv_sec ||				\
+ ((x).tv_sec == (y).tv_sec && (x).tv_usec <= (y).tv_usec))
+
+#define Million 1000000
+
+#define TimeSet(x, s, u)				\
+do{ (x).tv_sec = (s); (x).tv_usec = (u); }while(0)
+
+#define TimeIsZero(x)					\
+((x).tv_sec == 0 && (x).tv_usec == 0)
+
+#define TimeSub(x, y, z)				\
+do{ \
+  if ((x).tv_usec-(y).tv_usec >= 0) {			\
+    (z).tv_sec = (x).tv_sec - (y).tv_sec;			\
+    (z).tv_usec = (x).tv_usec - (y).tv_usec;		\
+  } else {						\
+    (z).tv_sec = (x).tv_sec - (y).tv_sec - 1;		\
+    (z).tv_usec = Million + (x).tv_usec - (y).tv_usec;	\
+  } \
+}while(0)
+
+#define TimeAdd(x, y, z)				\
+do{ \
+  if ((x).tv_usec+(y).tv_usec < Million) {		\
+    (z).tv_sec = (x).tv_sec + (y).tv_sec;			\
+    (z).tv_usec = (x).tv_usec + (y).tv_usec;		\
+  } else {						\
+    (z).tv_sec = (x).tv_sec + (y).tv_sec + 1;		\
+    (z).tv_usec = (x).tv_usec + (y).tv_usec - Million;	\
+  } \
+}while(0)
+
+/* runtime/timer.c */
+extern void klic_gettod(struct timeval* now);
+extern void call_at_specified_time(long sec, long usec, void(* func)());
+extern void call_after_specified_interval(long sec, long usec, void(* func)());
+extern void call_at_time_intervals(long sec, long usec, void(* func)());
+extern void init_virtualized_timer(void);
+
+#endif /* _KLIC_TIMER_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/timing.h klic-3.003-2001-12-28/runtime/timing.h
--- klic-3.003-2001-12-27/runtime/timing.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/timing.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,43 @@
+/* ---------------------------------------------------------- 
+%   (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.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_TIMING_H_
+#define _KLIC_TIMING_H_
+
+#include <sys/types.h>
+
+#define  field_diff(field)	(after.field - before.field)
+
+#ifdef GETRUSAGE
+
+#include <sys/time.h>
+#include <sys/resource.h>
+
+#define  diff_usec(field)\
+(field_diff(field.tv_sec) * 1000000 + field_diff(field.tv_usec))
+
+typedef struct rusage timerstruct;
+#define	 measure(x)	getrusage(RUSAGE_SELF, &(x))
+
+#else 
+
+#include <sys/times.h>
+#include <sys/param.h>
+
+#define	 tick2msec(n)	((n)*1000.0/HZ)
+
+typedef struct tms timerstruct;
+#define	 measure(x)	times(&(x))
+
+#endif
+
+Extern int gctimes Init(0);
+Extern int gcums Init(0);
+Extern int gcsms Init(0);
+Extern int measure_gc Init(0);
+
+#endif /* _KLIC_TIMING_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/trace.c klic-3.003-2001-12-28/runtime/trace.c
--- klic-3.003-2001-12-27/runtime/trace.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/trace.c	Fri Dec 28 13:46:47 2001
@@ -11,7 +11,7 @@
 #include <klic/predinfo.h>
 #include <klic/generic.h>
 #include <klic/functorstuffs.h>
-#include <klic/susp.h>
+#include "susp.h"
 #ifdef STRINGH
 #include <string.h>
 #else
@@ -20,13 +20,13 @@
 #include <stdio.h>
 #include <setjmp.h>
 
-#include <klic/trace.h>
-#include <klic/traceio.h>
+#include "trace.h"
+#include "traceio.h"
 #ifdef DIST
 #include <klic/distio.h>
 #endif
 #ifdef SHM
-#include <klic/shm.h>
+#include "shm.h"
 #endif
 
 extern module wait_penum_routine();
diff -ruN klic-3.003-2001-12-27/runtime/trace.h klic-3.003-2001-12-28/runtime/trace.h
--- klic-3.003-2001-12-27/runtime/trace.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/trace.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,71 @@
+/* ---------------------------------------------------------- 
+%   (C)1994,1995 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.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_TRACE_H_
+#define _KLIC_TRACE_H_
+
+/*
+  Tracer Status Information
+*/
+
+struct trace_info_rec {
+  FILE* in;
+  FILE* out;
+  q original_arg;
+  int enabled, leashed, leaping, spying;
+  int verbose;
+  unsigned long print_depth, print_length;
+};
+
+#define Leaping(info)		((info)->leaping)
+#define Spying(info)		((info)->spying)
+#define EnabledPorts(info)	((info)->enabled)
+#define LeashedPorts(info)	((info)->leashed)
+#define Enabled(info,port)	((EnabledPorts(info) >> (int)(port)) & 1)
+#define Leashed(info,port)	((LeashedPorts(info) >> (int)(port)) & 1)
+#define Verbose(info)		((info)->verbose)
+#define Depth(info)		((info)->print_depth)
+#define Length(info)		((info)->print_length)
+
+#define InStream(info)		((info)->in)
+#define OutStream(info)		((info)->out)
+
+/*
+  Info on Enqueued Goals
+*/
+
+struct enqueue_trace_rec {
+  struct enqueue_trace_rec* next;
+  struct goalrec* g;
+  long prio;
+};
+
+/*
+  Name Tables
+*/
+
+struct mod_table_entry {
+  module(* func)();
+  const unsigned char* name;
+};
+
+struct pred_table_entry {
+  const struct predicate* pred;
+  const struct mod_table_entry* mte;
+  const unsigned char* name;
+  char spied;
+  char default_trace;
+};
+
+/*
+  Trace Control
+*/
+
+enum trace_port {
+  Call, Susp, Reduce, Fail, AllPorts, NoMorePort, UnknownPort };
+
+#endif /* _KLIC_TRACE_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/traceio.h klic-3.003-2001-12-28/runtime/traceio.h
--- klic-3.003-2001-12-27/runtime/traceio.h	Thu Jan  1 09:00:00 1970
+++ klic-3.003-2001-12-28/runtime/traceio.h	Fri Dec 28 13:46:47 2001
@@ -0,0 +1,26 @@
+/* ---------------------------------------------------------- 
+%   (C)1993,1994,1995 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.)
+----------------------------------------------------------- */
+
+#ifndef _KLIC_TRACEIO_H_
+#define _KLIC_TRACEIO_H_
+
+#ifdef DIST
+#define TRACE_ATTACHIO()	AttachIO()
+#define TRACE_DETACHIO()	DetachIO()
+#else
+# ifdef SHM
+#define TRACE_ATTACHIO() \
+  do{ if (!shm_trace_lock) {s_lock(tr_key()); shm_trace_lock=1;} }while(0)
+#define TRACE_DETACHIO() \
+  do{ shm_trace_lock=0; s_unlock(tr_key()); }while(0)
+# else
+#define TRACE_ATTACHIO()
+#define TRACE_DETACHIO()
+# endif
+#endif
+
+#endif /* _KLIC_TRACEIO_H_ */
diff -ruN klic-3.003-2001-12-27/runtime/unify.c klic-3.003-2001-12-28/runtime/unify.c
--- klic-3.003-2001-12-27/runtime/unify.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/unify.c	Fri Dec 28 13:46:47 2001
@@ -7,11 +7,11 @@
 #include <klic/basic.h>
 #include <klic/struct.h>
 #include <klic/primitives.h>
-#include <klic/schedule.h>
+#include "schedule.h"
 #include <stdio.h>
 #include <klic/gb.h>
-#include <klic/gobj.h>
-#include <klic/susp.h>
+#include "gobj.h"
+#include "susp.h"
 
 q *do_unify(), *do_unify_value();
 extern struct predicate predicate_unify__term__dcode_xunify_2;
diff -ruN klic-3.003-2001-12-27/runtime/unify2.c klic-3.003-2001-12-28/runtime/unify2.c
--- klic-3.003-2001-12-27/runtime/unify2.c	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/unify2.c	Fri Dec 28 13:46:47 2001
@@ -12,7 +12,7 @@
 #include <klic/index.h>
 #include <klic/gb.h>
 #include <klic/functorstuffs.h>
-#include <klic/gobj.h>
+#include "gobj.h"
 
 /* 
   General Guard Unification
diff -ruN klic-3.003-2001-12-27/runtime/uterms.kl1 klic-3.003-2001-12-28/runtime/uterms.kl1
--- klic-3.003-2001-12-27/runtime/uterms.kl1	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2001-12-28/runtime/uterms.kl1	Fri Dec 28 13:46:47 2001
@@ -5,7 +5,7 @@
 %       (Read COPYRIGHT-JIPDEC for detailed information.)
 ----------------------------------------------------------- */
 
-:- inline:"#include <klic/gobj.h>".
+:- inline:"#include \"gobj.h\"".
 :- module unify_term_dcode.
 
 unify(X,Y) :- 
