1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#define _GNU_SOURCE #include <string.h> #include <dirent.h> int versionsort(const struct dirent **a, const struct dirent **b) { return strverscmp((*a)->d_name, (*b)->d_name); } #ifdef TEST int main(void) { return 0; } #endif