aboutsummaryrefslogtreecommitdiff
path: root/src/name_table.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/name_table.h')
-rw-r--r--src/name_table.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/name_table.h b/src/name_table.h
new file mode 100644
index 0000000..c7f885d
--- /dev/null
+++ b/src/name_table.h
@@ -0,0 +1,50 @@
+#ifndef _NAME_TABLE_
+#define _NAME_TABLE_
+
+#include "mytype.h"
+#include "id_table.h"
+
+
+/**************************************
+ NAME TABLE
+**************************************/
+
+typedef struct NameList {
+ char *name; // KEY
+ IDTYPE id;
+
+ // `heap' stores a heap only of a global name,
+ // that is, is kept having NULL for other nodes, such as agents.
+ VALUE heap;
+
+ struct NameList *next;
+} NameList;
+
+#define NAME_HASHSIZE 127
+static NameList *NameHashTable[NAME_HASHSIZE]; /* ハッシュテーブル本体 */
+
+// It should be called at first, and never called after that.
+void NameTable_init();
+
+
+void NameTable_set_heap_id(char *key, VALUE heap, IDTYPE id);
+
+
+// Erace key entry from NameHashTable
+void NameTable_erase(char *key);
+
+
+VALUE NameTable_get_heap(char *key);
+IDTYPE NameTable_get_set_id(char *key);
+
+void NameTable_puts_all();
+void NameTable_free_all();
+
+int NameTable_ckech_if_term_has_gname(VALUE term);
+
+int term_has_keynode(VALUE keynode, VALUE term);
+int keynode_exists_in_another_term(VALUE keynode, VALUE *connected_from);
+void global_replace_keynode_in_another_term(VALUE keynode, VALUE term);
+
+
+#endif