aboutsummaryrefslogtreecommitdiff
path: root/src/base/sort/string.c
blob: b511efa9ce5e2930f9bb0a3e2377860efaae9a72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include "internal.h"

void
sortยทstring(uintptr sz, byte* arr[])
{
    byte *tmp;
#define LESS(i, j) (strcmp(arr[i], arr[j]) < 0)
#define SWAP(i, j) (tmp = arr[i], arr[i] = arr[j], arr[j] = tmp)
    QSORT(sz, LESS, SWAP);
#undef SWAP
#undef LESS
}