Aram Hăvărneanu
Aram Hăvărneanu

Reputation: 784

C Strings Library

Is there a C strings library for C (not C++) that implements an abstraction over char * and wchar_t * strings?

The requirements are:

  1. to be BSD/MIT/CDDL licenced
  2. implements some kind of reference count mechanism
  3. has support for regular expressions
  4. has Unicode support

Thanks,

Upvotes: 7

Views: 1138

Answers (4)

Aram Hăvărneanu
Aram Hăvărneanu

Reputation: 784

I've ended up using Plan9 libraries. For Unix there's plan9port or the more lightweight 9base. For windows I use a custom the port that come with Go.

Upvotes: 1

viraptor
viraptor

Reputation: 34205

Glib can do most of that, but is LGPL: http://library.gnome.org/devel/glib/stable/

I don't think you can find refcounting in any string library in C though... It's just not that easy to do. You can make a thin wrapper around gchar* yourself if you need it.

Upvotes: 2

reko_t
reko_t

Reputation: 56460

Something like ICU might be what you need. It's licensed under Open Source License, and doesn't exactly abstract char*/wchar_t* (see: http://icu-project.org/docs/papers/unicode_wchar_t.html), but it might be what you need.

Upvotes: 1

Roman Nikitchenko
Roman Nikitchenko

Reputation: 13046

What about this? Looks good, at least matches some of your criteria, but I didn't use it so it must be checked. At least I see BSD license here so it could be useful point to start.

Upvotes: 2

Related Questions