I am using qsort library function to sort an array of structure elements, while searching on the Internet I found a resource: INFO: Sorting Structures with the C qsort() Functio
The typedef declaration creates an alias for a specific type. This means it can be used as any other type in declarations and definitions.
So if you have e.g.
typedef int (*compfn)(const void*, const void*);
Then you can declare a variable or argument using only compfn instead of the whole function pointer declaration. E.g. these two declarations are equal:
compfn function_pointer_1;
int (*function_pointer_2)(const void*, const void*);
Both creates a function pointer variable, and the only difference is the name of the variable name.
Using typedef is common when you have long and/or complicated declarations, to easy both your writing of such declarations and to make it easier to read.