C Collections

cjson · Section 3

cjson_list_remove

cjson_list_remove - remove and free an element from an array node by index

C Collections (libccollections, -lccollections)

#include <ccollections/cjson.h>
 
ccol_retval cjson_list_remove(cjson arr, size_t index);

Removes the element at position index from the array node arr 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   - arr is NULL, arr is not a CJSON_LIST, or index
                      is out of bounds.

cjson_list_push(3), cjson_list_get(3), cjson_dictionary_remove(3)