start of new file
[IRC.git] / Robust / src / Runtime / SimpleHash.h
index 96efe815c78ec993c6df73123c5ed5517e6fbb03..e777d54134a85fb97d8540515c70858ae3085357 100755 (executable)
@@ -22,28 +22,29 @@ struct RuntimeHash * allocateRuntimeHash(int size);
 void RuntimeHashaddChild(struct RuntimeHash *thisvar, struct RuntimeHash * child);
 void freeRuntimeHash(struct RuntimeHash *);
 
-
+void RuntimeHashrehash(struct RuntimeHash * thisvar);
 int RuntimeHashadd(struct RuntimeHash *, int key, int data);
+#ifdef RAW
+int RuntimeHashadd_I(struct RuntimeHash *, int key, int data);
+#endif
+int RuntimeHashremovekey(struct RuntimeHash *,int key);
 int RuntimeHashremove(struct RuntimeHash *,int key, int data);
 bool RuntimeHashcontainskey(struct RuntimeHash *,int key);
 bool RuntimeHashcontainskeydata(struct RuntimeHash *,int key, int data);
 int RuntimeHashget(struct RuntimeHash *,int key, int* data);
-int RuntimeHashcountdata(struct RuntimeHash *,int data);
 void RuntimeHashaddParent(struct RuntimeHash *,struct RuntimeHash* parent);
 int RuntimeHashfirstkey(struct RuntimeHash *);
 struct RuntimeIterator* RuntimeHashcreateiterator(struct RuntimeHash *);
 void RuntimeHashiterator(struct RuntimeHash *, struct RuntimeIterator * it);
 int RuntimeHashcount(struct RuntimeHash *, int key);
-void RuntimeHashaddAll(struct RuntimeHash *, struct RuntimeHash * set);
 struct RuntimeHash * RuntimeHashimageSet(struct RuntimeHash *, int key);
 
 struct RuntimeHash {
     int numelements;
     int size;
     struct RuntimeNode **bucket;
-    struct ArrayRuntime *listhead;
-    struct ArrayRuntime *listtail;
-    int tailindex;
+    struct RuntimeNode *listhead;
+    struct RuntimeNode *listtail;
 };
 
 inline int RuntimeHashcountset(struct RuntimeHash * thisvar);
@@ -56,25 +57,19 @@ inline int RuntimeHashcountset(struct RuntimeHash * thisvar);
 
 struct RuntimeNode {
   struct RuntimeNode *next;
+  struct RuntimeNode *lnext;
+  struct RuntimeNode *lprev;
   int data;
   int key;
-  int inuse;
 };
 
-struct ArrayRuntime {
-  struct RuntimeNode nodes[ARRAYSIZE];
-  struct ArrayRuntime * nextarray;
-};
-
-
 struct RuntimeIterator {
-  struct ArrayRuntime *cur, *tail;
-  int index,tailindex;
+  struct RuntimeNode *cur;
 };
 
 inline struct RuntimeIterator * noargallocateRuntimeIterator();
 
-inline struct RuntimeIterator * allocateRuntimeIterator(struct ArrayRuntime *start, struct ArrayRuntime *tl, int tlindex);
+inline struct RuntimeIterator * allocateRuntimeIterator(struct RuntimeNode *start);
 
 inline int RunhasNext(struct RuntimeIterator *thisvar);