2 .\" Copyright (c) 2008, 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 NVPAIR_VALUE_BYTE 3NVPAIR "Aug 1, 2008"
8 nvpair_value_byte, nvpair_value_boolean_value, nvpair_value_int8,
9 nvpair_value_uint8, nvpair_value_int16, nvpair_value_uint16,
10 nvpair_value_int32, nvpair_value_uint32, nvpair_value_int64,
11 nvpair_value_uint64, nvpair_value_double, nvpair_value_string,
12 nvpair_value_nvlist, nvpair_value_boolean_array, nvpair_value_byte_array,
13 nvpair_value_int8_array, nvpair_value_uint8_array, nvpair_value_int16_array,
14 nvpair_value_uint16_array, nvpair_value_int32_array, nvpair_value_uint32_array,
15 nvpair_value_int64_array, nvpair_value_uint64_array, nvpair_value_string_array,
16 nvpair_value_nvlist_array \- retrieve value from a name-value pair
20 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lnvpair\fR [ \fIlibrary\fR... ]
21 #include <libnvpair.h>
23 \fBint\fR \fBnvpair_value_byte\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBuchar_t *\fR\fIval\fR);
28 \fBint\fR \fBnvpair_value_boolean_value\fR(\fBnvpair_t *\fR\fInvpair\fR,
29 \fBboolean_t *\fR\fIval\fR);
34 \fBint\fR \fBnvpair_value_int8\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBint8_t *\fR\fIval\fR);
39 \fBint\fR \fBnvpair_value_uint8\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBuint8_t *\fR\fIval\fR);
44 \fBint\fR \fBnvpair_value_int16\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBint16_t *\fR\fIval\fR);
49 \fBint\fR \fBnvpair_value_uint16\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBuint16_t *\fR\fIval\fR);
54 \fBint\fR \fBnvpair_value_int32\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBint32_t *\fR\fIval\fR);
59 \fBint\fR \fBnvpair_value_uint32\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBuint32_t *\fR\fIval\fR);
64 \fBint\fR \fBnvpair_value_int64\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBint64_t *\fR\fIval\fR);
69 \fBint\fR \fBnvpair_value_uint64\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBuint64_t *\fR\fIval\fR);
74 \fBint\fR \fBnvpair_value_double\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBdouble *\fR\fIval\fR);
79 \fBint\fR \fBnvpair_value_string\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBchar **\fR\fIval\fR);
84 \fBint\fR \fBnvpair_value_nvlist\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBnvlist_t **\fR\fIval\fR);
89 \fBint\fR \fBnvpair_value_boolean_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
90 \fBboolean_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
95 \fBint\fR \fBnvpair_value_byte_array\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBuchar_t **\fR\fIval\fR,
96 \fBuint_t *\fR\fInelem\fR);
101 \fBint\fR \fBnvpair_value_int8_array\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBint8_t **\fR\fIval\fR,
102 \fBuint_t *\fR\fInelem\fR);
107 \fBint\fR \fBnvpair_value_uint8_array\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBuint8_t **\fR\fIval\fR,
108 \fBuint_t *\fR\fInelem\fR);
113 \fBint\fR \fBnvpair_value_int16_array\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBint16_t **\fR\fIval\fR,
114 \fBuint_t *\fR\fInelem\fR);
119 \fBint\fR \fBnvpair_value_uint16_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
120 \fBuint16_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
125 \fBint\fR \fBnvpair_value_int32_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
126 \fBint32_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
131 \fBint\fR \fBnvpair_value_uint32_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
132 \fBuint32_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
137 \fBint\fR \fBnvpair_value_int64_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
138 \fBint64_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
143 \fBint\fR \fBnvpair_value_uint64_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
144 \fBuint64_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
149 \fBint\fR \fBnvpair_value_string_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
150 \fBchar ***\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
155 \fBint\fR \fBnvpair_value_nvlist_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
156 \fBnvlist_t ***\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
166 Name-value pair to be processed.
175 Address to store the number of elements in value.
184 Address to store the value or the starting address of the array value.
190 These functions retrieve the value of \fInvpair\fR. The data type of
191 \fInvpair\fR must match the interface name for the call to be successful.
194 There is no \fBnvpair_value_boolean()\fR; the existence of the name implies the
198 For array data types, including string, the memory containing the data is
199 managed by the library and references to the value remains valid until
200 \fBnvlist_free()\fR is called on the \fBnvlist_t\fR from which \fInvpair\fR is
201 obtained. See \fBnvlist_free\fR(3NVPAIR).
204 The value of an nvpair may not be retrieved after the nvpair has been removed
205 from or replaced in an nvlist. Replacement can occur during pair additions to
206 nvlists created with \fBNV_UNIQUE_NAME_TYPE\fR and \fBNV_UNIQUE_NAME\fR. See
207 \fBnvlist_alloc\fR(3NVPAIR).
211 These functions return 0 on success and an error value on failure.
215 These functions will fail if:
222 Either one of the arguments is \fINULL\fR or the type of \fInvpair\fR does not
223 match the function name.
229 See \fBattributes\fR(5) for descriptions of the following attributes:
237 ATTRIBUTE TYPE ATTRIBUTE VALUE
239 Interface Stability Committed
247 \fBlibnvpair\fR(3LIB), \fBnvlist_alloc\fR(3NVPAIR), \fBattributes\fR(5)