Skip to content

Commit

Permalink
add CircularBufferGetCapacity
Browse files Browse the repository at this point in the history
  • Loading branch information
Roen-Ro committed Feb 21, 2019
1 parent fcd1f0b commit 07788c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CircularBuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ void CircularBufferReset(CircularBuffer cBuf)
cBuf->dataSize = 0;
}

size_t CircularBufferGetCapacity(CircularBuffer cBuf) {

return cBuf->size;
}

size_t CircularBufferGetSize(CircularBuffer cBuf)
{
return cBuf->size;
Expand Down
5 changes: 4 additions & 1 deletion CircularBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ extern void CircularBufferFree(CircularBuffer cBuf);
// Reset the CircularBuffer
extern void CircularBufferReset(CircularBuffer cBuf);

//get the capacity of CircularBuffer
//get the capacity of CircularBuffer
extern size_t CircularBufferGetCapacity(CircularBuffer cBuf);

//same as CircularBufferGetCapacity, Just for compatibility with older versions
extern size_t CircularBufferGetSize(CircularBuffer cBuf);

//get occupied data size of CircularBuffer
Expand Down

0 comments on commit 07788c8

Please sign in to comment.