WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
Doubly linked list
Doubly linked list 的协作图:

结构体

struct  LOS_DL_LIST
 

宏定义

#define LOS_DL_LIST_FIRST(object)   ((object)->pstNext)
 Point to the next node of the current node.
 
#define LOS_DL_LIST_LAST(object)   ((object)->pstPrev)
 Point to the previous node of the current node.
 
#define LOS_OFF_SET_OF(type, member)   ((UINTPTR)&((type *)0)->member)
 Obtain the offset of a structure member relative to the structure start address.
 
#define LOS_DL_LIST_ENTRY(item, type, member)    ((type *)(VOID *)((CHAR *)(item) - LOS_OFF_SET_OF(type, member)))
 Obtain the pointer to a structure that contains a doubly linked list.
 
#define LOS_DL_LIST_FOR_EACH_ENTRY(item, list, type, member)
 Traverse a doubly linked list which is included in a given type structure.
 
#define LOS_DL_LIST_FOR_EACH_ENTRY_SAFE(item, next, list, type, member)
 Traverse a doubly linked list which is included in a given type structure. And it is safe against removal of list entry.
 
#define LOS_DL_LIST_FOR_EACH_ENTRY_HOOK(item, list, type, member, hook)
 Iterate over a doubly linked list of given type, and call hook for any extra procedures every time.
 
#define LOS_DL_LIST_FOR_EACH(item, list)
 Traverse a doubly linked list.
 
#define LOS_DL_LIST_FOR_EACH_SAFE(item, next, list)
 Traverse a doubly linked list safe against removal of list entry.
 
#define LOS_DL_LIST_HEAD(list)   LOS_DL_LIST list = { &(list), &(list) }
 Initialize a double linked list.
 

类型定义

typedef struct LOS_DL_LIST LOS_DL_LIST
 

详细描述

宏定义说明

◆ LOS_DL_LIST_ENTRY

#define LOS_DL_LIST_ENTRY (   item,
  type,
  member 
)     ((type *)(VOID *)((CHAR *)(item) - LOS_OFF_SET_OF(type, member)))

Obtain the pointer to a structure that contains a doubly linked list.

Description:
This API is used to obtain the pointer to a structure that contains the doubly linked list which the first parameter item specified.
注意
None.
参数
item[IN] Type LOS_DL_LIST * The node of the doubly linked list.
type[IN] Structure name.
member[IN] The doubly linked list name in the structure.
返回值
Thepointer to the structure that contains the doubly linked list. And the doubly linked list has the node of the first parameter item.
Dependency:
  • los_list.h: the header file that contains the API declaration.
参见
LOS_DL_LIST_FOR_EACH_ENTRY | LOS_DL_LIST_FOR_EACH_ENTRY_SAFE
自从
Huawei LiteOS V100R001C00

◆ LOS_DL_LIST_FIRST

#define LOS_DL_LIST_FIRST (   object)    ((object)->pstNext)

Point to the next node of the current node.

Description:
This API is used to point to the next node of the current node.
注意
None.
参数
object[IN] Type LOS_DL_LIST * The node in the doubly linked list.
返回值
None.
Dependency:
  • los_list.h: the header file that contains the API declaration.
参见
LOS_DL_LIST_LAST
自从
Huawei LiteOS V100R001C00

◆ LOS_DL_LIST_FOR_EACH

#define LOS_DL_LIST_FOR_EACH (   item,
  list 
)
值:
for ((item) = (list)->pstNext; \
(item) != (list); \
(item) = (item)->pstNext)

Traverse a doubly linked list.

Description:
This API is used to traverse a doubly linked list. The API is a loop. The start node of the doubly linked list is the second parameter list. And in each loop, the obtained pointer to the next node of the doubly linked list is outputted in the first parameter item.
注意
None.
参数
item[IN/OUT] Type LOS_DL_LIST * The pointer to the next node in the doubly linked list.
list[IN] Type LOS_DL_LIST * The pointer to the node of the doubly linked list to be traversed.
返回值
None.
Dependency:
  • los_list.h: the header file that contains the API declaration.
