mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-22 19:58:09 +00:00
[common] ringbuffer: add getLength method
This commit is contained in:
parent
c3bc5fb0ff
commit
41403286d1
2 changed files with 6 additions and 0 deletions
|
@ -27,6 +27,7 @@ void ringbuffer_free(RingBuffer * rb);
|
||||||
void ringbuffer_push(RingBuffer rb, const void * value);
|
void ringbuffer_push(RingBuffer rb, const void * value);
|
||||||
void ringbuffer_reset(RingBuffer rb);
|
void ringbuffer_reset(RingBuffer rb);
|
||||||
|
|
||||||
|
int ringbuffer_getLength(const RingBuffer rb);
|
||||||
int ringbuffer_getStart (const RingBuffer rb);
|
int ringbuffer_getStart (const RingBuffer rb);
|
||||||
int ringbuffer_getCount (const RingBuffer rb);
|
int ringbuffer_getCount (const RingBuffer rb);
|
||||||
void * ringbuffer_getValues(const RingBuffer rb);
|
void * ringbuffer_getValues(const RingBuffer rb);
|
||||||
|
|
|
@ -69,6 +69,11 @@ void ringbuffer_reset(RingBuffer rb)
|
||||||
rb->count = 0;
|
rb->count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ringbuffer_getLength(const RingBuffer rb)
|
||||||
|
{
|
||||||
|
return rb->length;
|
||||||
|
}
|
||||||
|
|
||||||
int ringbuffer_getStart(const RingBuffer rb)
|
int ringbuffer_getStart(const RingBuffer rb)
|
||||||
{
|
{
|
||||||
return rb->start;
|
return rb->start;
|
||||||
|
|
Loading…
Reference in a new issue