C Collections

cyaml · Section 3

cyaml_list_remove

cyaml_list_remove - remove and free a list element by index

C Collections (libccollections, -lccollections)

#include <ccollections/cyaml.h>
 
ccol_retval cyaml_list_remove(cyaml seq, size_t index);

Removes the element at position index from the list node seq and
frees it together with everything below it.  The elements after
index move one position to the left, so the call costs O(n) in the
number of elements that follow index.

ccol_success        - the element was removed and freed.
ccol_invalid_args   - seq is NULL, seq is not a CYAML_LIST, or index
                      is out of bounds.

cyaml_list_push(3), cyaml_list_get(3), cyaml_dictionary_remove(3)