function lfds711_btree_au_find

From liblfds.org
Revision as of 18:11, 16 February 2017 by Admin (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source Files

└───liblfds711
    ├───inc
    │   └───liblfds711
    │           lfds711_btree_addonly_unbalanced.h
    └───src
        └───llfds711_btree_addonly_unbalanced
                lfds711_btree_addonly_unbalanced_find.c

Opaque Structures

struct lfds711_btree_au_element;
struct lfds711_btree_au_state;

Prototype

int lfds711_btree_au_get_by_key( struct lfds711_btree_au_state *baus, 
                                 int (*key_compare_function)(void const *new_key, void const *existing_key),
                                 void *key,
                                 struct lfds711_btree_au_element **baue );

Parameters

struct lfds711_btree_au_state *baus

A pointer to an initialized lfds711_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 lfds711_btree_au_init_valid_on_current_logical_core. This argument can be NULL.

void *key

A void pointer to the key to find.

struct lfds711_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 lfds711_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.

See Also