function lfds711_hash_a_get_by_key

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_hash_addonly.h
    └───src
        └───llfds711_freelist
                lfds711_hash_addonly_get.c

Opaque Structures

struct lfds711_hash_a_element;
struct lfds711_hash_a_state;

Prototype

int lfds711_hash_a_get_by_key( struct lfds711_hash_a_state *has,
                               int (*key_compare_function)(void const *new_key, void const *existing_key),
                               void (*key_hash_function)(void const *key, lfds711_pal_uint_t *hash),
                               void *key,
                               struct lfds711_hash_a_element **hae );

Parameters

struct lfds711_hash_a_state *has

A pointer to an initialized struct lfds711_hash_a_state.

int (*key_compare_function)(void const *new_key, void const *existing_key)

A callback used by the hash to compare elements. This callback, if provided, over-rides the matching callback provided to lfds711_hash_a_init_valid_on_current_logical_core. This argument can be NULL.

void (*key_hash_function)(void const *key, lfds711_uint_t *hash)

A callback used by the hash to hash elements. This callback, if provided, over-rides the matching callback provided to lfds711_hash_a_init_valid_on_current_logical_core. This argument can be NULL.

void *key

Points to (or is itself) a key.

struct lfds711_hash_a_element **hae

*hae is set to point the element with the key key. This argument is NOT set to NULL if the key is not found.

Return Value

Returns 1 if the element was found, 0 if not.

Notes

No notes.

See Also