Mercurial > hg > th-libs
comparison th_datastruct.h @ 632:553db886533e
Return a THERR_* error value from th_ringbuf_grow() instead of BOOL. This
breaks the API, but checking against BOOL will result in failure in case of
actual success (THERR_OK == 0) which should be "easy" to detect.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 17 Jan 2020 20:08:55 +0200 |
parents | d5221299656a |
children | 9c61834c191b |
comparison
equal
deleted
inserted
replaced
631:d5221299656a | 632:553db886533e |
---|---|
65 } th_ringbuf_t; | 65 } th_ringbuf_t; |
66 | 66 |
67 | 67 |
68 int th_ringbuf_init(th_ringbuf_t *buf, const size_t size, void (*mdeallocator)(void *data)); | 68 int th_ringbuf_init(th_ringbuf_t *buf, const size_t size, void (*mdeallocator)(void *data)); |
69 th_ringbuf_t * th_ringbuf_new(const size_t size, void (*mdeallocator)(void *data)); | 69 th_ringbuf_t * th_ringbuf_new(const size_t size, void (*mdeallocator)(void *data)); |
70 BOOL th_ringbuf_grow(th_ringbuf_t *buf, const size_t n); | 70 int th_ringbuf_grow(th_ringbuf_t *buf, const size_t n); |
71 void th_ringbuf_free(th_ringbuf_t *buf); | 71 void th_ringbuf_free(th_ringbuf_t *buf); |
72 void th_ringbuf_add(th_ringbuf_t *buf, void *ptr); | 72 void th_ringbuf_add(th_ringbuf_t *buf, void *ptr); |
73 | 73 |
74 | 74 |
75 /* Growing buffers | 75 /* Growing buffers |