1 '\" te
2 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH NVLIST_ALLOC 3NVPAIR "Feb 2, 2004"
7 .SH NAME
8 nvlist_alloc, nvlist_free, nvlist_size, nvlist_pack, nvlist_unpack, nvlist_dup,
9 nvlist_merge, nvlist_xalloc, nvlist_xpack, nvlist_xunpack, nvlist_xdup,
10 nvlist_lookup_nv_alloc, nv_alloc_init, nv_alloc_reset, nv_alloc_fini \- manage
11 a name-value pair list
12 .SH SYNOPSIS
13 .LP
14 .nf
15 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lnvpair\fR [ \fIlibrary\fR... ]
16 #include <libnvpair.h>
17
18 \fBint\fR \fBnvlist_alloc\fR(\fBnvlist_t **\fR\fInvlp\fR, \fBuint_t\fR \fInvflag\fR, \fBint\fR \fIflag\fR);
19 .fi
20
21 .LP
22 .nf
23 \fBint\fR \fBnvlist_xalloc\fR(\fBnvlist_t **\fR\fInvlp\fR, \fBuint_t\fR \fInvflag\fR,
24 \fBnv_alloc_t *\fR \fInva\fR);
25 .fi
26
226
227 .SH DESCRIPTION
228 .SS "List Manipulation"
229 .sp
230 .LP
231 The \fBnvlist_alloc()\fR function allocates a new name-value pair list and
232 updates \fInvlp\fR to point to the handle. The \fInvflag\fR argument specifies
233 \fBnvlist\fR properties to remain persistent across packing, unpacking, and
234 duplication. If \fBNV_UNIQUE_NAME\fR was specified for \fInvflag\fR, existing
235 nvpairs with matching names are removed before the new nvpair is added. If
236 \fBNV_UNIQUE_NAME_TYPE\fR was specified for \fInvflag\fR, existing nvpairs with
237 matching names and data types are removed before the new nvpair is added. See
238 \fBnvlist_add_byte\fR(3NVPAIR) for more information.
239 .sp
240 .LP
241 The \fBnvlist_xalloc()\fR function is identical to \fBnvlist_alloc()\fR except
242 that \fBnvlist_xalloc()\fR can use a different allocator, as described in the
243 Pluggable Allocators section.
244 .sp
245 .LP
246 The \fBnvlist_free()\fR function frees a name-value pair list.
247 .sp
248 .LP
249 The \fBnvlist_size()\fR function returns the minimum size of a contiguous
250 buffer large enough to pack \fInvl\fR. The \fIencoding\fR parameter specifies
251 the method of encoding when packing \fInvl\fR. Supported encoding methods are:
252 .sp
253 .ne 2
254 .na
255 \fB\fBNV_ENCODE_NATIVE\fR\fR
256 .ad
257 .RS 20n
258 Straight \fBbcopy()\fR as described in \fBbcopy\fR(3C).
259 .RE
260
261 .sp
262 .ne 2
263 .na
264 \fB\fBNV_ENCODE_XDR\fR\fR
265 .ad
266 .RS 20n
|
1 '\" te
2 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH NVLIST_ALLOC 3NVPAIR "Feb 15, 2016"
7 .SH NAME
8 nvlist_alloc, nvlist_free, nvlist_size, nvlist_pack, nvlist_unpack, nvlist_dup,
9 nvlist_merge, nvlist_xalloc, nvlist_xpack, nvlist_xunpack, nvlist_xdup,
10 nvlist_lookup_nv_alloc, nv_alloc_init, nv_alloc_reset, nv_alloc_fini \- manage
11 a name-value pair list
12 .SH SYNOPSIS
13 .LP
14 .nf
15 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lnvpair\fR [ \fIlibrary\fR... ]
16 #include <libnvpair.h>
17
18 \fBint\fR \fBnvlist_alloc\fR(\fBnvlist_t **\fR\fInvlp\fR, \fBuint_t\fR \fInvflag\fR, \fBint\fR \fIflag\fR);
19 .fi
20
21 .LP
22 .nf
23 \fBint\fR \fBnvlist_xalloc\fR(\fBnvlist_t **\fR\fInvlp\fR, \fBuint_t\fR \fInvflag\fR,
24 \fBnv_alloc_t *\fR \fInva\fR);
25 .fi
26
226
227 .SH DESCRIPTION
228 .SS "List Manipulation"
229 .sp
230 .LP
231 The \fBnvlist_alloc()\fR function allocates a new name-value pair list and
232 updates \fInvlp\fR to point to the handle. The \fInvflag\fR argument specifies
233 \fBnvlist\fR properties to remain persistent across packing, unpacking, and
234 duplication. If \fBNV_UNIQUE_NAME\fR was specified for \fInvflag\fR, existing
235 nvpairs with matching names are removed before the new nvpair is added. If
236 \fBNV_UNIQUE_NAME_TYPE\fR was specified for \fInvflag\fR, existing nvpairs with
237 matching names and data types are removed before the new nvpair is added. See
238 \fBnvlist_add_byte\fR(3NVPAIR) for more information.
239 .sp
240 .LP
241 The \fBnvlist_xalloc()\fR function is identical to \fBnvlist_alloc()\fR except
242 that \fBnvlist_xalloc()\fR can use a different allocator, as described in the
243 Pluggable Allocators section.
244 .sp
245 .LP
246 The \fBnvlist_free()\fR function frees a name-value pair list. If \fInvl\fR
247 is a null pointer, no action occurs.
248 .sp
249 .LP
250 The \fBnvlist_size()\fR function returns the minimum size of a contiguous
251 buffer large enough to pack \fInvl\fR. The \fIencoding\fR parameter specifies
252 the method of encoding when packing \fInvl\fR. Supported encoding methods are:
253 .sp
254 .ne 2
255 .na
256 \fB\fBNV_ENCODE_NATIVE\fR\fR
257 .ad
258 .RS 20n
259 Straight \fBbcopy()\fR as described in \fBbcopy\fR(3C).
260 .RE
261
262 .sp
263 .ne 2
264 .na
265 \fB\fBNV_ENCODE_XDR\fR\fR
266 .ad
267 .RS 20n
|