aboutsummaryrefslogtreecommitdiff
path: root/src/fifo_buffer.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-11-27 20:58:57 +0100
committerMax Kellermann <max@duempel.org>2011-11-28 07:45:15 +0100
commitf5468493521c0fd081dc63f920eaf613f746358c (patch)
tree0abe89cf0286e4f5c72dc54f6531aa9f23abb363 /src/fifo_buffer.h
parenta85af593f170f4081b44157d82e746ddc12cdc91 (diff)
fifo_buffer: add function fifo_buffer_realloc()
For growing FIFO buffers.
Diffstat (limited to 'src/fifo_buffer.h')
-rw-r--r--src/fifo_buffer.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/fifo_buffer.h b/src/fifo_buffer.h
index 114feec4..3bdb2393 100644
--- a/src/fifo_buffer.h
+++ b/src/fifo_buffer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2010 The Music Player Daemon Project
+ * Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* Redistribution and use in source and binary forms, with or without
@@ -57,6 +57,18 @@ 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