Mercurial > hg > th-libs
comparison th_datastruct.h @ 733:79d06eb6d39f
Rename "allocated" field to "is_allocated" in some structures.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 07 Dec 2022 11:57:43 +0200 |
parents | 98d12f33da7b |
children | 2ae1045f6c18 |
comparison
equal
deleted
inserted
replaced
732:d190dccc3ee6 | 733:79d06eb6d39f |
---|---|
57 { | 57 { |
58 void **data; ///< Array of pointers to the data | 58 void **data; ///< Array of pointers to the data |
59 size_t size; ///< Size of this ringbuffer in elements (aka pointers to data) | 59 size_t size; ///< Size of this ringbuffer in elements (aka pointers to data) |
60 size_t n; ///< Number of elements currently in the ringbuffer (@p n <= @p size) | 60 size_t n; ///< Number of elements currently in the ringbuffer (@p n <= @p size) |
61 void (*deallocator)(void *data); ///< De-allocator function that frees one element. | 61 void (*deallocator)(void *data); ///< De-allocator function that frees one element. |
62 BOOL allocated; | 62 BOOL is_allocated; |
63 } th_ringbuf_t; | 63 } th_ringbuf_t; |
64 | 64 |
65 | 65 |
66 int th_ringbuf_init(th_ringbuf_t *buf, const size_t size, void (*mdeallocator)(void *data)); | 66 int th_ringbuf_init(th_ringbuf_t *buf, const size_t size, void (*mdeallocator)(void *data)); |
67 int th_ringbuf_new(th_ringbuf_t **buf, const size_t size, void (*mdeallocator)(void *data)); | 67 int th_ringbuf_new(th_ringbuf_t **buf, const size_t size, void (*mdeallocator)(void *data)); |
75 #define TH_BUFGROW (32) | 75 #define TH_BUFGROW (32) |
76 | 76 |
77 | 77 |
78 typedef struct | 78 typedef struct |
79 { | 79 { |
80 BOOL allocated; | 80 BOOL is_allocated; |
81 uint8_t *data; | 81 uint8_t *data; |
82 size_t size, len, mingrow; | 82 size_t size, len, mingrow; |
83 } th_growbuf_t; | 83 } th_growbuf_t; |
84 | 84 |
85 | 85 |