Documentation
Includes
tuya_cloud_types.h
#include "tuya_cloud_types.h"
Macros
Marco _UNI_POINTER_H
#define _UNI_POINTER_H
Marco LIST_HEAD_INIT(name)
#define LIST_HEAD_INIT(name) { &(name), &(name) }
Marco LIST_HEAD(name)
#define LIST_HEAD(name) \
LIST_HEAD name = LIST_HEAD_INIT(name)
Marco INIT_LIST_HEAD(ptr)
#define INIT_LIST_HEAD(ptr) do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)
Marco NEW_LIST_NODE(type, node)
#define NEW_LIST_NODE(type, node) \
{\
node = (type *)Malloc(sizeof(type));\
}
Marco FREE_LIST(type, p, list_name)\
{\
#define FREE_LIST(type, p, list_name)\
{\
type *posnode;\
while(!tuya_list_empty(&(p)->list_name)) {\
posnode = tuya_list_entry((&(p)->list_name)->next, type, list_name);\
tuya_list_del((&(p)->list_name)->next);\
Free(posnode);\
}\
}
Marco GetFirstNode(type,p,list_name,pGetNode)\
{\
#define GetFirstNode(type,p,list_name,pGetNode)\
{\
pGetNode = NULL;\
while(!tuya_list_empty(&(p)->list_name)){\
pGetNode = tuya_list_entry((&(p)->list_name)->next, type, list_name);\
break;\
}\
}
Marco DeleteNodeAndFree(pDelNode,list_name)\
{\
#define DeleteNodeAndFree(pDelNode,list_name)\
{\
tuya_list_del(&(pDelNode->list_name));\
Free(pDelNode);\
}
Marco DeleteNode(pDelNode,list_name)\
{\
#define DeleteNode(pDelNode,list_name)\
{\
tuya_list_del(&(pDelNode->list_name));\
}
Marco FreeNode(pDelNode)\
{\
#define FreeNode(pDelNode)\
{\
Free(pDelNode);\
}
Marco tuya_list_entry(ptr, type, member)
#define tuya_list_entry(ptr, type, member) \
((type *)((char *)(ptr)-(size_t)(&((type *)0)->member)))
Marco tuya_list_for_each(pos, head)
#define tuya_list_for_each(pos, head) \
for (pos = (head)->next; (pos != NULL) && (pos != (head)); pos = pos->next)
Marco tuya_list_for_each_safe(p, n, head)
#define tuya_list_for_each_safe(p, n, head) \
for (p = (head)->next; n = p->next, p != (head); p = n)
Functions
Func tuya_list_empty
INT_T tuya_list_empty(IN CONST P_LIST_HEAD pHead);
Func tuya_list_add
VOID tuya_list_add(IN CONST P_LIST_HEAD pNew, IN CONST P_LIST_HEAD pHead);
Func tuya_list_add_tail
VOID tuya_list_add_tail(IN CONST P_LIST_HEAD pNew, IN CONST P_LIST_HEAD pHead);
Func tuya_list_splice
VOID tuya_list_splice(IN CONST P_LIST_HEAD pList, IN CONST P_LIST_HEAD pHead);
Func tuya_list_del
VOID tuya_list_del(IN CONST P_LIST_HEAD pEntry);
Func tuya_list_del_init
VOID tuya_list_del_init(IN CONST P_LIST_HEAD pEntry);
Vars
Consts
Types
Typedefs
Typedef LIST_HEAD,*P_LIST_HEAD;
typedef struct tuya_list_head
{
struct tuya_list_head *next, *prev;
}LIST_HEAD,*P_LIST_HEAD;