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
    
 
Kernel Functions for Driversnvlist_lookup_boolean(9F)


NAME

 nvlist_lookup_boolean, nvlist_lookup_byte, nvlist_lookup_int16, nvlist_lookup_uint16, nvlist_lookup_int32, nvlist_lookup_uint32, nvlist_lookup_int64, nvlist_lookup_uint64, nvlist_lookup_string, nvlist_lookup_byte_array, nvlist_lookup_int16_array, nvlist_lookup_uint16_array, nvlist_lookup_int32_array, nvlist_lookup_uint32_array, nvlist_lookup_int64_array, nvlist_lookup_uint64_array, nvlist_lookup_string_array - match name and type indicated by the interface name and retrieve data value

SYNOPSIS

 
#include <sys/nvpair.h> 
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_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);

INTERFACE LEVEL

 

Solaris DDI specific (Solaris DDI)

PARAMETERS

 

nvl
The list of name-value pairs (nvlist_t) to be processed.
name
Name of the name-value pair (nvpair) to search.
nelem
Address to store the number of elements in value.
val
Address to store the value or starting address of the array value.

DESCRIPTION

 

These functions find the nvpair that matches the name and type as indicated by the interface name. If one is found, nelem and val are modified to contain the number of elements in value and the starting address of data, respectively.

These interfaces work for nvlist_ts allocated with NV_UNIQUE_NAME or NV_UNIQUE_NAME_TYPE specified in nvlist_alloc(). (See nvlist_alloc(9F).) If this is not the case, the interface will return ENOTSUP because the list potentially contains multiple nvpairs with the same name and type.

All memory required for storing the array elements, including string values, are managed by the library. References to such data remain valid until nvlist_free() is called on nvl.

RETURN VALUES

 
0
success
EINVAL
invalid argument
ENOENT
no matching name-value pair found
ENOTSUP
encode/decode method not supported

CONTEXT

 

These functions can be called from user or interrupt contexts.


SunOS 5.9Go To TopLast Changed 26 September 2000

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