Move callback functions into the same file
[TD_C.git] / TP_13 / exo1 / lib / sort.h
index 86fd5c48d6803fe1b0b1c1d778d58f4bb745c467..0dce2136b88ed3cf5d386a074cbebc6b3a786e13 100644 (file)
@@ -1,5 +1,21 @@
 #ifndef SORT_H
 #define SORT_H
 
+#include <stdbool.h>
+
+typedef bool(*c_criteria_cb)(int a);
+
+bool is_even(int a);
+bool is_odd(int a);
+
+typedef bool(*s_criteria_cb)(int a, int b);
+
+/* sort criteria */
+bool ascending(int a, int b);
+bool descending(int a, int b);
+bool ascending_and_even(int a, int b);
+bool ascending_and_odd(int a, int b);
+
+void sort_bubble_array(int* array, unsigned length, s_criteria_cb sort_criteria);
 
 #endif /* SORT_H */