Hash list
include/structures/hlist.h View source View on GitHubStructs
Section titled “Structs”hlist_head
Section titled “hlist_head” struct hlist_head (1 field) source
§
struct hlist_node *first hlist_node
Section titled “hlist_node” struct hlist_node (2 fields) source
§
struct hlist_node *next §
struct hlist_node **pprev Functions
Section titled “Functions”INIT_HLIST_NODE
Section titled “INIT_HLIST_NODE”void INIT_HLIST_NODE(struct hlist_node *h) source hlist_unhashed
Section titled “hlist_unhashed”bool hlist_unhashed(const struct hlist_node *h) source hlist_empty
Section titled “hlist_empty”bool hlist_empty(const struct hlist_head *h) source hlist_add_before
Section titled “hlist_add_before”void hlist_add_before(struct hlist_node *n, struct hlist_node *next) source hlist_add_head
Section titled “hlist_add_head”void hlist_add_head(struct hlist_node *n, struct hlist_head *h) source hlist_del
Section titled “hlist_del”void hlist_del(struct hlist_node *n) source hlist_move_list
Section titled “hlist_move_list”void hlist_move_list(struct hlist_head *old, struct hlist_head *new) source hlist_pop_head
Section titled “hlist_pop_head”struct hlist_node * hlist_pop_head(struct hlist_head *h) source Macros
Section titled “Macros”HLIST_HEAD_INIT
Section titled “HLIST_HEAD_INIT”#define HLIST_HEAD_INIT {.first = NULL} source INIT_HLIST_HEAD
Section titled “INIT_HLIST_HEAD”#define INIT_HLIST_HEAD(ptr) source Expansion
#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) hlist_entry
Section titled “hlist_entry”#define hlist_entry(ptr, type, member) source Expansion
#define hlist_entry(ptr, type, member) container_of(ptr, type, member) hlist_entry_safe
Section titled “hlist_entry_safe”#define hlist_entry_safe(ptr, type, member) source Expansion
#define hlist_entry_safe(ptr, type, member) \
({ \
__auto_type __hlist_ptr = (ptr); \
__hlist_ptr ? hlist_entry(__hlist_ptr, type, member) : NULL; \
}) hlist_for_each_entry
Section titled “hlist_for_each_entry”#define hlist_for_each_entry(pos, head, member) source Expansion
#define hlist_for_each_entry(pos, head, member) \
for (pos = hlist_entry_safe((head)->first, typeof(*pos), member); pos; \
pos = hlist_entry_safe(pos->member.next, typeof(*pos), member)) hlist_for_each_entry_safe
Section titled “hlist_for_each_entry_safe”#define hlist_for_each_entry_safe(pos, n, head, member) source Expansion
#define hlist_for_each_entry_safe(pos, n, head, member) \
for (pos = hlist_entry_safe((head)->first, typeof(*pos), member); \
pos && ({ \
n = pos->member.next; \
1; \
}); \
pos = hlist_entry_safe(n, typeof(*pos), member))