General purpose library for name/value pairs.

Jordan Hubbard jordan.hubbard at gmail.com
Fri Jul 26 07:26:20 UTC 2013


On Jul 25, 2013, at 1:28 PM, Pawel Jakub Dawidek <pjd at freebsd.org> wrote:

> 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.

Indeed!

> 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);

Sorry, I must have misunderstood that function since I thought it would just get you a named string - you can also do something like this?

	{ { "name", "Pawel Jakub Dawidek" }, { "age", 37 }, { "favorite-float-num", 1.E027 }, { "likes", { "cats", "ZFS", "fashion models" } }, { "company", "wheel systems" } }

And then look up "name" and get a string, "age" and get a number, "favorite-float-num" for a float, "likes" for an array of strings, etc?

Thanks,

- Jordan



More information about the freebsd-arch mailing list