加入收藏
举报
当前仅显示指定条件回帖 [ 展开查看全部 ]
02-14 20:02
#
文件名称:
hdf_dlist-h.md
所在目录:
Openharmony v1.0 / docs / api / api-SmartVision-Devices
文件大小:
10.14 KB
下载地址:
fenwii/OpenHarmony
   
免责声明:本网站仅提供指向 GitHub 上的文件的链接,所有文件的版权归原作者所有,本网站不对文件内容的合法性、准确性或安全性承担任何责任。
文本预览:
# 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









Data Structure Name


Description


DListHead


Describes a doubly linked list.



## Macros





















Macro Name and Value


Description


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)


Obtains the first node of a doubly linked list.


DLIST_LAST_ENTRY(ptr, type, member)   CONTAINER_OF((ptr)->prev, type, member)


Obtains the last node of a doubly linked list.


DLIST_FOR_EACH_ENTRY(pos, head, type, member)


Traverses all nodes in a doubly linked list.


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.



## Functions
























Function Name


Description


DListHeadInit (struct DListHead *head)


static void 


Initializes a doubly linked list.


DListIsEmpty (const struct DListHead *head)


static bool 


Checks whether a doubly linked list is empty.


DListRemove (struct DListHead *entry)


static void 


Removes a node from a doubly linked list.


DListInsertHead (struct DListHead *entry, struct DListHead *head)


static void 


Inserts a node from the head of a doubly linked list.


DListInsertTail (struct DListHead *entry, struct DListHead *head)


static void 


Inserts a node from the tail of a doubly linked list.


DListMerge (struct DListHead *list, struct DListHead *head)


static void 


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.


点赞 回复
回帖
支持markdown部分语法 ?