Commit | Line | Data |
---|---|---|
fac749d5 JB |
1 | #ifndef SORT_H |
2 | #define SORT_H | |
3 | ||
33b9c646 JB |
4 | #include <stdbool.h> |
5 | ||
0b8ccced JB |
6 | typedef bool(*c_criteria_cb)(int a); |
7 | ||
8 | bool is_even(int a); | |
9 | bool is_odd(int a); | |
10 | ||
210f7f05 | 11 | typedef bool(*s_criteria_cb)(int a, int b); |
33b9c646 JB |
12 | |
13 | /* sort criteria */ | |
14 | bool ascending(int a, int b); | |
15 | bool descending(int a, int b); | |
e4001676 JB |
16 | bool ascending_and_even(int a, int b); |
17 | bool ascending_and_odd(int a, int b); | |
33b9c646 | 18 | |
210f7f05 | 19 | void sort_bubble_array(int* array, unsigned length, s_criteria_cb sort_criteria); |
fac749d5 JB |
20 | |
21 | #endif /* SORT_H */ |