|
|
|
|
@ -12,6 +12,7 @@ in the source distribution for its full text. |
|
|
|
|
|
|
|
|
|
#include <stdlib.h> |
|
|
|
|
#include <stdbool.h> |
|
|
|
|
#include <assert.h> |
|
|
|
|
|
|
|
|
|
#include "debug.h" |
|
|
|
|
|
|
|
|
|
@ -32,6 +33,14 @@ struct Hashtable_ { |
|
|
|
|
bool owner; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
|
|
|
|
|
bool Hashtable_isConsistent(Hashtable* this); |
|
|
|
|
|
|
|
|
|
int Hashtable_count(Hashtable* this); |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
HashtableItem* HashtableItem_new(int key, void* value); |
|
|
|
|
|
|
|
|
|
Hashtable* Hashtable_new(int size, bool owner); |
|
|
|
|
@ -43,7 +52,7 @@ inline int Hashtable_size(Hashtable* this); |
|
|
|
|
void Hashtable_put(Hashtable* this, int key, void* value); |
|
|
|
|
|
|
|
|
|
void* Hashtable_remove(Hashtable* this, int key); |
|
|
|
|
//#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
inline void* Hashtable_get(Hashtable* this, int key); |
|
|
|
|
|
|
|
|
|
void Hashtable_foreach(Hashtable* this, Hashtable_PairFunction f, void* userData); |
|
|
|
|
|