DecoderBuffer: add method _available()
This commit is contained in:
parent
a7d9f248ea
commit
4fe272a7fb
|
@ -130,6 +130,12 @@ decoder_buffer_fill(DecoderBuffer *buffer)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t
|
||||||
|
decoder_buffer_available(const DecoderBuffer *buffer)
|
||||||
|
{
|
||||||
|
return buffer->length - buffer->consumed;;
|
||||||
|
}
|
||||||
|
|
||||||
const void *
|
const void *
|
||||||
decoder_buffer_read(const DecoderBuffer *buffer, size_t *length_r)
|
decoder_buffer_read(const DecoderBuffer *buffer, size_t *length_r)
|
||||||
{
|
{
|
||||||
|
|
|
@ -77,6 +77,13 @@ decoder_buffer_clear(DecoderBuffer *buffer);
|
||||||
bool
|
bool
|
||||||
decoder_buffer_fill(DecoderBuffer *buffer);
|
decoder_buffer_fill(DecoderBuffer *buffer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* How many bytes are stored in the buffer?
|
||||||
|
*/
|
||||||
|
gcc_pure
|
||||||
|
size_t
|
||||||
|
decoder_buffer_available(const DecoderBuffer *buffer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads data from the buffer. This data is not yet consumed, you
|
* Reads data from the buffer. This data is not yet consumed, you
|
||||||
* have to call decoder_buffer_consume() to do that. The returned
|
* have to call decoder_buffer_consume() to do that. The returned
|
||||||
|
|
Loading…
Reference in New Issue