acl
3.5.3.0
|
类 | |
struct | ACL_BINHASH |
struct | ACL_BINHASH_INFO |
struct | ACL_BINHASH_ITER |
宏定义 | |
#define | ACL_BINHASH_FLAG_KEY_REUSE (1 << 0) |
#define | ACL_BINHASH_FLAG_SLICE_RTGC_OFF (1 << 1) |
#define | ACL_BINHASH_FLAG_SLICE1 (1 << 2) |
#define | ACL_BINHASH_FLAG_SLICE2 (1 << 3) |
#define | ACL_BINHASH_FLAG_SLICE3 (1 << 4) |
#define | ACL_BINHASH_STAT_OK 0 |
#define | ACL_BINHASH_STAT_INVAL 1 |
#define | ACL_BINHASH_STAT_DUPLEX_KEY 2 |
#define | ACL_BINHASH_STAT_NO_KEY 3 |
#define | ACL_BINHASH_ITER_KEY(iter) ((iter).ptr->key.c_key) |
#define | acl_binhash_iter_key ACL_BINHASH_ITER_KEY |
#define | ACL_BINHASH_ITER_VALUE(iter) ((iter).ptr->value) |
#define | acl_binhash_iter_value ACL_BINHASH_ITER_VALUE |
#define | ACL_BINHASH_FOREACH(iter, table_ptr) |
#define | ACL_BINHASH_FOREACH_REVERSE(iter, table_ptr) |
#define | acl_binhash_foreach ACL_BINHASH_FOREACH |
#define | acl_binhash_foreach_reverse ACL_BINHASH_FOREACH_REVERSE |
类型定义 | |
typedef struct ACL_BINHASH | ACL_BINHASH |
typedef struct ACL_BINHASH_INFO | ACL_BINHASH_INFO |
typedef struct ACL_BINHASH_ITER | ACL_BINHASH_ITER |
函数 | |
ACL_API ACL_BINHASH * | acl_binhash_create (int size, unsigned int flag) |
ACL_API ACL_BINHASH_INFO * | acl_binhash_enter (ACL_BINHASH *table, const void *key, int key_len, void *value) |
ACL_API ACL_BINHASH_INFO * | acl_binhash_locate (ACL_BINHASH *table, const void *key, int key_len) |
ACL_API void * | acl_binhash_find (ACL_BINHASH *table, const void *key, int key_len) |
ACL_API int | acl_binhash_delete (ACL_BINHASH *table, const void *key, int key_len, void(*free_fn)(void *)) |
ACL_API void | acl_binhash_free (ACL_BINHASH *table, void(*free_fn)(void *)) |
ACL_API void | acl_binhash_walk (ACL_BINHASH *table, void(*walk_fn)(ACL_BINHASH_INFO *, void *), void *arg) |
ACL_API ACL_BINHASH_INFO ** | acl_binhash_list (ACL_BINHASH *table) |
ACL_API int | acl_binhash_errno (ACL_BINHASH *table) |
ACL_API int | acl_binhash_size (const ACL_BINHASH *table) |
ACL_API int | acl_binhash_used (ACL_BINHASH *table) |
ACL_API ACL_BINHASH_INFO ** | acl_binhash_data (ACL_BINHASH *table) |
ACL_API const ACL_BINHASH_INFO * | acl_binhash_iter_head (ACL_BINHASH *table, ACL_BINHASH_ITER *iter) |
ACL_API const ACL_BINHASH_INFO * | acl_binhash_iter_next (ACL_BINHASH_ITER *iter) |
ACL_API const ACL_BINHASH_INFO * | acl_binhash_iter_tail (ACL_BINHASH *table, ACL_BINHASH_ITER *iter) |
ACL_API const ACL_BINHASH_INFO * | acl_binhash_iter_prev (ACL_BINHASH_ITER *iter) |
#define ACL_BINHASH_FLAG_KEY_REUSE (1 << 0) |
在文件 acl_binhash.h 第 79 行定义.
#define ACL_BINHASH_FLAG_SLICE1 (1 << 2) |
在文件 acl_binhash.h 第 81 行定义.
#define ACL_BINHASH_FLAG_SLICE2 (1 << 3) |
在文件 acl_binhash.h 第 82 行定义.
#define ACL_BINHASH_FLAG_SLICE3 (1 << 4) |
在文件 acl_binhash.h 第 83 行定义.
#define ACL_BINHASH_FLAG_SLICE_RTGC_OFF (1 << 1) |
在文件 acl_binhash.h 第 80 行定义.
#define ACL_BINHASH_FOREACH | ( | iter, | |
table_ptr | |||
) |
在文件 acl_binhash.h 第 224 行定义.
#define acl_binhash_foreach ACL_BINHASH_FOREACH |
在文件 acl_binhash.h 第 236 行定义.
#define ACL_BINHASH_FOREACH_REVERSE | ( | iter, | |
table_ptr | |||
) |
在文件 acl_binhash.h 第 229 行定义.
#define acl_binhash_foreach_reverse ACL_BINHASH_FOREACH_REVERSE |
在文件 acl_binhash.h 第 237 行定义.
#define ACL_BINHASH_ITER_KEY | ( | iter | ) | ((iter).ptr->key.c_key) |
在文件 acl_binhash.h 第 179 行定义.
#define acl_binhash_iter_key ACL_BINHASH_ITER_KEY |
在文件 acl_binhash.h 第 180 行定义.
#define ACL_BINHASH_ITER_VALUE | ( | iter | ) | ((iter).ptr->value) |
在文件 acl_binhash.h 第 182 行定义.
#define acl_binhash_iter_value ACL_BINHASH_ITER_VALUE |
在文件 acl_binhash.h 第 183 行定义.
#define ACL_BINHASH_STAT_DUPLEX_KEY 2 |
在文件 acl_binhash.h 第 154 行定义.
#define ACL_BINHASH_STAT_INVAL 1 |
在文件 acl_binhash.h 第 153 行定义.
#define ACL_BINHASH_STAT_NO_KEY 3 |
在文件 acl_binhash.h 第 155 行定义.
#define ACL_BINHASH_STAT_OK 0 |
在文件 acl_binhash.h 第 152 行定义.
typedef struct ACL_BINHASH ACL_BINHASH |
在文件 acl_binhash.h 第 13 行定义.
typedef struct ACL_BINHASH_INFO ACL_BINHASH_INFO |
在文件 acl_binhash.h 第 14 行定义.
typedef struct ACL_BINHASH_ITER ACL_BINHASH_ITER |
ACL_API ACL_BINHASH* acl_binhash_create | ( | int | size, |
unsigned int | flag | ||
) |
创建一个哈希表
size | {int} 哈希表的初始化大小 |
flag | {unsigned int} 哈希表属性标志位, ACL_BINHASH_FLAG_xxx |
ACL_API ACL_BINHASH_INFO** acl_binhash_data | ( | ACL_BINHASH * | table | ) |
ACL_API int acl_binhash_delete | ( | ACL_BINHASH * | table, |
const void * | key, | ||
int | key_len, | ||
void(*)(void *) | free_fn | ||
) |
删除某个哈希项
table | {ACL_BINHASH*} 哈希表指针 |
key | {const void*} 哈希键 |
key_len | {int} key 的长度 |
free_fn | {void (*)(void*)} 用来释放哈希键值的函数指针,如果为空则不在内部释放键值 |
ACL_API ACL_BINHASH_INFO* acl_binhash_enter | ( | ACL_BINHASH * | table, |
const void * | key, | ||
int | key_len, | ||
void * | value | ||
) |
向哈希表中添加对象
table | {ACL_BINHASH*} 哈希表指针 |
key | {const void*} 哈希键 |
key_len | {int} key 的长度 |
value | {void*} 键值 |
ACL_API int acl_binhash_errno | ( | ACL_BINHASH * | table | ) |
获得哈希表操作时的出错号
table | {ACL_BINHASH*} 哈希表指针 |
ACL_API void* acl_binhash_find | ( | ACL_BINHASH * | table, |
const void * | key, | ||
int | key_len | ||
) |
查询某个哈希键的键值
table | {ACL_BINHASH*} 哈希表指针 |
key | {const void*} 哈希键 |
key_len | {int} key 的长度 |
ACL_API void acl_binhash_free | ( | ACL_BINHASH * | table, |
void(*)(void *) | free_fn | ||
) |
释放哈希表
table | {ACL_BINHASH*} 哈希表指针 |
free_fn | {void (*)(void*)} 如果不为空,则用此函数来释放哈希表内的所有键值 |
ACL_API const ACL_BINHASH_INFO* acl_binhash_iter_head | ( | ACL_BINHASH * | table, |
ACL_BINHASH_ITER * | iter | ||
) |
ACL_API const ACL_BINHASH_INFO* acl_binhash_iter_next | ( | ACL_BINHASH_ITER * | iter | ) |
ACL_API const ACL_BINHASH_INFO* acl_binhash_iter_prev | ( | ACL_BINHASH_ITER * | iter | ) |
ACL_API const ACL_BINHASH_INFO* acl_binhash_iter_tail | ( | ACL_BINHASH * | table, |
ACL_BINHASH_ITER * | iter | ||
) |
ACL_API ACL_BINHASH_INFO** acl_binhash_list | ( | ACL_BINHASH * | table | ) |
列出当前哈希表中的所有元素数组列表
table | {ACL_BINHASH*} 哈希表指针 |
ACL_API ACL_BINHASH_INFO* acl_binhash_locate | ( | ACL_BINHASH * | table, |
const void * | key, | ||
int | key_len | ||
) |
从哈希表中根据键名取得对应的哈希条目
table | {ACL_BINHASH*} 哈希表指针 |
key | {const void*} 哈希键 |
key_len | {int} key 的长度 |
ACL_API int acl_binhash_size | ( | const ACL_BINHASH * | table | ) |
ACL_API int acl_binhash_used | ( | ACL_BINHASH * | table | ) |
当前哈希表中对象的个数
table | {ACL_BINHASH*} 哈希表指针 |
ACL_API void acl_binhash_walk | ( | ACL_BINHASH * | table, |
void(*)(ACL_BINHASH_INFO *, void *) | walk_fn, | ||
void * | arg | ||
) |
遍历整个哈希表,并用用户给出的回调函数操作哈希表中的键值
table | {ACL_BINHASH*} 哈希表指针 |
walk_fn | {void (*)(ACL_BINHASH_INFO*, void*)} 在遍历哈希表中的每个元素时的回调函数 |
arg | {void*} 用户传递的参数,作为参数在 walk_fn 中传递 |