I am very new to C programming and even newer to the Max SDK.
Could someone explain the linklist_sort() to me?
long myAlphabeticalCmpfn(void *a, void *b)
t_symbol *s1 = (t_symbol *)a;
t_symbol *s2 = (t_symbol *)b;
if(s1->s_name < s2->s_name)
void mySortMethod(t_myobj *x)
// the linklist was already created and filled with items previously
My first problem is that there doesn't seem to be a function that walks through the linked list. I pass the linked list to the myAlphabeticalCmpfn but there seems to be no equivalent to x->next. So how does it iterate through the whole list?
The myAlphabeticalCmpfn only returns a true or false and doesn't do any sorting. Where does the sorting take place? What kind of sort is it, swap-sort?
I believe t_symbol is a struct. Is there an equivalent for float (ultimately I want to sort floats).
Sorry if this is all obvious, but I am at a roadblock here. Any input is very much appreciated.