Mon, 29 Sep 2025 23:28:46 +0200
fix cxKvListSetKey() and cxKvListRemoveKey() accidentally not declared for C++
relates to #461
src/cx/kv_list.h | file | annotate | diff | comparison | revisions |
--- a/src/cx/kv_list.h Mon Sep 29 23:25:31 2025 +0200 +++ b/src/cx/kv_list.h Mon Sep 29 23:28:46 2025 +0200 @@ -267,33 +267,6 @@ } /** - * Removes the key of a list item. - * - * This can be useful if you want to explicitly remove an item from the lookup map. - * - * If no key is associated with the item, nothing happens, and this function returns zero. - * - * @param list the list - * @param index the index of the element in the list - * @retval zero success - * @retval non-zero the index is out of bounds - */ -cx_attr_nonnull -cx_attr_export -int cxKvListRemoveKey(CxList *list, size_t index); - -/** - * Returns the key of a list item. - * - * @param list the list - * @param index the index of the element in the list - * @return a pointer to the key or @c NULL when the index is out of bounds or the item does not have a key - */ -cx_attr_nonnull -cx_attr_export -const CxHashKey *cxKvListGetKey(CxList *list, size_t index); - -/** * Inserts an item into the list at the specified index and associates it with the specified key. * * @param list (@c CxList*) the list @@ -330,6 +303,33 @@ #endif /** + * Removes the key of a list item. + * + * This can be useful if you want to explicitly remove an item from the lookup map. + * + * If no key is associated with the item, nothing happens, and this function returns zero. + * + * @param list the list + * @param index the index of the element in the list + * @retval zero success + * @retval non-zero the index is out of bounds + */ +cx_attr_nonnull +cx_attr_export +int cxKvListRemoveKey(CxList *list, size_t index); + +/** + * Returns the key of a list item. + * + * @param list the list + * @param index the index of the element in the list + * @return a pointer to the key or @c NULL when the index is out of bounds or the item does not have a key + */ +cx_attr_nonnull +cx_attr_export +const CxHashKey *cxKvListGetKey(CxList *list, size_t index); + +/** * Adds an item into the list and associates it with the specified key. * * @param list (@c CxList*) the list