aboutsummaryrefslogtreecommitdiffstats
path: root/src/fifo_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/fifo_buffer.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/fifo_buffer.c b/src/fifo_buffer.c
index 9ac7270bb..65cb2ffdc 100644
--- a/src/fifo_buffer.c
+++ b/src/fifo_buffer.c
@@ -66,6 +66,22 @@ fifo_buffer_free(struct fifo_buffer *buffer)
g_free(buffer);
}
+size_t
+fifo_buffer_capacity(const struct fifo_buffer *buffer)
+{
+ assert(buffer != NULL);
+
+ return buffer->size;
+}
+
+size_t
+fifo_buffer_available(const struct fifo_buffer *buffer)
+{
+ assert(buffer != NULL);
+
+ return buffer->end - buffer->start;
+}
+
void
fifo_buffer_clear(struct fifo_buffer *buffer)
{