参见
LOS_DL_LIST_FOR_EACH_SAFE | LOS_DL_LIST_FOR_EACH_ENTRY
自从
Huawei LiteOS V100R001C00

◆ LOS_DL_LIST_FOR_EACH_ENTRY

#define LOS_DL_LIST_FOR_EACH_ENTRY (   item,
  list,
  type,
  member 
)
值:
for ((item) = LOS_DL_LIST_ENTRY((list)->pstNext, type, member); \
&(item)->member != (list); \
(item) = LOS_DL_LIST_ENTRY((item)->member.pstNext, type, member))
#define LOS_DL_LIST_ENTRY(item, type, member)
Obtain the pointer to a structure that contains a doubly linked list.
Definition los_list.h:279
osal_u8 type
Definition oal_net.h:0

Traverse a doubly linked list which is included in a given type structure.

Description:
This API is used to traverse a doubly linked list which is included in a given type structure. The API is a loop. The start node of the doubly linked list is the second parameter list. And in each loop, the obtained pointer to a structure that contains the list is outputted in the first parameter item.
注意
None.
参数
item[IN/OUT] The pointer to the structure that contains the doubly linked list.
list[IN] Type LOS_DL_LIST * The start node of the doubly linked list to be traversed.
type[IN] Structure name.
member[IN] The doubly linked list name in the structure.
返回值
None.
Dependency:
  • los_list.h: the header file that contains the API declaration.
参见
LOS_DL_LIST_ENTRY | LOS_DL_LIST_FOR_EACH_ENTRY_SAFE | LOS_DL_LIST_FOR_EACH
自从
Huawei LiteOS V100R001C00

◆ LOS_DL_LIST_FOR_EACH_ENTRY_HOOK

#define LOS_DL_LIST_FOR_EACH_ENTRY_HOOK (   item,
  list,
  type,
  member,
  hook 
)
值:
for ((item) = LOS_DL_LIST_ENTRY((list)->pstNext, type, member), hook; \
&(item)->member != (list); \
(item) = LOS_DL_LIST_ENTRY((item)->member.pstNext, type, member), hook)

Iterate over a doubly linked list of given type, and call hook for any extra procedures every time.

Description:
This API is used to iterate over a doubly linked list of given type, and call hook for any extra procedures every time.
注意
None.
参数
item[IN/OUT] Pointer to the structure that contains the doubly linked list that is to be traversed.
list[IN] Pointer to the doubly linked list to be traversed.
type[IN] Structure name.
member[IN] Member name of the doubly linked list in the structure.
hook[IN] Hook for extra procedures which will be called every time when dev is fetched.
返回值
None.
Dependency:
  • los_list.h: the header file that contains the API declaration.
参见
LOS_DL_LIST_ENTRY | LOS_DL_LIST_FOR_EACH_ENTRY
自从
Huawei LiteOS V200R005C10

◆ LOS_DL_LIST_FOR_EACH_ENTRY_SAFE

#define LOS_DL_LIST_FOR_EACH_ENTRY_SAFE (   item,
  next,
  list,
  type,
  member 
)
值:
for ((item) = LOS_DL_LIST_ENTRY((list)->pstNext, type, member), \
(next) = LOS_DL_LIST_ENTRY((item)->member.pstNext, type, member); \
&(item)->member != (list); \
(item) = (next), (next) = LOS_DL_LIST_ENTRY((item)->member.pstNext, type, member))

Traverse a doubly linked list which is included in a given type structure. And it is safe against removal of list entry.

