mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
hashtable_destroy()
This commit is contained in:
@@ -18,6 +18,7 @@ typedef struct{
|
|||||||
bool hashtable_init(hashtable*, size_t);
|
bool hashtable_init(hashtable*, size_t);
|
||||||
bool hashtable_insert(hashtable*, char*, void*);
|
bool hashtable_insert(hashtable*, char*, void*);
|
||||||
bool hashtable_remove(hashtable*, char*);
|
bool hashtable_remove(hashtable*, char*);
|
||||||
|
void hashtable_destroy(hashtable*);
|
||||||
void* hashtable_get(hashtable*, char*);
|
void* hashtable_get(hashtable*, char*);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -112,3 +112,12 @@ void* hashtable_get(hashtable* table, char* key){
|
|||||||
|
|
||||||
return entry->val;
|
return entry->val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void hashtable_destroy(hashtable* table){
|
||||||
|
|
||||||
|
// would be cool if this also deleted non removed entries
|
||||||
|
|
||||||
|
free(table->entries);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user