diff options
Diffstat (limited to 'src/DecoderBuffer.hxx')
-rw-r--r-- | src/DecoderBuffer.hxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/DecoderBuffer.hxx b/src/DecoderBuffer.hxx index 92cc31aa4..4cadd7740 100644 --- a/src/DecoderBuffer.hxx +++ b/src/DecoderBuffer.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2013 The Music Player Daemon Project + * Copyright (C) 2003-2014 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -20,6 +20,8 @@ #ifndef MPD_DECODER_BUFFER_HXX #define MPD_DECODER_BUFFER_HXX +#include "Compiler.h" + #include <stddef.h> /** @@ -32,6 +34,8 @@ struct DecoderBuffer; struct Decoder; struct InputStream; +template<typename T> struct ConstBuffer; + /** * Creates a new buffer. * @@ -50,12 +54,17 @@ decoder_buffer_new(Decoder *decoder, InputStream &is, void decoder_buffer_free(DecoderBuffer *buffer); +gcc_pure bool decoder_buffer_is_empty(const DecoderBuffer *buffer); +gcc_pure bool decoder_buffer_is_full(const DecoderBuffer *buffer); +void +decoder_buffer_clear(DecoderBuffer *buffer); + /** * Read data from the input_stream and append it to the buffer. * @@ -73,13 +82,10 @@ decoder_buffer_fill(DecoderBuffer *buffer); * decoder_buffer_consume() call. * * @param buffer the decoder_buffer object - * @param length_r pointer to a size_t where you will receive the - * number of bytes available - * @return a pointer to the read buffer, or nullptr if there is no data - * available */ -const void * -decoder_buffer_read(const DecoderBuffer *buffer, size_t *length_r); +gcc_pure +ConstBuffer<void> +decoder_buffer_read(const DecoderBuffer *buffer); /** * Consume (delete, invalidate) a part of the buffer. The "nbytes" |