您的位置:首页 > 其它

3.2.6 htable.c:哈希表双向链表

2016-04-07 09:36 183 查看
HTABLE结构体实现了哈希表双向链表,节点为HTABLE_INFO,qmgr模块所使用的一系列主要结构体都用HTABLE来存放。

/* Structure of one hash table entry. */

typedef struct HTABLE_INFO {
char   *key;			/* lookup key */
void   *value;			/* associated value */
struct HTABLE_INFO *next;		/* colliding entry */
struct HTABLE_INFO *prev;		/* colliding entry */
} HTABLE_INFO;

/* Structure of one hash table. */

typedef struct HTABLE {
ssize_t size;			/* length of entries array */
ssize_t used;			/* number of entries in table */
HTABLE_INFO **data;			/* entries array, auto-resized */
HTABLE_INFO **seq_bucket;		/* current sequence hash bucket */
HTABLE_INFO **seq_element;		/* current sequence element */
} HTABLE;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: