Ion C
C library for Ion
ion_collection.h File Reference
#include "ion_types.h"

Go to the source code of this file.

Data Structures

struct  _ion_collection_node
 
struct  _ion_collection
 

Macros

#define IPCN_DATA_SIZE   sizeof(void *)
 
#define IPCN_OVERHEAD_SIZE   (sizeof(ION_COLLECTION_NODE) - IPCN_DATA_SIZE)
 
#define IPCN_pNODE_TO_pDATA(x)   (&((x)->_data[0]))
 
#define IPCN_pDATA_TO_pNODE(x)   ((ION_COLLECTION_NODE *) (((uint8_t *)(x)) - IPCN_OVERHEAD_SIZE))
 
#define ION_COLLECTION_IS_EMPTY(collection)    ((collection)->_head == NULL)
 
#define ION_COLLECTION_SIZE(pcol)    ((pcol)->_count)
 
#define ION_COLLECTION_OPEN(collection, pcursor)    (pcursor) = (collection)->_head
 
#define ION_COLLECTION_NEXT(pcursor, pbuf)
 
#define ION_COLLECTION_CLOSE(pcursor)    (pcursor) = NULL
 

Typedefs

typedef struct _ion_collection_node ION_COLLECTION_NODE
 
typedef struct _ion_collection_nodeION_COLLECTION_CURSOR
 

Macro Definition Documentation

◆ ION_COLLECTION_NEXT

#define ION_COLLECTION_NEXT (   pcursor,
  pbuf 
)
Value:
if ((pcursor) != NULL) { \
*((void **)&(pbuf)) = IPCN_pNODE_TO_pDATA(pcursor); \
(pcursor) = (pcursor)->_next; \
} else { \
*((void **)&(pbuf)) = NULL; \
}