forked from bestjie/bwlimitplugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhash.h
29 lines (21 loc) · 774 Bytes
/
hash.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef _LINUX_GHASH_H_
#define _LINUX_GHASH_H_
#include <string.h>
#ifndef __USE_ISOC99
#define inline
#endif
//Tomoka Asagi ÂéľÃ÷Ïã
#define create_hashtable(hsize) hash_create(lh_strhash, equal_str, hsize)
unsigned int lh_strhash(void *src);
int equal_str(void *k1, void *k2);
struct hashentry;
struct _hashtable;
typedef struct _hashtable hashtable;
hashtable *hash_create(unsigned int (*keyfunc)(void *),int (*comparefunc)(void *,void *),int size);
void hash_free(hashtable *tab);
void hash_insert(void *key, void *data, hashtable *tab);
void hash_remove(void *key, hashtable *tab);
void *hash_value(void *key, hashtable *tab);
void hash_for_each_do(hashtable *tab, int (cb)(void *, void *));
int hash_count(hashtable *tab);
#endif