src/ucx/array.h

branch
feature/array
changeset 339
ae368664625f
parent 337
f695ae118460
child 342
8f0a3c00d1d2
equal deleted inserted replaced
338:0878f83348a0 339:ae368664625f
211 * @param array the array to retrieve the element from 211 * @param array the array to retrieve the element from
212 * @param index index of the element to return 212 * @param index index of the element to return
213 * @return the requested element 213 * @return the requested element
214 * @see ucx_array_at() 214 * @see ucx_array_at()
215 */ 215 */
216 #define ucx_array_at_typed(type, arr, i) (((type*)((arr).data))[i]) 216 #define ucx_array_at_typed(type, array, index) (((type*)((array).data))[index])
217 217
218 /** 218 /**
219 * Shorthand for ucx_array_at_typed(). 219 * Shorthand for ucx_array_at_typed().
220 */ 220 */
221 #define ucx_array_at_int(arr, i) ucx_array_at_typed(int, arr, i) 221 #define ucx_array_at_int(arr, i) ucx_array_at_typed(int, arr, i)
292 /** 292 /**
293 * Sorts a UcxArray with an almost in-place merge sort. 293 * Sorts a UcxArray with an almost in-place merge sort.
294 * 294 *
295 * This function uses additional memory for exactly one element. 295 * This function uses additional memory for exactly one element.
296 * 296 *
297 * @param the array to sort 297 * @param array the array to sort
298 * @param cmpfnc the function that shall be used to compare the element data 298 * @param cmpfnc the function that shall be used to compare the element data
299 * @param data additional data for the cmp_func() 299 * @param data additional data for the cmp_func()
300 */ 300 */
301 void ucx_array_sort(UcxArray array, cmp_func cmpfnc, void *data); 301 void ucx_array_sort(UcxArray array, cmp_func cmpfnc, void *data);
302 302

mercurial