![]() |
This is Unofficial EPICS BASE Doxygen Site
|
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "epicsSpin.h"
#include "dbDefs.h"
#include "epicsRingBytes.h"
Go to the source code of this file.
Classes | |
struct | ringPvt |
Macros | |
#define | SLOP 16 |
Typedefs | |
typedef struct ringPvt | ringPvt |
Functions | |
LIBCOM_API epicsRingBytesId epicsStdCall | epicsRingBytesCreate (int size) |
Create a new ring buffer. More... | |
LIBCOM_API epicsRingBytesId epicsStdCall | epicsRingBytesLockedCreate (int size) |
Create a new ring buffer, secured by a spinlock. More... | |
LIBCOM_API void epicsStdCall | epicsRingBytesDelete (epicsRingBytesId id) |
Delete the ring buffer and free any associated memory. More... | |
LIBCOM_API int epicsStdCall | epicsRingBytesGet (epicsRingBytesId id, char *value, int nbytes) |
Read data out of the ring buffer. More... | |
LIBCOM_API int epicsStdCall | epicsRingBytesPut (epicsRingBytesId id, char *value, int nbytes) |
Write data into the ring buffer. More... | |
LIBCOM_API void epicsStdCall | epicsRingBytesFlush (epicsRingBytesId id) |
Make the ring buffer empty. More... | |
LIBCOM_API int epicsStdCall | epicsRingBytesFreeBytes (epicsRingBytesId id) |
Return the number of free bytes in the ring buffer. More... | |
LIBCOM_API int epicsStdCall | epicsRingBytesUsedBytes (epicsRingBytesId id) |
Return the number of bytes currently stored in the ring buffer. More... | |
LIBCOM_API int epicsStdCall | epicsRingBytesSize (epicsRingBytesId id) |
Return the size of the ring buffer. More... | |
LIBCOM_API int epicsStdCall | epicsRingBytesIsEmpty (epicsRingBytesId id) |
Test if the ring buffer is currently empty. More... | |
LIBCOM_API int epicsStdCall | epicsRingBytesIsFull (epicsRingBytesId id) |
Test if the ring buffer is currently full. More... | |
LIBCOM_API int epicsStdCall | epicsRingBytesHighWaterMark (epicsRingBytesIdConst id) |
See how full a ring buffer has been since it was last checked. More... | |
LIBCOM_API void epicsStdCall | epicsRingBytesResetHighWaterMark (epicsRingBytesId id) |
Reset the Highwater mark of the ring buffer. More... | |
#define SLOP 16 |
Definition at line 33 of file epicsRingBytes.c.
LIBCOM_API epicsRingBytesId epicsStdCall epicsRingBytesCreate | ( | int | nbytes | ) |
Create a new ring buffer.
nbytes | Size of ring buffer to create |
Definition at line 44 of file epicsRingBytes.c.
LIBCOM_API void epicsStdCall epicsRingBytesDelete | ( | epicsRingBytesId | id | ) |
Delete the ring buffer and free any associated memory.
id | RingbufferID returned by epicsRingBytesCreate() |
Definition at line 66 of file epicsRingBytes.c.
LIBCOM_API void epicsStdCall epicsRingBytesFlush | ( | epicsRingBytesId | id | ) |
Make the ring buffer empty.
id | RingbufferID returned by epicsRingBytesCreate() |
Definition at line 169 of file epicsRingBytes.c.
LIBCOM_API int epicsStdCall epicsRingBytesFreeBytes | ( | epicsRingBytesId | id | ) |
Return the number of free bytes in the ring buffer.
id | RingbufferID returned by epicsRingBytesCreate() |
Definition at line 178 of file epicsRingBytes.c.
LIBCOM_API int epicsStdCall epicsRingBytesGet | ( | epicsRingBytesId | id, |
char * | value, | ||
int | nbytes | ||
) |
Read data out of the ring buffer.
id | RingbufferID returned by epicsRingBytesCreate() |
value | Where to put the data fetched from the buffer |
nbytes | Maximum number of bytes to get |
Definition at line 73 of file epicsRingBytes.c.
LIBCOM_API int epicsStdCall epicsRingBytesHighWaterMark | ( | epicsRingBytesIdConst | id | ) |
See how full a ring buffer has been since it was last checked.
Returns the maximum amount of data the ring buffer has held in bytes since the water mark was last reset. A new ring buffer starts with a water mark of 0.
id | RingbufferID returned by epicsRingBytesCreate() |
Definition at line 235 of file epicsRingBytes.c.
LIBCOM_API int epicsStdCall epicsRingBytesIsEmpty | ( | epicsRingBytesId | id | ) |
Test if the ring buffer is currently empty.
id | RingbufferID returned by epicsRingBytesCreate() |
Definition at line 218 of file epicsRingBytes.c.
LIBCOM_API int epicsStdCall epicsRingBytesIsFull | ( | epicsRingBytesId | id | ) |
Test if the ring buffer is currently full.
id | RingbufferID returned by epicsRingBytesCreate() |
Definition at line 230 of file epicsRingBytes.c.
LIBCOM_API epicsRingBytesId epicsStdCall epicsRingBytesLockedCreate | ( | int | nbytes | ) |
Create a new ring buffer, secured by a spinlock.
nbytes | Size of ring buffer to create |
Definition at line 57 of file epicsRingBytes.c.
LIBCOM_API int epicsStdCall epicsRingBytesPut | ( | epicsRingBytesId | id, |
char * | value, | ||
int | nbytes | ||
) |
Write data into the ring buffer.
id | RingbufferID returned by epicsRingBytesCreate() |
value | Source of the data to be put into the buffer |
nbytes | How many bytes to put |
Definition at line 117 of file epicsRingBytes.c.
LIBCOM_API void epicsStdCall epicsRingBytesResetHighWaterMark | ( | epicsRingBytesId | id | ) |
Reset the Highwater mark of the ring buffer.
The Highwater mark will be set to the current usage
id | RingbufferID returned by epicsRingBytesCreate() |
Definition at line 241 of file epicsRingBytes.c.
LIBCOM_API int epicsStdCall epicsRingBytesSize | ( | epicsRingBytesId | id | ) |
Return the size of the ring buffer.
id | RingbufferID returned by epicsRingBytesCreate() |
Definition at line 211 of file epicsRingBytes.c.
LIBCOM_API int epicsStdCall epicsRingBytesUsedBytes | ( | epicsRingBytesId | id | ) |
Return the number of bytes currently stored in the ring buffer.
id | RingbufferID returned by epicsRingBytesCreate() |
Definition at line 194 of file epicsRingBytes.c.