A simple linked list implementation inspired from the Linux kernel.
More...
|
#define | ll_get_container(ptr, type, member) ((type*)((void*)ptr - ((size_t) & ((type*)0)->member))) |
|
#define | ll_get_first_container(head, type, member) ll_get_container(head.next, type, member) |
|
#define | ll_get_last_container(head, type, member) ll_get_container(head.prev, type, member) |
|
#define | ll_get_next_container(container_ptr, type, member) ll_get_container(container_ptr->member.next, type, member) |
|
#define | ll_get_prev_container(container_ptr, type, member) ll_get_container(container_ptr->member.prev, type, member) |
|
#define | ll_del_free(ptr, type, member) ll_del(ptr); free(ll_get_container(ptr, type, member)); |
|
A simple linked list implementation inspired from the Linux kernel.
◆ ll_del_free
#define ll_del_free |
( |
|
ptr, |
|
|
|
type, |
|
|
|
member |
|
) |
| ll_del(ptr); free(ll_get_container(ptr, type, member)); |
◆ ll_get_container
#define ll_get_container |
( |
|
ptr, |
|
|
|
type, |
|
|
|
member |
|
) |
| ((type*)((void*)ptr - ((size_t) & ((type*)0)->member))) |
◆ ll_get_first_container
◆ ll_get_last_container
◆ ll_get_next_container
#define ll_get_next_container |
( |
|
container_ptr, |
|
|
|
type, |
|
|
|
member |
|
) |
| ll_get_container(container_ptr->member.next, type, member) |
◆ ll_get_prev_container
#define ll_get_prev_container |
( |
|
container_ptr, |
|
|
|
type, |
|
|
|
member |
|
) |
| ll_get_container(container_ptr->member.prev, type, member) |