views:

89

answers:

2

I'm searching for something on the level of GNU extensions for C, but a little beyond (some basic data structure management). Best would be something BSD/MIT licensed.

If there is something for just strings containing GNU extensions equivalents plus adding some more it would be great.

I would prefer something that can be simply compiled into a project (no external libraries) based totally on the C standard (ANSI C89 if possible).

Edit: its for an OpenSource project that has a weird license, so no GPL code can't be added and working with plain K&R/ANSI C is pure pain.

+2  A: 

Thinking outside the box, a viable but off-the-wall approach is to use Lua. It is small, written in the subset of ANSI C that also happens to be valid C++, and supplies a rich garbage collected environment for strings, and associative arrays.

It can be built as a shared library, but it can also be statically linked.

It can admittedly feel a tad verbose when driving its data types entirely from the C side, but it is easy to move some of the higher level logic of your application into the Lua side where its data just works. Its VM is highly tuned, allowing it to perform better than one would expect for an interpreted scripting language, and there is a JIT compiler available as well for those times when its existing VM just isn't quite fast enough.

It is also open source and MIT licensed.

RBerteig
Thanks for giving me something to think about. But its not a solution viable right now.
Let_Me_Be
+3  A: 

This question already seems to be addressed here.

I actually wrote a somewhat lengthy response (recommending Glib and mentioning that Lua since 5.0 is MIT, not BSD), however my machine crashed half-way through :(

gamen
Right, its MIT, not BSD. I keep getting those two mixed up. I fixed my answer.
RBerteig