aboutsummaryrefslogtreecommitdiff
path: root/htable.h
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-09-20 04:04:22 +0000
committersotech117 <michael_foiani@brown.edu>2023-09-20 04:04:22 +0000
commit1263cbdbb6cf3ebbb157286b2bb2e488e4b931c8 (patch)
tree0538cd930e5afd840f0edef42f448d1933b03b59 /htable.h
parent5eb24f6063515e86e3e87e6fb91e6672dc14de34 (diff)
fix handshake protocol
Diffstat (limited to 'htable.h')
-rw-r--r--htable.h45
1 files changed, 0 insertions, 45 deletions
diff --git a/htable.h b/htable.h
deleted file mode 100644
index 65eac58..0000000
--- a/htable.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef __HASHTABLE_H__
-#define __HASHTABLE_H__
-
-#include <pthread.h>
-
-#include "list.h"
-
-/* FIXME make this a doubly-hashed, dynamically groweable hashtable */
-
-typedef struct htable {
- list_t *ht_hash; /* table entries */
- unsigned int ht_size; /* table size */
- unsigned int ht_cap; /* table capacity */
-} htable_t;
-
-typedef struct htable_node {
- list_t hn_link; /* link */
- unsigned int hn_id; /* hash id */
- void *hn_data; /* data */
-} htable_node_t;
-
-void htable_init( htable_t *ht, unsigned int cap );
-void htable_destroy( htable_t *ht );
-void *htable_get( htable_t *ht, unsigned int id );
-void *htable_put( htable_t *ht, unsigned int id, void *data );
-void *htable_remove( htable_t *ht, unsigned int id );
-
-#define htable_iterate_begin( ht, key, var, type ) \
-do { \
- unsigned int ___i; \
- htable_t *__ht = (ht); \
- htable_node_t *__hnode; \
- for(___i = 0;___i < __ht->ht_cap;___i++ ) { \
- list_iterate_begin( &__ht->ht_hash[___i ], __hnode, htable_node_t, hn_link ) { \
- (var) = (type*) __hnode->hn_data; \
- (key) = __hnode->hn_id; \
- do
-
-#define htable_iterate_end() \
- while( 0 ); \
- } list_iterate_end(); \
- } \
-} while( 0 )
-
-#endif /* __HASHTABLE_H__ */ \ No newline at end of file