diff --git a/src/util/table.c b/src/util/table.c index 13a89f6f8..21a86fed4 100644 --- a/src/util/table.c +++ b/src/util/table.c @@ -144,13 +144,13 @@ void TableClear(struct Table* table) { } } -void TableEnumerate(const struct Table* table, void (handler(void* value, void* user)), void* user) { +void TableEnumerate(const struct Table* table, void (handler(uint32_t key, void* value, void* user)), void* user) { size_t i; for (i = 0; i < table->tableSize; ++i) { const struct TableList* list = &table->table[i]; size_t j; for (j = 0; j < list->nEntries; ++j) { - handler(list->list[j].value, user); + handler(list->list[j].key, list->list[j].value, user); } } } diff --git a/src/util/table.h b/src/util/table.h index 2e8d31baa..3c21c40ff 100644 --- a/src/util/table.h +++ b/src/util/table.h @@ -25,7 +25,7 @@ void TableInsert(struct Table*, uint32_t key, void* value); void TableRemove(struct Table*, uint32_t key); void TableClear(struct Table*); -void TableEnumerate(const struct Table*, void (handler(void* value, void* user)), void* user); +void TableEnumerate(const struct Table*, void (handler(uint32_t key, void* value, void* user)), void* user); static inline void HashTableInit(struct Table* table, size_t initialSize, void (deinitializer(void*))) { TableInit(table, initialSize, deinitializer);