Move callback functions into the same file
[TD_C.git] / TP_13 / exo1 / lib / sort.h
CommitLineData
fac749d5
JB
1#ifndef SORT_H
2#define SORT_H
3
33b9c646
JB
4#include <stdbool.h>
5
0b8ccced
JB
6typedef bool(*c_criteria_cb)(int a);
7
8bool is_even(int a);
9bool is_odd(int a);
10
210f7f05 11typedef bool(*s_criteria_cb)(int a, int b);
33b9c646
JB
12
13/* sort criteria */
14bool ascending(int a, int b);
15bool descending(int a, int b);
e4001676
JB
16bool ascending_and_even(int a, int b);
17bool ascending_and_odd(int a, int b);
33b9c646 18
210f7f05 19void sort_bubble_array(int* array, unsigned length, s_criteria_cb sort_criteria);
fac749d5
JB
20
21#endif /* SORT_H */