tags:

views:

92

answers:

2

What are some common general purpose library as Boost is to C++ but for C? It should be a cross-platform library and include collections such as trees, linked-lists, queues, etc... What are the advantages/disadvantages to those libraries?

+6  A: 

glib is pretty nice because:

  • liberally licensed (LGPL)
  • constant development
  • tons of data structures
    • trees
    • lists
    • queues
    • caches
    • etc.
  • good documentation
    • lots of sample code
  • development "assistance"
    • logging
    • thread abstraction
    • thread pools
    • test framework
    • timers
  • Unicode support
  • many supported platforms
  • regular expressions
  • tons more...
The Alchemist
I skipped glib as the base library because it is not possible to link it as a static library (especially not if you link it with gnome apps) or has this changed in the meantime?
Lothar
@Lothar - it's *possible*, it just means your software should be LGPL compatible ;) If license requirements are important too you could add it to your question.
detly
@Lothar: Just to clear something up, the `glib` license (LGPL) makes your work a "Combined Work" if you staticly link, as per Section 4. Even if you staticly link, you don't have to release your work under the LGPL as long as you "effectively do not restrict modification of the portions of the Library contained in the Combined Work." How can you *not* restrict modification of `glib` if you are staticly linking it in? Easy: supply the object files so people can link in another version of `glib`.P.S. This is assuming you don't modify `glib`.
The Alchemist
+1  A: 

The Apache portable runtime project

http://apr.apache.org/

is good. Covers basic datastructures and is very good at network and IO abstraction. The later is a magnitude better then glib.

Unfortunately most document links on the apache websites are broken at the moment :-( But this one works work http://apr.apache.org/docs/apr/1.4/modules.html

Lothar
Thanks Lothar. Why do you say its a magnitude better?
Shiftbit
It is much more feature complete if you want to write a server. Well not a real surpise, i think.
Lothar