Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / nvlist_next_nvpair.9f
blob7e5ed274a0bcd08fa9a30b461c18cdfbd23e6c4f
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_NEXT_NVPAIR 9F "Jan 16, 2006"
7 .SH NAME
8 nvlist_next_nvpair, nvpair_name, nvpair_type \- return data regarding
9 name-value pairs
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/nvpair.h>
15 \fBnvpair_t *\fR\fBnvlist_next_nvpair\fR(\fBnvlist_t *\fR\fInvl\fR, \fBnvpair_t *\fR\fInvpair\fR);
16 .fi
18 .LP
19 .nf
20 \fBchar *\fR\fBnvpair_name\fR(\fBnvpair_t *\fR\fInvpair\fR);
21 .fi
23 .LP
24 .nf
25 \fBdata_type_t\fR \fBnvpair_type\fR(\fBnvpair_t *\fR\fInvpair\fR);
26 .fi
28 .SH INTERFACE LEVEL
29 .sp
30 .LP
31 Solaris DDI specific (Solaris DDI)
32 .SH PARAMETERS
33 .sp
34 .ne 2
35 .na
36 \fB\fInvl\fR\fR
37 .ad
38 .RS 10n
39 The list of name-value pairs (\fBnvlist_t\fR) to be processed.
40 .RE
42 .sp
43 .ne 2
44 .na
45 \fB\fInvpair\fR\fR
46 .ad
47 .RS 10n
48 Handle to a name-value pair.
49 .RE
51 .SH DESCRIPTION
52 .sp
53 .LP
54 The \fBnvlist_next_nvpair()\fR function returns a handle to the next name-value
55 pair (\fBnvpair\fR) in the list following \fInvpair\fR. If \fInvpair\fR is
56 NULL, the first pair is returned. If \fInvpair\fR is the last pair in the
57 \fBnvlist_t\fR, NULL is returned.
58 .sp
59 .LP
60 The \fBnvpair_name()\fR function returns a string containing the name of
61 \fInvpair\fR.
62 .sp
63 .LP
64 The \fBnvpair_type()\fR function retrieves the value of the \fInvpair\fR in the
65 form of enumerated type \fBdata_type_t\fR. This is used to determine the
66 appropriate \fBnvpair_*()\fR function to call for retrieving the value.
67 .SH RETURN VALUES
68 .sp
69 .LP
70 For \fBnvpair_name()\fR: a string containing the name.
71 .sp
72 .LP
73 For \fBnvpair_type()\fR: an enumerated data type \fBdata_type_t\fR. Possible
74 values for \fBdata_type_t\fR are:
75 .sp
76 .in +2
77 .nf
78 DATA_TYPE_BOOLEAN
79 DATA_TYPE_BOOLEAN_VALUE
80 DATA_TYPE_BYTE
81 DATA_TYPE_INT8
82 DATA_TYPE_UINT8
83 DATA_TYPE_INT16
84 DATA_TYPE_UINT16
85 DATA_TYPE_INT32
86 DATA_TYPE_UINT32
87 DATA_TYPE_INT64
88 DATA_TYPE_UINT64
89 DATA_TYPE_STRING
90 DATA_TYPE_NVLIST
91 DATA_TYPE_BOOLEAN_ARRAY
92 DATA_TYPE_BYTE_ARRAY
93 DATA_TYPE_INT8_ARRAY
94 DATA_TYPE_UINT8_ARRAY
95 DATA_TYPE_INT16_ARRAY
96 DATA_TYPE_UINT16_ARRAY
97 DATA_TYPE_INT32_ARRAY
98 DATA_TYPE_UINT32_ARRAY
99 DATA_TYPE_INT64_ARRAY
100 DATA_TYPE_UINT64_ARRAY
101 DATA_TYPE_STRING_ARRAY
102 DATA_TYPE_NVLIST_ARRAY
104 .in -2
109 After nvpairs is removed from or replaced in an nvlist, it cannot be
110 manipulated. This includes \fBnvlist_next_nvpair()\fR, \fBnvpair_name()\fR and
111 \fBnvpair_type()\fR. Replacement can happen during pair addition on nvlists
112 created with NV_UNIQUE_NAME_TYPE and NV_UNIQUE_NAME. See \fBnvlist_alloc\fR(9F)
113 for more details.
114 .SH CONTEXT
117 These functions can be called from user, interrupt, or kernel context.