]> rtime.felk.cvut.cz Git - frescor/frsh-forb.git/blobdiff - src/fwp/fwp/tests/hashtest/hashtable.h
fwp: Remove unused crap from tests
[frescor/frsh-forb.git] / src / fwp / fwp / tests / hashtest / hashtable.h
diff --git a/src/fwp/fwp/tests/hashtest/hashtable.h b/src/fwp/fwp/tests/hashtest/hashtable.h
deleted file mode 100644 (file)
index 2ff971f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _HASHTABLE_H
-#define _HASHTABLE_H
-
-/* Zbyva nadefinovat iteraci pres zretazeny seznam 
- *
- *mozno vyheldavat zaznamu dle label
- *
- */
-
-#include "list.h"
-//#include "ul_list.h"
-#include <stdlib.h>
-
-/* Hash table with linked list per each entry*/
-struct hash_table {
-       struct list_head *entries;
-       unsigned int size;
-};
-
-static inline int htable_init(struct hash_table *htable, int size)
-{
-       int i;
-
-       void *entries = malloc(sizeof(struct list_head) * size);        
-       if (!entries)
-               return -1;
-
-       htable->entries = (struct list_head*) entries;
-       htable->size = size;
-       for ( i = 0; i < size; i++)
-               INIT_LIST_HEAD(&htable->entries[i]);
-
-       return 0;
-}
-
-static inline void htable_free(struct hash_table *htable)
-{      
-       free(htable->entries);
-       htable->entries = NULL;
-       htable->size = 0;
-}
-
-
-static inline void htable_add(struct hash_table *htable, unsigned int hash,
-                             struct list_head *new)
-{
-       __list_add(new, htable->entries[hash].prev, &htable->entries[hash]);
-}
-
-
-static inline void htable_del(struct hash_table *htable, unsigned int hash,
-                             struct list_head *new)
-{
-       __list_add(new, htable->entries[hash].prev, &htable->entries[hash]);
-}
-
-
-#endif /* _HASHTABLE_H */