2 .\" Copyright (c) 2016 Adam Starak <starak.adam@gmail.com>
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .Nd "API for getting name/value pairs. Nonexistent pairs do not raise an error."
40 .Fn dnvlist_get_bool "const nvlist_t *nvl" "const char *name" "bool defval"
42 .Fn dnvlist_get_number "const nvlist_t *nvl" "const char *name" "uint64_t defval"
44 .Fn dnvlist_get_string "const nvlist_t *nvl" "const char *name" "const char *defval"
46 .Fn dnvlist_get_nvlist "const nvlist_t *nvl" "const char *name" "nvlist_t *defval"
48 .Fn dnvlist_get_descriptor "const nvlist_t *nvl" "const char *name" "int defval"
50 .Fn dnvlist_get_binary "const nvlist_t *nvl" "const char *name" "size_t *sizep" "void *defval" "size_t defsize"
52 .Fn dnvlist_take_bool "const nvlist_t *nvl" "const char *name" "bool defval"
54 .Fn dnvlist_take_number "const nvlist_t *nvl" "const char *name" "uint64_t defval"
56 .Fn dnvlist_take_string "const nvlist_t *nvl" "const char *name" "const char *defval"
58 .Fn dnvlist_take_nvlist "const nvlist_t *nvl" "const char *name" "nvlist_t *defval"
60 .Fn dnvlist_take_descriptor "const nvlist_t *nvl" "const char *name" "int defval"
62 .Fn dnvlist_take_binary "const nvlist_t *nvl" "const char *name" "size_t *sizep" "void *defval" "size_t defsize"
66 library permits easy management of name/value pairs and can send and receive
68 For more information, also see
73 family of functions returns the value associated with the specified name.
74 If an element of the specified name does not exist, the function returns the
77 Returned strings, nvlists, descriptors, binaries, or arrays must not be modified
79 They still belong to the nvlist.
80 If the nvlist is in an error state, attempts to use any of these functions will
81 cause the program to abort.
85 family of functions returns the value associated with the specified name and
86 removes the element from the nvlist.
87 If an element of the supplied name does not exist, the value provided in
90 When the value is a string, binary, or array value, the caller is
91 responsible for freeing returned memory with
93 When the value is an nvlist, the caller is responsible for destroying the
96 When the value is a descriptor, the caller is responsible for closing the
97 returned descriptor with
112 API was implemented by
113 .An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
114 under sponsorship from the FreeBSD Foundation.
115 This manual page was written by
116 .An Adam Starak Aq Mt starak.adam@gmail.com