TuyaOS
结构体 | 宏定义 | 类型定义
tuya_slist.h 文件参考

tuya sigle direciton list module 更多...

#include "tuya_cloud_types.h"
tuya_slist.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

结构体

struct  slist_head
 sigle list head 更多...
 

宏定义

#define FREE_SLIST_SAFE(tpos, type, pos, n, list, member)
 traverse and free each object of the sigle list 更多...
 
#define INIT_SLIST_HEAD(ptr)
 sigle list head initialization 更多...
 
#define NEW_SLIST_NODE(type, node)
 new a sigle list head, will call Malloc 更多...
 
#define SLIST_ENTRY(ptr, type, member)   CNTR_OF(ptr,type,member)
 cast the slist entry to special type
 
#define SLIST_FOR_EACH(pos, list)
 traverse each node of the sigle list, cannot change the sigle list 更多...
 
#define SLIST_FOR_EACH_ENTRY(tpos, type, pos, list, member)
 traverse each object of the sigle list, cannot change the sigle list 更多...
 
#define SLIST_FOR_EACH_ENTRY_SAFE(tpos, type, pos, n, list, member)
 traverse each object of the sigle list, you can add or del the object during traverse 更多...
 
#define SLIST_FOR_EACH_SAFE(pos, n, list)
 traverse each node of the sigle list, you can add or del the object during traverse 更多...
 
#define SLIST_HEAD(name)   SLIST_HEAD name = {NULL}
 define a sigle list head and initialize to empty
 

类型定义

typedef struct slist_head SLIST_HEAD
 sigle list head
 

详细描述

tuya sigle direciton list module

版本
1.0
日期
2019-10-30

宏定义说明

◆ FREE_SLIST_SAFE

#define FREE_SLIST_SAFE (   tpos,
  type,
  pos,
  n,
  list,
  member 
)
值:
{\
type *posnode; \
SLIST_FOR_EACH_ENTRY_SAFE(tpos, type, pos, n, list, member) { \
(list)->next = n; \
posnode = tpos; \
Free(posnode); \
} \
}

traverse and free each object of the sigle list

◆ INIT_SLIST_HEAD

#define INIT_SLIST_HEAD (   ptr)
值:
do { \
(ptr)->next = NULL; \
} while (0)

sigle list head initialization

◆ NEW_SLIST_NODE

#define NEW_SLIST_NODE (   type,
  node 
)
值:
{\
node = (type *)Malloc(sizeof(type));\
}
#define Malloc(req_size)
malloc memory
Definition: tal_memory.h:25

new a sigle list head, will call Malloc

◆ SLIST_FOR_EACH

#define SLIST_FOR_EACH (   pos,
  list 
)
值:
for (pos = (list)->next; pos ; \
pos = pos->next)

traverse each node of the sigle list, cannot change the sigle list

◆ SLIST_FOR_EACH_ENTRY

#define SLIST_FOR_EACH_ENTRY (   tpos,
  type,
  pos,
  list,
  member 
)
值:
for (pos = (list)->next; \
pos && (tpos = SLIST_ENTRY(pos, type, member), 1); \
pos = pos->next)
#define SLIST_ENTRY(ptr, type, member)
cast the slist entry to special type
Definition: tuya_slist.h:56

traverse each object of the sigle list, cannot change the sigle list

◆ SLIST_FOR_EACH_ENTRY_SAFE

#define SLIST_FOR_EACH_ENTRY_SAFE (   tpos,
  type,
  pos,
  n,
  list,
  member 
)
值:
for (pos = (list)->next; \
pos && (n = pos->next, 1) && \
(tpos = SLIST_ENTRY(pos, type, member), 1); \
pos = n)

traverse each object of the sigle list, you can add or del the object during traverse

◆ SLIST_FOR_EACH_SAFE

#define SLIST_FOR_EACH_SAFE (   pos,
  n,
  list 
)
值:
for (pos = (list)->next; pos && ({ n = pos->next; 1; }); \
pos = n)

traverse each node of the sigle list, you can add or del the object during traverse