Index: uspace/lib/libc/generic/libadt/hash_table.c
===================================================================
--- uspace/lib/libc/generic/libadt/hash_table.c	(revision 00acd66d3981789b3f8b04cdd854d29343dd9aa0)
+++ uspace/lib/libc/generic/libadt/hash_table.c	(revision 088cecc97a4e21cb1647840c41cee125f006a3b3)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2006 Jakub Jermar
+ * Copyright (c) 2008 Jakub Jermar
  * All rights reserved.
  *
@@ -47,11 +47,12 @@
 /** Create chained hash table.
  *
- * @param h Hash table structure. Will be initialized by this call.
- * @param m Number of slots in the hash table.
- * @param max_keys Maximal number of keys needed to identify an item.
- * @param op Hash table operations structure.
- * @return true on success
+ * @param h		Hash table structure. Will be initialized by this call.
+ * @param m		Number of hash table buckets.
+ * @param max_keys	Maximal number of keys needed to identify an item.
+ * @param op		Hash table operations structure.
+ * @return		True on success
  */
-int hash_table_create(hash_table_t *h, hash_count_t m, hash_count_t max_keys, hash_table_operations_t *op)
+int hash_table_create(hash_table_t *h, hash_count_t m, hash_count_t max_keys,
+    hash_table_operations_t *op)
 {
 	hash_count_t i;
@@ -77,9 +78,20 @@
 }
 
-/** Insert item into hash table.
+/** Destroy a hash table instance.
  *
- * @param h Hash table.
- * @param key Array of all keys necessary to compute hash index.
- * @param item Item to be inserted into the hash table.
+ * @param h		Hash table to be destroyed.
+ */
+void hash_table_destroy(hash_table_t *h)
+{
+	assert(h);
+	assert(h->entry);
+	free(h->entry);
+}
+
+/** Insert item into a hash table.
+ *
+ * @param h		Hash table.
+ * @param key		Array of all keys necessary to compute hash index.
+ * @param item		Item to be inserted into the hash table.
  */
 void hash_table_insert(hash_table_t *h, unsigned long key[], link_t *item)
@@ -98,8 +110,8 @@
 /** Search hash table for an item matching keys.
  *
- * @param h Hash table.
- * @param key Array of all keys needed to compute hash index.
+ * @param h		Hash table.
+ * @param key		Array of all keys needed to compute hash index.
  *
- * @return Matching item on success, NULL if there is no such item.
+ * @return		Matching item on success, NULL if there is no such item.
  */
 link_t *hash_table_find(hash_table_t *h, unsigned long key[])
@@ -113,5 +125,6 @@
 	assert(chain < h->entries);
 	
-	for (cur = h->entry[chain].next; cur != &h->entry[chain]; cur = cur->next) {
+	for (cur = h->entry[chain].next; cur != &h->entry[chain];
+	    cur = cur->next) {
 		if (h->op->compare(key, h->max_keys, cur)) {
 			/*
@@ -129,7 +142,8 @@
  * For each removed item, h->remove_callback() is called.
  *
- * @param h Hash table.
- * @param key Array of keys that will be compared against items of the hash table.
- * @param keys Number of keys in the 'key' array.
+ * @param h		Hash table.
+ * @param key		Array of keys that will be compared against items of
+ * 			the hash table.
+ * @param keys		Number of keys in the 'key' array.
  */
 void hash_table_remove(hash_table_t *h, unsigned long key[], hash_count_t keys)
@@ -138,5 +152,6 @@
 	link_t *cur;
 
-	assert(h && h->op && h->op->hash && h->op->compare && h->op->remove_callback);
+	assert(h && h->op && h->op->hash && h->op->compare &&
+	    h->op->remove_callback);
 	assert(keys <= h->max_keys);
 	
@@ -144,5 +159,6 @@
 
 		/*
-		 * All keys are known, hash_table_find() can be used to find the entry.
+		 * All keys are known, hash_table_find() can be used to find the
+		 * entry.
 		 */
 	
@@ -160,5 +176,6 @@
 	 */
 	for (chain = 0; chain < h->entries; chain++) {
-		for (cur = h->entry[chain].next; cur != &h->entry[chain]; cur = cur->next) {
+		for (cur = h->entry[chain].next; cur != &h->entry[chain];
+		    cur = cur->next) {
 			if (h->op->compare(key, keys, cur)) {
 				link_t *hlp;
