/*LINTLIBRARY*/
/*PROTOLIB1*/
/*
 * Copyright 2000, 2003 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 *
 *  usr/src/lib/libnvpair/llib-lnvpair
 */

#pragma ident	"@(#)llib-lnvpair	1.4	03/08/20 SMI"

#include "libnvpair.h"

int nvlist_alloc(nvlist_t **nvlp, uint_t nvflag, int kmflag);

void nvlist_free(nvlist_t *nvl);

int nvlist_size(nvlist_t *nvl, size_t *size, int encoding);

int nvlist_pack(nvlist_t *nvl, char **bufp, size_t *buflen, int encoding,
    int kmflag);

int nvlist_unpack(char *buf, size_t buflen, nvlist_t **nvlp, int kmflag);

int nvlist_dup(nvlist_t *nvl, nvlist_t **nvlp, int kmflag);

void nvlist_remove(nvlist_t *nvl, char *name, data_type_t type);

void nvlist_remove_all(nvlist_t *nvl, char *name);

int nvlist_add_boolean(nvlist_t *nvl, char *name);

int nvlist_add_byte(nvlist_t *nvl, char *name, uchar_t val);

int nvlist_add_int16(nvlist_t *nvl, char *name, int16_t val);

int nvlist_add_uint16(nvlist_t *nvl, char *name, uint16_t val);

int nvlist_add_int32(nvlist_t *nvl, char *name, int32_t val);

int nvlist_add_uint32(nvlist_t *nvl, char *name, uint32_t val);

int nvlist_add_int64(nvlist_t *nvl, char *name, int64_t val);

int nvlist_add_uint64(nvlist_t *nvl, char *name, uint64_t val);

int nvlist_add_string(nvlist_t *nvl, char *name, char *val);

int nvlist_add_nvlist(nvlist_t *nvl, char *name, nvlist_t *val);

int nvlist_add_byte_array(nvlist_t *nvl, char *name, uchar_t *val,
    uint_t nelem);

int nvlist_add_int16_array(nvlist_t *nvl, char *name, int16_t *val,
    uint_t nelem);

int nvlist_add_uint16_array(nvlist_t *nvl, char *name, uint16_t *val,
    uint_t nelem);

int nvlist_add_int32_array(nvlist_t *nvl, char *name, int32_t *val,
    uint_t nelem);

int nvlist_add_uint32_array(nvlist_t *nvl, char *name, uint32_t *val,
    uint_t nelem);

int nvlist_add_int64_array(nvlist_t *nvl, char *name, int64_t *val,
    uint_t nelem);

int nvlist_add_uint64_array(nvlist_t *nvl, char *name, uint64_t *val,
    uint_t nelem);

int nvlist_add_string_array(nvlist_t *nvl, char *name, char **val,
    uint_t nelem);

int nvlist_add_nvlist_array(nvlist_t *nvl, char *name, nvlist_t **val,
    uint_t nelem);

int nvlist_add_hrtime(nvlist_t *nvl, char *name, hrtime_t val);

int nvlist_lookup_boolean(nvlist_t *nvl, char *name);

int nvlist_lookup_byte(nvlist_t *nvl, char *name, uchar_t *val);

int nvlist_lookup_int16(nvlist_t *nvl, char *name, int16_t *val);

int nvlist_lookup_uint16(nvlist_t *nvl, char *name, uint16_t *val);

int nvlist_lookup_int32(nvlist_t *nvl, char *name, int32_t *val);

int nvlist_lookup_uint32(nvlist_t *nvl, char *name, uint32_t *val);

int nvlist_lookup_int64(nvlist_t *nvl, char *name, int64_t *val);

int nvlist_lookup_uint64(nvlist_t *nvl, char *name, uint64_t *val);

int nvlist_lookup_string(nvlist_t *nvl, char *name, char **val);

int nvlist_lookup_nvlist(nvlist_t *nvl, char *name, nvlist_t **val);

int nvlist_lookup_byte_array(nvlist_t *nvl, char *name, uchar_t **val,
    uint_t *nelem);

int nvlist_lookup_int16_array(nvlist_t *nvl, char *name, int16_t **val,
    uint_t *nelem);

int nvlist_lookup_uint16_array(nvlist_t *nvl, char *name, uint16_t **val,
    uint_t *nelem);

int nvlist_lookup_int32_array(nvlist_t *nvl, char *name, int32_t **val,
    uint_t *nelem);

int nvlist_lookup_uint32_array(nvlist_t *nvl, char *name, uint32_t **val,
    uint_t *nelem);

int nvlist_lookup_int64_array(nvlist_t *nvl, char *name, int64_t **val,
    uint_t *nelem);

int nvlist_lookup_uint64_array(nvlist_t *nvl, char *name, uint64_t **val,
    uint_t *nelem);

int nvlist_lookup_string_array(nvlist_t *nvl, char *name, char ***val,
    uint_t *nelem);

int nvlist_lookup_nvlist_array(nvlist_t *nvl, char *name, nvlist_t ***val,
    uint_t *nelem);

int nvlist_lookup_hrtime(nvlist_t *nvl, char *name, hrtime_t *val);

nvpair_t *nvlist_next_nvpair(nvlist_t *nvl, nvpair_t *nvpair);

char *nvpair_name(nvpair_t *nvpair);

data_type_t nvpair_type(nvpair_t *nvpair);

int nvpair_value_byte(nvpair_t *nvpair, uchar_t *val);

int nvpair_value_int16(nvpair_t *nvpair, int16_t *val);

int nvpair_value_uint16(nvpair_t *nvpair, uint16_t *val);

int nvpair_value_int32(nvpair_t *nvpair, int32_t *val);

int nvpair_value_uint32(nvpair_t *nvpair, uint32_t *val);

int nvpair_value_int64(nvpair_t *nvpair, int64_t *val);

int nvpair_value_uint64(nvpair_t *nvpair, uint64_t *val);

int nvpair_value_string(nvpair_t *nvpair, char **val);

int nvpair_value_nvlist(nvpair_t *nvpair, nvlist_t **val);

int nvpair_value_byte_array(nvpair_t *nvpair, uchar_t **val, uint_t *nelem);

int nvpair_value_int16_array(nvpair_t *nvpair, int16_t **val, uint_t *nelem);

int nvpair_value_uint16_array(nvpair_t *nvpair, uint16_t **val, uint_t *nelem);

int nvpair_value_int32_array(nvpair_t *nvpair, int32_t **val, uint_t *nelem);

int nvpair_value_uint32_array(nvpair_t *nvpair, uint32_t **val, uint_t *nelem);

int nvpair_value_int64_array(nvpair_t *nvpair, int64_t **val, uint_t *nelem);

int nvpair_value_uint64_array(nvpair_t *nvpair, uint64_t **val, uint_t *nelem);

int nvpair_value_string_array(nvpair_t *nvpair, char ***val, uint_t *nelem);

int nvpair_value_nvlist_array(nvpair_t *nvpair, nvlist_t ***val, uint_t *nelem);

int nvpair_value_hrtime(nvpair_t *nvpair, hrtime_t *val);

void nvlist_print(FILE *fp, nvlist_t *nvl);
