rb: add a get name function

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This commit is contained in:
Angus Salkeld 2010-06-12 11:25:50 +10:00
parent 2787bea55c
commit e7975a77e3
2 changed files with 12 additions and 0 deletions

View File

@ -125,6 +125,13 @@ qb_ringbuffer_t *qb_rb_open(const char *name, size_t size, uint32_t flags);
*/
void qb_rb_close(qb_ringbuffer_t * rb);
/**
* Get the name of the ringbuffer.
* @param rb ringbuffer instance
* @return name.
*/
char* qb_rb_name_get(qb_ringbuffer_t * rb);
/**
* Write a chunk to the ring buffer.
*

View File

@ -226,6 +226,11 @@ void qb_rb_close(qb_ringbuffer_t * rb)
free(rb);
}
char* qb_rb_name_get(qb_ringbuffer_t * rb)
{
return rb->shared_hdr->hdr_path;
}
static size_t _qb_rb_space_free_locked_(qb_ringbuffer_t * rb)
{
uint32_t write_size;