src/cx/kv_list.h

changeset 1407
59290d70434a
parent 1406
85dc816f3442
--- a/src/cx/kv_list.h	Tue Sep 30 20:29:55 2025 +0200
+++ b/src/cx/kv_list.h	Tue Sep 30 22:21:41 2025 +0200
@@ -176,10 +176,34 @@
 cx_attr_export
 CxMap *cxKvListAsMap(CxList *list);
 
+/**
+ * Sets or updates the key of a list item.
+ *
+ * This is, for example, useful when you have inserted an element using the CxList interface,
+ * and now you want to associate this element with a key.
+ *
+ * @param list the list
+ * @param index the index of the element in the list
+ * @param key the key
+ * @retval zero success
+ * @retval non-zero memory allocation failure or the index is out of bounds
+ * @see cxKvListSetKey()
+ */
 cx_attr_nonnull
 cx_attr_export
 int cx_kv_list_set_key(CxList *list, size_t index, CxHashKey key);
 
+/**
+ * Inserts an item into the list at the specified index and associates it with the specified key.
+ *
+ * @param list the list
+ * @param index the index the inserted element shall have
+ * @param key the key
+ * @param value the value
+ * @retval zero success
+ * @retval non-zero memory allocation failure or the index is out of bounds
+ * @see cxKvListInsert()
+ */
 cx_attr_nonnull
 cx_attr_export
 int cx_kv_list_insert(CxList *list, size_t index, CxHashKey key, void *value);

mercurial