getdns_list_get functions

Functions

getdns_return_t getdns_list_get_length (const getdns_list *list, size_t *answer)
 
getdns_return_t getdns_list_get_data_type (const getdns_list *list, size_t index, getdns_data_type *answer)
 
getdns_return_t getdns_list_get_dict (const getdns_list *list, size_t index, getdns_dict **answer)
 
getdns_return_t getdns_list_get_list (const getdns_list *list, size_t index, getdns_list **answer)
 
getdns_return_t getdns_list_get_bindata (const getdns_list *list, size_t index, getdns_bindata **answer)
 
getdns_return_t getdns_list_get_int (const getdns_list *list, size_t index, uint32_t *answer)
 

Detailed Description

Function Documentation

getdns_return_t getdns_list_get_length ( const getdns_list list,
size_t *  answer 
)

get the length of the specified list (returned in *answer)

Parameters
listlist of any of the supported data types
answernumber of valid items in the list
Returns
GETDNS_RETURN_GOOD on success
GETDNS_RETURN_NO_SUCH_LIST_ITEM if list is not valid or params are NULL
getdns_return_t getdns_list_get_data_type ( const getdns_list list,
size_t  index,
getdns_data_type answer 
)

get the enumerated data type of the indexed list item

Parameters
listthe list from which to fetch the data type
indexthe item in the list from which to fetch the data type
*answerassigned the value of the data type on success
Returns
GETDNS_RETURN_GOOD on success
GETDNS_RETURN_NO_SUCH_LIST_ITEM if the index is out of range or the list is NULL
getdns_return_t getdns_list_get_dict ( const getdns_list list,
size_t  index,
getdns_dict **  answer 
)

retrieve the dictionary value of the specified list item, the caller must not free storage associated with the return value. When the list is destroyed this dict data is also free()'d - keep this in mind when using this function.

Parameters
listthe list from which to fetch the value
indexthe item in the list from which to fetch the value
**answerassigned a pointer to the dict value of the indexed element
Returns
GETDNS_RETURN_GOOD on success
GETDNS_RETURN_NO_SUCH_LIST_ITEM if the index is out of range or the list is NULL
GETDNS_RETURN_WRONG_TYPE_REQUESTED if the data type does not match the contents of the indexed item
getdns_return_t getdns_list_get_list ( const getdns_list list,
size_t  index,
getdns_list **  answer 
)

retrieve the list value of the specified list item, the caller must not free storage associated with the return value. When the list is destroyed any list data is also free()'d - keep this in mind when using this function.

Parameters
listthe list from which to fetch the value
indexthe item in the list from which to fetch the value
**answerassigned a pointer to the list value of the indexed element
Returns
GETDNS_RETURN_GOOD on success
GETDNS_RETURN_NO_SUCH_LIST_ITEM if the index is out of range or the list is NULL
GETDNS_RETURN_WRONG_TYPE_REQUESTED if the data type does not match the contents of the indexed item
getdns_return_t getdns_list_get_bindata ( const getdns_list list,
size_t  index,
getdns_bindata **  answer 
)

retrieve the binary data value of the specified list item, the caller must not free storage associated with the return value. When the list is destroyed any bindata data is also free()'d - keep this in mind when using this function.

Parameters
listthe list from which to fetch the value
indexthe item in the list from which to fetch the value
**answerassigned a pointer to the list value of the indexed element
Returns
GETDNS_RETURN_GOOD on success
GETDNS_RETURN_NO_SUCH_LIST_ITEM if the index is out of range or the list is NULL
GETDNS_RETURN_WRONG_TYPE_REQUESTED if the data type does not match the contents of the indexed item
getdns_return_t getdns_list_get_int ( const getdns_list list,
size_t  index,
uint32_t *  answer 
)

retrieve the integer value of the specified list item

Parameters
listthe list from which to fetch the item
indexthe index of the element in the list to fetch from
*answerassigned the integer value of the indexed element
Returns
GETDNS_RETURN_GOOD on success
GETDNS_RETURN_NO_SUCH_LIST_ITEM if the index is out of range or the list is NULL
GETDNS_RETURN_WRONG_TYPE_REQUESTED if the data type does not match the contents of the indexed item