Merge commit '37e84ab74e939caf52150fc3352081786ecc0c29' into merges
[unleashed.git] / include / sys / nvpair_impl.h
blobf12dbbfe6ef5490e6ad70f8157d40c9db06d1cf9
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _NVPAIR_IMPL_H
28 #define _NVPAIR_IMPL_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 #include <sys/nvpair.h>
39 * The structures here provided for information and debugging purposes only
40 * may be changed in the future.
44 * implementation linked list for pre-packed data
46 typedef struct i_nvp i_nvp_t;
48 struct i_nvp {
49 union {
50 uint64_t _nvi_align; /* ensure alignment */
51 struct {
52 i_nvp_t *_nvi_next; /* pointer to next nvpair */
53 i_nvp_t *_nvi_prev; /* pointer to prev nvpair */
54 } _nvi;
55 } _nvi_un;
56 nvpair_t nvi_nvp; /* nvpair */
58 #define nvi_next _nvi_un._nvi._nvi_next
59 #define nvi_prev _nvi_un._nvi._nvi_prev
61 typedef struct {
62 i_nvp_t *nvp_list; /* linked list of nvpairs */
63 i_nvp_t *nvp_last; /* last nvpair */
64 i_nvp_t *nvp_curr; /* current walker nvpair */
65 nv_alloc_t *nvp_nva; /* pluggable allocator */
66 uint32_t nvp_stat; /* internal state */
67 } nvpriv_t;
69 #ifdef __cplusplus
71 #endif
73 #endif /* _NVPAIR_IMPL_H */