fifo_buffer: add functions _capacity() and _available()

This commit is contained in:
Max Kellermann
2011-11-27 21:11:47 +01:00
parent 07067f8b95
commit a85af593f1
2 changed files with 29 additions and 0 deletions

View File

@@ -62,6 +62,19 @@ fifo_buffer_new(size_t size);
void
fifo_buffer_free(struct fifo_buffer *buffer);
/**
* Return the capacity of the buffer, i.e. the size that was passed to
* fifo_buffer_new().
*/
size_t
fifo_buffer_capacity(const struct fifo_buffer *buffer);
/**
* Return the number of bytes currently stored in the buffer.
*/
size_t
fifo_buffer_available(const struct fifo_buffer *buffer);
/**
* Clears all data currently in this #fifo_buffer object. This does
* not overwrite the actuall buffer; it just resets the internal