9022 loader.efi: module placement must check memory map
[unleashed.git] / share / man / man9f / nvlist_lookup_boolean.9f
blob2bb2ad16deae1563e375fb407388603fdd84e7dc
1 '\" te
2 .\" Copyright (c) 2006, 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_LOOKUP_BOOLEAN 9F "May 20, 2006"
7 .SH NAME
8 nvlist_lookup_boolean, nvlist_lookup_boolean_value, nvlist_lookup_byte,
9 nvlist_lookup_int8, nvlist_lookup_int16, nvlist_lookup_int32,
10 nvlist_lookup_int64, nvlist_lookup_uint8, nvlist_lookup_uint16,
11 nvlist_lookup_uint32, nvlist_lookup_uint64, nvlist_lookup_string,
12 nvlist_lookup_nvlist, nvlist_lookup_boolean_array, nvlist_lookup_byte_array,
13 nvlist_lookup_int8_array, nvlist_lookup_int16_array, nvlist_lookup_int32_array,
14 nvlist_lookup_int64_array, nvlist_lookup_uint8_array,
15 nvlist_lookup_uint16_array, nvlist_lookup_uint32_array,
16 nvlist_lookup_uint64_array, nvlist_lookup_string_array,
17 nvlist_lookup_nvlist_array, nvlist_lookup_pairs \- match name and type
18 indicated by the interface name and retrieve data value
19 .SH SYNOPSIS
20 .LP
21 .nf
22 #include <sys/nvpair.h>
24 \fBint\fR \fBnvlist_lookup_boolean\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR);
25 .fi
27 .LP
28 .nf
29 \fBint\fR \fBnvlist_lookup_boolean_value\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
30      \fBboolean_t *\fR\fIval\fR);
31 .fi
33 .LP
34 .nf
35 \fBint\fR \fBnvlist_lookup_byte\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
36      \fBuchar_t *\fR\fIval\fR);
37 .fi
39 .LP
40 .nf
41 \fBint\fR \fBnvlist_lookup_int8\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
42      \fBint8_t *\fR\fIval\fR);
43 .fi
45 .LP
46 .nf
47 \fBint\fR \fBnvlist_lookup_uint8\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
48      \fBuint8_t *\fR\fIval\fR);
49 .fi
51 .LP
52 .nf
53 \fBint\fR \fBnvlist_lookup_int16\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
54      \fBint16_t *\fR\fIval\fR);
55 .fi
57 .LP
58 .nf
59 \fBint\fR \fBnvlist_lookup_uint16\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
60      \fBuint16_t *\fR\fIval\fR);
61 .fi
63 .LP
64 .nf
65 \fBint\fR \fBnvlist_lookup_int32\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
66      \fBint32_t *\fR\fIval\fR);
67 .fi
69 .LP
70 .nf
71 \fBint\fR \fBnvlist_lookup_uint32\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
72      \fBuint32_t *\fR\fIval\fR);
73 .fi
75 .LP
76 .nf
77 \fBint\fR \fBnvlist_lookup_int64\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
78      \fBint64_t *\fR\fIval\fR);
79 .fi
81 .LP
82 .nf
83 \fBint\fR \fBnvlist_lookup_uint64\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
84      \fBuint64_t *\fR\fIval\fR);
85 .fi
87 .LP
88 .nf
89 \fBint\fR \fBnvlist_lookup_string\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
90      \fBchar **\fR\fIval\fR);
91 .fi
93 .LP
94 .nf
95 \fBint\fR \fBnvlist_lookup_nvlist\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
96      \fBnvlist_t **\fR\fIval\fR);
97 .fi
99 .LP
101 \fBint\fR \fBnvlist_lookup_boolean_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
102      \fBboolean_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
107 \fBint\fR \fBnvlist_lookup_byte_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
108      \fBuchar_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
113 \fBint\fR \fBnvlist_lookup_int8_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
114      \fBint8_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
119 \fBint\fR \fBnvlist_lookup_uint8_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
120      \fBuint8_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
125 \fBint\fR \fBnvlist_lookup_int16_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
126      \fBint16_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
131 \fBint\fR \fBnvlist_lookup_uint16_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
132      \fBuint16_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
137 \fBint\fR \fBnvlist_lookup_int32_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
138      \fBint32_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
143 \fBint\fR \fBnvlist_lookup_uint32_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
144      \fBuint32_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
149 \fBint\fR \fBnvlist_lookup_int64_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
150      \fBint64_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
155 \fBint\fR \fBnvlist_lookup_uint64_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
156      \fBuint64_t **\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
161 \fBint\fR \fBnvlist_lookup_string_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
162      \fBchar  ***\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
167 \fBint\fR \fBnvlist_lookup_nvlist_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
168      \fBnvlist_t ***\fR\fIval\fR, \fBuint_t *\fR\fInelem\fR);
173 \fBint\fR \fBnvlist_lookup_pairs\fR(\fBnvlist_t *\fR\fInvl\fR, \fBint\fR \fIflag, ...\fR);
176 .SH INTERFACE LEVEL
179 Solaris DDI specific (Solaris DDI)
180 .SH PARAMETERS
182 .ne 2
184 \fB\fInvl\fR\fR
186 .RS 9n
187 The list of name-value pairs (\fBnvlist_t\fR) to be processed.
191 .ne 2
193 \fB\fIname\fR\fR
195 .RS 9n
196 Name of the name-value pair (\fBnvpair\fR) to search.
200 .ne 2
202 \fB\fInelem\fR\fR
204 .RS 9n
205 Address to store the number of elements in value.
209 .ne 2
211 \fB\fIval\fR\fR
213 .RS 9n
214 Address to store the value or starting address of the array value.
218 .ne 2
220 \fB\fIflag\fR\fR
222 .RS 9n
223 Specify bit fields defining lookup behavior:
225 .ne 2
227 \fBNV_FLAG_NOENTOK\fR
229 .RS 19n
230 The retrival function will not fail if no matching name-value pair is found.
235 .SH DESCRIPTION
238 These functions find the \fBnvpair\fR that matches the name and type as
239 indicated by the interface name. If one is found, \fInelem\fR and \fIval\fR are
240 modified to contain the number of elements in value and the starting address of
241 data, respectively.
244 These interfaces work for \fBnvlist_t\fR allocated with \fBNV_UNIQUE_NAME\fR or
245 \fBNV_UNIQUE_NAME_TYPE\fR specified in \fBnvlist_alloc()\fR. See
246 \fBnvlist_alloc\fR(9F). If this is not the case, the interface will return
247 \fBENOTSUP\fR because the list potentially contains multiple \fBnvpair\fRs with
248 the same name and type.
251 Multiple threads can simultaneously read the same \fBnvlist_t\fR but only one
252 thread should actively change a given \fBnvlist_t\fR at a time. The caller is
253 responsible for the synchronization.
256 All memory required for storing the array elements, including string values,
257 are managed by the library. References to such data remain valid until
258 \fBnvlist_free()\fR is called on \fInvl\fR.
261 The \fBnvlist_lookup_pairs()\fR function retrieves a set of \fBnvpair\fRs. The
262 arguments are a null-terminated list of pairs (data type
263 \fBDATA_TYPE_BOOLEAN\fR), triples (non-array data types) or quads (array data
264 types). As shown below, the interpretation of the arguments depends on the
265 value of \fItype\fR. See \fBnvpair_type\fR(9F).
267 .ne 2
269 \fB\fIname\fR\fR
271 .RS 9n
272 Name of the name-value pair to search.
276 .ne 2
278 \fB\fItype\fR\fR
280 .RS 9n
281 Data type.
285 .ne 2
287 \fB\fIval\fR\fR
289 .RS 9n
290 Address to store the starting address of the value. When using data type
291 \fBDATA_TYPE_BOOLEAN\fR, the \fIval\fR argument is ignored.
295 .ne 2
297 \fB\fInelem\fR\fR
299 .RS 9n
300 Address to store the number of elements in value. Non-array data types have
301 only one argument and \fInelem\fR is ignored.
306 The argument order is \fIname\fR, \fItype\fR, [\fIval\fR], [\fInelem\fR].
309 When using \fBNV_FLAG_NOENTOK\fR and no matching name-value pair is found, the
310 memory pointed to by \fIval\fR and \fInelem\fR is not touched.
313 These functions return \fB0\fR on success and an error value on failure.
314 .SH ERRORS
317 These functions fail under the following conditions.
319 .ne 2
321 \fB\fB0\fR\fR
323 .RS 11n
324 Success
328 .ne 2
330 \fB\fBEINVAL\fR\fR
332 .RS 11n
333 Invalid argument
337 .ne 2
339 \fB\fBENOENT\fR\fR
341 .RS 11n
342 No matching name-value pair found
346 .ne 2
348 \fB\fBENOTSUP\fR\fR
350 .RS 11n
351 Encode/decode method not supported
354 .SH CONTEXT
357 These functions can be called from user, interrupt, or kernel context.
358 .SH ATTRIBUTES
361 See \fBattributes\fR(5) for descriptions of the following attributes:
366 box;
367 c | c
368 l | l .
369 ATTRIBUTE TYPE  ATTRIBUTE VALUE
371 Interface Stability     Committed
374 .SH SEE ALSO
377 \fBnvlist_alloc\fR(9F), \fBnvpair_type\fR(9F)
380 \fIWriting Device Drivers\fR
383 \fISTREAMS Programming Guide\fR