Hashtable: hide implementation of Hashtable and HashtableItem

This commit is contained in:
Christian Göttsche 2021-01-04 23:21:54 +01:00 committed by cgzones
parent 8fe04b7494
commit 7043a93eba
2 changed files with 15 additions and 12 deletions

View File

@ -19,6 +19,20 @@ in the source distribution for its full text.
#include "XUtils.h" #include "XUtils.h"
typedef struct HashtableItem_ {
ht_key_t key;
unsigned int probe;
void* value;
} HashtableItem;
struct Hashtable_ {
unsigned int size;
HashtableItem* buckets;
unsigned int items;
bool owner;
};
#ifndef NDEBUG #ifndef NDEBUG
static void Hashtable_dump(const Hashtable* this) { static void Hashtable_dump(const Hashtable* this) {

View File

@ -14,18 +14,7 @@ typedef unsigned int ht_key_t;
typedef void(*Hashtable_PairFunction)(ht_key_t key, void* value, void* userdata); typedef void(*Hashtable_PairFunction)(ht_key_t key, void* value, void* userdata);
typedef struct HashtableItem_ { typedef struct Hashtable_ Hashtable;
ht_key_t key;
unsigned int probe;
void* value;
} HashtableItem;
typedef struct Hashtable_ {
unsigned int size;
HashtableItem* buckets;
unsigned int items;
bool owner;
} Hashtable;
#ifndef NDEBUG #ifndef NDEBUG