rstream: Extract some RStream functionality to RBuffer

RBuffer instances represent the internal buffer used by RStreams.

This changes RStream constructor to receive RBuffer pointers and adds a set of
RBuffer methods that expose the lower level buffer manipulation to consumers of
the RStream API.
This commit is contained in:
Thiago de Arruda
2014-10-17 09:17:12 -03:00
parent 56ef9e8668
commit 68de5d79a2
7 changed files with 185 additions and 84 deletions

View File

@@ -19531,7 +19531,7 @@ static void on_job_exit(Job *job, void *data)
static void on_job_data(RStream *rstream, void *data, bool eof, char *type)
{
Job *job = data;
uint32_t read_count = rstream_available(rstream);
uint32_t read_count = rstream_pending(rstream);
char *str = xmalloc(read_count + 1);
rstream_read(rstream, str, read_count);