struct a {int data;}; struct b {int data;};
void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *));
int compare_foo(const struct foo *a, const struct foo *b) { ... }
int compare_foo(const void *a, const void *b) { const struct foo *real_a = (struct foo *)a; const struct foo *real_b = (struct foo *)b; ... }