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 * A merge sort algorithm is used, which is guaranteed to use no more additional |
237 * The qsort_r() function is used, if available (glibc, FreeBSD or MacOS). |
238 * memory than for exactly one element. |
238 * The order of arguments is automatically adjusted for the FreeBSD and MacOS |
|
239 * version of qsort_r(). |
|
240 * |
|
241 * If qsort_r() is not available, a merge sort algorithm is used, which is |
|
242 * guaranteed to use no more additional memory than for exactly one element. |
239 * |
243 * |
240 * @param array the array to sort |
244 * @param array the array to sort |
241 * @param cmpfnc the function that shall be used to compare the element data |
245 * @param cmpfnc the function that shall be used to compare the element data |
242 * @param data additional data for the cmp_func() or <code>NULL</code> |
246 * @param data additional data for the cmp_func() or <code>NULL</code> |
243 */ |
247 */ |