-#define ARR_SET_INSERT(arr, cmp, elm) \
-do { \
- int idx = ir_arr_bsearch((arr), sizeof((arr)[0]), (cmp), (elm)); \
- if (idx < 0) { \
- idx = -idx - 1; \
- memmove(&(arr)[idx+1], &(arr)[idx], sizeof((arr)[0]) * (ARR_DESCR((arr))->nelts - idx)); \
- (arr)[idx] = *(elm); \
- ++ARR_DESCR((arr))->nelts; \
- } \
-} while(0)
-
-#define ARR_SET_INSERT_EXT(type, arr, cmp, elm) \
-do { \
- int idx = ir_arr_bsearch((arr), sizeof((arr)[0]), (cmp), (elm)); \
- if (idx < 0) { \
- int len = ARR_LEN(arr); \
- idx = -idx - 1; \
- ARR_EXTO(type, arr, len + 1); \
- memmove(&(arr)[idx+1], &(arr)[idx], sizeof((arr)[0]) * (len - idx)); \
- (arr)[idx] = *(elm); \
- } \
-} while(0)
-
-#define ARR_SET_REMOVE(arr, cmp, elm) \
-do { \
- int idx = ir_arr_bsearch((arr), sizeof((arr)[0]), (cmp), (elm)); \
- if (idx >= 0) { \
- --ARR_DESCR((arr))->nelts; \
- memmove(&(arr)[idx], &(arr)[idx+1], sizeof((arr)[0]) * (ARR_DESCR((arr))->nelts - idx)); \
- } \
-} while(0)
-
-/**
- * Return the index of an element in an array set.
- * To check for containment, use the expression:
- * (ARR_SET_GET_IDX(arr, cmp, elm) >= 0)
- *
- * @return The index or some value < 0 if the element was not in the set.
- */
-#define ARR_SET_GET_IDX(arr, cmp, elm) \
- (ARR_VRFY((arr)), ir_arr_bsearch((arr), sizeof((arr)[0]), cmp, (elm)))