Fri, 19 Dec 2025 17:22:03 +0100
update ucx
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | /* |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | * |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
4 | * Copyright 2021 Mike Becker, Olaf Wintermann All rights reserved. |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | * |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | * Redistribution and use in source and binary forms, with or without |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | * modification, are permitted provided that the following conditions are met: |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | * |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | * 1. Redistributions of source code must retain the above copyright |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | * notice, this list of conditions and the following disclaimer. |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | * |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | * 2. Redistributions in binary form must reproduce the above copyright |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | * notice, this list of conditions and the following disclaimer in the |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | * documentation and/or other materials provided with the distribution. |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | * |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
26 | * POSSIBILITY OF SUCH DAMAGE. |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27 | */ |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28 | /** |
| 16 | 29 | * @file array_list.h |
| 30 | * @brief Array list implementation. | |
| 31 | * @author Mike Becker | |
| 32 | * @author Olaf Wintermann | |
| 33 | * @copyright 2-Clause BSD License | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34 | */ |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
36 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
37 | #ifndef UCX_ARRAY_LIST_H |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
38 | #define UCX_ARRAY_LIST_H |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
39 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
40 | #include "list.h" |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
41 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
42 | #ifdef __cplusplus |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
43 | extern "C" { |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
44 | #endif |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
45 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
46 | /** |
| 22 | 47 | * The maximum item size in an array list that fits into |
| 48 | * a stack buffer when swapped. | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
49 | */ |
| 22 | 50 | CX_EXPORT extern const unsigned cx_array_swap_sbo_size; |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
51 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
52 | /** |
| 31 | 53 | * Declares a typed array with size and capacity. |
| 16 | 54 | * |
| 31 | 55 | * @param type the type of the elements |
| 56 | * @param name the name of the array | |
| 57 | */ | |
| 58 | #define CX_ARRAY(type, name) \ | |
| 59 | struct { \ | |
| 60 | type *data; \ | |
| 61 | size_t size; \ | |
| 62 | size_t capacity; \ | |
| 63 | } name | |
| 64 | ||
| 65 | /** | |
| 66 | * Internal structure for arrays. | |
| 16 | 67 | * |
| 31 | 68 | * A generalization of array structures declared with CX_ARRAY(). |
| 69 | */ | |
| 70 | typedef struct cx_array_s { | |
| 71 | /** The array data. */ | |
| 72 | void *data; | |
| 73 | /** The number of elements. */ | |
| 74 | size_t size; | |
| 75 | /** The maximum number of elements. */ | |
| 76 | size_t capacity; | |
| 77 | } CxArray; | |
| 78 | ||
| 79 | /** | |
| 80 | * Initializes an array by allocating memory. | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
81 | * |
| 31 | 82 | * Internal function - do not use manually. |
| 83 | * | |
| 84 | * @param allocator the allocator for the array | |
| 85 | * @param array a pointer to the array structure | |
| 86 | * @param elem_size size of one element | |
| 87 | * @param capacity the initial maximum number of elements | |
| 88 | * @retval zero allocation was successful | |
| 89 | * @retval non-zero allocation failed | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
90 | */ |
| 31 | 91 | cx_attr_nonnull |
| 92 | CX_EXPORT int cx_array_init_(const CxAllocator *allocator, CxArray *array, size_t elem_size, size_t capacity); | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
93 | |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
94 | /** |
| 31 | 95 | * Initializes an array by allocating memory. |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
96 | * |
| 31 | 97 | * The size is set to zero. |
| 98 | * | |
| 99 | * @attention If the array was already initialized, this will leak memory. | |
| 100 | * Use cx_array_reserve() to change the capacity of an initialized array. | |
| 16 | 101 | * |
| 31 | 102 | * @param allocator (@c CxAllocator*) the allocator for the array |
| 103 | * @param array the name of the array | |
| 104 | * @param capacity (@c size_t) the initial maximum number of elements | |
| 105 | * @retval zero allocation was successful | |
| 106 | * @retval non-zero allocation failed | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
107 | */ |
| 31 | 108 | #define cx_array_init_a(allocator, array, capacity) cx_array_init_(allocator, (CxArray*)&(array), sizeof((array).data[0]), capacity) |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
109 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
110 | /** |
| 31 | 111 | * Initializes an array by allocating memory. |
| 16 | 112 | * |
| 31 | 113 | * The size is set to zero. |
| 16 | 114 | * |
| 31 | 115 | * @attention If the array was already initialized, this will leak memory. |
| 21 | 116 | * |
| 16 | 117 | * @param array the name of the array |
| 31 | 118 | * @param capacity (@c size_t) the initial maximum number of elements |
| 119 | * @retval zero allocation was successful | |
| 120 | * @retval non-zero allocation failed | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
121 | */ |
| 31 | 122 | #define cx_array_init(array, capacity) cx_array_init_a(cxDefaultAllocator, array, capacity) |
| 123 | ||
| 124 | /** | |
| 125 | * Initializes an array with fixed size memory. | |
| 126 | * | |
| 127 | * Internal function - do not use manually. | |
| 128 | * | |
| 129 | * @param array a pointer to the array structure | |
| 130 | * @param data the fixed size array | |
| 131 | * @param capacity the capacity of the fixed size array | |
| 132 | * @param size the number of initialized elements in the fixed size array | |
| 133 | */ | |
| 134 | cx_attr_nonnull | |
| 135 | CX_EXPORT void cx_array_init_fixed_(CxArray *array, const void *data, size_t capacity, size_t size); | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
136 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
137 | /** |
| 31 | 138 | * Initializes an array with fixed size memory. |
| 139 | * | |
| 140 | * This is useful, for example, when you want to work with memory on the stack | |
| 141 | * and only want to move to the heap when the stack memory is not enough. | |
| 142 | * | |
| 143 | * With the @p num_initialized argument you can specify how many elements in the | |
| 144 | * fixed size array are already correctly initialized, which determines the | |
| 145 | * initial size of the array. | |
| 16 | 146 | * |
| 31 | 147 | * The capacity is determined automatically by the compiler. |
| 16 | 148 | * |
| 31 | 149 | * @attention When you add elements to an array that was initialized with fixed |
| 150 | * size memory, you MUST check the capacity before adding the element and invoke | |
| 151 | * cx_array_copy_to_new() when you intend to exceed the capacity. | |
| 152 | * | |
| 153 | * @attention When you pass a pointer to an array that does not have a fixed | |
| 154 | * size, the behavior is unspecified. | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
155 | * |
| 31 | 156 | * @param array the name of the array to initialize |
| 157 | * @param fixed_size_array (@c void*) the fixed size array | |
| 158 | * @param num_initialized (@c size_t) the number of already initialized elements in the fixed size array | |
| 159 | * @see cx_array_copy_to_new() | |
| 160 | */ | |
| 161 | #define cx_array_init_fixed(array, fixed_size_array, num_initialized) \ | |
| 162 | cx_array_init_fixed_((CxArray*)&(array), fixed_size_array, cx_nmemb(fixed_size_array), num_initialized) | |
| 163 | ||
| 164 | /** | |
| 165 | * Changes the capacity of an array. | |
| 16 | 166 | * |
| 31 | 167 | * Internal function - do not use. |
| 168 | * | |
| 169 | * @param allocator the allocator | |
| 170 | * @param array a pointer to the array structure | |
| 171 | * @param elem_size the size of one element | |
| 172 | * @param capacity the new capacity | |
| 173 | * @retval zero allocation was successful | |
| 174 | * @retval non-zero allocation failed | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
175 | */ |
| 31 | 176 | cx_attr_nonnull |
| 177 | CX_EXPORT int cx_array_reserve_(const CxAllocator *allocator, CxArray *array, size_t elem_size, size_t capacity); | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
178 | |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
179 | /** |
| 31 | 180 | * Changes the capacity of an array. |
| 181 | * | |
| 182 | * If required, the size is reduced to fit into the new capacity. | |
| 183 | * | |
| 184 | * @param allocator (@c CxAllocator*) the allocator for the array | |
| 185 | * @param array the name of the array | |
| 186 | * @param capacity (@c size_t) the new maximum number of elements | |
| 187 | * @retval zero allocation was successful | |
| 188 | * @retval non-zero allocation failed | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
189 | */ |
| 31 | 190 | #define cx_array_reserve_a(allocator, array, capacity) \ |
| 191 | cx_array_reserve_(allocator, (CxArray*)&(array), sizeof((array).data[0]), capacity) | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
192 | |
| 31 | 193 | /** |
| 194 | * Changes the capacity of an array. | |
| 195 | * | |
| 196 | * If required, the size is reduced to fit into the new capacity. | |
| 197 | * | |
| 198 | * @param array the name of the array | |
| 199 | * @param capacity (@c size_t) the new maximum number of elements | |
| 200 | * @retval zero allocation was successful | |
| 201 | * @retval non-zero allocation failed | |
| 202 | */ | |
| 203 | #define cx_array_reserve(array, capacity) \ | |
| 204 | cx_array_reserve_a(cxDefaultAllocator, array, capacity) | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
205 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
206 | /** |
| 31 | 207 | * Copies the array to a new memory region. |
| 208 | * | |
| 209 | * Internal function - do not use. | |
| 210 | * | |
| 211 | * @param allocator the allocator for new new memory | |
| 212 | * @param array a pointer to the array structure | |
| 213 | * @param elem_size the size of one element | |
| 214 | * @param capacity the new capacity | |
| 215 | * @retval zero allocation was successful | |
| 216 | * @retval non-zero allocation failed | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
217 | */ |
| 31 | 218 | cx_attr_nonnull |
| 219 | CX_EXPORT int cx_array_copy_to_new_(const CxAllocator *allocator, CxArray *array, size_t elem_size, size_t capacity); | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
220 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
221 | /** |
| 31 | 222 | * Copies the array to a new memory region. |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
223 | * |
| 31 | 224 | * This is useful when you have initialized the array with a fixed size memory |
| 225 | * using cx_array_init_fixed(), and now you want to increase the capacity. | |
| 226 | * | |
| 227 | * @attention When the original memory does not belong to stack memory, and | |
| 228 | * you do not have another reference to this memory, it will leak. | |
| 16 | 229 | * |
| 31 | 230 | * @param allocator (@c CxAllocator*) the allocator for the new memory |
| 231 | * @param array the name of the array | |
| 232 | * @param capacity (@c size_t) the new maximum number of elements | |
| 233 | * @retval zero allocation was successful | |
| 234 | * @retval non-zero allocation failed | |
| 235 | * @see cx_array_init_fixed() | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
236 | */ |
| 31 | 237 | #define cx_array_copy_to_new_a(allocator, array, capacity) \ |
| 238 | cx_array_copy_to_new_(allocator, (CxArray*)&(array), sizeof((array).data[0]), capacity) | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
239 | |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
240 | /** |
| 31 | 241 | * Copies the array to a new memory region. |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
242 | * |
| 31 | 243 | * This is useful when you have initialized the array with a fixed size memory |
| 244 | * using cx_array_init_fixed(), and now you want to increase the capacity. | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
245 | * |
| 31 | 246 | * @attention When the original memory does not belong to stack memory, and |
| 247 | * you do not have another reference to this memory, it will leak. | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
248 | * |
| 31 | 249 | * @param array the name of the array |
| 250 | * @param capacity (@c size_t) the new maximum number of elements | |
| 251 | * @retval zero allocation was successful | |
| 252 | * @retval non-zero allocation failed | |
| 253 | * @see cx_array_init_fixed() | |
| 254 | */ | |
| 255 | #define cx_array_copy_to_new(array, capacity) \ | |
| 256 | cx_array_copy_to_new_a(cxDefaultAllocator, array, capacity) | |
| 257 | ||
| 258 | /** | |
| 259 | * Inserts data into an array. | |
| 22 | 260 | * |
| 31 | 261 | * Internal function - do not use. |
| 262 | * | |
| 263 | * @param allocator the allocator to use for a possible reallocation | |
| 264 | * @param array a pointer to the array structure | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
265 | * @param elem_size the size of one element |
| 31 | 266 | * @param index the index where to insert the @p other data |
| 267 | * @param other a pointer to an array of data that shall be inserted | |
| 268 | * @param n the number of elements that shall be inserted | |
| 16 | 269 | * @retval zero success |
| 31 | 270 | * @retval non-zero a re-allocation was necessary but failed |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
271 | */ |
| 31 | 272 | cx_attr_nonnull_arg(1, 2) |
| 273 | CX_EXPORT int cx_array_insert_(const CxAllocator *allocator, CxArray *array, | |
| 274 | size_t elem_size, size_t index, const void *other, size_t n); | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
275 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
276 | /** |
| 31 | 277 | * Appends an element to an array. |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
278 | * |
| 31 | 279 | * When the capacity is not enough to hold the new element, a re-allocation is attempted. |
| 22 | 280 | * |
| 31 | 281 | * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation |
| 282 | * @param array the name of the array where the element shall be added | |
| 283 | * @param element the element that shall be added | |
| 16 | 284 | * @retval zero success |
| 31 | 285 | * @retval non-zero a re-allocation was necessary but failed |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
286 | */ |
| 31 | 287 | #define cx_array_add_a(allocator, array, element) \ |
| 288 | cx_array_insert_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (array).size, (void*)&(element), 1) | |
| 289 | ||
| 290 | /** | |
| 291 | * Appends an element to an array. | |
| 292 | * | |
| 293 | * When the capacity is not enough to hold the new element, a re-allocation is attempted. | |
| 294 | * | |
| 295 | * @param array the name of the array where the element shall be added | |
| 296 | * @param element (@c void*) a pointer to the element that shall be added | |
| 297 | * @retval zero success | |
| 298 | * @retval non-zero a re-allocation was necessary but failed | |
| 299 | */ | |
| 300 | #define cx_array_add(array, element) \ | |
| 301 | cx_array_add_a(cxDefaultAllocator, array, element) | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
302 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
303 | /** |
| 31 | 304 | * Inserts an element into an array. |
| 305 | * | |
| 306 | * When the capacity is not enough to hold the new element, a re-allocation is attempted. | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
307 | * |
| 31 | 308 | * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation |
| 309 | * @param array the name of the array where the element shall be inserted | |
| 310 | * @param index (@c size_t) the index where to insert the @p element | |
| 311 | * @param element the element that shall be inserted | |
| 16 | 312 | * @retval zero success |
| 31 | 313 | * @retval non-zero a re-allocation was necessary but failed |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
314 | */ |
| 31 | 315 | #define cx_array_insert_a(allocator, array, index, element) \ |
| 316 | cx_array_insert_(allocator, (CxArray*)&(array), sizeof((array).data[0]), index, (void*)&(element), 1) | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
317 | |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
318 | /** |
| 31 | 319 | * Inserts an element into an array. |
| 320 | * | |
| 321 | * When the capacity is not enough to hold the new element, a re-allocation is attempted. | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
322 | * |
| 31 | 323 | * @param array the name of the array where the element shall be inserted |
| 324 | * @param index (@c size_t) the index where to insert the @p element | |
| 325 | * @param element (@c void*) a pointer to the element that shall be inserted | |
| 16 | 326 | * @retval zero success |
| 31 | 327 | * @retval non-zero a re-allocation was necessary but failed |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
328 | */ |
| 31 | 329 | #define cx_array_insert(array, index, element) \ |
| 330 | cx_array_insert_a(cxDefaultAllocator, array, index, element) | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
331 | |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
332 | /** |
| 31 | 333 | * Inserts data into an array. |
| 334 | * | |
| 335 | * When the capacity is not enough to hold the new elements, a re-allocation is attempted. | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
336 | * |
| 31 | 337 | * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation |
| 338 | * @param array the name of the array where the elements shall be inserted | |
| 339 | * @param index (@c size_t) the index where to insert the @p other data | |
| 340 | * @param other (@c void*) a pointer to an array of data that shall be inserted | |
| 341 | * @param n (@c size_t) the number of elements that shall be inserted | |
| 16 | 342 | * @retval zero success |
| 31 | 343 | * @retval non-zero a re-allocation was necessary but failed |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
344 | */ |
| 31 | 345 | #define cx_array_insert_array_a(allocator, array, index, other, n) \ |
| 346 | cx_array_insert_(allocator, (CxArray*)&(array), sizeof((array).data[0]), index, other, n) | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
347 | |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
348 | /** |
| 31 | 349 | * Inserts data into an array. |
| 350 | * | |
| 351 | * When the capacity is not enough to hold the new elements, a re-allocation is attempted. | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
352 | * |
| 31 | 353 | * @param array the name of the array where the elements shall be inserted |
| 354 | * @param index (@c size_t) the index where to insert the @p other data | |
| 355 | * @param other (@c void*) a pointer to an array of data that shall be inserted | |
| 356 | * @param n (@c size_t) the number of elements that shall be inserted | |
| 16 | 357 | * @retval zero success |
| 31 | 358 | * @retval non-zero a re-allocation was necessary but failed |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
359 | */ |
| 31 | 360 | #define cx_array_insert_array(array, index, other, n) \ |
| 361 | cx_array_insert_array_a(cxDefaultAllocator, array, index, other, n) | |
| 362 | ||
| 363 | /** | |
| 364 | * Appends data to an array. | |
| 365 | * | |
| 366 | * When the capacity is not enough to hold the new elements, a re-allocation is attempted. | |
| 367 | * | |
| 368 | * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation | |
| 369 | * @param array the name of the array where the elements shall be added | |
| 370 | * @param other (@c void*) a pointer to an array of data that shall be added | |
| 371 | * @param n (@c size_t) the number of elements that shall be added | |
| 372 | * @retval zero success | |
| 373 | * @retval non-zero a re-allocation was necessary but failed | |
| 374 | */ | |
| 375 | #define cx_array_add_array_a(allocator, array, other, n) \ | |
| 376 | cx_array_insert_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (array).size, other, n) | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
377 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
378 | /** |
| 31 | 379 | * Appends data to an array. |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
380 | * |
| 31 | 381 | * When the capacity is not enough to hold the new elements, a re-allocation is attempted. |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
382 | * |
| 31 | 383 | * @param array the name of the array where the elements shall be added |
| 384 | * @param other (@c void*) a pointer to an array of data that shall be added | |
| 385 | * @param n (@c size_t) the number of elements that shall be added | |
| 16 | 386 | * @retval zero success |
| 31 | 387 | * @retval non-zero a re-allocation was necessary but failed |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
388 | */ |
| 31 | 389 | #define cx_array_add_array(array, other, n) \ |
| 390 | cx_array_add_array_a(cxDefaultAllocator, array, other, n) | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
391 | |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
392 | /** |
| 31 | 393 | * Inserts sorted data into a sorted array. |
| 394 | * | |
| 395 | * Internal function - do not use. | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
396 | * |
| 31 | 397 | * @param allocator the allocator to use for a possible reallocation |
| 398 | * @param array a pointer to the array structure | |
| 399 | * @param elem_size the size of one element | |
| 400 | * @param sorted_data a pointer to an array of data that shall be inserted | |
| 401 | * @param n the number of elements that shall be inserted | |
| 402 | * @param cmp_func the compare function | |
| 403 | * @param allow_duplicates @c false if duplicates shall be skipped during insertion | |
| 16 | 404 | * @retval zero success |
| 31 | 405 | * @retval non-zero a re-allocation was necessary but failed |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
406 | */ |
| 31 | 407 | cx_attr_nonnull |
| 408 | CX_EXPORT int cx_array_insert_sorted_(const CxAllocator *allocator, CxArray *array, | |
| 409 | size_t elem_size, const void *sorted_data, size_t n, | |
| 410 | cx_compare_func cmp_func, bool allow_duplicates); | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
411 | |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
412 | /** |
| 31 | 413 | * Inserts an element into a sorted array. |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
414 | * |
| 31 | 415 | * When the capacity is not enough to hold the new element, a re-allocation is attempted. |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
416 | * |
| 31 | 417 | * @attention if the array is not sorted according to the specified @p cmp_func, the behavior is undefined. |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
418 | * |
| 31 | 419 | * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation |
| 420 | * @param array the name of the array where the elements shall be inserted | |
| 421 | * @param element the element that shall be inserted | |
| 422 | * @param cmp_func (@c cx_compare_func) the compare function that establishes the order | |
| 16 | 423 | * @retval zero success |
| 31 | 424 | * @retval non-zero a re-allocation was necessary but failed |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
425 | */ |
| 31 | 426 | #define cx_array_insert_sorted_a(allocator, array, element, cmp_func) \ |
| 427 | cx_array_insert_sorted_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (void*)&(element), 1, cmp_func, true) | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
428 | |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
429 | /** |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
430 | * Inserts an element into a sorted array. |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
431 | * |
| 31 | 432 | * When the capacity is not enough to hold the new element, a re-allocation is attempted. |
| 433 | * | |
| 434 | * @attention if the array is not sorted according to the specified @p cmp_func, the behavior is undefined. | |
| 435 | * | |
| 436 | * @param array the name of the array where the elements shall be inserted | |
| 437 | * @param element the element that shall be inserted | |
| 438 | * @param cmp_func (@c cx_compare_func) the compare function that establishes the order | |
| 439 | * @retval zero success | |
| 440 | * @retval non-zero a re-allocation was necessary but failed | |
| 441 | */ | |
| 442 | #define cx_array_insert_sorted(array, element, cmp_func) \ | |
| 443 | cx_array_insert_sorted_a(cxDefaultAllocator, array, element, cmp_func) | |
| 444 | ||
| 445 | /** | |
| 446 | * Inserts sorted data into a sorted array. | |
| 447 | * | |
| 448 | * When the capacity is not enough to hold the new elements, a re-allocation is attempted. | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
449 | * |
| 31 | 450 | * @attention if either array is not sorted according to the specified @p cmp_func, the behavior is undefined. |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
451 | * |
| 31 | 452 | * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation |
| 453 | * @param array the name of the array where the elements shall be inserted | |
| 454 | * @param sorted_data (@c void*) a pointer to an array of sorted data that shall be inserted | |
| 455 | * @param n (@c size_t) the number of elements that shall be inserted | |
| 456 | * @param cmp_func (@c cx_compare_func) the compare function that establishes the order | |
| 457 | * @retval zero success | |
| 458 | * @retval non-zero a re-allocation was necessary but failed | |
| 459 | */ | |
| 460 | #define cx_array_insert_sorted_array_a(allocator, array, sorted_data, n, cmp_func) \ | |
| 461 | cx_array_insert_sorted_(allocator, (CxArray*)&(array), sizeof((array).data[0]), sorted_data, n, cmp_func, true) | |
| 462 | ||
| 463 | /** | |
| 464 | * Inserts sorted data into a sorted array. | |
| 465 | * | |
| 466 | * When the capacity is not enough to hold the new elements, a re-allocation is attempted. | |
| 467 | * | |
| 468 | * @attention if either array is not sorted according to the specified @p cmp_func, the behavior is undefined. | |
| 16 | 469 | * |
| 31 | 470 | * @param array the name of the array where the elements shall be inserted |
| 471 | * @param sorted_data (@c void*) a pointer to an array of sorted data that shall be inserted | |
| 472 | * @param n (@c size_t) the number of elements that shall be inserted | |
| 473 | * @param cmp_func (@c cx_compare_func) the compare function that establishes the order | |
| 16 | 474 | * @retval zero success |
| 31 | 475 | * @retval non-zero a re-allocation was necessary but failed |
| 476 | */ | |
| 477 | #define cx_array_insert_sorted_array(array, sorted_data, n, cmp_func) \ | |
| 478 | cx_array_insert_sorted_array_a(cxDefaultAllocator, array, sorted_data, n, cmp_func) | |
| 479 | ||
| 480 | /** | |
| 481 | * Inserts an element into a sorted array if it is not already contained. | |
| 482 | * | |
| 483 | * When the capacity is not enough to hold the new element, a re-allocation is attempted. | |
| 484 | * | |
| 485 | * @attention if the array is not sorted according to the specified @p cmp_func, the behavior is undefined. | |
| 486 | * | |
| 487 | * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation | |
| 488 | * @param array the name of the array where the elements shall be inserted | |
| 489 | * @param element the element that shall be inserted | |
| 490 | * @param cmp_func (@c cx_compare_func) the compare function that establishes the order | |
| 491 | * @retval zero success | |
| 492 | * @retval non-zero a re-allocation was necessary but failed | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
493 | */ |
| 31 | 494 | #define cx_array_insert_unique_a(allocator, array, element, cmp_func) \ |
| 495 | cx_array_insert_sorted_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (void*)&(element), 1, cmp_func, false) | |
| 496 | ||
| 497 | /** | |
| 498 | * Inserts an element into a sorted array if it is not already contained. | |
| 499 | * | |
| 500 | * When the capacity is not enough to hold the new element, a re-allocation is attempted. | |
| 501 | * | |
| 502 | * @attention if the array is not sorted according to the specified @p cmp_func, the behavior is undefined. | |
| 503 | * | |
| 504 | * @param array the name of the array where the elements shall be inserted | |
| 505 | * @param element the element that shall be inserted | |
| 506 | * @param cmp_func (@c cx_compare_func) the compare function that establishes the order | |
| 507 | * @retval zero success | |
| 508 | * @retval non-zero a re-allocation was necessary but failed | |
| 509 | */ | |
| 510 | #define cx_array_insert_unique(array, element, cmp_func) \ | |
| 511 | cx_array_insert_unique_a(cxDefaultAllocator, array, element, cmp_func) | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
512 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
513 | /** |
| 31 | 514 | * Inserts sorted data into a sorted array, skipping duplicates. |
| 515 | * | |
| 516 | * When the capacity is not enough to hold the new elements, a re-allocation is attempted. | |
| 517 | * | |
| 518 | * @attention if either array is not sorted according to the specified @p cmp_func, the behavior is undefined. | |
| 519 | * | |
| 520 | * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation | |
| 521 | * @param array the name of the array where the elements shall be inserted | |
| 522 | * @param sorted_data (@c void*) a pointer to an array of sorted data that shall be inserted | |
| 523 | * @param n (@c size_t) the number of elements that shall be inserted | |
| 524 | * @param cmp_func (@c cx_compare_func) the compare function that establishes the order | |
| 525 | * @retval zero success | |
| 526 | * @retval non-zero a re-allocation was necessary but failed | |
| 527 | */ | |
| 528 | #define cx_array_insert_unique_array_a(allocator, array, sorted_data, n, cmp_func) \ | |
| 529 | cx_array_insert_sorted_(allocator, (CxArray*)&(array), sizeof((array).data[0]), sorted_data, n, cmp_func, false) | |
| 530 | ||
| 531 | /** | |
| 532 | * Inserts sorted data into a sorted array, skipping duplicates. | |
| 533 | * | |
| 534 | * When the capacity is not enough to hold the new elements, a re-allocation is attempted. | |
| 535 | * | |
| 536 | * @attention if either array is not sorted according to the specified @p cmp_func, the behavior is undefined. | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
537 | * |
| 31 | 538 | * @param array the name of the array where the elements shall be inserted |
| 539 | * @param sorted_data (@c void*) a pointer to an array of sorted data that shall be inserted | |
| 540 | * @param n (@c size_t) the number of elements that shall be inserted | |
| 541 | * @param cmp_func (@c cx_compare_func) the compare function that establishes the order | |
| 542 | * @retval zero success | |
| 543 | * @retval non-zero a re-allocation was necessary but failed | |
| 544 | */ | |
| 545 | #define cx_array_insert_unique_array(array, sorted_data, n, cmp_func) \ | |
| 546 | cx_array_insert_unique_array_a(cxDefaultAllocator, array, sorted_data, n, cmp_func) | |
| 547 | ||
| 548 | /** | |
| 549 | * Inserts sorted data into a sorted array. | |
| 550 | * | |
| 551 | * Internal function - do not use. | |
| 552 | * | |
| 553 | * @param allocator the allocator to use for a possible reallocation | |
| 554 | * @param array a pointer to the array structure | |
| 555 | * @param elem_size the size of one element | |
| 556 | * @param sorted_data a pointer to an array of data that shall be inserted | |
| 557 | * @param n the number of elements that shall be inserted | |
| 558 | * @param cmp_func the compare function | |
| 559 | * @param context additional context for the compare function | |
| 560 | * @param allow_duplicates @c false if duplicates shall be skipped during insertion | |
| 16 | 561 | * @retval zero success |
| 31 | 562 | * @retval non-zero a re-allocation was necessary but failed |
| 563 | */ | |
| 564 | cx_attr_nonnull_arg(1, 2, 4, 6) | |
| 565 | CX_EXPORT int cx_array_insert_sorted_c_(const CxAllocator *allocator, CxArray *array, | |
| 566 | size_t elem_size, const void *sorted_data, size_t n, | |
| 567 | cx_compare_func2 cmp_func, void *context, bool allow_duplicates); | |
| 568 | ||
| 569 | /** | |
| 570 | * Inserts an element into a sorted array. | |
| 571 | * | |
| 572 | * When the capacity is not enough to hold the new element, a re-allocation is attempted. | |
| 573 | * | |
| 574 | * @attention if the array is not sorted according to the specified @p cmp_func, the behavior is undefined. | |
| 575 | * | |
| 576 | * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation | |
| 577 | * @param array the name of the array where the elements shall be inserted | |
| 578 | * @param element the element that shall be inserted | |
| 579 | * @param cmp_func (@c cx_compare_func2) the compare function that establishes the order | |
| 580 | * @param context (@c void*) additional context for the compare function | |
| 581 | * @retval zero success | |
| 582 | * @retval non-zero a re-allocation was necessary but failed | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
583 | */ |
| 31 | 584 | #define cx_array_insert_sorted_ca(allocator, array, element, cmp_func) \ |
| 585 | cx_array_insert_sorted_c_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (void*)&(element), 1, cmp_func, context, true) | |
| 586 | ||
| 587 | /** | |
| 588 | * Inserts an element into a sorted array. | |
| 589 | * | |
| 590 | * When the capacity is not enough to hold the new element, a re-allocation is attempted. | |
| 591 | * | |
| 592 | * @attention if the array is not sorted according to the specified @p cmp_func, the behavior is undefined. | |
| 593 | * | |
| 594 | * @param array the name of the array where the elements shall be inserted | |
| 595 | * @param element the element that shall be inserted | |
| 596 | * @param cmp_func (@c cx_compare_func2) the compare function that establishes the order | |
| 597 | * @param context (@c void*) additional context for the compare function | |
| 598 | * @retval zero success | |
| 599 | * @retval non-zero a re-allocation was necessary but failed | |
| 600 | */ | |
| 601 | #define cx_array_insert_sorted_c(array, element, cmp_func, context) \ | |
| 602 | cx_array_insert_sorted_ca(cxDefaultAllocator, array, element, cmp_func, context) | |
| 603 | ||
| 604 | /** | |
| 605 | * Inserts sorted data into a sorted array. | |
| 606 | * | |
| 607 | * When the capacity is not enough to hold the new elements, a re-allocation is attempted. | |
| 608 | * | |
| 609 | * @attention if either array is not sorted according to the specified @p cmp_func, the behavior is undefined. | |
| 610 | * | |
| 611 | * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation | |
| 612 | * @param array the name of the array where the elements shall be inserted | |
| 613 | * @param sorted_data (@c void*) a pointer to an array of sorted data that shall be inserted | |
| 614 | * @param n (@c size_t) the number of elements that shall be inserted | |
| 615 | * @param cmp_func (@c cx_compare_func2) the compare function that establishes the order | |
| 616 | * @param context (@c void*) additional context for the compare function | |
| 617 | * @retval zero success | |
| 618 | * @retval non-zero a re-allocation was necessary but failed | |
| 619 | */ | |
| 620 | #define cx_array_insert_sorted_array_ca(allocator, array, sorted_data, n, cmp_func, context) \ | |
| 621 | cx_array_insert_sorted_c_(allocator, (CxArray*)&(array), sizeof((array).data[0]), sorted_data, n, cmp_func, context, true) | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
622 | |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
623 | /** |
| 31 | 624 | * Inserts sorted data into a sorted array. |
| 625 | * | |
| 626 | * When the capacity is not enough to hold the new elements, a re-allocation is attempted. | |
| 627 | * | |
| 628 | * @attention if either array is not sorted according to the specified @p cmp_func, the behavior is undefined. | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
629 | * |
| 31 | 630 | * @param array the name of the array where the elements shall be inserted |
| 631 | * @param sorted_data (@c void*) a pointer to an array of sorted data that shall be inserted | |
| 632 | * @param n (@c size_t) the number of elements that shall be inserted | |
| 633 | * @param cmp_func (@c cx_compare_func2) the compare function that establishes the order | |
| 634 | * @param context (@c void*) additional context for the compare function | |
| 635 | * @retval zero success | |
| 636 | * @retval non-zero a re-allocation was necessary but failed | |
| 637 | */ | |
| 638 | #define cx_array_insert_sorted_array_c(array, sorted_data, n, cmp_func, context) \ | |
| 639 | cx_array_insert_sorted_array_ca(cxDefaultAllocator, array, sorted_data, n, cmp_func, context) | |
| 640 | ||
| 641 | /** | |
| 642 | * Inserts an element into a sorted array if it is not already contained. | |
| 643 | * | |
| 644 | * When the capacity is not enough to hold the new element, a re-allocation is attempted. | |
| 645 | * | |
| 646 | * @attention if the array is not sorted according to the specified @p cmp_func, the behavior is undefined. | |
| 647 | * | |
| 648 | * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation | |
| 649 | * @param array the name of the array where the elements shall be inserted | |
| 650 | * @param element the element that shall be inserted | |
| 651 | * @param cmp_func (@c cx_compare_func2) the compare function that establishes the order | |
| 652 | * @param context (@c void*) additional context for the compare function | |
| 16 | 653 | * @retval zero success |
| 31 | 654 | * @retval non-zero a re-allocation was necessary but failed |
| 655 | */ | |
| 656 | #define cx_array_insert_unique_ca(allocator, array, element, cmp_func, context) \ | |
| 657 | cx_array_insert_sorted_c_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (void*)&(element), 1, cmp_func, context, false) | |
| 658 | ||
| 659 | /** | |
| 660 | * Inserts an element into a sorted array if it is not already contained. | |
| 661 | * | |
| 662 | * When the capacity is not enough to hold the new element, a re-allocation is attempted. | |
| 663 | * | |
| 664 | * @attention if the array is not sorted according to the specified @p cmp_func, the behavior is undefined. | |
| 665 | * | |
| 666 | * @param array the name of the array where the elements shall be inserted | |
| 667 | * @param element the element that shall be inserted | |
| 668 | * @param cmp_func (@c cx_compare_func2) the compare function that establishes the order | |
| 669 | * @param context (@c void*) additional context for the compare function | |
| 670 | * @retval zero success | |
| 671 | * @retval non-zero a re-allocation was necessary but failed | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
672 | */ |
| 31 | 673 | #define cx_array_insert_unique_c(array, element, cmp_func, context) \ |
| 674 | cx_array_insert_unique_ca(cxDefaultAllocator, array, element, cmp_func, context) | |
| 675 | ||
| 676 | /** | |
| 677 | * Inserts sorted data into a sorted array, skipping duplicates. | |
| 678 | * | |
| 679 | * When the capacity is not enough to hold the new elements, a re-allocation is attempted. | |
| 680 | * | |
| 681 | * @attention if either array is not sorted according to the specified @p cmp_func, the behavior is undefined. | |
| 682 | * | |
| 683 | * @param allocator (@c CxAllocator*) the allocator to use for a possible reallocation | |
| 684 | * @param array the name of the array where the elements shall be inserted | |
| 685 | * @param sorted_data (@c void*) a pointer to an array of sorted data that shall be inserted | |
| 686 | * @param n (@c size_t) the number of elements that shall be inserted | |
| 687 | * @param cmp_func (@c cx_compare_func2) the compare function that establishes the order | |
| 688 | * @param context (@c void*) additional context for the compare function | |
| 689 | * @retval zero success | |
| 690 | * @retval non-zero a re-allocation was necessary but failed | |
| 691 | */ | |
| 692 | #define cx_array_insert_unique_array_ca(allocator, array, sorted_data, n, cmp_func, context) \ | |
| 693 | cx_array_insert_sorted_c_(allocator, (CxArray*)&(array), sizeof((array).data[0]), sorted_data, n, cmp_func, context, false) | |
| 694 | ||
| 695 | /** | |
| 696 | * Inserts sorted data into a sorted array, skipping duplicates. | |
| 697 | * | |
| 698 | * When the capacity is not enough to hold the new elements, a re-allocation is attempted. | |
| 699 | * | |
| 700 | * @attention if either array is not sorted according to the specified @p cmp_func, the behavior is undefined. | |
| 701 | * | |
| 702 | * @param array the name of the array where the elements shall be inserted | |
| 703 | * @param sorted_data (@c void*) a pointer to an array of sorted data that shall be inserted | |
| 704 | * @param n (@c size_t) the number of elements that shall be inserted | |
| 705 | * @param cmp_func (@c cx_compare_func2) the compare function that establishes the order | |
| 706 | * @param context (@c void*) additional context for the compare function | |
| 707 | * @retval zero success | |
| 708 | * @retval non-zero a re-allocation was necessary but failed | |
| 709 | */ | |
| 710 | #define cx_array_insert_unique_array_c(array, sorted_data, n, cmp_func, context) \ | |
| 711 | cx_array_insert_unique_array_ca(cxDefaultAllocator, array, sorted_data, n, cmp_func, context) | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
712 | |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
713 | /** |
| 31 | 714 | * An alternative to qsort_r() when that is not available on your platform. |
| 715 | * | |
| 716 | * If it is available, qsort_r() is used directly. | |
| 717 | * | |
| 718 | * @param array the array that shall be sorted | |
| 719 | * @param nmemb the number of elements in the array | |
| 720 | * @param size the size of one element | |
| 721 | * @param fn the compare function | |
| 722 | * @param context the context for the compare function | |
| 723 | */ | |
| 724 | CX_EXPORT void cx_array_qsort_c(void *array, size_t nmemb, size_t size, | |
| 725 | cx_compare_func2 fn, void *context); | |
| 726 | ||
| 727 | /** | |
| 728 | * Sorts an array. | |
| 729 | * | |
| 730 | * Internal function - do not use. | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
731 | * |
| 31 | 732 | * @param array a pointer to the array structure |
| 733 | * @param elem_size the size of one element | |
| 734 | * @param fn the compare function | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
735 | */ |
| 31 | 736 | CX_EXPORT void cx_array_sort_(CxArray *array, size_t elem_size, |
| 737 | cx_compare_func fn); | |
| 738 | ||
| 739 | /** | |
| 740 | * Sorts an array. | |
| 741 | * | |
| 742 | * Internal function - do not use. | |
| 743 | * | |
| 744 | * @param array a pointer to the array structure | |
| 745 | * @param elem_size the size of one element | |
| 746 | * @param fn the compare function | |
| 747 | * @param context the context for the compare function | |
| 748 | */ | |
| 749 | CX_EXPORT void cx_array_sort_c_(CxArray *array, size_t elem_size, | |
| 750 | cx_compare_func2 fn, void *context); | |
| 751 | ||
| 752 | /** | |
| 753 | * Sorts an array. | |
| 754 | * | |
| 755 | * @param array the name of the array | |
| 756 | * @param fn (@c cx_compare_func) the compare function | |
| 757 | * @param context (@c void*) the context for the compare function | |
| 758 | */ | |
| 759 | #define cx_array_sort(array, fn) \ | |
| 760 | cx_array_sort_((CxArray*)&(array), sizeof((array).data[0]), fn) | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
761 | |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
762 | /** |
| 31 | 763 | * Sorts an array. |
| 764 | * | |
| 765 | * @param array the name of the array | |
| 766 | * @param fn (@c cx_compare_func2) the compare function | |
| 767 | * @param context (@c void*) the context for the compare function | |
| 768 | */ | |
| 769 | #define cx_array_sort_c(array, fn, context) \ | |
| 770 | cx_array_sort_c_((CxArray*)&(array), sizeof((array).data[0]), fn, context) | |
| 771 | ||
| 772 | /** | |
| 773 | * Creates an iterator over the elements of an array. | |
| 774 | * | |
| 775 | * Internal function - do not use. | |
| 776 | * | |
| 777 | * @param array a pointer to the array structure | |
| 778 | * @param elem_size the size of one element | |
| 779 | * @return an iterator over the elements | |
| 780 | */ | |
| 781 | cx_attr_nodiscard cx_attr_nonnull | |
| 782 | CX_EXPORT CxIterator cx_array_iterator_(CxArray *array, size_t elem_size); | |
| 783 | ||
| 784 | /** | |
| 785 | * Creates an iterator over the elements of an array. | |
| 786 | * | |
| 787 | * The iterator will yield pointers to the elements. | |
| 788 | * | |
| 789 | * This iterator cannot be used to remove elements | |
| 790 | * because it does not get a modifiable reference to the array's size. | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
791 | * |
| 31 | 792 | * @param array the name of the array |
| 793 | * @return an iterator over the elements | |
| 794 | * @see cx_array_iterator_ptr() | |
| 795 | */ | |
| 796 | #define cx_array_iterator(array) \ | |
| 797 | cx_array_iterator_((CxArray*)&(array), sizeof((array).data[0])) | |
| 798 | ||
| 799 | /** | |
| 800 | * Creates an iterator over the elements of an array containing pointers. | |
| 801 | * | |
| 802 | * Internal function - do not use. | |
| 803 | * | |
| 804 | * @param array the name of the array | |
| 805 | * @return an iterator over the elements | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
806 | */ |
| 31 | 807 | cx_attr_nodiscard cx_attr_nonnull |
| 808 | CX_EXPORT CxIterator cx_array_iterator_ptr_(CxArray *array); | |
| 809 | ||
| 810 | /** | |
| 811 | * Creates an iterator over the elements of an array containing pointers. | |
| 812 | * | |
| 813 | * The iterator will yield the elements themselves, which are supposed to | |
| 814 | * be pointers. | |
| 815 | * | |
| 816 | * This iterator cannot be used to remove elements | |
| 817 | * because it does not get a modifiable reference to the array's size. | |
| 818 | * | |
| 819 | * @param array the name of the array | |
| 820 | * @return an iterator over the elements | |
| 821 | * @see cx_array_iterator() | |
| 822 | */ | |
| 823 | #define cx_array_iterator_ptr(array) \ | |
| 824 | cx_array_iterator_ptr_((CxArray*)&(array)) | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
825 | |
| 22 | 826 | |
| 827 | /** | |
| 31 | 828 | * Removes elements from the array. |
| 22 | 829 | * |
| 31 | 830 | * Internal function - do not use. |
| 22 | 831 | * |
| 31 | 832 | * @param array a pointer to the array structure |
| 22 | 833 | * @param elem_size the size of one element |
| 31 | 834 | * @param index the index of the first element to remove |
| 835 | * @param n the number of elements to remove | |
| 836 | * @param fast indicates whether tail elements should be copied into the gap | |
| 22 | 837 | */ |
| 31 | 838 | cx_attr_nonnull |
| 839 | CX_EXPORT void cx_array_remove_(CxArray *array, size_t elem_size, size_t index, size_t n, bool fast); | |
| 22 | 840 | |
| 841 | /** | |
| 31 | 842 | * Removes one element from the array. |
| 22 | 843 | * |
| 31 | 844 | * Tail elements are all moved by one. If you don't need a stable order |
| 845 | * in the array, consider using cx_array_remove_fast(). | |
| 22 | 846 | * |
| 31 | 847 | * If the index is out of bounds, this function does nothing. |
| 22 | 848 | * |
| 31 | 849 | * @param array the name of the array |
| 850 | * @param index (@c size_t) the index of the element to remove | |
| 851 | * @see cx_array_remove_fast() | |
| 22 | 852 | */ |
| 31 | 853 | #define cx_array_remove(array, index) \ |
| 854 | cx_array_remove_((CxArray*)&(array), sizeof((array).data[0]), index, 1, false) | |
| 855 | ||
| 856 | /** | |
| 857 | * Removes one element from the array. | |
| 858 | * | |
| 859 | * The gap will be filled with a copy of the last element in the array. | |
| 860 | * This changes the order of elements. If you want a stable order, | |
| 861 | * use cx_array_remove() instead. | |
| 862 | * | |
| 863 | * If the index is out of bounds, this function does nothing. | |
| 864 | * | |
| 865 | * @param array the name of the array | |
| 866 | * @param index (@c size_t) the index of the element to remove | |
| 867 | * @see cx_array_remove() | |
| 868 | */ | |
| 869 | #define cx_array_remove_fast(array, index) \ | |
| 870 | cx_array_remove_((CxArray*)&(array), sizeof((array).data[0]), index, 1, true) | |
| 22 | 871 | |
| 872 | /** | |
| 31 | 873 | * Removes multiple elements from the array. |
| 874 | * | |
| 875 | * Tail elements are all moved to close the gap. If you don't need a stable | |
| 876 | * order in the array, consider using cx_array_remove_array_fast(). | |
| 22 | 877 | * |
| 31 | 878 | * If the index is out of bounds, this function does nothing. |
| 879 | * If @n overflows the array, this function removes as many elements as it can. | |
| 880 | * | |
| 881 | * @param array the name of the array | |
| 882 | * @param index (@c size_t) the index of the first element to remove | |
| 883 | * @param n (@c size_t) the number of elements to remove | |
| 884 | * @see cx_array_remove_array_fast() | |
| 22 | 885 | */ |
| 31 | 886 | #define cx_array_remove_array(array, index, n) \ |
| 887 | cx_array_remove_((CxArray*)&(array), sizeof((array).data[0]), index, n, false) | |
| 22 | 888 | |
| 889 | /** | |
| 31 | 890 | * Removes multiple elements from the array. |
| 891 | * | |
| 892 | * Tail elements are copied into the gap. If you have more tail elements | |
| 893 | * than the number of elements that are removed, this will change the order | |
| 894 | * of elements. If you want a stable order, use cx_array_remove_array() instead. | |
| 22 | 895 | * |
| 31 | 896 | * If the index is out of bounds, this function does nothing. |
| 897 | * If @n overflows the array, this function removes as many elements as it can. | |
| 898 | * | |
| 899 | * @param array the name of the array | |
| 900 | * @param index (@c size_t) the index of the first element to remove | |
| 901 | * @param n (@c size_t) the number of elements to remove | |
| 902 | * @see cx_array_remove_array() | |
| 22 | 903 | */ |
| 31 | 904 | #define cx_array_remove_array_fast(array, index, n) \ |
| 905 | cx_array_remove_((CxArray*)&(array), sizeof((array).data[0]), index, n, true) | |
| 22 | 906 | |
| 907 | /** | |
| 31 | 908 | * Deallocates an array. |
| 909 | * | |
| 910 | * Internal function - do not use. | |
| 911 | * | |
| 912 | * @param allocator (@c CxAllocator*) the allocator which was used to allocate the array | |
| 913 | * @param array a pointer to the array structure | |
| 914 | */ | |
| 915 | cx_attr_nonnull | |
| 916 | CX_EXPORT void cx_array_free_(const CxAllocator *allocator, CxArray *array); | |
| 917 | ||
| 918 | /** | |
| 919 | * Deallocates an array. | |
| 920 | * | |
| 921 | * The structure is reset to zero and can be re-initialized with | |
| 922 | * cx_array_inita(). | |
| 22 | 923 | * |
| 31 | 924 | * @param array the name of the array |
| 22 | 925 | */ |
| 31 | 926 | #define cx_array_free(array) cx_array_free_(cxDefaultAllocator, (CxArray*)&(array)) |
| 927 | ||
| 928 | /** | |
| 929 | * Deallocates an array. | |
| 930 | * | |
| 931 | * The structure is reset to zero and can be re-initialized with | |
| 932 | * cx_array_init_a(). | |
| 933 | * | |
| 934 | * @param allocator (@c CxAllocator*) the allocator which was used to allocate the array | |
| 935 | * @param array the name of the array | |
| 936 | */ | |
| 937 | #define cx_array_free_a(allocator, array) cx_array_free_(allocator, (CxArray*)&(array)) | |
| 938 | ||
| 22 | 939 | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
940 | /** |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
941 | * Searches the largest lower bound in a sorted array. |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
942 | * |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
943 | * In other words, this function returns the index of the largest element |
| 16 | 944 | * in @p arr that is less or equal to @p elem with respect to @p cmp_func. |
| 945 | * When no such element exists, @p size is returned. | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
946 | * |
| 23 | 947 | * When such an element exists more than once, the largest index of all those |
| 948 | * elements is returned. | |
| 949 | * | |
| 16 | 950 | * If @p elem is contained in the array, this is identical to |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
951 | * #cx_array_binary_search(). |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
952 | * |
| 16 | 953 | * If the array is not sorted with respect to the @p cmp_func, the behavior |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
954 | * is undefined. |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
955 | * |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
956 | * @param arr the array to search |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
957 | * @param size the size of the array |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
958 | * @param elem_size the size of one element |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
959 | * @param elem the element to find |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
960 | * @param cmp_func the compare function |
| 16 | 961 | * @return the index of the largest lower bound, or @p size |
| 962 | * @see cx_array_binary_search_sup() | |
| 963 | * @see cx_array_binary_search() | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
964 | */ |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
965 | cx_attr_nonnull |
| 22 | 966 | CX_EXPORT size_t cx_array_binary_search_inf(const void *arr, size_t size, |
| 967 | size_t elem_size, const void *elem, cx_compare_func cmp_func); | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
968 | |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
969 | /** |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
970 | * Searches an item in a sorted array. |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
971 | * |
| 23 | 972 | * When such an element exists more than once, the largest index of all those |
| 973 | * elements is returned. | |
| 974 | * | |
| 16 | 975 | * If the array is not sorted with respect to the @p cmp_func, the behavior |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
976 | * is undefined. |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
977 | * |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
978 | * @param arr the array to search |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
979 | * @param size the size of the array |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
980 | * @param elem_size the size of one element |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
981 | * @param elem the element to find |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
982 | * @param cmp_func the compare function |
| 16 | 983 | * @return the index of the element in the array, or @p size if the element |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
984 | * cannot be found |
| 16 | 985 | * @see cx_array_binary_search_inf() |
| 986 | * @see cx_array_binary_search_sup() | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
987 | */ |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
988 | cx_attr_nonnull |
| 22 | 989 | CX_EXPORT size_t cx_array_binary_search(const void *arr, size_t size, |
| 990 | size_t elem_size, const void *elem, cx_compare_func cmp_func); | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
991 | |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
992 | /** |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
993 | * Searches the smallest upper bound in a sorted array. |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
994 | * |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
995 | * In other words, this function returns the index of the smallest element |
| 16 | 996 | * in @p arr that is greater or equal to @p elem with respect to @p cmp_func. |
| 997 | * When no such element exists, @p size is returned. | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
998 | * |
| 23 | 999 | * When such an element exists more than once, the smallest index of all those |
| 1000 | * elements is returned. | |
| 1001 | * | |
| 16 | 1002 | * If @p elem is contained in the array, this is identical to |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
1003 | * #cx_array_binary_search(). |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
1004 | * |
| 16 | 1005 | * If the array is not sorted with respect to the @p cmp_func, the behavior |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
1006 | * is undefined. |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
1007 | * |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
1008 | * @param arr the array to search |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
1009 | * @param size the size of the array |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
1010 | * @param elem_size the size of one element |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
1011 | * @param elem the element to find |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
1012 | * @param cmp_func the compare function |
| 16 | 1013 | * @return the index of the smallest upper bound, or @p size |
| 1014 | * @see cx_array_binary_search_inf() | |
| 1015 | * @see cx_array_binary_search() | |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
1016 | */ |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
1017 | cx_attr_nonnull |
| 22 | 1018 | CX_EXPORT size_t cx_array_binary_search_sup(const void *arr, size_t size, |
| 1019 | size_t elem_size, const void *elem, cx_compare_func cmp_func); | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1020 | |
| 31 | 1021 | |
| 1022 | /** | |
| 1023 | * Searches the largest lower bound in a sorted array. | |
| 1024 | * | |
| 1025 | * In other words, this function returns the index of the largest element | |
| 1026 | * in @p arr that is less or equal to @p elem with respect to @p cmp_func. | |
| 1027 | * When no such element exists, @p size is returned. | |
| 1028 | * | |
| 1029 | * When such an element exists more than once, the largest index of all those | |
| 1030 | * elements is returned. | |
| 1031 | * | |
| 1032 | * If @p elem is contained in the array, this is identical to | |
| 1033 | * #cx_array_binary_search(). | |
| 1034 | * | |
| 1035 | * If the array is not sorted with respect to the @p cmp_func, the behavior | |
| 1036 | * is undefined. | |
| 1037 | * | |
| 1038 | * @param arr the array to search | |
| 1039 | * @param size the size of the array | |
| 1040 | * @param elem_size the size of one element | |
| 1041 | * @param elem the element to find | |
| 1042 | * @param cmp_func the compare function | |
| 1043 | * @param context the context for the compare function | |
| 1044 | * @return the index of the largest lower bound, or @p size | |
| 1045 | * @see cx_array_binary_search_sup() | |
| 1046 | * @see cx_array_binary_search() | |
| 1047 | */ | |
| 1048 | cx_attr_nonnull | |
| 1049 | CX_EXPORT size_t cx_array_binary_search_inf_c(const void *arr, size_t size, | |
| 1050 | size_t elem_size, const void *elem, cx_compare_func2 cmp_func, void *context); | |
| 1051 | ||
| 1052 | /** | |
| 1053 | * Searches an item in a sorted array. | |
| 1054 | * | |
| 1055 | * When such an element exists more than once, the largest index of all those | |
| 1056 | * elements is returned. | |
| 1057 | * | |
| 1058 | * If the array is not sorted with respect to the @p cmp_func, the behavior | |
| 1059 | * is undefined. | |
| 1060 | * | |
| 1061 | * @param arr the array to search | |
| 1062 | * @param size the size of the array | |
| 1063 | * @param elem_size the size of one element | |
| 1064 | * @param elem the element to find | |
| 1065 | * @param cmp_func the compare function | |
| 1066 | * @param context the context for the compare function | |
| 1067 | * @return the index of the element in the array, or @p size if the element | |
| 1068 | * cannot be found | |
| 1069 | * @see cx_array_binary_search_inf() | |
| 1070 | * @see cx_array_binary_search_sup() | |
| 1071 | */ | |
| 1072 | cx_attr_nonnull | |
| 1073 | CX_EXPORT size_t cx_array_binary_search_c(const void *arr, size_t size, | |
| 1074 | size_t elem_size, const void *elem, cx_compare_func2 cmp_func, void *context); | |
| 1075 | ||
| 1076 | /** | |
| 1077 | * Searches the smallest upper bound in a sorted array. | |
| 1078 | * | |
| 1079 | * In other words, this function returns the index of the smallest element | |
| 1080 | * in @p arr that is greater or equal to @p elem with respect to @p cmp_func. | |
| 1081 | * When no such element exists, @p size is returned. | |
| 1082 | * | |
| 1083 | * When such an element exists more than once, the smallest index of all those | |
| 1084 | * elements is returned. | |
| 1085 | * | |
| 1086 | * If @p elem is contained in the array, this is identical to | |
| 1087 | * #cx_array_binary_search(). | |
| 1088 | * | |
| 1089 | * If the array is not sorted with respect to the @p cmp_func, the behavior | |
| 1090 | * is undefined. | |
| 1091 | * | |
| 1092 | * @param arr the array to search | |
| 1093 | * @param size the size of the array | |
| 1094 | * @param elem_size the size of one element | |
| 1095 | * @param elem the element to find | |
| 1096 | * @param cmp_func the compare function | |
| 1097 | * @param context the context for the compare function | |
| 1098 | * @return the index of the smallest upper bound, or @p size | |
| 1099 | * @see cx_array_binary_search_inf() | |
| 1100 | * @see cx_array_binary_search() | |
| 1101 | */ | |
| 1102 | cx_attr_nonnull | |
| 1103 | CX_EXPORT size_t cx_array_binary_search_sup_c(const void *arr, size_t size, | |
| 1104 | size_t elem_size, const void *elem, cx_compare_func2 cmp_func, void *context); | |
| 1105 | ||
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1106 | /** |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1107 | * Swaps two array elements. |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1108 | * |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1109 | * @param arr the array |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1110 | * @param elem_size the element size |
| 22 | 1111 | * @param idx1 index of the first element |
| 1112 | * @param idx2 index of the second element | |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1113 | */ |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
1114 | cx_attr_nonnull |
| 22 | 1115 | CX_EXPORT void cx_array_swap(void *arr, size_t elem_size, size_t idx1, size_t idx2); |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1116 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1117 | /** |
| 16 | 1118 | * Allocates an array list for storing elements with @p elem_size bytes each. |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1119 | * |
| 16 | 1120 | * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of |
| 22 | 1121 | * copies of the added elements, and the compare function will be automatically set |
| 31 | 1122 | * to cx_cmp_ptr(). |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1123 | * |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1124 | * @param allocator the allocator for allocating the list memory |
| 21 | 1125 | * (if @c NULL, the cxDefaultAllocator will be used) |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1126 | * @param elem_size the size of each element in bytes |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1127 | * @param initial_capacity the initial number of elements the array can store |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1128 | * @return the created list |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1129 | */ |
|
11
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
1130 | cx_attr_nodiscard |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
1131 | cx_attr_malloc |
|
0aa8cbd7912e
refactor dbuObjectExecuteQuery: replace multiple lists with a single ll list
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
1132 | cx_attr_dealloc(cxListFree, 1) |
| 22 | 1133 | CX_EXPORT CxList *cxArrayListCreate(const CxAllocator *allocator, |
| 31 | 1134 | size_t elem_size, size_t initial_capacity); |
|
0
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1135 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1136 | #ifdef __cplusplus |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1137 | } // extern "C" |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1138 | #endif |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1139 | |
|
1a157da63d7c
add API for registering types and simple SQLite proof of concept
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1140 | #endif // UCX_ARRAY_LIST_H |