# HG changeset patch # User Matti Hamalainen # Date 1423265878 -7200 # Node ID e96c900ca6f15c98a72d914b9590f342765acba7 # Parent f9254c34ad052976664a4503eab57c9194d703eb Rename qringbuf_t to th_ringbuf_t. diff -r f9254c34ad05 -r e96c900ca6f1 th_util.c --- a/th_util.c Sat Feb 07 01:37:11 2015 +0200 +++ b/th_util.c Sat Feb 07 01:37:58 2015 +0200 @@ -543,9 +543,9 @@ /* * Ringbuffers */ -qringbuf_t * th_ringbuf_new(const size_t size, void (*mdeallocator)(void *data)) +th_ringbuf_t * th_ringbuf_new(const size_t size, void (*mdeallocator)(void *data)) { - qringbuf_t *res = th_malloc0(sizeof(qringbuf_t)); + th_ringbuf_t *res = th_malloc0(sizeof(th_ringbuf_t)); res->data = (char **) th_calloc(size, sizeof(char *)); res->size = size; @@ -556,7 +556,7 @@ } -BOOL th_ringbuf_grow(qringbuf_t *buf, const size_t n) +BOOL th_ringbuf_grow(th_ringbuf_t *buf, const size_t n) { buf->data = (char **) th_realloc(buf->data, (buf->size + n) * sizeof(char *)); if (buf->data != NULL) @@ -569,7 +569,7 @@ } -void th_ringbuf_free(qringbuf_t *buf) +void th_ringbuf_free(th_ringbuf_t *buf) { int i; @@ -584,7 +584,7 @@ } -void th_ringbuf_add(qringbuf_t *buf, void *ptr) +void th_ringbuf_add(th_ringbuf_t *buf, void *ptr) { if (buf->n < buf->size) buf->n++; diff -r f9254c34ad05 -r e96c900ca6f1 th_util.h --- a/th_util.h Sat Feb 07 01:37:11 2015 +0200 +++ b/th_util.h Sat Feb 07 01:37:58 2015 +0200 @@ -183,12 +183,12 @@ char **data; int n, size; void (*deallocator)(void *); -} qringbuf_t; +} th_ringbuf_t; -qringbuf_t * th_ringbuf_new(const size_t size, void (*mdeallocator)(void *)); -BOOL th_ringbuf_grow(qringbuf_t *buf, const size_t n); -void th_ringbuf_free(qringbuf_t *buf); -void th_ringbuf_add(qringbuf_t *buf, void *ptr); +th_ringbuf_t * th_ringbuf_new(const size_t size, void (*mdeallocator)(void *)); +BOOL th_ringbuf_grow(th_ringbuf_t *buf, const size_t n); +void th_ringbuf_free(th_ringbuf_t *buf); +void th_ringbuf_add(th_ringbuf_t *buf, void *ptr); /* Growing buffers