23
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
24
.\" SUCH DAMAGE.
25
25
.\"
26
- .Dd June 18, 2018
26
+ .Dd January 3, 2025
27
27
.Dt CNV 9
28
28
.Os
29
29
.Sh NAME
30
30
.Nm cnvlist_get ,
31
31
.Nm cnvlist_take ,
32
32
.Nm cnvlist_free
33
- .Nd " API for managing name/value pairs by cookie. "
33
+ .Nd " API for managing name/value pairs by cookie"
34
34
.Sh LIBRARY
35
35
.Lb libnv
36
36
.Sh SYNOPSIS
115
115
.Nm libnv
116
116
library permits easy management of name/value pairs and can send and receive
117
117
them over sockets.
118
- For more information, also see
118
+ For more information, see
119
119
.Xr nv 9 .
120
120
.Pp
121
121
The concept of cookies is explained in
@@ -128,44 +128,50 @@ from
128
128
.Pp
129
129
The
130
130
.Fn cnvlist_name
131
- function returns the name of an element associated with the given cookie.
131
+ function returns the name of an element associated with
132
+ .Fa cookie .
132
133
.Pp
133
134
The
134
135
.Fn cnvlist_type
135
- function returns the type of an element associated with the given cookie.
136
+ function returns the type of an element associated with
137
+ .Fa cookie .
136
138
Types which can be returned are described in
137
139
.Xr nv 9 .
138
140
.Pp
139
141
The
140
142
.Nm cnvlist_get
141
- family of functions obtains the value associated with the given cookie.
143
+ functions return the value associated with
144
+ .Fa cookie .
142
145
Returned strings, nvlists, descriptors, binaries, or arrays must not be modified
143
- by the user, since they still belong to the nvlist.
146
+ by the user since they still belong to the nvlist.
144
147
The nvlist must not be in an error state.
145
148
.Pp
146
149
The
147
150
.Nm cnvlist_take
148
- family of functions returns the value associated with the given cookie and
149
- removes the element from the nvlist.
151
+ functions return the value associated with the given cookie and
152
+ remove the element from the nvlist.
150
153
When the value is a string, binary, or array value, the caller is responsible
151
154
for freeing the returned memory with
152
155
.Fn free 3 .
153
156
When the value is an nvlist, the caller is responsible for destroying the
154
157
returned nvlist with
155
158
.Fn nvlist_destroy .
156
159
When the value is a descriptor, the caller is responsible for closing the
157
- returned descriptor with the
160
+ returned descriptor with
158
161
.Fn close 2 .
159
162
.Pp
160
163
The
161
164
.Nm cnvlist_free
162
- family of functions removes an element of the supplied cookie and frees all
163
- resources.
164
- If an element of the given cookie has the wrong type or does not exist, the
165
+ functions remove the element identified by
166
+ .Fa cookie
167
+ and free any associated resources.
168
+ If the element identified by
169
+ .Fa cookie
170
+ has the wrong type or does not exist, the
165
171
program
166
- is aborted .
172
+ aborts .
167
173
.Sh EXAMPLES
168
- The following example demonstrates how to deal with cnvlist API.
174
+ The following example demonstrates how to deal with the cnvlist API.
169
175
.Bd -literal
170
176
int type;
171
177
void *cookie, *scookie, *bcookie;
0 commit comments