blob: b7d23b177429f272f2855c2b4a0ee80ebfca3d20 (
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
|
'\" 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 LIBNVPAIR 3LIB "Mar 13, 2016"
.SH NAME
libnvpair \- name-value pair library
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR... ] \fIfile\fR... \fB-lnvpair\fR [ \fIlibrary\fR... ]
#include <\fBlibnvpair.h\fR>
.fi
.SH DESCRIPTION
.LP
The \fBlibnvpair\fR library exports a set of functions for managing name-value
pairs.
.sp
.LP
The library defines four opaque handles:
.sp
.ne 2
.na
\fB\fBnvpair_t\fR\fR
.ad
.RS 18n
handle to a name-value pair
.RE
.sp
.ne 2
.na
\fB\fBnvlist_t\fR\fR
.ad
.RS 18n
handle to a list of name-value pairs
.RE
.sp
.ne 2
.na
\fB\fBnv_alloc_t\fR\fR
.ad
.RS 18n
handle to a pluggable allocator
.RE
.sp
.ne 2
.na
\fB\fBnv_alloc_ops_t\fR\fR
.ad
.RS 18n
handle to pluggable allocator operations
.RE
.sp
.LP
The library supports the following operations:
.RS +4
.TP
.ie t \(bu
.el o
Allocate and free an \fBnvlist_t\fR.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Specify the allocater to be used when manipulating an \fBnvlist_t\fR.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Add and remove an \fBnvpair_t\fR from a list.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Search \fBnvlist_t\fR for a specified name pair.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Pack an \fBnvlist_t\fR into a contiguous buffer.
.RE
.RS +4
.TP
.ie t \(bu
.el o
Expand a packed nvlist into a searchable \fBnvlist_t\fR.
.RE
.SH INTERFACES
.LP
The shared object \fBlibnvpair.so.1\fR provides the public interfaces defined
below. See \fBIntro\fR(3) for additional information on shared object
interfaces.
.sp
.sp
.TS
l l
l l .
\fBnvlist_add_boolean\fR \fBnvlist_add_boolean_value\fR
\fBnvlist_add_boolean_array\fR \fBnvlist_add_byte\fR
\fBnvlist_add_byte_array\fR \fBnvlist_add_double\fR
\fBnvlist_add_int8\fR \fBnvlist_add_int8_array\fR
\fBnvlist_add_int16\fR \fBnvlist_add_int16_array\fR
\fBnvlist_add_int32\fR \fBnvlist_add_int32_array\fR
\fBnvlist_add_int64\fR \fBnvlist_add_int64_array\fR
\fBnvlist_add_nvlist\fR \fBnvlist_add_nvlist_array\fR
\fBnvlist_add_nvpair\fR \fBnvlist_add_string\fR
\fBnvlist_add_string_array\fR \fBnvlist_add_uint8\fR
\fBnvlist_add_uint8_array\fR \fBnvlist_add_uint16\fR
\fBnvlist_add_uint16_array\fR \fBnvlist_add_uint32\fR
\fBnvlist_add_uint32_array\fR \fBnvlist_add_uint64\fR
\fBnvlist_add_uint64_array\fR \fBnvlist_alloc\fR
\fBnvlist_dup\fR \fBnvpair_empty\fR
\fBnvlist_exists\fR
\fBnvlist_free\fR \fBnvlist_lookup_boolean\fR
\fBnvlist_lookup_boolean_value\fR \fBnvlist_lookup_boolean_array\fR
\fBnvlist_lookup_byte\fR \fBnvlist_lookup_byte_array\fR
\fBnvlist_lookup_double\fR \fBnvlist_lookup_int8\fR
\fBnvlist_lookup_int8_array\fR \fBnvlist_lookup_int16\fR
\fBnvlist_lookup_int16_array\fR \fBnvlist_lookup_int32\fR
\fBnvlist_lookup_int32_array\fR \fBnvlist_lookup_int64\fR
\fBnvlist_lookup_int64_array\fR \fBnvlist_lookup_nvlist\fR
\fBnvlist_lookup_nvlist_array\fR \fBnvlist_lookup_nv_alloc\fR
\fBnvlist_lookup_nvpair\fR \fBnvlist_lookup_pairs\fR
\fBnvlist_lookup_string\fR \fBnvlist_lookup_string_array\fR
\fBnvlist_lookup_uint8\fR \fBnvlist_lookup_uint8_array\fR
\fBnvlist_lookup_uint16\fR \fBnvlist_lookup_uint16_array\fR
\fBnvlist_lookup_uint32\fR \fBnvlist_lookup_uint32_array\fR
\fBnvlist_lookup_uint64\fR \fBnvlist_lookup_uint64_array\fR
\fBnvlist_merge\fR \fBnvlist_next_nvpair\fR
\fBnvlist_pack\fR \fBnvlist_remove\fR
\fBnvlist_remove_all\fR \fBnvlist_size\fR
\fBnvlist_unpack\fR \fBnvlist_xalloc\fR
\fBnvlist_xdup\fR \fBnvlist_xpack\fR
\fBnvlist_xunpack\fR \fBnvpair_name\fR
\fBnvpair_type\fR \fBnvpair_value_boolean_array\fR
\fBnvpair_value_boolean_value\fR \fBnvpair_value_byte\fR
\fBnvpair_value_byte_array\fR \fBnvpair_value_double\fR
\fBnvpair_value_int8\fR \fBnvpair_value_int8_array\fR
\fBnvpair_value_int16\fR \fBnvpair_value_int16_array\fR
\fBnvpair_value_int32\fR \fBnvpair_value_int32_array\fR
\fBnvpair_value_int64\fR \fBnvpair_value_int64_array\fR
\fBnvpair_value_nvlist\fR \fBnvpair_value_nvlist_array\fR
\fBnvpair_value_string\fR \fBnvpair_value_string_array\fR
\fBnvpair_value_uint8\fR \fBnvpair_value_uint8_array\fR
\fBnvpair_value_uint16\fR \fBnvpair_value_uint16_array\fR
\fBnvpair_value_uint32\fR \fBnvpair_value_uint32_array\fR
\fBnvpair_value_uint64\fR \fBnvpair_value_uint64_array\fR
\fBnv_alloc_init\fR \fBnv_alloc_fini\fR
\fBnv_alloc_reset\fR
.TE
.SH FILES
.ne 2
.na
\fB\fB/lib/libnvpair.so.1\fR\fR
.ad
.RS 26n
shared object
.RE
.sp
.ne 2
.na
\fB\fB/lib/64/libnvpair.so.1\fR\fR
.ad
.RS 26n
64-bit shared object
.RE
.SH ATTRIBUTES
.LP
See \fBattributes\fR(7) for description 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
.LP
.BR Intro (3),
.BR attributes (7)
|