Changeset View
Changeset View
Standalone View
Standalone View
contrib/ldns/ldns/radix.h
Show First 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | ldns_radix_node_t* ldns_radix_search(ldns_radix_t* tree, const uint8_t* key, | ||||
radix_strlen_t len); | radix_strlen_t len); | ||||
/** | /** | ||||
* Search data in the tree, and if not found, find the closest smaller | * Search data in the tree, and if not found, find the closest smaller | ||||
* element in the tree. | * element in the tree. | ||||
* @param tree: tree to insert to. | * @param tree: tree to insert to. | ||||
* @param key: key. | * @param key: key. | ||||
* @param len: length of key. | * @param len: length of key. | ||||
* @param result: the radix node with the exact or closest match. NULL if | * @param[out] result: the radix node with the exact or closest match. NULL if | ||||
* the key is smaller than the smallest key in the tree. | * the key is smaller than the smallest key in the tree. | ||||
* @return 1 if exact match, 0 otherwise. | * @return 1 if exact match, 0 otherwise. | ||||
* | * | ||||
*/ | */ | ||||
int ldns_radix_find_less_equal(ldns_radix_t* tree, const uint8_t* key, | int ldns_radix_find_less_equal(ldns_radix_t* tree, const uint8_t* key, | ||||
radix_strlen_t len, ldns_radix_node_t** result); | radix_strlen_t len, ldns_radix_node_t** result); | ||||
/** | /** | ||||
Show All 27 Lines | |||||
* | * | ||||
*/ | */ | ||||
ldns_radix_node_t* ldns_radix_prev(ldns_radix_node_t* node); | ldns_radix_node_t* ldns_radix_prev(ldns_radix_node_t* node); | ||||
/** | /** | ||||
* Split radix tree intwo. | * Split radix tree intwo. | ||||
* @param tree1: one tree. | * @param tree1: one tree. | ||||
* @param num: number of elements to split off. | * @param num: number of elements to split off. | ||||
* @param tree2: another tree. | * @param[out] tree2: another tree. | ||||
* @return: status. | * @return: status. | ||||
* | * | ||||
*/ | */ | ||||
ldns_status ldns_radix_split(ldns_radix_t* tree1, size_t num, | ldns_status ldns_radix_split(ldns_radix_t* tree1, size_t num, | ||||
ldns_radix_t** tree2); | ldns_radix_t** tree2); | ||||
/** | /** | ||||
* Join two radix trees. | * Join two radix trees. | ||||
Show All 31 Lines |