Arrays addition to libnv would help a lot on lots of project being worked on right now. I just open this PR to keep a track of it
Add mariusz to this one now that he is in :)
A commit references this bug: Author: oshogbo Date: Sat Aug 15 06:34:50 UTC 2015 New revision: 286796 URL: https://svnweb.freebsd.org/changeset/base/286796 Log: Add support for the arrays in nvlist library. - Add nvlist_{add,get,take,move,exists,free}_{number,bool,string,nvlist, descriptor} functions. - Add support for (un)packing arrays. - Add the nvl_array_next field to the nvlist structure. If an array is added by the nvlist_{move,add}_nvlist_array function this field will contains next element in the array. - Add the nitems field to the nvpair and nvpair_header structure. This field contains number of elements in the array. - Add special flag (NV_FLAG_IN_ARRAY) which is set if nvlist is a part of an array. - Add special type (NV_TYPE_NVLIST_ARRAY_NEXT).This type is used only on packing/unpacking. - Add new API for traversing arrays (nvlist_get_array_next). - Add the nvlist_get_pararr function which combines the nvlist_get_array_next and nvlist_get_parent functions. If nvlist is in the array it will return next element from array. If nvlist is last element in array or it isn't in array it will return his container (parent). This function should simplify traveling over nvlist. - Add tests for new features. - Add documentation for new functions. - Add my copyright. - Regenerate the sys/cddl/compat/opensolaris/sys/nvpair.h file. PR: 191083 Reviewed by: allanjude (doc) Approved by: pjd (mentor) Changes: head/lib/libnv/tests/Makefile head/lib/libnv/tests/nv_array_tests.cc head/share/man/man9/nv.9 head/sys/cddl/compat/opensolaris/sys/nvpair.h head/sys/contrib/libnv/nv_impl.h head/sys/contrib/libnv/nvlist.c head/sys/contrib/libnv/nvlist_impl.h head/sys/contrib/libnv/nvpair.c head/sys/contrib/libnv/nvpair_impl.h head/sys/sys/nv.h
A commit references this bug: Author: ngie Date: Sun Jan 3 09:16:42 UTC 2016 New revision: 293094 URL: https://svnweb.freebsd.org/changeset/base/293094 Log: MFC r286796: r286796 (by oshogbo): Add support for the arrays in nvlist library. - Add nvlist_{add,get,take,move,exists,free}_{number,bool,string,nvlist, descriptor} functions. - Add support for (un)packing arrays. - Add the nvl_array_next field to the nvlist structure. If an array is added by the nvlist_{move,add}_nvlist_array function this field will contains next element in the array. - Add the nitems field to the nvpair and nvpair_header structure. This field contains number of elements in the array. - Add special flag (NV_FLAG_IN_ARRAY) which is set if nvlist is a part of an array. - Add special type (NV_TYPE_NVLIST_ARRAY_NEXT).This type is used only on packing/unpacking. - Add new API for traversing arrays (nvlist_get_array_next). - Add the nvlist_get_pararr function which combines the nvlist_get_array_next and nvlist_get_parent functions. If nvlist is in the array it will return next element from array. If nvlist is last element in array or it isn't in array it will return his container (parent). This function should simplify traveling over nvlist. - Add tests for new features. - Add documentation for new functions. - Add my copyright. - Regenerate the sys/cddl/compat/opensolaris/sys/nvpair.h file. PR: 191083 Changes: _U user/ngie/stable-10-libnv/ user/ngie/stable-10-libnv/lib/libnv/tests/Makefile user/ngie/stable-10-libnv/lib/libnv/tests/nv_array_tests.cc user/ngie/stable-10-libnv/share/man/man9/nv.9 user/ngie/stable-10-libnv/sys/cddl/compat/opensolaris/sys/nvpair.h user/ngie/stable-10-libnv/sys/contrib/libnv/nv_impl.h user/ngie/stable-10-libnv/sys/contrib/libnv/nvlist.c user/ngie/stable-10-libnv/sys/contrib/libnv/nvlist_impl.h user/ngie/stable-10-libnv/sys/contrib/libnv/nvpair.c user/ngie/stable-10-libnv/sys/contrib/libnv/nvpair_impl.h user/ngie/stable-10-libnv/sys/sys/nv.h