src/ucx/array.h

branch
feature/array
changeset 337
f695ae118460
parent 336
6d7aa8a1a3b3
child 339
ae368664625f
equal deleted inserted replaced
336:6d7aa8a1a3b3 337:f695ae118460
156 * @param data a pointer to the data to insert (may be <code>NULL</code>) 156 * @param data a pointer to the data to insert (may be <code>NULL</code>)
157 * @return zero on success, non-zero if a reallocation was necessary but failed 157 * @return zero on success, non-zero if a reallocation was necessary but failed
158 */ 158 */
159 int ucx_array_prepend(UcxArray *array, void *data); 159 int ucx_array_prepend(UcxArray *array, void *data);
160 160
161
162 /**
163 * Sets an element at the specified index.
164 *
165 * If the index is out of bounds, the array automatically grows.
166 * The pointer to the data may be NULL, in which case the element is zeroed.
167 *
168 * @param array a pointer the array where to set the data
169 * @param index the index of the element to set
170 * @param data a pointer to the data to insert (may be <code>NULL</code>)
171 * @return zero on success, non-zero if a reallocation was necessary but failed
172 */
173 int ucx_array_set(UcxArray *array, size_t index, void *data);
174
161 /** 175 /**
162 * Concatenates two arrays. 176 * Concatenates two arrays.
163 * 177 *
164 * The contents of the second array are appended to the first array in one 178 * The contents of the second array are appended to the first array in one
165 * single operation. The second array is otherwise left untouched. 179 * single operation. The second array is otherwise left untouched.

mercurial