150 |
150 |
151 /** |
151 /** |
152 * Allocates an array list for storing elements with \p item_size bytes each. |
152 * Allocates an array list for storing elements with \p item_size bytes each. |
153 * |
153 * |
154 * If \p item_size is CX_STORE_POINTERS, the created list will be created as if |
154 * If \p item_size is CX_STORE_POINTERS, the created list will be created as if |
155 * cxListStorePointers() was called immediately after creation. |
155 * cxListStorePointers() was called immediately after creation and the compare |
|
156 * function will be automatically set to cx_cmp_ptr(), if none is given. |
156 * |
157 * |
157 * @param allocator the allocator for allocating the list memory |
158 * @param allocator the allocator for allocating the list memory |
158 * (if \c NULL the cxDefaultAllocator will be used) |
159 * (if \c NULL the cxDefaultAllocator will be used) |
159 * @param comparator the comparator for the elements |
160 * @param comparator the comparator for the elements |
160 * (if \c NULL sort and find functions will not work) |
161 * (if \c NULL, and the list is not storing pointers, sort and find |
|
162 * functions will not work) |
161 * @param item_size the size of each element in bytes |
163 * @param item_size the size of each element in bytes |
162 * @param initial_capacity the initial number of elements the array can store |
164 * @param initial_capacity the initial number of elements the array can store |
163 * @return the created list |
165 * @return the created list |
164 */ |
166 */ |
165 CxList *cxArrayListCreate( |
167 CxList *cxArrayListCreate( |
175 * The list will use the cxDefaultAllocator and \em NO compare function. |
177 * The list will use the cxDefaultAllocator and \em NO compare function. |
176 * If you want to call functions that need a compare function, you have to |
178 * If you want to call functions that need a compare function, you have to |
177 * set it immediately after creation or use cxArrayListCreate(). |
179 * set it immediately after creation or use cxArrayListCreate(). |
178 * |
180 * |
179 * If \p item_size is CX_STORE_POINTERS, the created list will be created as if |
181 * If \p item_size is CX_STORE_POINTERS, the created list will be created as if |
180 * cxListStorePointers() was called immediately after creation. |
182 * cxListStorePointers() was called immediately after creation and the compare |
|
183 * function will be automatically set to cx_cmp_ptr(). |
181 * |
184 * |
182 * @param item_size the size of each element in bytes |
185 * @param item_size the size of each element in bytes |
183 * @param initial_capacity the initial number of elements the array can store |
186 * @param initial_capacity the initial number of elements the array can store |
184 * @return the created list |
187 * @return the created list |
185 */ |
188 */ |