--- a/mojoshader_internal.h Sat Apr 04 02:10:43 2009 -0400
+++ b/mojoshader_internal.h Sun Apr 05 03:20:53 2009 -0400
@@ -124,6 +124,26 @@
return ((a < b) ? a : b);
} // Min
+
+// Hashtables...
+
+typedef struct HashTable HashTable;
+typedef uint32 (*HashTable_HashFn)(const void *key);
+typedef int (*HashTable_KeyMatchFn)(const void *a, const void *b);
+typedef void (*HashTable_NukeFn)(const void *key, const void *value);
+
+int hash_init(HashTable *table, const uint32 initial_table_size,
+ const HashTable_HashFn hashfn,
+ const HashTable_KeyMatchFn keymatchfn,
+ const HashTable_NukeFn nukefn,
+ const int stackable,
+ MOJOSHADER_malloc m, MOJOSHADER_free f, void *d);
+void hash_deinit(HashTable *table);
+int hash_insert(HashTable *table, const void *key, const void *value);
+int hash_remove(HashTable *table, const void *key);
+int hash_find(const HashTable *table, const void *key, const void **_value);
+
+
// This is the ID for a D3DXSHADER_CONSTANTTABLE in the bytecode comments.
#define CTAB_ID 0x42415443 // 0x42415443 == 'CTAB'
#define CTAB_SIZE 28 // sizeof (D3DXSHADER_CONSTANTTABLE).