UNIXworkcode

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