39#ifndef UCX_ARRAY_LIST_H
40#define UCX_ARRAY_LIST_H
95 CX_ARRAY_COPY_SUCCESS,
96 CX_ARRAY_COPY_REALLOC_NOT_SUPPORTED,
97 CX_ARRAY_COPY_REALLOC_FAILED,
170 size_t initial_capacity
187#define cxArrayListCreateSimple(item_size, initial_capacity) \
188 cxArrayListCreate(NULL, NULL, item_size, initial_capacity)
CxList * cxArrayListCreate(CxAllocator const *allocator, cx_compare_func comparator, size_t item_size, size_t initial_capacity)
Allocates an array list for storing elements with item_size bytes each.
cx_array_copy_result
Return codes for cx_array_copy().
Definition: array_list.h:94
enum cx_array_copy_result cx_array_copy(void **target, size_t *size, size_t *capacity, size_t index, void const *src, size_t elem_size, size_t elem_count, struct cx_array_reallocator_s *reallocator)
Copies elements from one array to another.
void cx_array_swap(void *arr, size_t elem_size, size_t idx1, size_t idx2)
Swaps two array elements.
int(* cx_compare_func)(void const *left, void const *right)
A comparator function comparing two collection elements.
Definition: collection.h:55
#define __attribute__(x)
Removes GNU C attributes where they are not supported.
Definition: common.h:127
Interface for list implementations.
Structure holding the data for an allocator.
Definition: allocator.h:86
Defines a reallocation mechanism for arrays.
Definition: array_list.h:51
void * ptr1
Custom data pointer.
Definition: array_list.h:76
size_t int1
Custom data integer.
Definition: array_list.h:84
size_t int2
Custom data integer.
Definition: array_list.h:88
void * ptr2
Custom data pointer.
Definition: array_list.h:80
Structure for holding the base data of a list.
Definition: list.h:55