68 #define DLIST_PNODE_INIT_DATA(pnode) (pnode)->next = (pnode)->prev = pnode 74 #define DLIST_NODE_INIT(node) DLIST_PNODE_INIT_DATA(&(node)) 80 #define DLIST_PNODE_INIT(pnode) DLIST_PNODE_INIT_DATA(pnode) 165 return head->
next == head;
202 #define dlist_entry(ptr, type, member) \ 203 ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) 211 #define dlist_for_each(pos, head) \ 212 for(pos = (head)->next; pos != (head); pos = pos->next) 225 #define dlist_for_each_safe(pos, npos, head) \ 226 for(pos = (head)->next, npos = pos->next; pos != (head); \ 227 pos = npos, npos = pos->next) 232 #endif // _RNR_DLIST_H static void dlist_prepend(dnode_t *node, dnode_t *head)
prepend new node to head of list
The doubly linked node structure.
static void dlist_delete(dnode_t *node)
deletes node from list
#define DLIST_PNODE_INIT(pnode)
Initialize node links (pointer version).
#define C_DECLS_BEGIN
C declaration block begin in C.
static void dlist_append(dnode_t *node, dnode_t *head)
append a new node to the in of the list
struct dlist_node * next
next node in dlist
static void dlist_splice(dnode_t *list, dnode_t *head)
prepend new list at head of given list
struct dlist_node * prev
previous node in dlist
#define C_DECLS_END
C declaration block end in C.
static void _dlist_add(dnode_t *node, dnode_t *prev, dnode_t *next)
insert a new entry between two known consecutive entries
static int dlist_is_empty(dnode_t *head)
tests whether a list is empty
static void _dlist_del(dnode_t *prev, dnode_t *next)
delete the node(s) between the prev/next nodes.
struct dlist_node dnode_t
The doubly linked node structure.