[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: g_list_sort() or local mergesort?



On Sun, 19 Jul 2009 19:27:04 -0400, Stuart Brorson wrote:

> Instead of providing clarity, I'll muddy the waters.  There is a sorting
> algorithm already implemented in gattrib: gattrib/src/listsort.c.

Oh, and its mergesort for double linked lists, too :-)
 

> If you choose option B, then you could just move this code into libgeda
> instead of writing something from scratch.  In fact, it would be better
> to have one sort implementation for gaf, instead of different one
> scattered around the source tree.  However, this depends upon the
> requirements of your sort, i.e. are you sorting single- or double-linked
> lists?  Sorting numbers or strings?   Long or short lists?  And so
> on....

True. 
The gattrib sorting algorithm works on a list of strings. What I need, is 
to sort a list of components. And then I need functions to add an item to 
the list, or remove an item. This looks like reinventing glib... 

Is there any reason stay away from glib functions?

---<(kaimartin)>---
-- 
Kai-Martin Knaak
Öffentlicher PGP-Schlüssel:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6C0B9F53



_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user