149#define cxKvListSetKey(list, index, key) cx_kv_list_set_key(list, index, CX_HASH_KEY(key))
162#define cxKvListInsert(list, index, key, value) cx_kv_list_insert(list, index, CX_HASH_KEY(key), value)
198#define cxKvListAdd(list, key, value) cxKvListInsert(list, (list)->collection.size, key, value)
struct cx_allocator_s CxAllocator
High-Level type alias for the allocator type.
Definition allocator.h:80
Common definitions and feature checks.
#define CX_MALLOC
The attributed function always returns freshly allocated memory.
Definition common.h:156
#define CX_DEALLOC(...)
Not supported in clang.
Definition common.h:172
#define CX_NONNULL
All pointer arguments must be non-NULL.
Definition common.h:141
#define CX_NODISCARD
Warn about discarded return value.
Definition common.h:256
#define CX_RETURNS_NONNULL
The returned value is guaranteed to be non-NULL.
Definition common.h:151
#define CX_EXTERN
Declares a function with external linkage.
Definition common.h:297
struct cx_hash_key_s CxHashKey
Type for a hash key.
Definition hash_key.h:61
int cx_kv_list_insert(CxList *list, size_t index, CxHashKey key, void *value)
Inserts an item into the list at the specified index and associates it with the specified key.
CxList * cxKvListCreate(const CxAllocator *allocator, size_t elem_size)
Allocates a linked list with a lookup-map for storing elements with elem_size bytes each.
int cxKvListRemoveKey(CxList *list, size_t index)
Removes the key of a list item.
const CxHashKey * cxKvListGetKey(CxList *list, size_t index)
Returns the key of a list item.
CxMap * cxKvListCreateAsMap(const CxAllocator *allocator, size_t elem_size)
Allocates a linked list with a lookup-map for storing elements with elem_size bytes each.
CxList * cxKvListAsList(CxMap *map)
Converts a map pointer belonging to a key-value-List back to the original list pointer.
int cx_kv_list_set_key(CxList *list, size_t index, CxHashKey key)
Sets or updates the key of a list item.
CxMap * cxKvListAsMap(CxList *list)
Converts a map pointer belonging to a key-value-List back to the original list pointer.
Interface for list implementations.
struct cx_list_s CxList
Common type for all list implementations.
Definition list.h:179
void cxListFree(CxList *list)
Deallocates the memory of the specified list structure.
Interface for map implementations.
void cxMapFree(CxMap *map)
Deallocates the memory of the specified map.
struct cx_map_s CxMap
Type for the UCX map.
Definition map.h:50