Add debugging sanity checks.

This commit is contained in:
Hisham Muhammad
2006-11-12 21:52:14 +00:00
parent c90a445103
commit 36848494f5
4 changed files with 37 additions and 2 deletions

View File

@ -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);