#ifndef _COMPARE_H #define _COMPARE_H #include #include #include #include #include #include #include #include #include #include // réel aléatoire dans [0,1] #define RAND01 ((double)random() / RAND_MAX) #define RANDINT(n) (random() % (n)) /* compare.c */ int fcmp_int(const void *x, const void *y); int fcmp_reverse_int(const void *x, const void *y); int fcmp_char(const void *x, const void *y); int fcmp_double(const void *x, const void *y); int fcmp_string(const void *x, const void *y); int fcmp_string_hiera(const void *x, const void *y); int fcmp_pointx(const void *p, const void *q); int fcmp_pointy(const void *p, const void *q); // taille max d'une string #define MAXSTR 7 // type fonction de comparaison typedef int (*fcmp)(const void *, const void *); // type chaîne de caractères typedef char *string; typedef struct { double x, y; } point; #endif