--- /dev/null
+#ifndef _CLOOKUP_H_
+#define _CLOOKUP_H_
+
+#define LOADFACTOR 0.75
+#define HASH_SIZE 100
+
+typedef struct hashlistnode {
+ unsigned int key;
+ void *val; //this can be cast to another type or used to point to a larger structure
+ struct hashlistnode *next;
+} cachehashlistnode_t;
+
+typedef struct hashtable {
+ cachehashlistnode_t *table; // points to beginning of hash table
+ unsigned int size;
+ unsigned int numelements;
+ float loadfactor;
+} cachehashtable_t;
+
+/* Prototypes for hash*/
+cachehashtable_t *cachehashCreate(unsigned int size, float loadfactor);
+unsigned int cachehashFunction(cachehashtable_t *table, unsigned int key);
+void cachehashInsert(cachehashtable_t *table, unsigned int key, void *val);
+void *cachehashSearch(cachehashtable_t *table, unsigned int key); //returns val, NULL if not found
+int cachehashRemove(cachehashtable_t *table, unsigned int key); //returns -1 if not found
+void cachehashResize(cachehashtable_t *table, unsigned int newsize);
+/* end hash */
+
+#endif
+
--- /dev/null
+#ifndef _LLOOKUP_H_
+#define _LLOOKUP_H_
+
+#define LOADFACTOR 0.75
+#define HASH_SIZE 100
+
+typedef struct hashlistnode {
+ unsigned int oid;
+ unsigned int mid;
+ void *val;// points to the object header structure
+ struct hashlistnode *next;
+} lhashlistnode_t;
+
+typedef struct hashtable {
+ lhashlistnode_t *table; // points to beginning of hash table
+ unsigned int size;
+ unsigned int numelements;
+ float loadfactor;
+} lhashtable_t;
+
+/* Prototypes for hash*/
+lhashtable_t *lhashCreate(unsigned int size, float loadfactor);
+unsigned int lhashFunction(lhashtable_t *table, unsigned int oid);
+void lhashInsert(lhashtable_t *table, unsigned int oid, void *val, unsigned int mid);
+void *lhashSearch(lhashtable_t *table, unsigned int oid); //returns val, NULL if not found
+int lhashRemove(lhashtable_t *table, unsigned int oid); //returns -1 if not found
+void lhashResize(lhashtable_t *table, unsigned int newsize);
+/* end hash */
+
+#endif
+
--- /dev/null
+#ifndef _MLOOKUP_H_
+#define _MLOOKUP_H_
+
+#define LOADFACTOR 0.75
+#define HASH_SIZE 100
+
+typedef struct hashlistnode {
+ unsigned int key;
+ void *val; //this can be cast to another type or used to point to a larger structure
+ struct hashlistnode *next;
+} mhashlistnode_t;
+
+typedef struct hashtable {
+ mhashlistnode_t *table; // points to beginning of hash table
+ unsigned int size;
+ unsigned int numelements;
+ float loadfactor;
+} mhashtable_t;
+
+/* Prototypes for hash*/
+mhashtable_t *mhashCreate(unsigned int size, float loadfactor);
+unsigned int mhashFunction(mhashtable_t *table, unsigned int key);
+void mhashInsert(mhashtable_t *table, unsigned int key, void *val);
+void *mhashSearch(mhashtable_t *table, unsigned int key); //returns val, NULL if not found
+int mhashRemove(mhashtable_t *table, unsigned int key); //returns -1 if not found
+void mhashResize(mhashtable_t *table, unsigned int newsize);
+/* end hash */
+
+#endif
+