Mercurial > hg > th-libs
changeset 157:e96c900ca6f1
Rename qringbuf_t to th_ringbuf_t.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 07 Feb 2015 01:37:58 +0200 |
parents | f9254c34ad05 |
children | 79e904905dbf |
files | th_util.c th_util.h |
diffstat | 2 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- 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++;
--- 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