wzq
2020-08-22 cc6bec3330c29cc29f54d3e3d919d510f0197641
src/queue/include/hashtable.h
@@ -2,6 +2,7 @@
#define __HASHTABLE_H__
#include <sys/queue.h>
#include <functional>
#include <set>
#define MAPSIZE 100
@@ -23,10 +24,17 @@
void *hashtable_remove(hashtable_t *hashtable, int key);
void hashtable_removeall(hashtable_t *hashtable);
/**
 * 遍历hash_table
 * @demo
 * hashtable_foreach(&hashtable, [&](int key, void * value){
 *   printf("%d, %p\n", key, value);
 * });
 *
*/
void hashtable_foreach(hashtable_t *hashtable, std::function<void(int, void *)>  cb);
void hashtable_foreach(hashtable_t *hashtable, hashtable_foreach_cb cb);
void hashtable_printall(hashtable_t *hashtable);
// void hashtable_printall(hashtable_t *hashtable);
int hashtable_alloc_key(hashtable_t *hashtable);