[common] ringbuffer: add getLength method

This commit is contained in:
Geoffrey McRae 2021-07-09 02:22:51 +10:00
parent c3bc5fb0ff
commit 41403286d1
2 changed files with 6 additions and 0 deletions

View File

@ -27,6 +27,7 @@ void ringbuffer_free(RingBuffer * rb);
void ringbuffer_push(RingBuffer rb, const void * value);
void ringbuffer_reset(RingBuffer rb);
int ringbuffer_getLength(const RingBuffer rb);
int ringbuffer_getStart (const RingBuffer rb);
int ringbuffer_getCount (const RingBuffer rb);
void * ringbuffer_getValues(const RingBuffer rb);

View File

@ -69,6 +69,11 @@ void ringbuffer_reset(RingBuffer rb)
rb->count = 0;
}
int ringbuffer_getLength(const RingBuffer rb)
{
return rb->length;
}
int ringbuffer_getStart(const RingBuffer rb)
{
return rb->start;