aboutsummaryrefslogtreecommitdiffstats
path: root/src/fifo_buffer.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-11-28 11:56:01 +0100
committerMax Kellermann <max@duempel.org>2011-11-28 11:56:01 +0100
commit4f093d5b979c3547c8dd8045dde5d91e8cc93461 (patch)
tree94b1c12cfce14c90f26852e948ba419a8a7ba7eb /src/fifo_buffer.h
parent37420c342bf9582a0de32d46f78716e913119400 (diff)
parente1b032cbad5db7698104a93c2235fb7da1f8b580 (diff)
downloadmpd-4f093d5b979c3547c8dd8045dde5d91e8cc93461.tar.gz
mpd-4f093d5b979c3547c8dd8045dde5d91e8cc93461.tar.xz
mpd-4f093d5b979c3547c8dd8045dde5d91e8cc93461.zip
Merge branch 'v0.16.x'
Conflicts: Makefile.am NEWS configure.ac src/encoder/flac_encoder.c src/log.c src/pcm_buffer.c
Diffstat (limited to 'src/fifo_buffer.h')
-rw-r--r--src/fifo_buffer.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/fifo_buffer.h b/src/fifo_buffer.h
index 2730207b5..3bdb23938 100644
--- a/src/fifo_buffer.h
+++ b/src/fifo_buffer.h
@@ -57,12 +57,37 @@ struct fifo_buffer *
fifo_buffer_new(size_t size);
/**
+ * Change the capacity of the #fifo_buffer, while preserving existing
+ * data.
+ *
+ * @param buffer the old buffer, may be NULL
+ * @param new_size the requested new size of the #fifo_buffer; must
+ * not be smaller than the data which is stored in the old buffer
+ * @return the new buffer, may be NULL if the requested new size is 0
+ */
+struct fifo_buffer *
+fifo_buffer_realloc(struct fifo_buffer *buffer, size_t new_size);
+
+/**
* Frees the resources consumed by this #fifo_buffer object.
*/
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.