+static void heapsort(void)
+{
+#define H_LESS(_a,_b) ((_a).key > (_b).key)
+ struct elt *heap = ary-1;
+ HEAP_INIT(struct elt, heap, n, H_LESS, HEAP_SWAP);
+ uns nn = n;
+ while (nn)
+ HEAP_DELMIN(struct elt, heap, nn, H_LESS, HEAP_SWAP);
+#undef H_LESS
+}
+
+static void heapsort_ind(void)
+{
+#define H_LESS(_a,_b) ((_a)->key > (_b)->key)
+ struct elt **heap = ind-1;
+ HEAP_INIT(struct elt *, heap, n, H_LESS, HEAP_SWAP);
+ uns nn = n;
+ while (nn)
+ HEAP_DELMIN(struct elt *, heap, nn, H_LESS, HEAP_SWAP);
+#undef H_LESS
+}
+