ucx/cx/array_list.h

changeset 102
64ded9f6a6c6
parent 101
7b3a3130be44
--- a/ucx/cx/array_list.h	Mon Jan 06 22:22:55 2025 +0100
+++ b/ucx/cx/array_list.h	Tue Feb 25 21:11:00 2025 +0100
@@ -47,6 +47,7 @@
  * The maximum item size in an array list that fits into stack buffer
  * when swapped.
  */
+cx_attr_export
 extern const unsigned cx_array_swap_sbo_size;
 
 /**
@@ -218,6 +219,7 @@
 /**
  * A default stdlib-based array reallocator.
  */
+cx_attr_export
 extern CxArrayReallocator *cx_array_default_reallocator;
 
 /**
@@ -238,6 +240,7 @@
  * on the stack or shall not reallocated in place
  * @return an array reallocator
  */
+cx_attr_export
 CxArrayReallocator cx_array_reallocator(
         const struct cx_allocator_s *allocator,
         const void *stackmem
@@ -274,6 +277,7 @@
  * @see cx_array_reallocator()
  */
 cx_attr_nonnull_arg(1, 2, 3)
+cx_attr_export
 int cx_array_reserve(
         void **array,
         void *size,
@@ -317,6 +321,7 @@
  * @see cx_array_reallocator()
  */
 cx_attr_nonnull_arg(1, 2, 3, 6)
+cx_attr_export
 int cx_array_copy(
         void **target,
         void *size,
@@ -475,6 +480,7 @@
  * @retval non-zero failure
  */
 cx_attr_nonnull_arg(1, 2, 3, 5)
+cx_attr_export
 int cx_array_insert_sorted(
         void **target,
         size_t *size,
@@ -601,6 +607,7 @@
  * @see cx_array_binary_search()
  */
 cx_attr_nonnull
+cx_attr_export
 size_t cx_array_binary_search_inf(
         const void *arr,
         size_t size,
@@ -626,6 +633,7 @@
  * @see cx_array_binary_search_sup()
  */
 cx_attr_nonnull
+cx_attr_export
 size_t cx_array_binary_search(
         const void *arr,
         size_t size,
@@ -657,6 +665,7 @@
  * @see cx_array_binary_search()
  */
 cx_attr_nonnull
+cx_attr_export
 size_t cx_array_binary_search_sup(
         const void *arr,
         size_t size,
@@ -674,6 +683,7 @@
  * @param idx2 index of second element
  */
 cx_attr_nonnull
+cx_attr_export
 void cx_array_swap(
         void *arr,
         size_t elem_size,
@@ -684,9 +694,9 @@
 /**
  * Allocates an array list for storing elements with @p elem_size bytes each.
  *
- * If @p elem_size is CX_STORE_POINTERS, the created list will be created as if
- * cxListStorePointers() was called immediately after creation and the compare
- * function will be automatically set to cx_cmp_ptr(), if none is given.
+ * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of
+ * copies of the added elements and the compare function will be automatically set
+ * to cx_cmp_ptr(), if none is given.
  *
  * @param allocator the allocator for allocating the list memory
  * (if @c NULL, a default stdlib allocator will be used)
@@ -700,6 +710,7 @@
 cx_attr_nodiscard
 cx_attr_malloc
 cx_attr_dealloc(cxListFree, 1)
+cx_attr_export
 CxList *cxArrayListCreate(
         const CxAllocator *allocator,
         cx_compare_func comparator,
@@ -714,9 +725,9 @@
  * If you want to call functions that need a compare function, you have to
  * set it immediately after creation or use cxArrayListCreate().
  *
- * If @p elem_size is CX_STORE_POINTERS, the created list will be created as if
- * cxListStorePointers() was called immediately after creation and the compare
- * function will be automatically set to cx_cmp_ptr().
+ * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of
+ * copies of the added elements and the compare function will be automatically set
+ * to cx_cmp_ptr(), if none is given.
  *
  * @param elem_size (@c size_t) the size of each element in bytes
  * @param initial_capacity (@c size_t) the initial number of elements the array can store

mercurial