qsort(bt->rw[t], bt->num[t],
sizeof(TRELLIS_ATOM *),
(int (*)(const void *,const void *))compare_wid);
bt->rw[t] is a pointer to struct pointer, bt->[num] is an int, I don’t understand what that fourth parameter is, except that compare_wid is a function defined somewhere as follows:
static int compare_wid( TRELLIS_ATOM* a, TRELLIS_ATOM* b )
{
...
return x;
}
(int (*)(const void *,const void *))means “treat what follows as a pointer to a function that takes two parameters of typeconst void*and returns anint“.compare_widis indeed a function that can be treated this way.qsortwill call this function to perform comparisons between items when sorting: if the integer it returns is zero, the items are assumed to be equal, otherwise the sign of the integer is used to order them.