'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
.\" 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.
.\" 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.
.\" 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]
.TH NVPAIR_VALUE_BYTE 3NVPAIR "Aug 1, 2008"
.SH NAME
nvpair_value_byte, nvpair_value_boolean_value, nvpair_value_int8,
nvpair_value_uint8, nvpair_value_int16, nvpair_value_uint16,
nvpair_value_int32, nvpair_value_uint32, nvpair_value_int64,
nvpair_value_uint64, nvpair_value_double, nvpair_value_string,
nvpair_value_nvlist, nvpair_value_boolean_array, nvpair_value_byte_array,
nvpair_value_int8_array, nvpair_value_uint8_array, nvpair_value_int16_array,
nvpair_value_uint16_array, nvpair_value_int32_array, nvpair_value_uint32_array,
nvpair_value_int64_array, nvpair_value_uint64_array, nvpair_value_string_array,
nvpair_value_nvlist_array \- retrieve value from a name-value pair
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lnvpair\fR [ \fIlibrary\fR... ]
#include <libnvpair.h>

\fBint\fR \fBnvpair_value_byte\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBuchar_t *\fR\fIval\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_boolean_value\fR(\fBnvpair_t *\fR\fInvpair\fR,
     \fBboolean_t *\fR\fIval\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_int8\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBint8_t *\fR\fIval\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_uint8\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBuint8_t *\fR\fIval\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_int16\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBint16_t *\fR\fIval\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_uint16\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBuint16_t *\fR\fIval\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_int32\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBint32_t *\fR\fIval\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_uint32\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBuint32_t *\fR\fIval\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_int64\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBint64_t *\fR\fIval\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_uint64\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBuint64_t *\fR\fIval\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_double\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBdouble *\fR\fIval\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_string\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBchar **\fR\fIval\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_nvlist\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBnvlist_t **\fR\fIval\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_boolean_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
     \fBboolean_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_byte_array\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBuchar_t **\fR\fIval\fR,
     \fBuint_t *\fR\fInelem\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_int8_array\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBint8_t **\fR\fIval\fR,
     \fBuint_t *\fR\fInelem\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_uint8_array\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBuint8_t **\fR\fIval\fR,
     \fBuint_t *\fR\fInelem\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_int16_array\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBint16_t **\fR\fIval\fR,
     \fBuint_t *\fR\fInelem\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_uint16_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
     \fBuint16_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_int32_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
     \fBint32_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_uint32_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
     \fBuint32_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_int64_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
     \fBint64_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_uint64_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
     \fBuint64_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_string_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
     \fBchar ***\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
.fi

.LP
.nf
\fBint\fR \fBnvpair_value_nvlist_array\fR(\fBnvpair_t *\fR\fInvpair\fR,
     \fBnvlist_t ***\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
.fi

.SH PARAMETERS
.sp
.ne 2
.na
\fB\fInvpair\fR\fR
.ad
.RS 10n
Name-value pair to be processed.
.RE

.sp
.ne 2
.na
\fB\fInelem\fR\fR
.ad
.RS 10n
Address to store the number of elements in value.
.RE

.sp
.ne 2
.na
\fB\fIval\fR\fR
.ad
.RS 10n
Address to store the value or the starting address of the array value.
.RE

.SH DESCRIPTION
.sp
.LP
These functions retrieve the value of \fInvpair\fR. The data type of
\fInvpair\fR must match the interface name for the call to be successful.
.sp
.LP
There is no \fBnvpair_value_boolean()\fR; the existence of the name implies the
value is true.
.sp
.LP
For array data types, including string, the memory containing the data is
managed by the library and references to the value remains valid until
\fBnvlist_free()\fR is called on the \fBnvlist_t\fR from which \fInvpair\fR is
obtained. See \fBnvlist_free\fR(3NVPAIR).
.sp
.LP
The value of an nvpair may not be retrieved after the nvpair has been removed
from or replaced in an nvlist. Replacement can occur during pair additions to
nvlists created with \fBNV_UNIQUE_NAME_TYPE\fR and \fBNV_UNIQUE_NAME\fR. See
\fBnvlist_alloc\fR(3NVPAIR).
.SH RETURN VALUES
.sp
.LP
These functions return 0 on success and an error value on failure.
.SH ERRORS
.sp
.LP
These functions will fail if:
.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 10n
Either one of the arguments is \fINULL\fR or the type of \fInvpair\fR does not
match the function name.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5)  for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Committed
_
MT-Level	MT-Safe
.TE

.SH SEE ALSO
.sp
.LP
\fBlibnvpair\fR(3LIB), \fBnvlist_alloc\fR(3NVPAIR), \fBattributes\fR(5)