Add uc_htable_remove + test

This commit is contained in:
Nils O. Selåsdal
2013-10-17 22:12:48 +02:00
parent 6c76759355
commit 0f0ae6dd1e
3 changed files with 70 additions and 1 deletions
+10 -1
View File
@@ -48,7 +48,7 @@ struct UHTable {
int uc_htable_init(struct UHTable *table, size_t buckets);
/**
* Frees resources of the hash table.
* Free resources of the hash table.
* @param table hash table to free (does not free @table itself
*/
void uc_htable_destroy(struct UHTable *table);
@@ -201,6 +201,15 @@ void uc_htable_clear(struct UHTable *table);
*/
void uc_htable_insert(struct UHTable *table, struct UHNode *node, size_t hash);
/** Remove a node.
* If the node pointer is not part of the table,
* no action is taken
*
* @param table table to remove from.
* @param node node to remove.
*/
void uc_htable_remove(struct UHTable *table, struct UHNode *node);
/** Resize the hash table. This changes the number of buckets, and re-inserts
* all nodes.
*