ZEDA  1.6.18
Macros
zeda_ring.h File Reference

ring buffer. More...

#include <zeda/zeda_misc.h>
Include dependency graph for zeda_ring.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define zRingClass(ring_t, cell_t)
 generate ring buffer class. More...
 
#define zRingSize(y)   (y)->size
 
#define zRingBuf(y)   ( (y)->buf )
 
#define zRingElemSize(y)   sizeof(*zRingBuf(y))
 
#define zRingHead(y)   ( &zRingBuf(y)[(y)->head] )
 
#define zRingElem(y, i)   ( &zRingBuf(y)[((y)->head+(i)) % (y)->size] )
 
#define zRingSetElem(a, i, d)   memcpy( zRingElem(a,i), (d), zRingElemSize(a) )
 
#define zRingReset(y)   ( (y)->head = 0 );
 
#define zRingInit(y)
 
#define zRingAlloc(y, type, size)
 allocate an array. More...
 
#define zRingFree(y)
 
#define zRingIncHead(y)
 
#define zRingDecHead(y)
 

Detailed Description

ring buffer.

Author
Zhidao