wangzhengquan
2020-07-06 302ae4427b04a25e4f1ee8acadbb05bf902f47f7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef __HASHTABLE_H__
#define __HASHTABLE_H__
 
#include <sys/queue.h>
//#include "queue.h"
 
#define MAPSIZE 100
 
typedef struct hashtable_t
{
 struct tailq_header_t* array[MAPSIZE];
 
} hashtable_t;
 
void hashtable_init(hashtable_t *hashtable);
void *hashtable_get(hashtable_t *hashtable, int key);
void* hashtable_put(hashtable_t *hashtable, int key, void *value);
void *hashtable_remove(hashtable_t *hashtable, int key);
void hashtable_removeall(hashtable_t *hashtable);
 
 
void hashtable_printall(hashtable_t *hashtable);
#endif