src/ucx/array.h

branch
feature/array
changeset 337
f695ae118460
parent 336
6d7aa8a1a3b3
child 339
ae368664625f
     1.1 --- a/src/ucx/array.h	Thu Jul 04 22:23:15 2019 +0200
     1.2 +++ b/src/ucx/array.h	Thu Jul 04 22:32:03 2019 +0200
     1.3 @@ -158,6 +158,20 @@
     1.4   */
     1.5  int ucx_array_prepend(UcxArray *array, void *data);
     1.6  
     1.7 +
     1.8 +/**
     1.9 + * Sets an element at the specified index.
    1.10 + * 
    1.11 + * If the index is out of bounds, the array automatically grows.
    1.12 + * The pointer to the data may be NULL, in which case the element is zeroed. 
    1.13 + * 
    1.14 + * @param array a pointer the array where to set the data
    1.15 + * @param index the index of the element to set
    1.16 + * @param data a pointer to the data to insert (may be <code>NULL</code>)
    1.17 + * @return zero on success, non-zero if a reallocation was necessary but failed
    1.18 + */
    1.19 +int ucx_array_set(UcxArray *array, size_t index, void *data);
    1.20 +
    1.21  /**
    1.22   * Concatenates two arrays.
    1.23   * 

mercurial