rstream: Expose rstream_read_ptr and _available.

Needed for accessing this information without direct access to the
rstream_buffer.
This commit is contained in:
Scott Prager
2014-10-25 20:03:24 -04:00
committed by Thiago de Arruda
parent 4df884a611
commit 50f1c5db25

View File

@@ -190,6 +190,18 @@ RStream * rstream_new(rstream_cb cb, RBuffer *buffer, void *data)
return rv;
}
/// Returns the read pointer used by the rstream.
char *rstream_read_ptr(RStream *rstream)
{
return rbuffer_read_ptr(rstream->buffer);
}
/// Returns the number of bytes before the rstream is full.
size_t rstream_available(RStream *rstream)
{
return rbuffer_available(rstream->buffer);
}
/// Frees all memory allocated for a RStream instance
///
/// @param rstream The `RStream` instance