Description:
This API is used to traverse a doubly linked list which is included in a given type structure. The API is a loop. The start node of the doubly linked list is the third parameter list. And in each loop, the obtained pointer to a structure that contains the list is outputted in the first parameter item. And the next node is outputted in the second parameter next.
注意
None.
参数
item[IN/OUT] The pointer to the structure that contains the doubly linked list.
next[IN/OUT] The pointer to the structure that contains the next node of the doubly linked list.
list[IN] Type LOS_DL_LIST * The start node of the doubly linked list to be traversed.
type[IN] Structure name.
member[IN] The doubly linked list name in the structure.
返回值
None.
Dependency:
  • los_list.h: the header file that contains the API declaration.
参见
LOS_DL_LIST_ENTRY | LOS_DL_LIST_FOR_EACH_ENTRY | LOS_DL_LIST_FOR_EACH_SAFE
自从
Huawei LiteOS V100R001C00

◆ LOS_DL_LIST_FOR_EACH_SAFE

#define LOS_DL_LIST_FOR_EACH_SAFE (   item,
  next,
  list 
)
值:
for ((item) = (list)->pstNext, (next) = (item)->pstNext; \
(item) != (list); \
(item) = (next), (next) = (item)->pstNext)

Traverse a doubly linked list safe against removal of list entry.

Description:
This API is used to traverse a doubly linked list safe against removal of list entry. The API is a loop. The start node of the doubly linked list is the third parameter list. And in each loop, the obtained pointer to the next node of the doubly linked list is outputted in the first parameter item. And the next node of the the node specified by first parameter item is outputted in the second parameter next.
注意
None.
参数
item[IN/OUT] Type LOS_DL_LIST * The pointer to the next node in the doubly linked list.
next[IN/OUT] Type LOS_DL_LIST * The pointer to the next node of the the node specified by first parameter item.
list[IN] Type LOS_DL_LIST * The pointer to the node of the doubly linked list to be traversed.
返回值
None.
Dependency:
  • los_list.h: the header file that contains the API declaration.
参见
LOS_DL_LIST_FOR_EACH | LOS_DL_LIST_FOR_EACH_ENTRY_SAFE
自从
Huawei LiteOS V100R001C00

◆ LOS_DL_LIST_HEAD

#define LOS_DL_LIST_HEAD (   list)    LOS_DL_LIST list = { &(list), &(list) }

Initialize a double linked list.

Description:
This API is used to initialize the input node (the parameter list) to a double linked list. The difference with LOS_ListInit is that the parameter list is not a pointer while in LOS_ListInit it is a pointer.
注意
None.
参数
list[IN] Type LOS_DL_LIST A node to be initialized to a doubly linked list.
返回值
None.
Dependency:
  • los_list.h: the header file that contains the API declaration.
参见
LOS_ListInit
自从
Huawei LiteOS V100R001C00

◆ LOS_DL_LIST_LAST

#define LOS_DL_LIST_LAST (   object)    ((object)->pstPrev)

Point to the previous node of the current node.

Description:
This API is used to point to the previous node of the current node.
注意
None.
参数
object[IN] Type LOS_DL_LIST * The node in the doubly linked list.
返回值
None.
Dependency:
  • los_list.h: the header file that contains the API declaration.
参见
LOS_DL_LIST_FIRST
自从
Huawei LiteOS V100R001C00

◆ LOS_OFF_SET_OF

#define LOS_OFF_SET_OF (   type,
  member 
)    ((UINTPTR)&((type *)0)->member)

Obtain the offset of a structure member relative to the structure start address.

Description:
This API is used to obtain the offset of the structure member (member) relative to the start address of the structure (type). And return the offset of UINTPTR type.
注意
None.
参数
type[IN] Structure name.
member[IN] The structure member name which needs to measure the offset.
返回值
UINTPTROffset of the member relative to the structure start address.
Dependency:
  • los_list.h: the header file that contains the API declaration.
自从
Huawei LiteOS V100R001C00

类型定义说明

◆ LOS_DL_LIST

typedef struct LOS_DL_LIST LOS_DL_LIST

Structure of a node in a doubly linked list.