5 #define HASH_WALK_REMOVE 1
8 typedef struct hash_table hash_table
;
10 #define TABLE hash_table *table
11 extern unsigned int hash_entries_max(TABLE
);
12 extern unsigned int hash_entries(TABLE
);
13 extern unsigned int hash_entries_added(TABLE
);
14 extern unsigned int hash_entries_removed(TABLE
);
15 extern unsigned int hash_table_size(TABLE
);
16 extern hash_table
*hash_init(unsigned int buckets
);
17 extern void *hash_find(TABLE
, const char *key
);
18 extern void *hash_find2(TABLE
, const char *k1
, const char *k2
);
19 extern int hash_add(TABLE
, const char *key
, void *data
);
20 extern int hash_add2(TABLE
, const char *k1
, const char *k2
, void *data
);
21 extern int hash_add_unique(TABLE
, const char *key
, void *data
);
22 extern int hash_add_unique2(TABLE
, const char *k1
, const char *k2
, void *data
);
23 extern void *hash_update(TABLE
, const char *key
, void *data
);
24 extern void *hash_update2(TABLE
, const char *k1
, const char *k2
, void *data
);
25 extern void *hash_remove(TABLE
, const char *key
);
26 extern void *hash_remove2(TABLE
, const char *k1
, const char *k2
);
27 extern void hash_remove_data(TABLE
, const char *k1
, const void *data
);
28 extern void hash_remove_data2(TABLE
, const char *k1
, const char *k2
, const void *data
);
29 extern void hash_walk_data(TABLE
, int (*walker
)(void *data
));
30 extern int hash_check_table(TABLE
);
31 extern unsigned int hash_count_entries(TABLE
);
32 extern void hash_debug_print_table_data(TABLE
, const char *name
, int force
);
33 #define hash_debug_table(x, force) hash_debug_print_table_data((x), #x, force)