RngLib
From ProjectWiki
What is this?
rngBuf.h - an implementation of vxWorks style ring bufs
stubby article
Functions
int rngNBytes(RING_ID ringId); //rngNBytes( ) - determine the number of bytes in a ring buffer RING_ID rngCreate(int nbytes); // void rngDelete(RING_ID ringId); void rngFlush(RING_ID ringId); int rngBufGet(RING_ID rngId, char *buffer, int maxbytes); int rngBufPut(RING_ID rngId, char *buffer, int nbytes); bool rngIsEmpty(RING_ID ringId); bool rngIsFull(RING_ID ringId); int rngFreeBytes(RING_ID ringId); int rngNBytes(RING_ID ringId); void rngPutAhead(RING_ID ringId, char byte, int offset); void rngMoveAhead(RING_ID ringId, int n);
Macros
// RNG_ELEM_PUT - put one character into a ring buffer //(register int) 't'. // c is a char // returns 1 if success 0 if not #define RNG_ELEM_PUT(r, c, t)
// RNG_ELEM_GET - get one character from a ring buffer // p should be a char * // (register int) 'f'. // returns 1 if success 0 if not #define RNG_ELEM_GET(r,p,f)