# hdf\_dlist.h ## **Overview** **Related Modules:** [DriverUtils](DriverUtils.md) **Description:** Declares doubly linked list structures and interfaces. This file provides interfaces such as inserting a node from the head or tail of a doubly linked list, checking whether a doubly linked list is empty, traversing a doubly linked list, and merging doubly linked lists. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Data Structures
CONTAINER_OF(ptr, type, member) (type *)((char *)(ptr) - (char *)&((type *)0)->member) |
Obtains the address of a structure variable from its member address. |
DLIST_FIRST_ENTRY(ptr, type, member) CONTAINER_OF((ptr)->next, type, member) |
|
DLIST_LAST_ENTRY(ptr, type, member) CONTAINER_OF((ptr)->prev, type, member) |
|
DLIST_FOR_EACH_ENTRY(pos, head, type, member) |
|
DLIST_FOR_EACH_ENTRY_SAFE(pos, tmp, head, type, member) |
Traverses all nodes in a doubly linked list. This function is used to delete the nodes pointed to by pos during traversal. |
DListHeadInit (struct DListHead *head) |
|
DListIsEmpty (const struct DListHead *head) |
|
DListRemove (struct DListHead *entry) |
|
DListInsertHead (struct DListHead *entry, struct DListHead *head) |
|
DListInsertTail (struct DListHead *entry, struct DListHead *head) |
|
DListMerge (struct DListHead *list, struct DListHead *head) |
Merges two linked lists by adding the list specified by list to the head of the list specified by head and initializes the merged list. |