#ifndef __GHETTOCHAINEDHASHMAP_H__ #define __GHETTOCHAINEDHASHMAP_H__ typedef struct ChainedHashMapEntry { void * value; struct ChainedHashMapEntry * next; char * name; } ChainedHashMapEntry; typedef struct ChainedHashMap { ChainedHashMapEntry ** mapValues; size_t sizeOfMap; } ChainedHashMap; __int8 createInitialHashMap(ChainedHashMap ** hashMap, size_t desiredSize); __int8 releaseHashMap(ChainedHashMap * hashMap); __int8 insertIntoHashMap(ChainedHashMap * hashMap, char * key, void * value); __int8 searchHashMap(ChainedHashMap * hashMap, char * key, void ** value); __int8 removeFromHashMap(ChainedHashMap * hashMap, char * key); __int8 hashKey(char * key, __int32 * hashValue); #endif #include "GhettoChainedHashMap.h" int main(int argc, char * argv[]) { ChainedHashMap * hashMap; createInitialHashMap(&hashMap, 4096); if (hashMap->sizeOfMap != 4096) return 0; releaseHashMap(hashMap); if (hashMap != 0) return 0; return 1; }