From 266ab52b3a741a58fb17c48b0f7939d7c5d266de Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 11 Apr 2016 13:00:19 +0200 Subject: Imported Upstream version 0.6 --- Hashtable.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Hashtable.c') diff --git a/Hashtable.c b/Hashtable.c index 3ecc0f2..617a5be 100644 --- a/Hashtable.c +++ b/Hashtable.c @@ -15,8 +15,8 @@ in the source distribution for its full text. /*{ typedef struct Hashtable_ Hashtable; -typedef void(*HashtablePairFunction)(int, void*); -typedef int(*HashtableHashAlgorithm)(Hashtable*, int); +typedef void(*Hashtable_PairFunction)(int, void*, void*); +typedef int(*Hashtable_HashAlgorithm)(Hashtable*, int); typedef struct HashtableItem { int key; @@ -28,7 +28,7 @@ struct Hashtable_ { int size; HashtableItem** buckets; int items; - HashtableHashAlgorithm hashAlgorithm; + Hashtable_HashAlgorithm hashAlgorithm; bool owner; }; }*/ @@ -129,11 +129,11 @@ inline void* Hashtable_get(Hashtable* this, int key) { bucketPtr = bucketPtr->next; } -void Hashtable_foreach(Hashtable* this, HashtablePairFunction f) { +void Hashtable_foreach(Hashtable* this, Hashtable_PairFunction f, void* userData) { for (int i = 0; i < this->size; i++) { HashtableItem* walk = this->buckets[i]; while (walk != NULL) { - f(walk->key, walk->value); + f(walk->key, walk->value, userData); walk = walk->next; } } -- cgit v1.2.3