Samuel Keding wrote:
> Thanks,
Well, if this is for me, I forgot to say, that compproc(void*,void*) has
to work like the cmp() in qsort().
It has to return 0 if the two arguments are equivalent, return < 0 if
the first is "smaller" and return > 0 when the first is "greater" than
the second.
Also the list is sorted like the smaller ones are at the beginning, so
the list is incremental. If you want it to be decremental, obviously you
need to reverse the return value of cmp.
One last note: xlist_destroy() first removes all nodes, then destroys
the list. Actually it is up to you to first free all values in the
nodes, and to set the destroyed xlist to NULL, if you need.
Sorry, but the implementation lacks documentation, so if you don't
understand something, just mail me (or take a look at the code, it is
short :)
--
Greetings,
Balázs
|