}
-static size_t fragbuf_missing(mrp_fragbuf_t *buf)
+size_t mrp_fragbuf_used(mrp_fragbuf_t *buf)
+{
+ return buf->used;
+}
+
+
+size_t mrp_fragbuf_missing(mrp_fragbuf_t *buf)
{
void *ptr;
int offs;
uint32_t size;
if (!buf->framed || !buf->used)
- return -1;
+ return 0;
/* find the last frame */
ptr = buf->data;
/** Destroy the given data collector buffer, freeing all associated memory. */
void mrp_fragbuf_destroy(mrp_fragbuf_t *buf);
+/** Return the amount of buffer space currently in used in th buffer. */
+size_t mrp_fragbuf_used(mrp_fragbuf_t *buf);
+
+/** Return the amount of bytes missing from the last message. */
+size_t mrp_fragbuf_missing(mrp_fragbuf_t *buf);
+
/** Allocate a buffer of the given size from the buffer. */
void *mrp_fragbuf_alloc(mrp_fragbuf_t *buf, size_t size);