fnvpair.c revision 53089ab7c84db6fb76c16ca50076c147cda11757
/*
* CDDL HEADER START
*
* 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
* 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]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2012 by Delphix. All rights reserved.
*/
#ifndef _KERNEL
#include <stdlib.h>
#endif
/*
* "Force" nvlist wrapper.
*
* These functions wrap the nvlist_* functions with assertions that assume
* the operation is successful. This allows the caller's code to be much
* more readable, especially for the fnvlist_lookup_* and fnvpair_value_*
* functions, which can return the requested value (rather than filling in
* a pointer).
*
* These functions use NV_UNIQUE_NAME, encoding NV_ENCODE_NATIVE, and allocate
* with KM_SLEEP.
*
* More wrappers should be added as needed -- for example
* nvlist_lookup_*_array and nvpair_value_*_array.
*/
nvlist_t *
fnvlist_alloc(void)
{
return (nvl);
}
void
{
}
{
return (size);
}
/*
* Returns allocated buffer of size *sizep. Caller must free the buffer with
* fnvlist_pack_free().
*/
char *
{
char *packed = 0;
KM_SLEEP), ==, 0);
return (packed);
}
/*ARGSUSED*/
void
{
#ifdef _KERNEL
#else
#endif
}
nvlist_t *
{
return (rv);
}
nvlist_t *
{
return (rv);
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
nvpair_t *
{
return (rv);
}
/* returns B_TRUE if the entry exists */
{
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
char *
{
char *rv;
return (rv);
}
nvlist_t *
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
{
return (rv);
}
char *
{
char *rv;
return (rv);
}
nvlist_t *
{
return (rv);
}