Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GLib v APR pros and cons of each [closed]

Tags:

I have a couple of hobby C programming projects that I would like to start. I am looking for an open source library that has a liberal license (I want credit, but pretty much anybody can use). The library needs to have strings better than the C standard library and some portable threading primitives.

I am considering GLib and APR. What is your practical experience? Which is the better foundational C library? Are there any other libraries filling the same niche?

like image 967
Rodney Schuler Avatar asked Nov 17 '08 21:11

Rodney Schuler


1 Answers

I think glib is generally superior to apr. glib has many more datastructures as portable libraries. e.g hash tables, all kind of lists, queues, stacks, dynamic array, also for argument parsing, file io has it's own wrappers also and memory managment is easy modifiable. E.g you can easily make glib use the Boehm Weisser GC this is AFAIKT never been done or easy possible with Apache. I would decide a bit different. If you need a more useful library of data structures glib is a better equipped. If it comes to GUI stuff than libapr has nothing whereas glib has gdk/gtk+ and a lot of stuff for gnome if you like.

However, if it comes to network stuff, libapr definitely has an edge over glib.

So my suggestions is

  • Desktop programming: Use GTK+ and glib.
  • Network stuff: Use apr, but be assured glib does have all this portable stuff also.
like image 80
Friedrich Avatar answered Sep 20 '22 13:09

Friedrich