coreprof updates, nothing huge
[IRC.git] / Robust / src / Runtime / chash.h
index f8bae0447f5e43b9341fee48ab81ac64f45e9867..ca256f22dda7f6caea4153bbb5581406c6d32876 100644 (file)
@@ -3,11 +3,14 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#define INLINE    inline __attribute__((always_inline))
+//#define INLINE
 
 typedef struct cnode {
-  unsigned int key;
+  void * key;
   void *val;       //this can be cast to another type or used to point to a larger structure
   struct cnode *next;
+  struct cnode *lnext;
 } cnode_t;
 
 typedef struct ctable {
@@ -15,16 +18,19 @@ typedef struct ctable {
   unsigned int size;
   unsigned int mask;
   unsigned int numelements;
+  unsigned int resize;
   float loadfactor;
+  struct cnode *listhead;
 } ctable_t;
 
 /* Prototypes for hash*/
 ctable_t *cCreate(unsigned int size, float loadfactor);
-unsigned int cInsert(ctable_t *table, unsigned int key, void *val);
-void *cSearch(chashtable_t *table, unsigned int key); //returns val, NULL if not found
-unsigned int cRemove(chashtable_t *table, unsigned int key); //returns -1 if not found
-unsigned int cResize(chashtable_t *table, unsigned int newsize);
-void cDelete(chashtable_t *table);
+void cInsert(ctable_t *table, void * key, void * val);
+void * cSearch(ctable_t *table, void * key); //returns val, NULL if not found
+unsigned int cRemove(ctable_t *table, void * key); //returns -1 if not found
+unsigned int cResize(ctable_t *table, unsigned int newsize);
+void cDelete(ctable_t *table);
+void crehash(ctable_t *table);
 /* end hash */
 
 #endif