1nvlist_lookup_boolean(3NNVaPmAeI-Rv)alue Pair Library Funnvcltiisotn_slookup_boolean(3NVPAIR)
2
3
4
6 nvlist_lookup_boolean, nvlist_lookup_boolean_value, nvlist_lookup_byte,
7 nvlist_lookup_int8, nvlist_lookup_uint8, nvlist_lookup_int16,
8 nvlist_lookup_uint16, nvlist_lookup_int32, nvlist_lookup_uint32,
9 nvlist_lookup_int64, nvlist_lookup_uint64, nvlist_lookup_double,
10 nvlist_lookup_string, nvlist_lookup_nvlist, nvlist_lookup_bool‐
11 ean_array, nvlist_lookup_byte_array, nvlist_lookup_int8_array,
12 nvlist_lookup_uint8_array, nvlist_lookup_int16_array,
13 nvlist_lookup_uint16_array, nvlist_lookup_int32_array,
14 nvlist_lookup_uint32_array, nvlist_lookup_int64_array,
15 nvlist_lookup_uint64_array, nvlist_lookup_nvlist_array,
16 nvlist_lookup_string_array, nvlist_lookup_pairs - match name and type
17 indicated by the interface name and retrieve data value
18
20 cc [ flag... ] file... -lnvpair [ library... ]
21 #include <libnvpair.h>
22
23 int nvlist_lookup_boolean(nvlist_t *nvl, const char *name);
24
25
26 int nvlist_lookup_boolean_value(nvlist_t *nvl,
27 const char *name, boolean_t *val);
28
29
30 int nvlist_lookup_byte(nvlist_t *nvl, const char *name,
31 uchar_t *val);
32
33
34 int nvlist_lookup_int8(nvlist_t *nvl, const char *name,
35 int8_t *val);
36
37
38 int nvlist_lookup_uint8(nvlist_t *nvl, const char *name,
39 uint8_t *val);
40
41
42 int nvlist_lookup_int16(nvlist_t *nvl, const char *name,
43 int16_t *val);
44
45
46 int nvlist_lookup_uint16(nvlist_t *nvl, const char *name,
47 uint16_t *val);
48
49
50 int nvlist_lookup_int32(nvlist_t *nvl, const char *name,
51 int32_t *val);
52
53
54 int nvlist_lookup_uint32(nvlist_t *nvl, const char *name,
55 uint32_t *val);
56
57
58 int nvlist_lookup_int64(nvlist_t *nvl, const char *name,
59 int64_t *val);
60
61
62 int nvlist_lookup_uint64(nvlist_t *nvl, const char *name,
63 uint64_t *val);
64
65
66 int nvlist_lookup_double(nvlist_t *nvl, const char *name,
67 double *val);
68
69
70 int nvlist_lookup_string(nvlist_t *nvl, const char *name,
71 char **val);
72
73
74 int nvlist_lookup_nvlist(nvlist_t *nvl, const char *name,
75 nvlist_t **val);
76
77
78 int nvlist_lookup_boolean_array(nvlist_t *nvl, const char *name,
79 boolean_t **val, uint_t *nelem);
80
81
82 int nvlist_lookup_byte_array(nvlist_t *nvl, const char *name,
83 uchar_t **val, uint_t *nelem);
84
85
86 int nvlist_lookup_int8_array(nvlist_t *nvl, const char *name,
87 int8_t **val, uint_t *nelem);
88
89
90 int nvlist_lookup_uint8_array(nvlist_t *nvl, const char *name,
91 uint8_t **val, uint_t *nelem);
92
93
94 int nvlist_lookup_int16_array(nvlist_t *nvl, const char *name,
95 int16_t **val, uint_t *nelem);
96
97
98 int nvlist_lookup_uint16_array(nvlist_t *nvl, const char *name,
99 uint16_t **val, uint_t *nelem);
100
101
102 int nvlist_lookup_int32_array(nvlist_t *nvl, const char *name,
103 int32_t **val, uint_t *nelem);
104
105
106 int nvlist_lookup_uint32_array(nvlist_t *nvl, const char *name,
107 uint32_t **val, uint_t *nelem);
108
109
110 int nvlist_lookup_int64_array(nvlist_t *nvl, const char *name,
111 int64_t **val, uint_t *nelem);
112
113
114 int nvlist_lookup_uint64_array(nvlist_t *nvl, const char *name,
115 uint64_t **val, uint_t *nelem);
116
117
118 int nvlist_lookup_string_array(nvlist_t *nvl, const char *name,
119 char ***val, uint_t *nelem);
120
121
122 int nvlist_lookup_nvlist_array(nvlist_t *nvl, const char *name,
123 nvlist_t ***val, uint_t *nelem);
124
125
126 int nvlist_lookup_pairs(nvlist_t *nvl, int flag...);
127
128
130 nvl The nvlist_t to be processed.
131
132
133 name Name of the name-value pair to search.
134
135
136 nelem Address to store the number of elements in value.
137
138
139 val Address to store the starting address of the value.
140
141
142 flag Specify bit fields defining lookup behavior:
143
144 NV_FLAG_NOENTOK The retrival function will not fail if no
145 matching name-value pair is found.
146
147
148
150 These functions find the nvpair (name-value pair) that matches the name
151 and type as indicated by the interface name. If one is found, nelem and
152 val are modified to contain the number of elements in value and the
153 starting address of data, respectively.
154
155
156 These functions work for nvlists (lists of name-value pairs) allocated
157 with NV_UNIQUE_NAME or NV_UNIQUE_NAME_TYPE specified in
158 nvlist_alloc(3NVPAIR). If this is not the case, the function returns
159 ENOTSUP because the list potentially contains multiple nvpairs with the
160 same name and type.
161
162
163 Multiple threads can simultaneously read the same nvlist_t but only one
164 thread can actively change a given nvlist_t at a time. The caller is
165 responsible for the synchronization.
166
167
168 All memory required for storing the array elements, including string
169 value, are managed by the library. References to such data remain valid
170 until nvlist_free() is called on nvl.
171
172
173 The nvlist_lookup_pairs() function retrieves a set of nvpairs. The
174 arguments are a null-terminated list of pairs (data type
175 DATA_TYPE_BOOLEAN), triples (non-array data types) or quads (array data
176 types). The interpretation of the arguments depends on the value of
177 type (see nvpair_type(3NVPAIR)) as follows:
178
179 name Name of the name-value pair to search.
180
181
182 type Data type (see nvpair_type(3NVPAIR)).
183
184
185 val Address to store the starting address of the value. When using
186 data type DATA_TYPE_BOOLEAN, the val argument is omitted.
187
188
189 nelem Address to store the number of elements in value. Non-array
190 data types have only one argument and nelem is omitted.
191
192
193
194 The order of the arguments is name, type, [val], [nelem].
195
196
197 When using NV_FLAG_NOENTOK and no matching name-value pair is found,
198 the memory pointed to by val and nelem is left untouched.
199
201 These functions return 0 on success and an error value on failure.
202
204 These functions will fail if:
205
206 EINVAL There is an invalid argument.
207
208
209 ENOENT No matching name-value pair is found
210
211
212 ENOTSUP An encode/decode method is not supported.
213
214
216 See attributes(5) for descriptions of the following attributes:
217
218
219
220
221 ┌────────────────────────────┬──────────────────────────────┐
222 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
223 ├────────────────────────────┼──────────────────────────────┤
224 │Interface Stability │ Committed │
225 ├────────────────────────────┼──────────────────────────────┤
226 │MT-Level │ MT-Safe │
227 └────────────────────────────┴──────────────────────────────┘
228
230 libnvpair(3LIB), nvlist_alloc(3NVPAIR), nvpair_type(3NVPAIR),
231 attributes(5)
232
233
234
235SunOS 5.11 1 Aug 2008 nvlist_lookup_boolean(3NVPAIR)