Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Name-value Pair Library Functionsnvpair_value_byte(3NVPAIR)


NAME

 nvpair_value_byte, nvpair_value_int16, nvpair_value_uint16, nvpair_value_int32, nvpair_value_uint32, nvpair_value_int64, nvpair_value_uint64, nvpair_value_string, nvpair_value_byte_array, nvpair_value_int16_array, nvpair_value_uint16_array, nvpair_value_int32_array, nvpair_value_uint32_array, nvpair_value_int64_array, nvpair_value_uint64_array, nvpair_value_string_array - retrieve value from a name-value pair

SYNOPSIS

 
cc [ flag ... ] file ...-lnvpair [ library ... ] 
#include <libnvpair.h>
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_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);

PARAMETERS

 

nvpair
Name-value pair to be processed.
nelem
Address to store the number of elements in value.
val
Address to store the value or the starting address of the array value.

DESCRIPTION

 

These functions retrieve the value of nvpair. The data type of nvpair must match the interface name for the call to be successful.

There is no nvpair_value_boolean(); the existence of the name implies the value is true.

For array data types, including string, the memory containing the data is managed by the library and references to the value remains valid until nvlist_free() is called on the nvlist_t from which nvpair is obtained. See nvlist_free(3NVPAIR).

RETURN VALUES

 

These functions return 0 on success and an error value on failure.

ERRORS

 

These functions will fail if:

EINVAL
Either one of the arguments is NULL or the type of nvpair does not match the function name.

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
Interface StabilityEvolving
MT-LevelMT-Safe

SEE ALSO

 

libnvpair(3LIB), attributes(5)


SunOS 5.9Go To TopLast Changed 10 Apr 2001

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.