|
TuyaOS
|
tuya bidirection list module 更多...
#include "tuya_cloud_types.h"

结构体 | |
| struct | tuya_list_head |
| bidirection list head 更多... | |
宏定义 | |
| #define | DeleteNode(pDelNode, list_name) |
| remove the object from the bidirection list 更多... | |
| #define | DeleteNodeAndFree(pDelNode, list_name) |
| remove the object from bidirection list and free the memory 更多... | |
| #define | FREE_LIST(type, p, list_name) |
| free all objects in the bidirection list 更多... | |
| #define | FreeNode(pDelNode) |
| free the object in bidirection list 更多... | |
| #define | GetFirstNode(type, p, list_name, pGetNode) |
| get the first object of the bidirection list 更多... | |
| #define | INIT_LIST_HEAD(ptr) |
| bidirection list initialization 更多... | |
| #define | LIST_HEAD(name) LIST_HEAD name = LIST_HEAD_INIT(name) |
| #define | LIST_HEAD_INIT(name) { &(name), &(name) } |
| define and initialize bidirection list head | |
| #define | NEW_LIST_NODE(type, node) |
| create a new bidirection list, will call malloc 更多... | |
| #define | tuya_list_entry(ptr, type, member) ((type *)((char *)(ptr)-(size_t)(&((type *)0)->member))) |
| cast the bidirection list node to object | |
| #define | tuya_list_for_each(pos, head) for (pos = (head)->next; (pos != NULL) && (pos != (head)); pos = pos->next) |
| traverse the bidirection list, cannot change the bidiretion list during traverse | |
| #define | tuya_list_for_each_safe(p, n, head) for (p = (head)->next; n = p->next, p != (head); p = n) |
| traverse the bidirection list, can change the bidiretion list during traverse | |
类型定义 | |
| typedef struct tuya_list_head | LIST_HEAD |
| bidirection list head | |
| typedef struct tuya_list_head * | P_LIST_HEAD |
函数 | |
| void | tuya_list_add (const P_LIST_HEAD pNew, const P_LIST_HEAD pHead) |
| add new list node into bidirection list 更多... | |
| void | tuya_list_add_tail (const P_LIST_HEAD pNew, const P_LIST_HEAD pHead) |
| add new list node to the tail of the bidirection list 更多... | |
| void | tuya_list_del (const P_LIST_HEAD pEntry) |
| remove a list node from bidirection list 更多... | |
| void | tuya_list_del_init (const P_LIST_HEAD pEntry) |
| remove a list node from bidirection list and initialize it 更多... | |
| INT_T | tuya_list_empty (const P_LIST_HEAD pHead) |
| check if the bidirection list is empty 更多... | |
| void | tuya_list_splice (const P_LIST_HEAD pList, const P_LIST_HEAD pHead) |
| splice two dibrection list 更多... | |
tuya bidirection list module
| #define DeleteNode | ( | pDelNode, | |
| list_name | |||
| ) |
remove the object from the bidirection list
| #define DeleteNodeAndFree | ( | pDelNode, | |
| list_name | |||
| ) |
remove the object from bidirection list and free the memory
| #define FREE_LIST | ( | type, | |
| p, | |||
| list_name | |||
| ) |
free all objects in the bidirection list
| #define FreeNode | ( | pDelNode | ) |
free the object in bidirection list
| #define GetFirstNode | ( | type, | |
| p, | |||
| list_name, | |||
| pGetNode | |||
| ) |
get the first object of the bidirection list
| #define INIT_LIST_HEAD | ( | ptr | ) |
bidirection list initialization
| #define NEW_LIST_NODE | ( | type, | |
| node | |||
| ) |
create a new bidirection list, will call malloc
| void tuya_list_add | ( | const P_LIST_HEAD | pNew, |
| const P_LIST_HEAD | pHead | ||
| ) |
add new list node into bidirection list
| [in] | pNew | the new list node |
| [in] | pHead | the bidirection list |
| void tuya_list_add_tail | ( | const P_LIST_HEAD | pNew, |
| const P_LIST_HEAD | pHead | ||
| ) |
add new list node to the tail of the bidirection list
| [in] | pNew | the new list node |
| [in] | pHead | the bidirection list |
| void tuya_list_del | ( | const P_LIST_HEAD | pEntry | ) |
remove a list node from bidirection list
| [in] | pEntry | the list node need to remove |
| void tuya_list_del_init | ( | const P_LIST_HEAD | pEntry | ) |
remove a list node from bidirection list and initialize it
| [in] | pEntry | the list node need to remove and initialize |
| INT_T tuya_list_empty | ( | const P_LIST_HEAD | pHead | ) |
check if the bidirection list is empty
| [in] | pHead | the bidirection list |
| void tuya_list_splice | ( | const P_LIST_HEAD | pList, |
| const P_LIST_HEAD | pHead | ||
| ) |
splice two dibrection list
| [in] | pList | the bidirection list need to splice |
| [in] | pHead | the bidirection list |