src/linked_list.c

changeset 1624
aab23807d562
parent 1618
ef7cab6eb131
--- a/src/linked_list.c	Thu Dec 18 16:43:05 2025 +0100
+++ b/src/linked_list.c	Thu Dec 18 16:44:11 2025 +0100
@@ -254,19 +254,6 @@
     }
 }
 
-void cx_linked_list_insert_sorted(
-        void **begin,
-        void **end,
-        ptrdiff_t loc_prev,
-        ptrdiff_t loc_next,
-        void *new_node,
-        cx_compare_func cmp_func
-) {
-    assert(ll_next(new_node) == NULL);
-    cx_linked_list_insert_sorted_chain(
-            begin, end, loc_prev, loc_next, new_node, cmp_func);
-}
-
 static void *cx_linked_list_insert_sorted_chain_impl(
         void **begin,
         void **end,
@@ -409,6 +396,19 @@
     return dup_begin;
 }
 
+void cx_linked_list_insert_sorted(
+        void **begin,
+        void **end,
+        ptrdiff_t loc_prev,
+        ptrdiff_t loc_next,
+        void *new_node,
+        cx_compare_func cmp_func
+) {
+    assert(ll_next(new_node) == NULL);
+    cx_linked_list_insert_sorted_chain(
+            begin, end, loc_prev, loc_next, new_node, cmp_func);
+}
+
 void cx_linked_list_insert_sorted_chain(
         void **begin,
         void **end,
@@ -450,6 +450,62 @@
             insert_begin, cx_acmp_wrap, &wrapper, false);
 }
 
+void cx_linked_list_insert_sorted_c(
+        void **begin,
+        void **end,
+        ptrdiff_t loc_prev,
+        ptrdiff_t loc_next,
+        void *new_node,
+        cx_compare_func2 cmp_func,
+        void *context
+) {
+    assert(ll_next(new_node) == NULL);
+    cx_linked_list_insert_sorted_chain_c(
+            begin, end, loc_prev, loc_next, new_node, cmp_func, context);
+}
+
+void cx_linked_list_insert_sorted_chain_c(
+        void **begin,
+        void **end,
+        ptrdiff_t loc_prev,
+        ptrdiff_t loc_next,
+        void *insert_begin,
+        cx_compare_func2 cmp_func,
+        void *context
+) {
+    cx_linked_list_insert_sorted_chain_impl(
+            begin, end, loc_prev, loc_next,
+            insert_begin, cmp_func, context, true);
+}
+
+int cx_linked_list_insert_unique_c(
+        void **begin,
+        void **end,
+        ptrdiff_t loc_prev,
+        ptrdiff_t loc_next,
+        void *new_node,
+        cx_compare_func2 cmp_func,
+        void *context
+) {
+    assert(ll_next(new_node) == NULL);
+    return NULL != cx_linked_list_insert_unique_chain_c(
+            begin, end, loc_prev, loc_next, new_node, cmp_func, context);
+}
+
+void *cx_linked_list_insert_unique_chain_c(
+        void **begin,
+        void **end,
+        ptrdiff_t loc_prev,
+        ptrdiff_t loc_next,
+        void *insert_begin,
+        cx_compare_func2 cmp_func,
+        void *context
+) {
+    return cx_linked_list_insert_sorted_chain_impl(
+            begin, end, loc_prev, loc_next,
+            insert_begin, cmp_func, context, false);
+}
+
 size_t cx_linked_list_remove_chain(
         void **begin,
         void **end,

mercurial