Index: libadt/Makefile
===================================================================
--- libadt/Makefile	(revision ee7736e64ecd4cd5308f4da73ff749ed08389b37)
+++ libadt/Makefile	(revision 4f34b6ac42375724d853b5027eb939a834cacdba)
@@ -42,5 +42,6 @@
 
 GENERIC_SOURCES = \
-	generic/list.c
+	generic/list.c \
+	generic/hash_table.c
 
 GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
Index: libadt/generic/hash_table.c
===================================================================
--- libadt/generic/hash_table.c	(revision ee7736e64ecd4cd5308f4da73ff749ed08389b37)
+++ libadt/generic/hash_table.c	(revision 4f34b6ac42375724d853b5027eb939a834cacdba)
@@ -36,4 +36,6 @@
 #include <malloc.h>
 #include <assert.h>
+#include <stdio.h>
+#include <string.h>
 
 /** Create chained hash table.
@@ -43,18 +45,20 @@
  * @param max_keys Maximal number of keys needed to identify an item.
  * @param op Hash table operations structure.
+ * @return true on success
  */
-void 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)
 {
-	int i;
+	hash_count_t i;
 
-	ASSERT(h);
-	ASSERT(op && op->hash && op->compare);
-	ASSERT(max_keys > 0);
+	assert(h);
+	assert(op && op->hash && op->compare);
+	assert(max_keys > 0);
 	
-	h->entry = malloc(m * sizeof(link_t *), 0);
+	h->entry = malloc(m * sizeof(link_t *));
 	if (!h->entry) {
-		panic("cannot allocate memory for hash table\n");
+		printf("cannot allocate memory for hash table\n");
+		return false;
 	}
-	memsetb((__address) h->entry, m * sizeof(link_t *), 0);
+	memset((void *) h->entry, 0,  m * sizeof(link_t *));
 	
 	for (i = 0; i < m; i++)
@@ -64,4 +68,5 @@
 	h->max_keys = max_keys;
 	h->op = op;
+	return true;
 }
 
@@ -72,13 +77,13 @@
  * @param item Item to be inserted into the hash table.
  */
-void hash_table_insert(hash_table_t *h, __native key[], link_t *item)
+void hash_table_insert(hash_table_t *h, unsigned long key[], link_t *item)
 {
 	hash_index_t chain;
 
-	ASSERT(item);
-	ASSERT(h && h->op && h->op->hash && h->op->compare);
+	assert(item);
+	assert(h && h->op && h->op->hash && h->op->compare);
 
 	chain = h->op->hash(key);
-	ASSERT(chain < h->entries);
+	assert(chain < h->entries);
 	
 	list_append(item, &h->entry[chain]);
@@ -92,13 +97,13 @@
  * @return Matching item on success, NULL if there is no such item.
  */
-link_t *hash_table_find(hash_table_t *h, __native key[])
+link_t *hash_table_find(hash_table_t *h, unsigned long key[])
 {
 	link_t *cur;
 	hash_index_t chain;
 
-	ASSERT(h && h->op && h->op->hash && h->op->compare);
+	assert(h && h->op && h->op->hash && h->op->compare);
 
 	chain = h->op->hash(key);
-	ASSERT(chain < h->entries);
+	assert(chain < h->entries);
 	
 	/*
@@ -126,11 +131,11 @@
  * @param keys Number of keys in the 'key' array.
  */
-void hash_table_remove(hash_table_t *h, __native key[], hash_count_t keys)
+void hash_table_remove(hash_table_t *h, unsigned long key[], hash_count_t keys)
 {
 	hash_index_t chain;
 	link_t *cur;
 
-	ASSERT(h && h->op && h->op->hash && h->op->compare && h->op->remove_callback);
-	ASSERT(keys <= h->max_keys);
+	assert(h && h->op && h->op->hash && h->op->compare && h->op->remove_callback);
+	assert(keys <= h->max_keys);
 	
 	if (keys == h->max_keys) {
Index: libadt/include/hash_table.h
===================================================================
--- libadt/include/hash_table.h	(revision ee7736e64ecd4cd5308f4da73ff749ed08389b37)
+++ libadt/include/hash_table.h	(revision 4f34b6ac42375724d853b5027eb939a834cacdba)
@@ -54,5 +54,5 @@
 	 * @return Index into hash table.
 	 */
-	hash_index_t (* hash)(int key[]);
+	hash_index_t (* hash)(unsigned long key[]);
 	
 	/** Hash table item comparison function.
@@ -62,5 +62,5 @@
 	 * @return true if the keys match, false otherwise.
 	 */
-	int (*compare)(int key[], hash_count_t keys, link_t *item);
+	int (*compare)(unsigned long key[], hash_count_t keys, link_t *item);
 
 	/** Hash table item removal callback.
@@ -73,8 +73,8 @@
 #define hash_table_get_instance(item, type, member)	list_get_instance((item), type, member)
 
-extern void hash_table_create(hash_table_t *h, hash_count_t m, hash_count_t max_keys, hash_table_operations_t *op);
-extern void hash_table_insert(hash_table_t *h, int key[], link_t *item);
-extern link_t *hash_table_find(hash_table_t *h, int key[]);
-extern void hash_table_remove(hash_table_t *h, int key[], hash_count_t keys);
+extern int hash_table_create(hash_table_t *h, hash_count_t m, hash_count_t max_keys, hash_table_operations_t *op);
+extern void hash_table_insert(hash_table_t *h, unsigned long key[], link_t *item);
+extern link_t *hash_table_find(hash_table_t *h, unsigned long key[]);
+extern void hash_table_remove(hash_table_t *h, unsigned long key[], hash_count_t keys);
 
 #endif
Index: libc/include/assert.h
===================================================================
--- libc/include/assert.h	(revision 4f34b6ac42375724d853b5027eb939a834cacdba)
+++ libc/include/assert.h	(revision 4f34b6ac42375724d853b5027eb939a834cacdba)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2005 Martin Decky
+ * Copyright (C) 2006 Josef Cejka
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __LIBC__ASSERT_H__
+#define __LIBC__ASSERT_H__
+
+/** Debugging assert macro
+ *
+ * If NDEBUG is not set, the assert() macro
+ * evaluates expr and if it is false prints 
+ * error message and terminate program.
+ *
+ * @param expr Expression which is expected to be true.
+ *
+ */
+
+#include <stdlib.h>
+#ifndef NDEBUG
+#	define assert(expr) if (!(expr)) { printf("Assertion failed (%s) at file '%s', line %d.\n", #expr, __FILE__, __LINE__); abort();}
+#else
+#	define assert(expr)
+#endif
+
+#endif
