General purpose library for name/value pairs.

Pawel Jakub Dawidek pjd at FreeBSD.org
Thu Jul 25 20:27:49 UTC 2013


Returning to this thread after a short break. I removed all
{,u}int{8,16.32.64} types and implemented only 'number' type which is
uint64_t. Looks much nicer now.

On Mon, Jul 08, 2013 at 03:09:40PM -0700, Jordan K. Hubbard wrote:
> On Jul 8, 2013, at 2:33 PM, Pawel Jakub Dawidek <pjd at FreeBSD.org> wrote:
> >> String, Number, Boolean, Data, Date, Array and Dictionary are all plists support, and Apple developers have gotten along pretty well for many years with that set (not supporting Dictionaries, btw, is a pretty fundamental loss IMHO - it means you have to always iterate through lists to find your stuff, which is meh!).
> > 
> > I do support nested nvlists. Doesn't that fill the gap?
> 
> Not really, no.  In fact, once you support dictionaries, you'll find that most people prefer them to lists since data can now be passed in order-independent fashion and evolved over time without breaking older code.  Arrays/lists are far less general purpose and used much less often (when I checked through a bunch of preference plists on one of my OS X boxes, I found arrays of <data> types to be the most common).  Nested dictionaries are even far more common in general practice.

Not sure if you looked at the API, but with nvlist you can lookup
element by name:

	const char *nvlist_get_string(const nvlist_t *nvl, const char *name);

Or do you mean that internally it is slow as it iterates the list when
looking up an element? This can be easly changed to speed up the
lookups, but I don't consider it a pressing problem.

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://mobter.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20130725/ec5dad87/attachment.sig>


More information about the freebsd-arch mailing list