Mercurial > hg > th-libs
annotate th_datastruct.h @ 757:2ab2fece83ea
Add th_llist_length_slow().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 01 Feb 2023 14:09:25 +0200 |
parents | d91d1174cfd8 |
children | 618c7fa3a4f8 |
rev | line source |
---|---|
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1 /* |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2 * Various data structure functions |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3 * Programmed and designed by Matti 'ccr' Hamalainen |
726 | 4 * (C) Copyright 2002-2022 Tecnic Software productions (TNSP) |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
5 * |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
6 * Please read file 'COPYING' for information on license and distribution. |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
7 */ |
630 | 8 /// @file |
9 /// @brief Implementations of common data structures like linked lists, ring buffers, autogrowing buffers, etc. | |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
10 #ifndef TH_DATASTRUCT_H |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
11 #define TH_DATASTRUCT_H |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
12 |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
13 #include "th_util.h" |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
14 |
459
7fca448847a3
Oops, fix C++ guards in headers.
Matti Hamalainen <ccr@tnsp.org>
parents:
457
diff
changeset
|
15 #ifdef __cplusplus |
7fca448847a3
Oops, fix C++ guards in headers.
Matti Hamalainen <ccr@tnsp.org>
parents:
457
diff
changeset
|
16 extern "C" { |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
17 #endif |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
18 |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
19 |
630 | 20 /** @brief |
21 * Doubly linked list structure. | |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
22 */ |
630 | 23 typedef struct th_llist_t |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
24 { |
630 | 25 size_t num; ///< Number of nodes in the list, meaningful ONLY in the current root node of the list |
26 struct th_llist_t *prev, *next; ///< Pointers to previous and next nodes. | |
27 void *data; ///< Pointer to data payload of this node, if any | |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
28 } th_llist_t; |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
29 |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
30 |
627 | 31 th_llist_t * th_llist_new(void *data); |
32 void th_llist_free(th_llist_t *list); | |
33 void th_llist_free_func_data(th_llist_t *list, void (*freefunc)(void *data)); | |
34 void th_llist_free_func_node(th_llist_t *list, void (*freefunc)(th_llist_t *node)); | |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
35 |
627 | 36 void th_llist_append_node(th_llist_t **list, th_llist_t *node); |
37 th_llist_t * th_llist_append(th_llist_t **list, void *data); | |
38 void th_llist_prepend_node(th_llist_t **list, th_llist_t *node); | |
39 th_llist_t * th_llist_prepend(th_llist_t **list, void *data); | |
40 void th_llist_delete_node(th_llist_t **list, th_llist_t *node); | |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
41 |
627 | 42 th_llist_t * th_llist_get_nth(th_llist_t *list, const size_t n); |
43 size_t th_llist_length(const th_llist_t *list); | |
757
2ab2fece83ea
Add th_llist_length_slow().
Matti Hamalainen <ccr@tnsp.org>
parents:
754
diff
changeset
|
44 size_t th_llist_length_slow(const th_llist_t *list); |
627 | 45 ssize_t th_llist_position(const th_llist_t *list, const th_llist_t *node); |
754
d91d1174cfd8
Add th_llist_reverse() for reversing a linked list.
Matti Hamalainen <ccr@tnsp.org>
parents:
753
diff
changeset
|
46 void th_llist_reverse(th_llist_t **list); |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
47 |
627 | 48 void th_llist_foreach(th_llist_t *list, void (*func)(th_llist_t *node, void *userdata), void *data); |
49 int th_llist_foreach_cond(th_llist_t *list, int (*func)(th_llist_t *node, void *userdata), void *data, th_llist_t **res); | |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
50 |
753
64cb2b1777a9
Rename function th_llist_find() to th_llist_find_data().
Matti Hamalainen <ccr@tnsp.org>
parents:
751
diff
changeset
|
51 th_llist_t * th_llist_find_data(th_llist_t *list, const void *data); |
627 | 52 th_llist_t * th_llist_find_func(th_llist_t *list, const void *userdata, int (compare)(const void *, const void *)); |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
53 |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
54 |
630 | 55 /** @brief |
56 * Ringbuffer data structure | |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
57 */ |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
58 typedef struct |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
59 { |
735
31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
734
diff
changeset
|
60 bool is_allocated; ///< True if this structure has been allocated dynamically |
629
b695eb769e30
Change ringbuffer data type from (char *) to (void *).
Matti Hamalainen <ccr@tnsp.org>
parents:
627
diff
changeset
|
61 void **data; ///< Array of pointers to the data |
630 | 62 size_t size; ///< Size of this ringbuffer in elements (aka pointers to data) |
63 size_t n; ///< Number of elements currently in the ringbuffer (@p n <= @p size) | |
64 void (*deallocator)(void *data); ///< De-allocator function that frees one element. | |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
65 } th_ringbuf_t; |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
66 |
627 | 67 |
631
d5221299656a
Add new function th_ringbuf_init() and add "allocated" field to th_ringbuf_t
Matti Hamalainen <ccr@tnsp.org>
parents:
630
diff
changeset
|
68 int th_ringbuf_init(th_ringbuf_t *buf, const size_t size, void (*mdeallocator)(void *data)); |
731
98d12f33da7b
Change th_ringbuf_new() API.
Matti Hamalainen <ccr@tnsp.org>
parents:
726
diff
changeset
|
69 int th_ringbuf_new(th_ringbuf_t **buf, const size_t size, void (*mdeallocator)(void *data)); |
632
553db886533e
Return a THERR_* error value from th_ringbuf_grow() instead of BOOL. This
Matti Hamalainen <ccr@tnsp.org>
parents:
631
diff
changeset
|
70 int th_ringbuf_grow(th_ringbuf_t *buf, const size_t n); |
627 | 71 void th_ringbuf_free(th_ringbuf_t *buf); |
72 void th_ringbuf_add(th_ringbuf_t *buf, void *ptr); | |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
73 |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
74 |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
75 /* Growing buffers |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
76 */ |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
77 #define TH_BUFGROW (32) |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
78 |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
79 |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
80 /* Simple growing string buffer |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
81 */ |
735
31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
734
diff
changeset
|
82 bool th_strbuf_grow(char **buf, size_t *bufsize, size_t *len, const size_t grow); |
31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
734
diff
changeset
|
83 bool th_strbuf_putch(char **buf, size_t *bufsize, size_t *len, const uint8_t ch); |
31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
734
diff
changeset
|
84 bool th_strbuf_putsn(char **buf, size_t *bufsize, size_t *len, const char *str, const size_t slen); |
31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
734
diff
changeset
|
85 bool th_strbuf_puts(char **buf, size_t *bufsize, size_t *len, const char *str); |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
86 |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
87 |
734 | 88 /** @brief |
89 * Simple growing buffer structure | |
90 */ | |
91 typedef struct | |
92 { | |
735
31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
734
diff
changeset
|
93 bool is_allocated; ///< True if this structure has been allocated dynamically |
734 | 94 uint8_t *data; ///< Pointer to data |
95 size_t size; ///< Current allocated size of data | |
96 size_t len; ///< Actual used size of data (must be < size) | |
97 size_t mingrow; ///< Minimum amount of bytes to grow allocation by | |
98 ///< If 0, grow by TH_BUFGROW | |
99 } th_growbuf_t; | |
100 | |
101 | |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
102 /* Growing byte buffer |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
103 */ |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
104 void th_growbuf_init(th_growbuf_t *buf, const size_t mingrow); |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
105 void th_growbuf_clear(th_growbuf_t *buf); |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
106 th_growbuf_t *th_growbuf_new(const size_t mingrow); |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
107 void th_growbuf_free(th_growbuf_t *buf); |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
108 |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
109 |
735
31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
734
diff
changeset
|
110 bool th_growbuf_grow(th_growbuf_t *buf, const size_t grow); |
31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
734
diff
changeset
|
111 bool th_growbuf_puts(th_growbuf_t *buf, const char *str, bool eos); |
31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
734
diff
changeset
|
112 bool th_growbuf_putch(th_growbuf_t *buf, const char ch); |
31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
734
diff
changeset
|
113 bool th_growbuf_put_str(th_growbuf_t *buf, const void *s, const size_t len); |
31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
734
diff
changeset
|
114 bool th_growbuf_put_u8(th_growbuf_t *buf, const uint8_t val); |
31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
734
diff
changeset
|
115 bool th_growbuf_put_u16_be(th_growbuf_t *buf, const uint16_t val); |
31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
734
diff
changeset
|
116 bool th_growbuf_put_u16_le(th_growbuf_t *buf, const uint16_t val); |
31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
734
diff
changeset
|
117 bool th_growbuf_put_u32_be(th_growbuf_t *buf, const uint32_t val); |
31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
734
diff
changeset
|
118 bool th_growbuf_put_u32_le(th_growbuf_t *buf, const uint32_t val); |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
119 |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
120 |
736
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
121 /** @brief |
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
122 * Growing pointerlist/array structure |
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
123 */ |
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
124 typedef struct |
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
125 { |
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
126 bool is_allocated; |
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
127 size_t nitems, nallocated, ngrow; |
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
128 void **items; |
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
129 } th_ptrlist_t; |
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
130 |
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
131 |
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
132 int th_ptrlist_init(th_ptrlist_t *list, const size_t ninitial, const size_t ngrow); |
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
133 int th_ptrlist_new(th_ptrlist_t **list, const size_t ninitial, const size_t ngrow); |
751 | 134 int th_ptrlist_append(th_ptrlist_t *list, void *data); |
736
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
135 void th_ptrlist_free(th_ptrlist_t *list, void (*mdeallocator)(void *data)); |
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
136 |
ca837a4417f5
Add simple growing pointerlist data stucture implementation.
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
137 |
269
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
138 #ifdef __cplusplus |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
139 } |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
140 #endif |
fcbdc12f5866
Split data structures (linked lists, growbufs, ringbufs, etc.) code into th_datastruct.[ch] module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
141 #endif // TH_DATASTRUCT_H |