aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/nv.h
Commit message (Collapse)AuthorAgeFilesLines
* libnv: Add nvlist_append_*_array() family of functions.Mariusz Zaborski2018-06-181-0/+8
| | | | | | | | | | The nvlist_append_{bool,number,string,nvlist,descriptor}_array() functions allows to dynamically extend array stored in the nvlist. Submitted by: Mindaugas Rasiukevicius <rmind@netbsd.org> Notes: svn path=/head/; revision=335347
* SPDX: mostly fixes to previous changes.Pedro F. Giffuni2017-12-131-0/+2
| | | | | | | | Introduce the recently approved BSD-1-Clause and replace 0BSD which never did fit well our use cases. Notes: svn path=/head/; revision=326823
* Allow libnv to be built externally using GCC.Bryan Drewery2016-01-071-1/+1
| | | | | | | | | | | | | GCC does not define _VA_LIST_DECLARED. It defines _VA_LIST_ and others. This was causing the prototype to not be defined and leading to an error later due to using nvlist_add_stringv(3) without a prototype in nvlist_add_stringf(3). This uses the same check as other va_list prototypes in the original change in r279438. Notes: svn path=/head/; revision=293361
* Add support for the arrays in nvlist library.Mariusz Zaborski2015-08-151-15/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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) Notes: svn path=/head/; revision=286796
* Introduce the NV_FLAG_NO_UNIQUE flag. When set, it allows to storeMariusz Zaborski2015-05-021-0/+4
| | | | | | | | | | | | | | | multiple values using the same key in a nvlist. Approved by: pjd (mentor) Obtained from: WHEEL Systems (http://www.wheelsystems.com) Update man page. Reviewed by: AllanJude Approved by: pjd (mentor) Notes: svn path=/head/; revision=282347
* Approved, oprócz użycie RESTORE_ERRNO() do ustawiania errno.Mariusz Zaborski2015-05-021-3/+3
| | | | | | | | | | | | | | | | | | | | Change the nvlist_recv() function to take additional argument that specifies flags expected on the received nvlist. Receiving a nvlist with different set of flags than the ones we expect might lead to undefined behaviour, which might be potentially dangerous. Update consumers of this and related functions and update the tests. Approved by: pjd (mentor) Update man page for nvlist_unpack, nvlist_recv, nvlist_xfer, cap_recv_nvlist and cap_xfer_nvlist. Reviewed by: AllanJude Approved by: pjd (mentor) Notes: svn path=/head/; revision=282346
* Add nvlist_flags() function, which returns nvlist's public flags.Mariusz Zaborski2015-05-011-0/+1
| | | | | | | Approved by: pjd (mentor) Notes: svn path=/head/; revision=282312
* Remove the nvlist_.*[fv] functions.Mariusz Zaborski2015-04-291-123/+0
| | | | | | | | | | | | | | | | | | | Those functions are problematic, because there is no way to report memory allocation problems without complicating the API, so we can either abort or potentially return invalid results. None of which is acceptable. In most cases the caller knows the size of the name, so he can allocate buffer on the stack and use snprintf(3) to prepare the name. After some discussion the conclusion is to removed those functions, which also simplifies the API. Discussed with: pjd, rstone Approved by: pjd (mentor) Notes: svn path=/head/; revision=282257
* Move libnv into the kernel and hook it into the kernel buildRyan Stone2015-03-011-0/+322
Differential Revision: https://reviews.freebsd.org/D1883 Reviewed by: jfv MFC after: 1 month Sponsored by: Sandvine Inc. Notes: svn path=/head/; revision=279439