UNIXworkcode

1 Version 4.0.1 - 2026-02-08 2 -------------------------- 3 4 * fixes compilation errors when using a C++ compiler and a high warning level 5 * fixes incorrect nonnull-attribute for various list.h functions 6 7 Version 4.0.0 - 2025-12-31 8 -------------------------- 9 10 * adds cx_system_page_size() to allocator.h 11 * adds cx_compare_func2 function pointer that supports compare functions with custom data 12 * adds a new (optional) capacity parameter to cxJsonCreateArr() and cxJsonObjPutArr() 13 * adds cxJsonFromString(), cxJsonToString(), and cxJsonToPrettyString() 14 * adds cxJsonClone() 15 * adds cxJsonCompare() 16 * adds cxMapCompare() 17 * adds line continuation support to CxProperties / CxPropertiesConfig 18 * adds cx_hash_key_as_string() 19 * adds support for CxHashKey pointers in CX_HASH_KEY() and all map functions 20 * adds CX_NULLSTR convenience macro 21 * adds cx_strcast_m() 22 * adds cx_strat() 23 * adds cx_bstr() and cx_bstr_m() 24 * adds cxBufferMaximumCapacity() 25 * adds cxBufferAppendString() 26 * adds CX_BUFFER_DO_NOT_FREE buffer flag 27 * changes the parameter order of cxBufferInit() and cxBufferCreate() 28 * changes cxBufferReserve() to allow reducing the capacity 29 * changes cxBufferTerminate() to automatically shrink the buffer 30 * changes cxBufferTerminate() so that position and size are equal after a successful operation 31 * changes cxBufferPutString() to accept any kind of string that cx_strcast() supports 32 * changes that multiple string.h functions now also automatically apply cx_strcast() where possible 33 * changes the names of cxDefineDestructor() and cxDefineAdvancedDestructor() to 34 cxSetDestructor() and cxSetdvancedDestructor() 35 * changes the name of cxCollectionCompareFunc() to cxSetCompareFunc() 36 * changes the entire low-level array-list API by making it much simpler 37 * changes the tree API towards a more simple design 38 * changes the members of CxJson and CxJsonValue 39 * changes the return value of cxJsonObjIter() to CxMapIterator 40 * changes CxTree structure so that it now inherits CX_COLLECTION_BASE 41 * changes cxPropertiesLoad() to directly load properties from a file to a CxMap 42 * changes cxFreeDefault() from a macro to a function so that it can be used as a simple destructor 43 * fixes cxJsonWrite() incorrectly returning non-zero when strings needed to be escaped 44 * fixes cxJsonNext() incorrectly returning CX_JSON_INCOMPLETE_DATA when the input ends with trailing spaces 45 * fixes critical memory leak when using cxMapFree() on a kv-list that is using destructors 46 * fixes critical use-after-free with keys stored in kv-lists 47 * fixes that overwriting items with cxMapPut() in a kv-list did not work 48 * fixes that cxReallocate(), cxReallocateArray(), cx_reallocate(), and cx_reallocatearray() 49 were not returning zero after freeing the memory when passed a size of zero 50 * fixes that cx_list_default_insert_array() has the wrong nonnull attribute when used for cxListEmplaceArray() 51 * removes the CX_STR() macro and instead makes the cx_str() inlinable 52 * removes the cx_str*_m() functions 53 * removes the sort_members feature from CxJsonWriter 54 * removes the source and sink API from properties.h 55 * removes the flush feature from CxBuffer 56 * removes the ability to remove elements from the iterators created with cxIterator() and cxIteratorPtr() 57 * removes several unnecessary convenience functions 58 * removes the complicated wrapping of pointer lists 59 * removes cxIteratorRef() 60 61 Version 3.2.0 - 2025-11-30 62 -------------------------- 63 64 * adds cxMempoolTransfer() and cxMempoolTransferObject() 65 * adds support for different destruction strategies in CxMempool 66 * adds new key-value-based list implementation 67 + adds support for integer keys to CxHashKey 68 * adds support for comparing arbitrary strings without explicit call to cx_strcast() 69 * adds clone, union, difference, and intersection functions for CxList and CxMap 70 * adds cxListContains() and cxMapContains() 71 * adds cxListReserve() and cxListShrink() 72 * adds cxListSet() 73 * adds cxListFirst() and cxListLast() 74 * adds cxListRemoveAndGetFirst() and cxListRemoveAndGetLast(), 75 and corresponding macro aliases cxListPopFront() and cxListPop() 76 * adds cxListEmplace(), cxListEmplaceAt(), cxListEmplaceArray(), cxListEmplaceArrayAt(), and cxMapEmplace() 77 * adds cxListInsertUnique() and cxListInsertUniqueArray() 78 * adds cx_array_insert_unique() and various convenience macros 79 * adds cx_linked_list_insert_unique() and cx_linked_list_insert_unique_chain() 80 * adds cxCollectionCompareFunc() to conveniently set a compare function for a collection 81 without needing to access the base struct manually 82 * adds cxBufferShrink() 83 * adds cxBufferPop() 84 * adds cxTreeSize() 85 * adds CX_PRIstr and CX_SFMT macros for formatting UCX strings 86 * adds cx_strcpy() and cx_strcpy_a() 87 * adds cxJsonArrRemove() and cxJsonObjRemove() 88 * adds cxStdlibAllocator and allows changes of cxDefaultAllocator 89 * improves performance of the CxList array list implementation 90 * changes over-aggressively declaring functions as static inline 91 * changes cx_str() and cx_mutstr() to allow NULL strings 92 * changes cx_strcast() to also accept C-strings as input 93 * changes grow strategy for the memory pool to reduce reallocations 94 * changes grow strategy for CxBuffer, which does now take the page size into account 95 * changes the implementation of cx_strreplacen() for improved efficiency 96 * changes all cxListIterator() and cxMapIterator() families of functions to also accept NULL as argument 97 * changes insert_element member function of CxList to accept NULL source and return a pointer to the inserted element 98 * changes the compare function wrapper for pointer lists so that it no longer invokes the actual compare function for NULL pointers 99 * changes struct cx_array_reallocator_s by replacing the four generic data members with two specifically named members 100 * changes cx_array_reserve() so that it reserves exactly the requested capacity (i.e., without overallocation) 101 * changes all other array functions to perform smart overallocation to avoid too many subsequent allocations 102 * changes that binary search and infimum always report the largest index, and supremum always reports the smallest index 103 when the found element appears more than once in the array 104 * fixes critical memory overflow in the stack-based array reallocator (this unfortunately breaks the function signature) 105 * fixes critical bug in cx_array_insert_sorted() that caused an infinite loop when inserting duplicates 106 * fixes mempool implementation not supporting NULL as argument for realloc 107 * fixes mempool implementation not supporting zero as size for realloc 108 * fixes that the elem_count member of an iterator was not updated after removing an element flagged by cxIteratorFlagRemoval() 109 * fixes that starting an iteration in a non-root node incorrectly continues iteration with the siblings of that node 110 * fixes unnecessary allocations in cx_strcat() family of functions 111 * fixes ineffective overflow check in cx_strcat() family of functions 112 * fixes errno value after failing cxBufferSeek() to be consistently EINVAL 113 * fixes implementation of cxBufferTerminate() 114 * fixes that cxBufferWrite() could auto-extend the buffer beyond the configured threshold 115 * fixes allocator arguments for some printf.h functions not being const 116 * fixes that cx_tree_search() did not investigate subtrees with equally good distance 117 * fixes that memory was freed by the wrong allocator in cx_vasprintf_a() when the underlying vsnprintf() failed 118 * removes all functions that create mutating iterators in favor of making all iterators possibly mutating 119 * removes the use of C23 attributes because they don't mix well with GNU attributes in GCC 15 120 121 Version 3.1.0 - 2025-02-11 122 -------------------------- 123 124 * adds properties.h 125 * adds tree.h 126 * adds json.h 127 * adds locale-independent string to number conversion functions 128 * adds reallocarray() like functions to allocator.h 129 * adds cxIterator() to create iterators over raw C arrays 130 * adds cxIteratorPtr() to create iterators over raw C pointer arrays 131 * adds cx_array_reallocator() and cx_array_default_reallocator 132 * adds several new array and list functions 133 * adds cxBufferReset() 134 * adds cxBufferAppend() 135 * adds cxBufferEnableFlushing() and cxBufferFlush() 136 * adds CX_BUFFER_COPY_ON_WRITE and CX_BUFFER_COPY_ON_EXTEND flags 137 * adds cxBufferWriteFunc and cxBufferReadFunc function pointers (for convenience) 138 * adds cx_cmp_ptr() 139 * adds cx_vcmp_* family of functions 140 * adds cx_sprintf() and several more variants 141 * adds runtime constants to read out the actual SBO sizes 142 * adds improved version of UCX 2 Test framework (now a self-contained header) 143 * adds cx_nmemb() utility function to common.h 144 * changes that CxMap returns own CxMapIterator to save memory in CxIterator 145 * changes name of cxBasicMempoolCreate() to cxMempoolCreateSimple() 146 * changes all functions, for which there is no dedicated xyz_a variant, 147 to accept NULL as allocator argument (in which case a default allocator will be used) 148 * changes the name of destroy functions that actually free the memory to better indicate their behavior 149 * changes cx_strcat variants to allow handling of ENOMEM 150 * changes cx_strcast() to also accept cxstring (and doing nothing in that case) 151 * changes the behavior of cxBufferSeek() to allow offset zero for SEEK_END 152 * moves cx_compare_func typedef to compare.h 153 * moves cx_szmul() to common.h 154 * moves stream copy functions to new streams.h 155 * removes cx_strupper() and cx_strlower() because they only do the right thing in special cases 156 * removes several *_m variants of functions in string.h in favor of automatic conversion 157 * removes utils.h 158 * removes flag_removal function from iterator 159 * removes cxMapDetach() and makes cxMapRemoveAndGet() compatible with both map variants 160 * removes the API for changing the store_pointer property of collections after their creation 161 * removes CMake 162 * removes GTest dependency 163 * removes flags to disable SBO in tests 164 * removes CX_LINKED_LIST_SWAP_SBO_SIZE (it's not really an optimization for linked lists) 165 * fixes cx_strcmp() and cx_strcasecmp() not being useful for lexicographic ordering 166 * fixes cx_hash_key_cxstr() evaluating the argument twice 167 * fixes critical bug that produced wrong results when comparing lists of different type but same size 168 * ends UCX 2.1 long term support 169 170 Version 3.0.0 - 2023-07-09 171 -------------------------- 172 173 * complete redesign from scratch 174 * collections can now store copies of objects and not just pointers 175 * collections are now dynamically implemented 176 * users of the library can specify own implementations of collections that work with the UCX API 177 * low level API for custom lists that do not use the UCX structures 178 * various fixes and improvements 179 * drops some other, rarely used, features 180 * removes testing implementation from the lib 181 182 183 Version 2.1.0 - 2019-12-30 184 -------------------------- 185 186 * adds string replace functions 187 * adds set operations for UcxList and UcxMap 188 * adds sstrcaseprefix() and sstrcasesuffix() 189 * improves Doxygen documentation in ucx/string.h 190 * adds UcxArray data type 191 * adds support for CMake builds, but main build system is still autotools 192 193 Version 2.0 - 2018-12-28 194 ------------------------ 195 196 * some uncritical bug fixes 197 * overflow of sstrnlen now returns SIZE_MAX instead of zero 198 * adds scstr_t - a const char* variant for sstr_t 199 * renames utility compare functions 200 201 Version 1.1.0 - 2018-05-14 202 -------------------------- 203 204 * adds missing 32 bit support to integer overflow checks 205 * adds ucx_buffer_to_sstr() macro 206 * adds ucx_avl_free_content() 207 * adds some more compare and distance functions in utils.h 208 * adds SFMT() and PRIsstr convenience macros 209 * destructor functions for *_free_content() functions are now optional 210 211 Version 1.0.1 - 2018-01-21 212 -------------------------- 213 214 * some bug fixes 215 * adds integer overflow checks 216 217 Version 1.0.0 - 2017-10-28 218 -------------------------- 219 220 * first stable version of UCX released 221