summaryrefslogtreecommitdiff
path: root/static/freebsd/man9/nv.9 4.html
diff options
context:
space:
mode:
Diffstat (limited to 'static/freebsd/man9/nv.9 4.html')
-rw-r--r--static/freebsd/man9/nv.9 4.html1177
1 files changed, 0 insertions, 1177 deletions
diff --git a/static/freebsd/man9/nv.9 4.html b/static/freebsd/man9/nv.9 4.html
deleted file mode 100644
index 0dc22c75..00000000
--- a/static/freebsd/man9/nv.9 4.html
+++ /dev/null
@@ -1,1177 +0,0 @@
-<table class="head">
- <tr>
- <td class="head-ltitle">NV(9)</td>
- <td class="head-vol">Kernel Developer's Manual</td>
- <td class="head-rtitle">NV(9)</td>
- </tr>
-</table>
-<div class="manual-text">
-<section class="Sh">
-<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
-<p class="Pp"><code class="Nm">nvlist_create</code>,
- <code class="Nm">nvlist_destroy</code>,
- <code class="Nm">nvlist_error</code>,
- <code class="Nm">nvlist_set_error</code>,
- <code class="Nm">nvlist_empty</code>, <code class="Nm">nvlist_flags</code>,
- <code class="Nm">nvlist_exists</code>, <code class="Nm">nvlist_free</code>,
- <code class="Nm">nvlist_clone</code>, <code class="Nm">nvlist_dump</code>,
- <code class="Nm">nvlist_fdump</code>, <code class="Nm">nvlist_size</code>,
- <code class="Nm">nvlist_pack</code>, <code class="Nm">nvlist_unpack</code>,
- <code class="Nm">nvlist_send</code>, <code class="Nm">nvlist_recv</code>,
- <code class="Nm">nvlist_xfer</code>,
- <code class="Nm">nvlist_in_array</code>,
- <code class="Nm">nvlist_next</code>, <code class="Nm">nvlist_add</code>,
- <code class="Nm">nvlist_move</code>, <code class="Nm">nvlist_get</code>,
- <code class="Nm">nvlist_take</code>, <code class="Nm">nvlist_append</code>
- &#x2014; <span class="Nd">library for name/value pairs</span></p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="LIBRARY"><a class="permalink" href="#LIBRARY">LIBRARY</a></h1>
-<p class="Pp"><span class="Lb">Name/value pairs library (libnv, -lnv)</span></p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
-<p class="Pp"><code class="In">#include
- &lt;<a class="In">sys/nv.h</a>&gt;</code></p>
-<p class="Pp"><var class="Ft">nvlist_t *</var>
- <br/>
- <code class="Fn">nvlist_create</code>(<var class="Fa" style="white-space: nowrap;">int
- flags</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_destroy</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>);</p>
-<p class="Pp"><var class="Ft">int</var>
- <br/>
- <code class="Fn">nvlist_error</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_set_error</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">int
- error</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_empty</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>);</p>
-<p class="Pp"><var class="Ft">int</var>
- <br/>
- <code class="Fn">nvlist_flags</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_in_array</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>);</p>
-<p class="Pp"><var class="Ft">nvlist_t *</var>
- <br/>
- <code class="Fn">nvlist_clone</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_dump</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">int
- fd</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_fdump</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">FILE
- *fp</var>);</p>
-<p class="Pp"><var class="Ft">size_t</var>
- <br/>
- <code class="Fn">nvlist_size</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>);</p>
-<p class="Pp"><var class="Ft">void *</var>
- <br/>
- <code class="Fn">nvlist_pack</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">size_t
- *sizep</var>);</p>
-<p class="Pp"><var class="Ft">nvlist_t *</var>
- <br/>
- <code class="Fn">nvlist_unpack</code>(<var class="Fa" style="white-space: nowrap;">const
- void *buf</var>, <var class="Fa" style="white-space: nowrap;">size_t
- size</var>, <var class="Fa" style="white-space: nowrap;">int
- flags</var>);</p>
-<p class="Pp"><var class="Ft">int</var>
- <br/>
- <code class="Fn">nvlist_send</code>(<var class="Fa" style="white-space: nowrap;">int
- sock</var>, <var class="Fa" style="white-space: nowrap;">const nvlist_t
- *nvl</var>);</p>
-<p class="Pp"><var class="Ft">nvlist_t *</var>
- <br/>
- <code class="Fn">nvlist_recv</code>(<var class="Fa" style="white-space: nowrap;">int
- sock</var>, <var class="Fa" style="white-space: nowrap;">int
- flags</var>);</p>
-<p class="Pp"><var class="Ft">nvlist_t *</var>
- <br/>
- <code class="Fn">nvlist_xfer</code>(<var class="Fa" style="white-space: nowrap;">int
- sock</var>, <var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">int
- flags</var>);</p>
-<p class="Pp"><var class="Ft">const char *</var>
- <br/>
- <code class="Fn">nvlist_next</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">int
- *typep</var>, <var class="Fa" style="white-space: nowrap;">void
- **cookiep</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_exists</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_exists_type</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">int
- type</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_exists_null</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_exists_bool</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_exists_number</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_exists_string</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_exists_nvlist</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_exists_descriptor</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_exists_binary</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_exists_bool_array</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_exists_number_array</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_exists_string_array</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_exists_nvlist_array</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_exists_descriptor_array</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_add_null</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_add_bool</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">bool
- value</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_add_number</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">uint64_t
- value</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_add_string</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">const char
- *value</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_add_stringf</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">const char
- *valuefmt</var>,
- <var class="Fa" style="white-space: nowrap;">...</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_add_stringv</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">const char
- *valuefmt</var>, <var class="Fa" style="white-space: nowrap;">va_list
- valueap</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_add_nvlist</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">const nvlist_t
- *value</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_add_descriptor</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">int
- value</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_add_binary</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">const void
- *value</var>, <var class="Fa" style="white-space: nowrap;">size_t
- size</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_add_bool_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">const bool
- *value</var>, <var class="Fa" style="white-space: nowrap;">size_t
- nitems</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_add_number_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">const uint64_t
- *value</var>, <var class="Fa" style="white-space: nowrap;">size_t
- nitems</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_add_string_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">const char * const
- * value</var>, <var class="Fa" style="white-space: nowrap;">size_t
- nitems</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_add_nvlist_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">const nvlist_t *
- const * value</var>, <var class="Fa" style="white-space: nowrap;">size_t
- nitems</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_add_descriptor_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">const int
- *value</var>, <var class="Fa" style="white-space: nowrap;">size_t
- nitems</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_move_string</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">char
- *value</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_move_nvlist</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">nvlist_t
- *value</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_move_descriptor</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">int
- value</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_move_binary</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">void *value</var>,
- <var class="Fa" style="white-space: nowrap;">size_t size</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_move_bool_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">bool *value</var>,
- <var class="Fa" style="white-space: nowrap;">size_t nitems</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_move_number_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">uint64_t
- *value</var>, <var class="Fa" style="white-space: nowrap;">size_t
- nitems</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_move_string_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">char
- **value</var>, <var class="Fa" style="white-space: nowrap;">size_t
- nitems</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_move_nvlist_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">nvlist_t
- **value</var>, <var class="Fa" style="white-space: nowrap;">size_t
- nitems</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_move_descriptor_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">int *value</var>,
- <var class="Fa" style="white-space: nowrap;">size_t nitems</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_get_bool</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">uint64_t</var>
- <br/>
- <code class="Fn">nvlist_get_number</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">const char *</var>
- <br/>
- <code class="Fn">nvlist_get_string</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">const nvlist_t *</var>
- <br/>
- <code class="Fn">nvlist_get_nvlist</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">int</var>
- <br/>
- <code class="Fn">nvlist_get_descriptor</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">const void *</var>
- <br/>
- <code class="Fn">nvlist_get_binary</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">size_t
- *sizep</var>);</p>
-<p class="Pp"><var class="Ft">const bool *</var>
- <br/>
- <code class="Fn">nvlist_get_bool_array</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">size_t
- *nitems</var>);</p>
-<p class="Pp"><var class="Ft">const uint64_t *</var>
- <br/>
- <code class="Fn">nvlist_get_number_array</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">size_t
- *nitems</var>);</p>
-<p class="Pp"><var class="Ft">const char * const *</var>
- <br/>
- <code class="Fn">nvlist_get_string_array</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">size_t
- *nitems</var>);</p>
-<p class="Pp"><var class="Ft">const nvlist_t * const *</var>
- <br/>
- <code class="Fn">nvlist_get_nvlist_array</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">size_t
- *nitems</var>);</p>
-<p class="Pp"><var class="Ft">const int *</var>
- <br/>
- <code class="Fn">nvlist_get_descriptor_array</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">size_t
- *nitems</var>);</p>
-<p class="Pp"><var class="Ft">const nvlist_t *</var>
- <br/>
- <code class="Fn">nvlist_get_parent</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">void
- **cookiep</var>);</p>
-<p class="Pp"><var class="Ft">const nvlist_t *</var>
- <br/>
- <code class="Fn">nvlist_get_array_next</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>);</p>
-<p class="Pp"><var class="Ft">const nvlist_t *</var>
- <br/>
- <code class="Fn">nvlist_get_pararr</code>(<var class="Fa" style="white-space: nowrap;">const
- nvlist_t *nvl</var>, <var class="Fa" style="white-space: nowrap;">void
- **cookiep</var>);</p>
-<p class="Pp"><var class="Ft">bool</var>
- <br/>
- <code class="Fn">nvlist_take_bool</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">uint64_t</var>
- <br/>
- <code class="Fn">nvlist_take_number</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">char *</var>
- <br/>
- <code class="Fn">nvlist_take_string</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">nvlist_t *</var>
- <br/>
- <code class="Fn">nvlist_take_nvlist</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">int</var>
- <br/>
- <code class="Fn">nvlist_take_descriptor</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">void *</var>
- <br/>
- <code class="Fn">nvlist_take_binary</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">size_t
- *sizep</var>);</p>
-<p class="Pp"><var class="Ft">bool *</var>
- <br/>
- <code class="Fn">nvlist_take_bool_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">size_t
- *nitems</var>);</p>
-<p class="Pp"><var class="Ft">uint64_t **</var>
- <br/>
- <code class="Fn">nvlist_take_number_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">size_t
- *nitems</var>);</p>
-<p class="Pp"><var class="Ft">char **</var>
- <br/>
- <code class="Fn">nvlist_take_string_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">size_t
- *nitems</var>);</p>
-<p class="Pp"><var class="Ft">nvlist_t **</var>
- <br/>
- <code class="Fn">nvlist_take_nvlist_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">size_t
- *nitems</var>);</p>
-<p class="Pp"><var class="Ft">int *</var>
- <br/>
- <code class="Fn">nvlist_take_descriptor_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">size_t
- *nitems</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_append_bool_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">const bool
- value</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_append_number_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">const uint64_t
- value</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_append_string_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">const char * const
- value</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_append_nvlist_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">const nvlist_t *
- const value</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_append_descriptor_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">int
- value</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_free</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_free_type</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>, <var class="Fa" style="white-space: nowrap;">int
- type</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_free_null</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_free_bool</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_free_number</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_free_string</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_free_nvlist</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_free_descriptor</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_free_binary</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_free_bool_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_free_number_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_free_string_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_free_nvlist_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-<p class="Pp"><var class="Ft">void</var>
- <br/>
- <code class="Fn">nvlist_free_descriptor_array</code>(<var class="Fa" style="white-space: nowrap;">nvlist_t
- *nvl</var>, <var class="Fa" style="white-space: nowrap;">const char
- *name</var>);</p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
-<p class="Pp">The <code class="Nm">libnv</code> library permits creating and
- managing name value pairs as well as sending and receiving them over
- sockets. A group (list) of name value pairs is called an
- <code class="Nm">nvlist</code>. The API supports the following data types
- for values:</p>
-<dl class="Bl-ohang Bd-indent">
- <dt id="null"><a class="permalink" href="#null"><b class="Sy">null</b></a>
- (<a class="permalink" href="#NV_TYPE_NULL"><b class="Sy" id="NV_TYPE_NULL">NV_TYPE_NULL</b></a>)</dt>
- <dd>There is no data associated with the name.</dd>
- <dt id="bool"><a class="permalink" href="#bool"><b class="Sy">bool</b></a>
- (<a class="permalink" href="#NV_TYPE_BOOL"><b class="Sy" id="NV_TYPE_BOOL">NV_TYPE_BOOL</b></a>)</dt>
- <dd>The value can be either <code class="Dv">true</code> or
- <code class="Dv">false</code>.</dd>
- <dt id="number"><a class="permalink" href="#number"><b class="Sy">number</b></a>
- (<a class="permalink" href="#NV_TYPE_NUMBER"><b class="Sy" id="NV_TYPE_NUMBER">NV_TYPE_NUMBER</b></a>)</dt>
- <dd>The value is a number stored as <var class="Vt">uint64_t</var>.</dd>
- <dt id="string"><a class="permalink" href="#string"><b class="Sy">string</b></a>
- (<a class="permalink" href="#NV_TYPE_STRING"><b class="Sy" id="NV_TYPE_STRING">NV_TYPE_STRING</b></a>)</dt>
- <dd>The value is a C string.</dd>
- <dt id="nvlist"><a class="permalink" href="#nvlist"><b class="Sy">nvlist</b></a>
- (<a class="permalink" href="#NV_TYPE_NVLIST"><b class="Sy" id="NV_TYPE_NVLIST">NV_TYPE_NVLIST</b></a>)</dt>
- <dd>The value is a nested nvlist.</dd>
- <dt id="descriptor"><a class="permalink" href="#descriptor"><b class="Sy">descriptor</b></a>
- (<a class="permalink" href="#NV_TYPE_DESCRIPTOR"><b class="Sy" id="NV_TYPE_DESCRIPTOR">NV_TYPE_DESCRIPTOR</b></a>)</dt>
- <dd>The value is a file descriptor. Note that file descriptors can be sent
- only over <a class="Xr">unix(4)</a> domain sockets.</dd>
- <dt id="binary"><a class="permalink" href="#binary"><b class="Sy">binary</b></a>
- (<a class="permalink" href="#NV_TYPE_BINARY"><b class="Sy" id="NV_TYPE_BINARY">NV_TYPE_BINARY</b></a>)</dt>
- <dd>The value is a binary buffer.</dd>
- <dt id="NV_TYPE_BOOL_ARRAY"><b class="Sy">bool array</b>
- (<a class="permalink" href="#NV_TYPE_BOOL_ARRAY"><b class="Sy">NV_TYPE_BOOL_ARRAY</b></a>)</dt>
- <dd>The value is an array of boolean values.</dd>
- <dt id="NV_TYPE_NUMBER_ARRAY"><b class="Sy">number array</b>
- (<a class="permalink" href="#NV_TYPE_NUMBER_ARRAY"><b class="Sy">NV_TYPE_NUMBER_ARRAY</b></a>)</dt>
- <dd>The value is an array of numbers, each stored as
- <var class="Vt">uint64_t</var>.</dd>
- <dt id="NV_TYPE_STRING_ARRAY"><b class="Sy">string array</b>
- (<a class="permalink" href="#NV_TYPE_STRING_ARRAY"><b class="Sy">NV_TYPE_STRING_ARRAY</b></a>)</dt>
- <dd>The value is an array of C strings.</dd>
- <dt id="NV_TYPE_NVLIST_ARRAY"><b class="Sy">nvlist array</b>
- (<a class="permalink" href="#NV_TYPE_NVLIST_ARRAY"><b class="Sy">NV_TYPE_NVLIST_ARRAY</b></a>)</dt>
- <dd>The value is an array of nvlists. When an nvlist is added to an array, it
- becomes part of the primary nvlist. Traversing these arrays can be done
- using the
- <a class="permalink" href="#nvlist_get_array_next"><code class="Fn" id="nvlist_get_array_next">nvlist_get_array_next</code></a>()
- and <code class="Fn">nvlist_get_pararr</code>() functions.</dd>
- <dt id="NV_TYPE_DESCRIPTOR_ARRAY"><b class="Sy">descriptor array</b>
- (<a class="permalink" href="#NV_TYPE_DESCRIPTOR_ARRAY"><b class="Sy">NV_TYPE_DESCRIPTOR_ARRAY</b></a>)</dt>
- <dd>The value is an array of files descriptors.</dd>
-</dl>
-<p class="Pp" id="nvlist_create">The
- <a class="permalink" href="#nvlist_create"><code class="Fn">nvlist_create</code></a>()
- function allocates memory and initializes an nvlist.</p>
-<p class="Pp">The following flags can be provided:</p>
-<p class="Pp"></p>
-<div class="Bd-indent">
-<dl class="Bl-tag Bl-compact">
- <dt id="NV_FLAG_IGNORE_CASE"><a class="permalink" href="#NV_FLAG_IGNORE_CASE"><code class="Dv">NV_FLAG_IGNORE_CASE</code></a></dt>
- <dd>Perform case-insensitive lookups of provided names.</dd>
- <dt id="NV_FLAG_NO_UNIQUE"><a class="permalink" href="#NV_FLAG_NO_UNIQUE"><code class="Dv">NV_FLAG_NO_UNIQUE</code></a></dt>
- <dd>Names in the nvlist do not have to be unique.</dd>
-</dl>
-</div>
-<p class="Pp" id="nvlist_destroy">The
- <a class="permalink" href="#nvlist_destroy"><code class="Fn">nvlist_destroy</code></a>()
- function destroys the given nvlist. This function does nothing if
- <var class="Fa">nvl</var> is <code class="Dv">NULL</code>. This function
- never modifies <var class="Va">errno</var>.</p>
-<p class="Pp" id="nvlist_error">The
- <a class="permalink" href="#nvlist_error"><code class="Fn">nvlist_error</code></a>()
- function returns the first error set on <var class="Fa">nvl</var>. If
- <var class="Fa">nvl</var> is not in the error state, this function returns
- zero. If <var class="Fa">nvl</var> is <code class="Dv">NULL</code>,
- <code class="Er">ENOMEM</code> is returned.</p>
-<p class="Pp" id="nvlist_set_error">The
- <a class="permalink" href="#nvlist_set_error"><code class="Fn">nvlist_set_error</code></a>()
- function sets an the error value for <var class="Fa">nvl</var>. Subsequent
- calls to <code class="Fn">nvlist_error</code>() will return
- <var class="Fa">error</var>. This function cannot be used to clear the error
- state from an nvlist. This function does nothing if the nvlist is already in
- the error state.</p>
-<p class="Pp" id="nvlist_empty">The
- <a class="permalink" href="#nvlist_empty"><code class="Fn">nvlist_empty</code></a>()
- function returns <code class="Dv">true</code> if <var class="Fa">nvl</var>
- is empty and <code class="Dv">false</code> otherwise. The nvlist must not be
- in the error state.</p>
-<p class="Pp" id="nvlist_flags">The
- <a class="permalink" href="#nvlist_flags"><code class="Fn">nvlist_flags</code></a>()
- function returns the flags used to create <var class="Fa">nvl</var> with the
- <code class="Fn">nvlist_create</code>(),
- <code class="Fn">nvlist_recv</code>(),
- <code class="Fn">nvlist_unpack</code>(), or
- <code class="Fn">nvlist_xfer</code>() functions.</p>
-<p class="Pp" id="nvlist_in_array">The
- <a class="permalink" href="#nvlist_in_array"><code class="Fn">nvlist_in_array</code></a>()
- function returns <code class="Dv">true</code> if <var class="Fa">nvl</var>
- is part of an array that is a member of another nvlist.</p>
-<p class="Pp" id="nvlist_clone">The
- <a class="permalink" href="#nvlist_clone"><code class="Fn">nvlist_clone</code></a>()
- function clones <var class="Fa">nvl</var>. The clone shares no resources
- with its origin. This also means that all file descriptors that are part of
- the nvlist will be duplicated with the <a class="Xr">dup(2)</a> system call
- before placing them in the clone.</p>
-<p class="Pp" id="nvlist_dump">The
- <a class="permalink" href="#nvlist_dump"><code class="Fn">nvlist_dump</code></a>()
- function dumps nvlist content for debugging purposes to the file descriptor
- <var class="Fa">fd</var>.</p>
-<p class="Pp" id="nvlist_fdump">The
- <a class="permalink" href="#nvlist_fdump"><code class="Fn">nvlist_fdump</code></a>()
- dumps nvlist content for debugging purposes to the file stream
- <var class="Fa">fp</var>.</p>
-<p class="Pp" id="nvlist_size">The
- <a class="permalink" href="#nvlist_size"><code class="Fn">nvlist_size</code></a>()
- function returns the size of the binary buffer that would be generated by
- the <code class="Fn">nvlist_pack</code>() function.</p>
-<p class="Pp" id="nvlist_pack">The
- <a class="permalink" href="#nvlist_pack"><code class="Fn">nvlist_pack</code></a>()
- function converts the given nvlist to a binary buffer. The function
- allocates memory for the buffer which should be freed with the
- <a class="Xr">free(3)</a> function. If the <var class="Fa">sizep</var>
- argument is not <code class="Dv">NULL</code>, the size of the buffer is
- stored there. This function returns <code class="Dv">NULL</code> in case of
- an error (allocation failure). If the nvlist contains any file descriptors
- <code class="Dv">NULL</code> will be returned. The nvlist must not be in the
- error state.</p>
-<p class="Pp" id="nvlist_unpack">The
- <a class="permalink" href="#nvlist_unpack"><code class="Fn">nvlist_unpack</code></a>()
- function converts a binary buffer to a new nvlist. The
- <var class="Fa">flags</var> argument has the same meaning as the
- <var class="Fa">flags</var> argument passed to
- <code class="Fn">nvlist_create</code>(). If <var class="Fa">flags</var> do
- not match the flags used to create the initial nvlist before it was packed,
- this function will fail. The flags of nested nvlists are not validated by
- this function. The caller is responsible for validating the flags on any
- nested nvlists using <code class="Fn">nvlist_flags</code>(). This function
- returns the new nvlist on success or <code class="Dv">NULL</code> in case of
- an error.</p>
-<p class="Pp" id="nvlist_send">The
- <a class="permalink" href="#nvlist_send"><code class="Fn">nvlist_send</code></a>()
- function sends <var class="Fa">nvl</var> over the socket
- <var class="Fa">sock</var>. Note that nvlists that contain file descriptors
- can only be sent over <a class="Xr">unix(4)</a> domain sockets.</p>
-<p class="Pp" id="nvlist_recv">The
- <a class="permalink" href="#nvlist_recv"><code class="Fn">nvlist_recv</code></a>()
- function receives an nvlist over the socket <var class="Fa">sock</var>. As
- with <code class="Fn">nvlist_unpack</code>(), the
- <var class="Fa">flags</var> argument is used to construct the new nvlist and
- must match the flags used to construct the original nvlist written to
- <var class="Fa">sock</var> by the peer. The flags of nested nvlists are not
- validated by this function. The caller is responsible for validating the
- flags on any nested nvlists using <code class="Fn">nvlist_flags</code>().
- This function returns the new nvlist on success or
- <code class="Dv">NULL</code> in case of an error.</p>
-<p class="Pp" id="nvlist_xfer">The
- <a class="permalink" href="#nvlist_xfer"><code class="Fn">nvlist_xfer</code></a>()
- function sends <var class="Fa">nvl</var> over the socket
- <var class="Fa">sock</var> argument and then receives a new nvlist over the
- same socket. The <var class="Fa">flags</var> argument applies to the new
- nvlist similar to <code class="Fn">nvlist_recv</code>(). The nvlist
- <var class="Fa">nvl</var> is always destroyed. This function returns the new
- nvlist on success or <code class="Dv">NULL</code> in case of an error.</p>
-<p class="Pp" id="nvlist_next">The
- <a class="permalink" href="#nvlist_next"><code class="Fn">nvlist_next</code></a>()
- function iterates over <var class="Fa">nvl</var> returning the names and
- types of subsequent elements. The <var class="Fa">cookiep</var> argument
- determines which element is returned. If <var class="Va">*cookiep</var> is
- <code class="Dv">NULL</code>, the values for the first element in the list
- are returned. Otherwise, <var class="Va">*cookiep</var> should contain the
- result of a prior call to <code class="Fn">nvlist_next</code>() in which
- case values for the next element from <var class="Fa">nvl</var> are
- returned. This function returns <code class="Dv">NULL</code> when there are
- no more elements on <var class="Fa">nvl</var>. The
- <var class="Fa">typep</var> argument can be <code class="Dv">NULL</code>.
- Elements may not be removed from <var class="Fa">nvl</var> the nvlist while
- traversing it. <var class="Fa">nvl</var> must not be in the error state.
- Additional actions can be performed on an element identified by a cookie via
- the <a class="Xr">cnv(9)</a> API .</p>
-<p class="Pp" id="nvlist_exists">The
- <a class="permalink" href="#nvlist_exists"><code class="Fn">nvlist_exists</code></a>()
- function returns <code class="Dv">true</code> if an element named
- <var class="Fa">name</var> exists in <var class="Fa">nvl</var> (regardless
- of type) or <code class="Dv">false</code> otherwise. The nvlist must not be
- in the error state.</p>
-<p class="Pp" id="nvlist_exists_type">The
- <a class="permalink" href="#nvlist_exists_type"><code class="Fn">nvlist_exists_type</code></a>()
- function returns <code class="Dv">true</code> if an element named
- <var class="Fa">name</var> of type <var class="Fa">type</var> exists or
- <code class="Dv">false</code> otherwise. The nvlist must not be in the error
- state.</p>
-<p class="Pp" id="nvlist_exists_null">The
- <a class="permalink" href="#nvlist_exists_null"><code class="Fn">nvlist_exists_null</code></a>(),
- <a class="permalink" href="#nvlist_exists_bool"><code class="Fn" id="nvlist_exists_bool">nvlist_exists_bool</code></a>(),
- <a class="permalink" href="#nvlist_exists_number"><code class="Fn" id="nvlist_exists_number">nvlist_exists_number</code></a>(),
- <a class="permalink" href="#nvlist_exists_string"><code class="Fn" id="nvlist_exists_string">nvlist_exists_string</code></a>(),
- <a class="permalink" href="#nvlist_exists_nvlist"><code class="Fn" id="nvlist_exists_nvlist">nvlist_exists_nvlist</code></a>(),
- <a class="permalink" href="#nvlist_exists_descriptor"><code class="Fn" id="nvlist_exists_descriptor">nvlist_exists_descriptor</code></a>(),
- <a class="permalink" href="#nvlist_exists_binary"><code class="Fn" id="nvlist_exists_binary">nvlist_exists_binary</code></a>(),
- <a class="permalink" href="#nvlist_exists_bool_array"><code class="Fn" id="nvlist_exists_bool_array">nvlist_exists_bool_array</code></a>(),
- <a class="permalink" href="#nvlist_exists_number_array"><code class="Fn" id="nvlist_exists_number_array">nvlist_exists_number_array</code></a>(),
- <a class="permalink" href="#nvlist_exists_string_array"><code class="Fn" id="nvlist_exists_string_array">nvlist_exists_string_array</code></a>(),
- <a class="permalink" href="#nvlist_exists_nvlist_array"><code class="Fn" id="nvlist_exists_nvlist_array">nvlist_exists_nvlist_array</code></a>(),
- <a class="permalink" href="#nvlist_exists_descriptor_array"><code class="Fn" id="nvlist_exists_descriptor_array">nvlist_exists_descriptor_array</code></a>()
- functions return <code class="Dv">true</code> if element named
- <var class="Fa">name</var> with the type determined by the function name
- exists or <code class="Dv">false</code> otherwise. The nvlist must not be in
- the error state.</p>
-<p class="Pp" id="nvlist_add_null">The
- <a class="permalink" href="#nvlist_add_null"><code class="Fn">nvlist_add_null</code></a>(),
- <a class="permalink" href="#nvlist_add_bool"><code class="Fn" id="nvlist_add_bool">nvlist_add_bool</code></a>(),
- <a class="permalink" href="#nvlist_add_number"><code class="Fn" id="nvlist_add_number">nvlist_add_number</code></a>(),
- <a class="permalink" href="#nvlist_add_string"><code class="Fn" id="nvlist_add_string">nvlist_add_string</code></a>(),
- <a class="permalink" href="#nvlist_add_stringf"><code class="Fn" id="nvlist_add_stringf">nvlist_add_stringf</code></a>(),
- <a class="permalink" href="#nvlist_add_stringv"><code class="Fn" id="nvlist_add_stringv">nvlist_add_stringv</code></a>(),
- <a class="permalink" href="#nvlist_add_nvlist"><code class="Fn" id="nvlist_add_nvlist">nvlist_add_nvlist</code></a>(),
- <a class="permalink" href="#nvlist_add_descriptor"><code class="Fn" id="nvlist_add_descriptor">nvlist_add_descriptor</code></a>(),
- <a class="permalink" href="#nvlist_add_binary"><code class="Fn" id="nvlist_add_binary">nvlist_add_binary</code></a>(),
- <a class="permalink" href="#nvlist_add_bool_array"><code class="Fn" id="nvlist_add_bool_array">nvlist_add_bool_array</code></a>(),
- <a class="permalink" href="#nvlist_add_number_array"><code class="Fn" id="nvlist_add_number_array">nvlist_add_number_array</code></a>(),
- <a class="permalink" href="#nvlist_add_string_array"><code class="Fn" id="nvlist_add_string_array">nvlist_add_string_array</code></a>(),
- <code class="Fn">nvlist_add_nvlist_array</code>(),
- <a class="permalink" href="#nvlist_add_descriptor_array"><code class="Fn" id="nvlist_add_descriptor_array">nvlist_add_descriptor_array</code></a>()
- functions add an element to <var class="Fa">nvl</var>. When adding a string
- or binary buffer, these functions allocate memory and copy the data. When
- adding an nvlist, the <var class="Fa">value</var> nvlist is cloned and the
- clone is added to <var class="Fa">nvl</var>. When adding a file descriptor,
- the descriptor is duplicated via the <a class="Xr">dup(2)</a> system call
- and the new file descriptor is added. The array functions fail if there are
- any <code class="Dv">NULL</code> elements in the array, or if the array
- pointer is <code class="Dv">NULL</code>. If an error occurs while adding a
- new element, an internal error is set which can be examined using the
- <code class="Fn">nvlist_error</code>() function.</p>
-<p class="Pp" id="nvlist_move_string">The
- <a class="permalink" href="#nvlist_move_string"><code class="Fn">nvlist_move_string</code></a>(),
- <a class="permalink" href="#nvlist_move_nvlist"><code class="Fn" id="nvlist_move_nvlist">nvlist_move_nvlist</code></a>(),
- <a class="permalink" href="#nvlist_move_descriptor"><code class="Fn" id="nvlist_move_descriptor">nvlist_move_descriptor</code></a>(),
- <a class="permalink" href="#nvlist_move_binary"><code class="Fn" id="nvlist_move_binary">nvlist_move_binary</code></a>(),
- <a class="permalink" href="#nvlist_move_bool_array"><code class="Fn" id="nvlist_move_bool_array">nvlist_move_bool_array</code></a>(),
- <a class="permalink" href="#nvlist_move_number_array"><code class="Fn" id="nvlist_move_number_array">nvlist_move_number_array</code></a>(),
- <a class="permalink" href="#nvlist_move_string_array"><code class="Fn" id="nvlist_move_string_array">nvlist_move_string_array</code></a>(),
- <code class="Fn">nvlist_move_nvlist_array</code>(),
- <a class="permalink" href="#nvlist_move_descriptor_array"><code class="Fn" id="nvlist_move_descriptor_array">nvlist_move_descriptor_array</code></a>()
- functions add an element to <var class="Fa">nvl</var>, but unlike the
- <a class="permalink" href="#nvlist_add__type_"><code class="Fn" id="nvlist_add__type_">nvlist_add_&lt;type&gt;</code></a>()
- functions they consume the given resource. For string, file descriptor,
- binary buffer, or nvlist values, no value should be moved into an nvlist
- multiple times; doing so will cause that value to be freed multiple times.
- Note that strings or binary buffers must be allocated with
- <a class="Xr">malloc(3)</a>, and the pointers will be released via
- <a class="Xr">free(3)</a> when <var class="Fa">nvl</var> is destroyed. The
- array functions fail if there are any <code class="Dv">NULL</code> elements,
- or if the array pointer is <code class="Dv">NULL</code>. If an error occurs
- while adding new element, the resource is destroyed and an internal error is
- set which can be examined using the <code class="Fn">nvlist_error</code>()
- function.</p>
-<p class="Pp" id="nvlist_get_bool">The
- <a class="permalink" href="#nvlist_get_bool"><code class="Fn">nvlist_get_bool</code></a>(),
- <a class="permalink" href="#nvlist_get_number"><code class="Fn" id="nvlist_get_number">nvlist_get_number</code></a>(),
- <a class="permalink" href="#nvlist_get_string"><code class="Fn" id="nvlist_get_string">nvlist_get_string</code></a>(),
- <a class="permalink" href="#nvlist_get_nvlist"><code class="Fn" id="nvlist_get_nvlist">nvlist_get_nvlist</code></a>(),
- <a class="permalink" href="#nvlist_get_descriptor"><code class="Fn" id="nvlist_get_descriptor">nvlist_get_descriptor</code></a>(),
- <a class="permalink" href="#nvlist_get_binary"><code class="Fn" id="nvlist_get_binary">nvlist_get_binary</code></a>(),
- <a class="permalink" href="#nvlist_get_bool_array"><code class="Fn" id="nvlist_get_bool_array">nvlist_get_bool_array</code></a>(),
- <a class="permalink" href="#nvlist_get_number_array"><code class="Fn" id="nvlist_get_number_array">nvlist_get_number_array</code></a>(),
- <a class="permalink" href="#nvlist_get_string_array"><code class="Fn" id="nvlist_get_string_array">nvlist_get_string_array</code></a>(),
- <a class="permalink" href="#nvlist_get_nvlist_array"><code class="Fn" id="nvlist_get_nvlist_array">nvlist_get_nvlist_array</code></a>(),
- <a class="permalink" href="#nvlist_get_descriptor_array"><code class="Fn" id="nvlist_get_descriptor_array">nvlist_get_descriptor_array</code></a>()
- functions return the value of the first element in <var class="Fa">nvl</var>
- named <var class="Fa">name</var>. For string, nvlist, file descriptor,
- binary buffer, or array values, the returned resource must not be modified -
- it still belongs to <var class="Fa">nvl</var>.</p>
-<p class="Pp">If an element named <var class="Fa">name</var> does not exist, the
- program aborts. To avoid this, the caller should check for the existence of
- the element before trying to obtain the value or use the
- <a class="Xr">dnv(9)</a> extension which provides a default value in the
- case of a missing element.</p>
-<p class="Pp">The nvlist must not be in the error state.</p>
-<p class="Pp" id="nvlist_get_parent">The
- <a class="permalink" href="#nvlist_get_parent"><code class="Fn">nvlist_get_parent</code></a>()
- function returns the parent nvlist of <var class="Fa">nvl</var>.</p>
-<p class="Pp" id="nvlist_get_array_next~2">The
- <a class="permalink" href="#nvlist_get_array_next~2"><code class="Fn">nvlist_get_array_next</code></a>()
- function returns the next element after <var class="Fa">nvl</var> from an
- array of nvlists. If <var class="Fa">nvl</var> is not in an array of nvlists
- or it is the last element, this function returns
- <code class="Dv">NULL</code>. An nvlist is only in an nvlist array if it was
- added to an nvlist array using
- <a class="permalink" href="#nvlist_add_nvlist_array"><code class="Fn" id="nvlist_add_nvlist_array">nvlist_add_nvlist_array</code></a>(),
- <a class="permalink" href="#nvlist_append_nvlist_array"><code class="Fn" id="nvlist_append_nvlist_array">nvlist_append_nvlist_array</code></a>(),
- or
- <a class="permalink" href="#nvlist_move_nvlist_array"><code class="Fn" id="nvlist_move_nvlist_array">nvlist_move_nvlist_array</code></a>().</p>
-<p class="Pp" id="nvlist_get_pararr">The
- <a class="permalink" href="#nvlist_get_pararr"><code class="Fn">nvlist_get_pararr</code></a>()
- function returns the next element after
- <a class="permalink" href="#nvl"><code class="Fn" id="nvl">nvl</code></a>()
- from an array of nvlists. If <code class="Fn">nvl</code>() is the last
- element in an array of nvlists, the parent nvlist of <var class="Fa">nvl
- is</var> returned. If <code class="Fn">nvl</code>() is not in an array of
- nvlists, <code class="Dv">NULL</code> is returned.</p>
-<p class="Pp" id="nvlist_take_bool">The
- <a class="permalink" href="#nvlist_take_bool"><code class="Fn">nvlist_take_bool</code></a>(),
- <a class="permalink" href="#nvlist_take_number"><code class="Fn" id="nvlist_take_number">nvlist_take_number</code></a>(),
- <a class="permalink" href="#nvlist_take_string"><code class="Fn" id="nvlist_take_string">nvlist_take_string</code></a>(),
- <a class="permalink" href="#nvlist_take_nvlist"><code class="Fn" id="nvlist_take_nvlist">nvlist_take_nvlist</code></a>(),
- <a class="permalink" href="#nvlist_take_descriptor"><code class="Fn" id="nvlist_take_descriptor">nvlist_take_descriptor</code></a>(),
- <a class="permalink" href="#nvlist_take_binary"><code class="Fn" id="nvlist_take_binary">nvlist_take_binary</code></a>(),
- <a class="permalink" href="#nvlist_take_bool_array"><code class="Fn" id="nvlist_take_bool_array">nvlist_take_bool_array</code></a>(),
- <a class="permalink" href="#nvlist_take_number_array"><code class="Fn" id="nvlist_take_number_array">nvlist_take_number_array</code></a>(),
- <a class="permalink" href="#nvlist_take_string_array"><code class="Fn" id="nvlist_take_string_array">nvlist_take_string_array</code></a>(),
- <a class="permalink" href="#nvlist_take_nvlist_array"><code class="Fn" id="nvlist_take_nvlist_array">nvlist_take_nvlist_array</code></a>(),
- <a class="permalink" href="#nvlist_take_descriptor_array"><code class="Fn" id="nvlist_take_descriptor_array">nvlist_take_descriptor_array</code></a>()
- functions return the value of the element named <var class="Fa">name</var>
- and remove the element from <var class="Fa">nvl</var>. For string and binary
- buffer values, the caller is responsible for freeing the returned value
- using the <a class="Xr">free(3)</a> function. For nvlist values, the caller
- is responsible for destroying the returned nvlist using the
- <code class="Fn">nvlist_destroy</code>() function. For file descriptor
- values, the caller is responsible for closing the returned descriptor using
- the
- <a class="permalink" href="#close"><code class="Fn" id="close">close</code></a>(<var class="Fa">2</var>)
- system call. For array values, the caller is responsible for destroying
- every element of the array based on the element type. In addition, the
- caller must also free the pointer to the array using the
- <a class="Xr">free(3)</a> function.</p>
-<p class="Pp">If an element named <var class="Fa">name</var> does not exist, the
- program aborts. To avoid this, the caller should check for the existence of
- the element before trying to obtain the value or use the
- <a class="Xr">dnv(9)</a> extension which provides a default value in the
- case of a missing element.</p>
-<p class="Pp">The nvlist must not be in the error state.</p>
-<p class="Pp" id="nvlist_append_bool_array">The
- <a class="permalink" href="#nvlist_append_bool_array"><code class="Fn">nvlist_append_bool_array</code></a>(),
- <a class="permalink" href="#nvlist_append_number_array"><code class="Fn" id="nvlist_append_number_array">nvlist_append_number_array</code></a>(),
- <a class="permalink" href="#nvlist_append_string_array"><code class="Fn" id="nvlist_append_string_array">nvlist_append_string_array</code></a>(),
- <code class="Fn">nvlist_append_nvlist_array</code>(),
- <a class="permalink" href="#nvlist_append_descriptor_array"><code class="Fn" id="nvlist_append_descriptor_array">nvlist_append_descriptor_array</code></a>()
- functions append an element to an existing array using the same semantics as
- the add functions (that is, the element will be copied when applicable). If
- the array named <var class="Fa">name</var> does not exist, then it will be
- created as if using the
- <a class="permalink" href="#nvlist_add__type__array"><code class="Fn" id="nvlist_add__type__array">nvlist_add_&lt;type&gt;_array</code></a>()
- function. If an error occurs while appending a new element, an internal
- error is set on <var class="Fa">nvl</var>.</p>
-<p class="Pp" id="nvlist_free">The
- <a class="permalink" href="#nvlist_free"><code class="Fn">nvlist_free</code></a>()
- function removes the first element named <var class="Fa">name</var> from
- <var class="Fa">nvl</var> (regardless of type) and frees all resources
- associated with it. If no element named <var class="Fa">name</var> exists,
- the program aborts. The nvlist must not be in the error state.</p>
-<p class="Pp" id="nvlist_free_type">The
- <a class="permalink" href="#nvlist_free_type"><code class="Fn">nvlist_free_type</code></a>()
- function removes the first element named <var class="Fa">name</var> of type
- <var class="Fa">type</var> from <var class="Fa">nvl</var> and frees all
- resources associated with it. If no element named <var class="Fa">name</var>
- of type <var class="Fa">type</var> exists, the program aborts. The nvlist
- must not be in the error state.</p>
-<p class="Pp" id="nvlist_free_null">The
- <a class="permalink" href="#nvlist_free_null"><code class="Fn">nvlist_free_null</code></a>(),
- <a class="permalink" href="#nvlist_free_bool"><code class="Fn" id="nvlist_free_bool">nvlist_free_bool</code></a>(),
- <a class="permalink" href="#nvlist_free_number"><code class="Fn" id="nvlist_free_number">nvlist_free_number</code></a>(),
- <a class="permalink" href="#nvlist_free_string"><code class="Fn" id="nvlist_free_string">nvlist_free_string</code></a>(),
- <a class="permalink" href="#nvlist_free_nvlist"><code class="Fn" id="nvlist_free_nvlist">nvlist_free_nvlist</code></a>(),
- <a class="permalink" href="#nvlist_free_descriptor"><code class="Fn" id="nvlist_free_descriptor">nvlist_free_descriptor</code></a>(),
- <a class="permalink" href="#nvlist_free_binary"><code class="Fn" id="nvlist_free_binary">nvlist_free_binary</code></a>(),
- <a class="permalink" href="#nvlist_free_bool_array"><code class="Fn" id="nvlist_free_bool_array">nvlist_free_bool_array</code></a>(),
- <a class="permalink" href="#nvlist_free_number_array"><code class="Fn" id="nvlist_free_number_array">nvlist_free_number_array</code></a>(),
- <a class="permalink" href="#nvlist_free_string_array"><code class="Fn" id="nvlist_free_string_array">nvlist_free_string_array</code></a>(),
- <a class="permalink" href="#nvlist_free_nvlist_array"><code class="Fn" id="nvlist_free_nvlist_array">nvlist_free_nvlist_array</code></a>(),
- <a class="permalink" href="#nvlist_free_descriptor_array"><code class="Fn" id="nvlist_free_descriptor_array">nvlist_free_descriptor_array</code></a>()
- functions remove the first element named <var class="Fa">name</var> with the
- type determined by the function name from <var class="Fa">nvl</var> free all
- resources associated with it. If no element named <var class="Fa">name</var>
- with the appropriate type exists, the program aborts. The nvlist must not be
- in the error state.</p>
-<section class="Ss">
-<h2 class="Ss" id="Notes"><a class="permalink" href="#Notes">Notes</a></h2>
-<p class="Pp">The <code class="Fn">nvlist_pack</code>() and
- <code class="Fn">nvlist_unpack</code>() functions handle byte-order
- conversions, so binary buffers can be packed and unpacked on hosts with
- different endianness.</p>
-<p class="Pp" id="nvlist_recv~2">The
- <a class="permalink" href="#nvlist_recv~2"><code class="Fn">nvlist_recv</code></a>(),
- <code class="Fn">nvlist_send</code>(), and
- <code class="Fn">nvlist_xfer</code>() functions can transfer nvlists between
- hosts with different endianness.</p>
-</section>
-<section class="Ss">
-<h2 class="Ss" id="Kernel_Considerations"><a class="permalink" href="#Kernel_Considerations">Kernel
- Considerations</a></h2>
-<p class="Pp">The <code class="Nm">nv</code>, <code class="Nm">cnv</code>, and
- <code class="Nm">dnv</code> APIs can be used in the kernel with the
- following differences:</p>
-<ul class="Bl-bullet">
- <li>File descriptor and file descriptor array value types are not
- supported.</li>
- <li><code class="Fn">nvlist_recv</code>(),
- <code class="Fn">nvlist_send</code>(), and
- <code class="Fn">nvlist_xfer</code>() are not supported.</li>
- <li>All memory allocations use the <code class="Dv">M_NVLIST</code> memory
- type with <a class="Xr">malloc(9)</a> and <a class="Xr">free(9)</a>. As a
- result, any allocated buffers moved into an nvlist must be allocated with
- <code class="Dv">M_NVLIST</code>, and buffers returned by functions such
- as <code class="Fn">nvlist_pack</code>() must be freed with
- <code class="Dv">M_NVLIST</code>.</li>
-</ul>
-</section>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
-<p class="Pp">The following example demonstrates how to prepare an nvlist and
- send it over a <a class="Xr">unix(4)</a> domain socket.</p>
-<div class="Bd Pp Li">
-<pre>nvlist_t *nvl;
-int fd;
-
-fd = open(&quot;/tmp/foo&quot;, O_RDONLY);
-if (fd &lt; 0)
- err(1, &quot;open(\&quot;/tmp/foo\&quot;) failed&quot;);
-
-nvl = nvlist_create(0);
-
-/*
- * There is no need to check if nvlist_create() succeeded
- * as the nvlist_add_&lt;type&gt;() functions can cope.
- * If it failed, nvlist_send() will fail.
- */
-nvlist_add_string(nvl, &quot;filename&quot;, &quot;/tmp/foo&quot;);
-nvlist_add_number(nvl, &quot;flags&quot;, O_RDONLY);
-
-/*
- * We just want to send the descriptor, so we can give it
- * for the nvlist to consume (that is why we use nvlist_move
- * not nvlist_add).
- */
-nvlist_move_descriptor(nvl, &quot;fd&quot;, fd);
-if (nvlist_send(sock, nvl) &lt; 0) {
- nvlist_destroy(nvl);
- err(1, &quot;nvlist_send() failed&quot;);
-}
-nvlist_destroy(nvl);</pre>
-</div>
-<p class="Pp">Receiving an nvlist and retrieving element values:</p>
-<div class="Bd Pp Li">
-<pre>nvlist_t *nvl;
-const char *command;
-char *filename;
-int fd;
-
-nvl = nvlist_recv(sock, 0);
-if (nvl == NULL)
- err(1, &quot;nvlist_recv() failed&quot;);
-
-/* For command we accept a pointer to the nvlist's internal buffer. */
-command = nvlist_get_string(nvl, &quot;command&quot;);
-
-/*
- * For filename we remove it from the nvlist and take
- * ownership of the buffer.
- */
-filename = nvlist_take_string(nvl, &quot;filename&quot;);
-
-/* The same for the file descriptor. */
-fd = nvlist_take_descriptor(nvl, &quot;fd&quot;);
-
-printf(&quot;command=%s filename=%s fd=%d0, command, filename, fd);
-
-/* command is freed by nvlist_destroy() */
-nvlist_destroy(nvl);
-free(filename);
-close(fd);</pre>
-</div>
-<p class="Pp">Iterating over an nvlist:</p>
-<div class="Bd Pp Li">
-<pre>nvlist_t *nvl;
-const char *name;
-void *cookie;
-int type;
-
-nvl = nvlist_recv(sock, 0);
-if (nvl == NULL)
- err(1, &quot;nvlist_recv() failed&quot;);
-
-cookie = NULL;
-while ((name = nvlist_next(nvl, &amp;type, &amp;cookie)) != NULL) {
- printf(&quot;%s=&quot;, name);
- switch (type) {
- case NV_TYPE_NUMBER:
- printf(&quot;%ju&quot;, (uintmax_t)nvlist_get_number(nvl, name));
- break;
- case NV_TYPE_STRING:
- printf(&quot;%s&quot;, nvlist_get_string(nvl, name));
- break;
- default:
- printf(&quot;N/A&quot;);
- break;
- }
- printf(&quot;\n&quot;);
-}</pre>
-</div>
-<p class="Pp">Iterating over every nested nvlist:</p>
-<div class="Bd Pp Li">
-<pre>nvlist_t *nvl;
-const char *name;
-void *cookie;
-int type;
-
-nvl = nvlist_recv(sock, 0);
-if (nvl == NULL)
- err(1, &quot;nvlist_recv() failed&quot;);
-
-cookie = NULL;
-do {
- while ((name = nvlist_next(nvl, &amp;type, &amp;cookie)) != NULL) {
- if (type == NV_TYPE_NVLIST) {
- nvl = nvlist_get_nvlist(nvl, name);
- cookie = NULL;
- }
- }
-} while ((nvl = nvlist_get_parent(nvl, &amp;cookie)) != NULL);</pre>
-</div>
-<p class="Pp">Iterating over every nested nvlist and every nvlist element:</p>
-<div class="Bd Pp Li">
-<pre>nvlist_t *nvl;
-const nvlist_t * const *array;
-const char *name;
-void *cookie;
-int type;
-
-nvl = nvlist_recv(sock, 0);
-if (nvl == null)
- err(1, &quot;nvlist_recv() failed&quot;);
-
-cookie = NULL;
-do {
- while ((name = nvlist_next(nvl, &amp;type, &amp;cookie)) != NULL) {
- if (type == NV_TYPE_NVLIST) {
- nvl = nvlist_get_nvlist(nvl, name);
- cookie = NULL;
- } else if (type == NV_TYPE_NVLIST_ARRAY) {
- nvl = nvlist_get_nvlist_array(nvl, name, NULL)[0];
- cookie = NULL;
- }
- }
-} while ((nvl = nvlist_get_pararr(nvl, &amp;cookie)) != NULL);</pre>
-</div>
-<p class="Pp">Or alternatively:</p>
-<div class="Bd Pp Li">
-<pre>nvlist_t *nvl, *tmp;
-const nvlist_t * const *array;
-const char *name;
-void *cookie;
-int type;
-
-nvl = nvlist_recv(sock, 0);
-if (nvl == null)
- err(1, &quot;nvlist_recv() failed&quot;);
-
-cooke = NULL;
-tmp = nvl;
-do {
- do {
- nvl = tmp;
- while ((name = nvlist_next(nvl, &amp;type, &amp;cookie)) != NULL) {
- if (type == NV_TYPE_NVLIST) {
- nvl = nvlist_get_nvlist(nvl, name);
- cookie = NULL;
- } else if (type == NV_TYPE_NVLIST_ARRAY) {
- nvl = nvlist_get_nvlist_array(nvl, name,
- NULL)[0];
- cookie = NULL;
- }
- }
- cookie = NULL;
- } while ((tmp = nvlist_get_array_next(nvl)) != NULL);
-} while ((tmp = nvlist_get_parent(nvl, &amp;cookie)) != NULL);</pre>
-</div>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
- ALSO</a></h1>
-<p class="Pp"><a class="Xr">close(2)</a>, <a class="Xr">dup(2)</a>,
- <a class="Xr">open(2)</a>, <a class="Xr">err(3)</a>,
- <a class="Xr">free(3)</a>, <a class="Xr">printf(3)</a>,
- <a class="Xr">unix(4)</a></p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
-<p class="Pp">The <code class="Nm">libnv</code> library appeared in
- <span class="Ux">FreeBSD 11.0</span>.</p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
-<p class="Pp">The <code class="Nm">libnv</code> library was implemented by
- <span class="An">Pawel Jakub Dawidek</span>
- &lt;<a class="Mt" href="mailto:pawel@dawidek.net">pawel@dawidek.net</a>&gt;
- under sponsorship from the FreeBSD Foundation.</p>
-</section>
-</div>
-<table class="foot">
- <tr>
- <td class="foot-date">January 3, 2025</td>
- <td class="foot-os">FreeBSD 15.0</td>
- </tr>
-</table>