2 .\" Copyright (c) 2007, Sun Microsystems Inc. All Rights Reserved.
3 .\" Copyright 2016 Joyent, Inc.
4 .\" 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.
5 .\" 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.
6 .\" 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]
7 .TH NVLIST_LOOKUP_NVPAIR 3NVPAIR "Mar 13, 2016"
9 nvlist_lookup_nvpair, nvlist_exists, nvlist_empty \- lookup named pairs
13 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... -\fBlnvpair\fR [ \fIlibrary\fR... ]
14 #include <libnvpair.h>
16 \fBint\fR \fBnvlist_lookup_nvpair\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
17 nvpair_t **\fInvp\fR);
22 \fBboolean_t\fR \fBnvlist_exists\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR);
27 \fBboolean_t\fR \fBnvlist_empty\fR(\fBnvlist_t *\fR\fInvl\fR);
32 The \fBnvlist_lookup_nvpair()\fR function returns the nvpair with the matching
33 name, regardless of type. It is valid only for lists allocated with
34 \fBNV_UNIQUE_NAME\fR. See \fBnvlist_alloc\fR(3NVPAIR).
37 The \fBnvlist_exists()\fR function returns success if any nvpair exists with
38 the given name. It is valid for all types of lists.
41 The \fBnvlist_empty()\fR function returns success if the list \fInvl\fR
42 contains no nvpairs. It is valid for all types of lists.
45 The \fBnvlist_lookup_nvpair()\fR function returns 0 on success and an error
49 The \fBnvlist_exists()\fR function returns \fBB_TRUE\fR if an nvpair with the
50 given name exists and \fBB_FALSE\fR otherwise.
53 The \fBnvlist_empty()\fR function returns \fBB_TRUE\fR if the given
54 list, \fInvl\fR, contains no nvpairs and \fBB_FALSE\fR otherwise.
57 The \fBnvlist_lookup_nvpair()\fR function will fail if:
64 There is an invalid argument.
73 No matching name-value pair is found.
82 The list was not allocated with \fBNV_UNIQUE_NAME\fR.
87 See \fBattributes\fR(5) for descriptions of the following attributes:
95 ATTRIBUTE TYPE ATTRIBUTE VALUE
97 Interface Stability Committed
104 \fBlibnvpair\fR(3LIB), \fBnvlist_alloc\fR(3NVPAIR), \fBattributes\fR(5),
105 \fBnvlist_lookup_nvpair\fR(9F)