aboutsummaryrefslogtreecommitdiffstats
path: root/src/fifo_buffer.c
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.c
parent07067f8b958d52699526f4f757bca2714da183f4 (diff)
downloadmpd-a85af593f170f4081b44157d82e746ddc12cdc91.tar.gz
mpd-a85af593f170f4081b44157d82e746ddc12cdc91.tar.xz
mpd-a85af593f170f4081b44157d82e746ddc12cdc91.zip
fifo_buffer: add functions _capacity() and _available()
Diffstat (limited to 'src/fifo_buffer.c')
-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)
{