Documentation

Documentation

Includes

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

Macros

Marco _UNI_HLIST_H

#define _UNI_HLIST_H


      

Marco HLIST_HEAD_INIT

#define HLIST_HEAD_INIT { .first = NULL}
/**
 * @brief hash list head initialization
 * 
 */

Marco HLIST_HEAD(name)

#define HLIST_HEAD(name) HLIST_HEAD name = {.first = NULL}
/**
 * @brief hash list head define and initialization
 * 
 */

Marco INIT_HLIST_HEAD(ptr)

#define INIT_HLIST_HEAD(ptr) ((ptr->first)=NULL)
/**
 * @brief hash list head pointer initialization
 * 
 */

Marco HLIST_ENTRY(ptr, type, member)

#define HLIST_ENTRY(ptr, type, member) CNTR_OF(ptr,type,member)
/**
 * @brief convert hash list node to object
 * 
 */

Marco HLIST_FOR_EACH_ENTRY(tpos, type, pos, head, member)

#define HLIST_FOR_EACH_ENTRY(tpos, type, pos, head, member) \
   for (pos = (head)->first;                    \
        pos && (tpos = HLIST_ENTRY(pos, type, member), 1); \
        pos = pos->next)
/**
 * @brief traverse the member of the hash list
 * 
 */

Marco HLIST_FOR_EACH_ENTRY_CURR(tpos, type, pos, curr, member)

#define HLIST_FOR_EACH_ENTRY_CURR(tpos, type, pos, curr, member) \
   for (pos = (curr)->next;                    \
        pos && (tpos = HLIST_ENTRY(pos, type, member), 1); \
        pos = pos->next)
/**
 * @brief traverse the member of the hash list from a special member
 * 
 */

Marco HLIST_FOR_EACH_ENTRY_SAFE(tpos, type, pos, n, head, member)

#define HLIST_FOR_EACH_ENTRY_SAFE(tpos, type, pos, n, head, member) \
   for (pos = (head)->first; \
        pos && (n = pos->next, 1) && \
       (tpos = HLIST_ENTRY(pos, type, member), 1); \
        pos = n)
/**
 * @brief traverse the member of the hash list in safe mode, can change the hash list when traverse
 * 
 */

Marco HLIST_FOR_EACH(pos, head)

#define HLIST_FOR_EACH(pos, head) \
   for (pos = (head)->first; pos ; \
        pos = pos->next)
/**
 * @brief traverse the hash list node
 * 
 */

Marco HLIST_FOR_EACH_SAFE(pos, n, head)

#define HLIST_FOR_EACH_SAFE(pos, n, head) \
   for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
        pos = n)
/**
 * @brief traverse the hash list node in safe mode, can change the hash list when traverse
 * 
 */

Functions

Vars

Consts

Types

Typedefs

Typedef HLIST_NODE;

typedef struct hlist_node {
   struct hlist_node *next,**pprev;
}HLIST_NODE;
/**
 * @brief hash list node
 * 
 */

Typedef HLIST_HEAD;

typedef struct hlist_head{
   struct hlist_node *first;
}HLIST_HEAD;
/**
 * @brief hash list head
 * 
 */