diff -r 5492e8ef05f4 -r 3a3ffc27813f src/cx/list.h --- a/src/cx/list.h Sat Apr 12 21:32:31 2025 +0200 +++ b/src/cx/list.h Sun Apr 13 11:09:05 2025 +0200 @@ -689,6 +689,23 @@ return list->cl->at(list, index); } + +/** + * Sets the element at the specified index in the list + * + * @param list the list to set the element in + * @param index the index to set the element at + * @param elem element to set + * @retval zero on success + * @retval non-zero when index is out of bounds + */ +cx_attr_nonnull +int cxListSet( + CxList *list, + size_t index, + const void *elem +); + /** * Returns an iterator pointing to the item at the specified index. *