src/cx/linked_list.h

changeset 1180
4c3a69b9723a
parent 1162
e3bb67b72d33
--- a/src/cx/linked_list.h	Mon Feb 10 21:30:51 2025 +0100
+++ b/src/cx/linked_list.h	Mon Feb 10 20:59:02 2025 +0100
@@ -61,6 +61,7 @@
 cx_attr_nodiscard
 cx_attr_malloc
 cx_attr_dealloc(cxListFree, 1)
+cx_attr_export
 CxList *cxLinkedListCreate(
         const CxAllocator *allocator,
         cx_compare_func comparator,
@@ -103,6 +104,7 @@
  */
 cx_attr_nonnull
 cx_attr_nodiscard
+cx_attr_export
 void *cx_linked_list_at(
         const void *start,
         size_t start_index,
@@ -123,6 +125,7 @@
  * @return the index of the element, if found - unspecified if not found
  */
 cx_attr_nonnull_arg(1, 4, 5)
+cx_attr_export
 void *cx_linked_list_find(
         const void *start,
         ptrdiff_t loc_advance,
@@ -145,6 +148,7 @@
  */
 cx_attr_nonnull
 cx_attr_returns_nonnull
+cx_attr_export
 void *cx_linked_list_first(
         const void *node,
         ptrdiff_t loc_prev
@@ -163,6 +167,7 @@
  */
 cx_attr_nonnull
 cx_attr_returns_nonnull
+cx_attr_export
 void *cx_linked_list_last(
         const void *node,
         ptrdiff_t loc_next
@@ -179,6 +184,7 @@
  * @return the node or @c NULL if @p node has no predecessor
  */
 cx_attr_nonnull
+cx_attr_export
 void *cx_linked_list_prev(
         const void *begin,
         ptrdiff_t loc_next,
@@ -198,6 +204,7 @@
  * @param new_node a pointer to the node that shall be appended
  */
 cx_attr_nonnull_arg(5)
+cx_attr_export
 void cx_linked_list_add(
         void **begin,
         void **end,
@@ -219,6 +226,7 @@
  * @param new_node a pointer to the node that shall be prepended
  */
 cx_attr_nonnull_arg(5)
+cx_attr_export
 void cx_linked_list_prepend(
         void **begin,
         void **end,
@@ -236,6 +244,7 @@
  * @param loc_next the location of a @c next pointer within your node struct (required)
  */
 cx_attr_nonnull
+cx_attr_export
 void cx_linked_list_link(
         void *left,
         void *right,
@@ -254,6 +263,7 @@
  * @param loc_next the location of a @c next pointer within your node struct (required)
  */
 cx_attr_nonnull
+cx_attr_export
 void cx_linked_list_unlink(
         void *left,
         void *right,
@@ -276,6 +286,7 @@
  * @param new_node a pointer to the node that shall be inserted
  */
 cx_attr_nonnull_arg(6)
+cx_attr_export
 void cx_linked_list_insert(
         void **begin,
         void **end,
@@ -306,6 +317,7 @@
  * @param insert_end a pointer to the last node of the chain (or NULL if the last node shall be determined)
  */
 cx_attr_nonnull_arg(6)
+cx_attr_export
 void cx_linked_list_insert_chain(
         void **begin,
         void **end,
@@ -331,6 +343,7 @@
  * @param cmp_func a compare function that will receive the node pointers
  */
 cx_attr_nonnull_arg(1, 5, 6)
+cx_attr_export
 void cx_linked_list_insert_sorted(
         void **begin,
         void **end,
@@ -360,6 +373,7 @@
  * @param cmp_func a compare function that will receive the node pointers
  */
 cx_attr_nonnull_arg(1, 5, 6)
+cx_attr_export
 void cx_linked_list_insert_sorted_chain(
         void **begin,
         void **end,
@@ -391,6 +405,7 @@
  * @return the actual number of nodes that were removed (can be less when the list did not have enough nodes)
  */
 cx_attr_nonnull_arg(5)
+cx_attr_export
 size_t cx_linked_list_remove_chain(
         void **begin,
         void **end,
@@ -437,6 +452,8 @@
  * @param loc_next the location of the @c next pointer within the node struct
  * @return the size of the list or zero if @p node is @c NULL
  */
+cx_attr_nodiscard
+cx_attr_export
 size_t cx_linked_list_size(
         const void *node,
         ptrdiff_t loc_next
@@ -465,6 +482,7 @@
  * @param cmp_func the compare function defining the sort order
  */
 cx_attr_nonnull_arg(1, 6)
+cx_attr_export
 void cx_linked_list_sort(
         void **begin,
         void **end,
@@ -489,6 +507,7 @@
  * right list, positive if the left list is larger than the right list, zero if both lists are equal.
  */
 cx_attr_nonnull_arg(5)
+cx_attr_export
 int cx_linked_list_compare(
         const void *begin_left,
         const void *begin_right,
@@ -506,6 +525,7 @@
  * @param loc_next the location of a @c next pointer within your node struct (required)
  */
 cx_attr_nonnull_arg(1)
+cx_attr_export
 void cx_linked_list_reverse(
         void **begin,
         void **end,

mercurial