summaryrefslogtreecommitdiff
path: root/usr/src/man/man9f/nvpair_value_byte.9f
blob: bb7474f6549e20354d5f3c6be07c97ee57256ec4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
'\" te
.\" Copyright (c) 2006, 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 9F "Jan 16, 2006"
.SH NAME
nvpair_value_byte, nvpair_value_nvlist, nvpair_value_int8, nvpair_value_int16,
nvpair_value_int32, nvpair_value_int64, nvpair_value_uint8,
nvpair_value_uint16, nvpair_value_uint32, nvpair_value_uint64,
nvpair_value_string, nvpair_value_boolean_array, nvpair_value_byte_array,
nvpair_value_nvlist_array, nvpair_value_int8_array, nvpair_value_int16_array,
nvpair_value_int32_array, nvpair_value_int64_array, nvpair_value_uint8_array,
nvpair_value_uint16_array, nvpair_value_uint32_array,
nvpair_value_uint64_array, nvpair_value_string_array \- retrieve value from a
name-value pair
.SH SYNOPSIS
.LP
.nf
#include <sys/nvpair.h>

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

.LP
.nf
\fBint\fR \fBnvpair_value_byte\fR(\fBnvpair_t *\fR\fInvpair\fR, \fBuchar_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_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 INTERFACE LEVEL
.sp
.LP
Solaris DDI specific (Solaris DDI)
.SH PARAMETERS
.sp
.ne 2
.na
\fB\fInvpair\fR\fR
.ad
.RS 10n
Name-value pair (\fBnvpair\fR) 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 starting address of array value.
.RE

.SH DESCRIPTION
.sp
.LP
These functions retrieve the value of \fInvpair\fR. The data type of
\fInvpair\fR must match the function 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(9F)
.sp
.LP
The value of an nvpair may not be retrieved after the nvpair having been
removed from or replaced in an nvlist. Replacement can happen during pair
addition on nvlists created with NV_UNIQUE_NAME_TYPE and NV_UNIQUE_NAME. See
\fBnvlist_alloc(9F)\fR for more details.
.SH RETURN VALUES
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 10n
Success
.RE

.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 10n
Either one of the arguments is \fINULL\fR or type of \fInvpair\fR does not
match the interface name.
.RE

.SH CONTEXT
.sp
.LP
These functions can be called from user, interrupt, or kernel context.