stable
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef __SMCC_HASHTABLE_H__
|
||||
#define __SMCC_HASHTABLE_H__
|
||||
|
||||
#include <lib/core.h>
|
||||
#include <lib/rt/rt_alloc.h>
|
||||
#include "vector.h"
|
||||
|
||||
@@ -29,11 +30,14 @@ typedef struct hash_table {
|
||||
} hash_table_t;
|
||||
|
||||
// WARN you need set hash_func and key_cmp before use
|
||||
void hashtable_init(hash_table_t* ht) ;
|
||||
void init_hashtable(hash_table_t* ht) ;
|
||||
|
||||
void* hashtable_set(hash_table_t* ht, const void* key, void* value);
|
||||
void* hashtable_get(hash_table_t* ht, const void* key);
|
||||
void* hashtable_get(hash_table_t* ht, const void* key);
|
||||
void* hashtable_del(hash_table_t* ht, const void* key);
|
||||
void hashtable_destory(hash_table_t* ht);
|
||||
|
||||
typedef int (*hash_table_iter_func)(const void* key, void* value, void* context);
|
||||
void hashtable_foreach(hash_table_t* ht, hash_table_iter_func iter_func, void* context);
|
||||
|
||||
#endif // __SMCC_HASHTABLE_H__
|
||||
|
||||
Reference in New Issue
Block a user