summaryrefslogtreecommitdiff
path: root/src/include/util_Hash.h
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-02-03 12:20:40 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-02-03 12:20:40 +0000
commit118355583a6e67141bc0b5844b4057dab07c67c9 (patch)
treee861f7241c5bc5b7dd9612a73fea77e10edd6312 /src/include/util_Hash.h
parente844fb5a9731296e0562f4c78d9b044ff129f0db (diff)
standardizing names ... you will need to do a gmake <config>-clean before
recompiling. git-svn-id: http://svn.cactuscode.org/flesh/trunk@1342 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/include/util_Hash.h')
-rw-r--r--src/include/util_Hash.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/include/util_Hash.h b/src/include/util_Hash.h
new file mode 100644
index 00000000..62e6f2cc
--- /dev/null
+++ b/src/include/util_Hash.h
@@ -0,0 +1,72 @@
+ /*@@
+ @header Hash.h
+ @date Wed Oct 27 23:28:53 1999
+ @author Tom Goodale
+ @desc
+ Header file for hash stuff.
+ @enddesc
+ @version $Header$
+ @@*/
+
+#ifndef _HASH_H_
+#define _HASH_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct T_HASH_ENTRY
+{
+ struct T_HASH_ENTRY *last;
+ struct T_HASH_ENTRY *next;
+
+ unsigned int hash;
+
+ unsigned int klen;
+ char *key;
+
+ void *data;
+} iHashEntry;
+
+typedef struct T_HASH
+{
+ unsigned int size;
+ unsigned int fill;
+ unsigned int keys;
+
+ iHashEntry **array;
+} uHash;
+
+uHash *Util_HashCreate(unsigned int initial_size);
+int Util_HashDestroy(uHash *hash);
+
+int Util_HashStore(uHash *hash,
+ unsigned int klen,
+ char *key,
+ unsigned int hashval,
+ void *data);
+
+int Util_HashAdd(uHash *hash,
+ unsigned int klen,
+ char *key,
+ unsigned int hashval,
+ void *data);
+
+int Util_HashDelete(uHash *hash,
+ unsigned int klen,
+ char *key,
+ unsigned int hashval);
+
+void *Util_HashData(uHash *hash,
+ unsigned int klen,
+ char *key,
+ unsigned int hashval);
+
+unsigned int Util_HashHash(unsigned int klen,
+ char *key);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _HASH_H_ */