Defines error numbers and functions to translate those to a readable string.
enum ldns_enum_status ldns_status
ldns_radix_node_t * ldns_radix_prev(ldns_radix_node_t *node)
Previous element.
void ldns_radix_init(ldns_radix_t *tree)
Initialize radix tree.
void ldns_radix_traverse_postorder(ldns_radix_node_t *node, void(*func)(ldns_radix_node_t *, void *), void *arg)
Call function for all nodes in the tree, such that leaf nodes are called before parent nodes.
ldns_status ldns_radix_join(ldns_radix_t *tree1, ldns_radix_t *tree2)
Join two radix trees.
void ldns_radix_free(ldns_radix_t *tree)
Free the radix tree.
ldns_status ldns_radix_split(ldns_radix_t *tree1, size_t num, ldns_radix_t **tree2)
Split radix tree intwo.
ldns_radix_node_t * ldns_radix_last(const ldns_radix_t *tree)
Get the last element in the tree.
ldns_radix_t * ldns_radix_create(void)
Create a new radix tree.
ldns_radix_node_t * ldns_radix_search(ldns_radix_t *tree, const uint8_t *key, radix_strlen_t len)
Search data in the tree.
ldns_radix_node_t * ldns_radix_next(ldns_radix_node_t *node)
Next element.
ldns_status ldns_radix_insert(ldns_radix_t *tree, uint8_t *key, radix_strlen_t len, void *data)
Insert data into the tree.
ldns_radix_node_t * ldns_radix_first(const ldns_radix_t *tree)
Get the first element in the tree.
int ldns_radix_find_less_equal(ldns_radix_t *tree, const uint8_t *key, radix_strlen_t len, ldns_radix_node_t **result)
Search data in the tree, and if not found, find the closest smaller element in the tree.
void ldns_radix_printf(FILE *fd, const ldns_radix_t *tree)
Print radix tree (for debugging purposes).
void * ldns_radix_delete(ldns_radix_t *tree, const uint8_t *key, radix_strlen_t len)
Delete data from the tree.
Radix node select edge array.
ldns_radix_node_t * edge
Node that deals with byte+str.
radix_strlen_t len
Length of additional string for this edge.
uint8_t * str
Additional string after the selection byte for this edge.
ldns_radix_node_t * parent
Parent node.
uint16_t offset
Offset of the array.
radix_strlen_t klen
Key length corresponding to this node.
ldns_radix_array_t * array
Select edge array.
uint16_t len
Length of the array.
uint16_t capacity
Capacity of the array.
void * data
Data corresponding to this node.
uint8_t parent_index
Index in the the parent node select edge array.
uint8_t * key
Key corresponding to this node.
ldns_radix_node_t * root
Root.
size_t count
Number of nodes in tree.