232 int ucx_array_contains(UcxArray array, void *elem, cmp_func cmpfnc, void *data); |
232 int ucx_array_contains(UcxArray array, void *elem, cmp_func cmpfnc, void *data); |
233 |
233 |
234 /** |
234 /** |
235 * Sorts a UcxArray with the best available sort algorithm. |
235 * Sorts a UcxArray with the best available sort algorithm. |
236 * |
236 * |
237 * If present, qsort_s() will be used. Otherwise, if no additional data is |
237 * A merge sort algorithm is used, which is guaranteed to use no more additional |
238 * specified, qsort() is used as a fall back. |
238 * memory than for exactly one element. |
239 * |
|
240 * If qsort_s() is not available and <code>data</code> is not <code>NULL</code>, |
|
241 * a custom almost in-place merge sort algorithm is used, which uses additional |
|
242 * memory for exactly one element. |
|
243 * |
239 * |
244 * @param array the array to sort |
240 * @param array the array to sort |
245 * @param cmpfnc the function that shall be used to compare the element data |
241 * @param cmpfnc the function that shall be used to compare the element data |
246 * @param data additional data for the cmp_func() |
242 * @param data additional data for the cmp_func() or <code>NULL</code> |
247 */ |
243 */ |
248 void ucx_array_sort(UcxArray array, cmp_func cmpfnc, void *data); |
244 void ucx_array_sort(UcxArray array, cmp_func cmpfnc, void *data); |
249 |
245 |
250 /** |
246 /** |
251 * Removes an element from the array. |
247 * Removes an element from the array. |