| 575 * @param cmp_func (@c cx_compare_func2) the compare function that establishes the order |
575 * @param cmp_func (@c cx_compare_func2) the compare function that establishes the order |
| 576 * @param context (@c void*) additional context for the compare function |
576 * @param context (@c void*) additional context for the compare function |
| 577 * @retval zero success |
577 * @retval zero success |
| 578 * @retval non-zero a re-allocation was necessary but failed |
578 * @retval non-zero a re-allocation was necessary but failed |
| 579 */ |
579 */ |
| 580 #define cx_array_insert_sorted_ca(allocator, array, element, cmp_func) \ |
580 #define cx_array_insert_sorted_ca(allocator, array, element, cmp_func, context) \ |
| 581 cx_array_insert_sorted_c_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (void*)&(element), 1, cmp_func, context, true) |
581 cx_array_insert_sorted_c_(allocator, (CxArray*)&(array), sizeof((array).data[0]), (void*)&(element), 1, cmp_func, context, true) |
| 582 |
582 |
| 583 /** |
583 /** |
| 584 * Inserts an element into a sorted array. |
584 * Inserts an element into a sorted array. |
| 585 * |
585 * |
| 751 /** |
751 /** |
| 752 * Sorts an array. |
752 * Sorts an array. |
| 753 * |
753 * |
| 754 * @param array the name of the array |
754 * @param array the name of the array |
| 755 * @param fn (@c cx_compare_func) the compare function |
755 * @param fn (@c cx_compare_func) the compare function |
| 756 * @param context (@c void*) the context for the compare function |
|
| 757 */ |
756 */ |
| 758 #define cx_array_sort(array, fn) \ |
757 #define cx_array_sort(array, fn) \ |
| 759 cx_array_sort_((CxArray*)&(array), sizeof((array).data[0]), fn) |
758 cx_array_sort_((CxArray*)&(array), sizeof((array).data[0]), fn) |
| 760 |
759 |
| 761 /** |
760 /** |