aboutsummaryrefslogtreecommitdiff
path: root/src/fifo_buffer.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-11-27 21:11:47 +0100
committerMax Kellermann <max@duempel.org>2011-11-27 21:11:47 +0100
commita85af593f170f4081b44157d82e746ddc12cdc91 (patch)
tree1c5319c02c1345c8e730f2f9151ee3a2d593e30c /src/fifo_buffer.h
parent07067f8b958d52699526f4f757bca2714da183f4 (diff)
fifo_buffer: add functions _capacity() and _available()
Diffstat (limited to 'src/fifo_buffer.h')
-rw-r--r--src/fifo_buffer.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/fifo_buffer.h b/src/fifo_buffer.h
index 661dfd57..114feec4 100644
--- a/src/fifo_buffer.h
+++ b/src/fifo_buffer.h
@@ -63,6 +63,19 @@ 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
* pointers.