function lfds710_btree_au_find
Jump to navigation
Jump to search
Source Files
└───liblfds710 ├───inc │ └───liblfds710 │ lfds710_btree_addonly_unbalanced.h └───src └───llfds710_btree_addonly_unbalanced lfds710_btree_addonly_unbalanced_find.c
Opaque Structures
struct lfds710_btree_au_element; struct lfds710_btree_au_state;
Prototype
int lfds710_btree_au_get_by_key( struct lfds710_btree_au_state *baus, int (*key_compare_function)(void const *new_key, void const *existing_key), void *key, struct lfds710_btree_au_element **baue );
Parameters
struct lfds710_btree_au_state *baus
- A pointer to an initialized lfds710_btree_au_statee.
int (*key_compare_function)(void const *new_key, void const *existing_key)
- A callback used by the btree to compare keys. This callback, if provided, over-rides the matching callback provided to lfds710_btree_au_init_valid_on_current_logical_core. This argument can be NULL.
void *key
- A void pointer to the key to find.
struct lfds710_btree_au_element **baue
- Set to point to the element with the key key. If no such key is present in the btree, set to NULL.
Return Value
Returns 1 if an element is found, 0 otherwise.
Notes
The key_compare_function allows the lfds710_btree_au_get_by_key to be used in situations where the data to hand, which is to be searched for in the tree, is in a format other than that which is normally used. Rather than having to reformat that data, it can be easier and faster simply to provide a different key compare function.