ucx/cx/collection.h

changeset 943
9b5948aa5b90
parent 870
e167cf006213
--- a/ucx/cx/collection.h	Sun Nov 30 18:15:46 2025 +0100
+++ b/ucx/cx/collection.h	Sun Nov 30 18:17:49 2025 +0100
@@ -154,6 +154,14 @@
 #define cxCollectionSorted(c) ((c)->collection.sorted || (c)->collection.size == 0)
 
 /**
+ * Sets the compare function for a collection.
+ *
+ * @param c a pointer to a struct that contains #CX_COLLECTION_BASE
+ * @param func (@c cx_compare_func) the compare function that shall be used by @c c
+ */
+#define cxCollectionCompareFunc(c, func) (c)->collection.cmpfunc = (func)
+
+/**
  * Sets a simple destructor function for this collection.
  *
  * @param c a pointer to a struct that contains #CX_COLLECTION_BASE

mercurial