2 #include "lfds710_hash_addonly_internal.h"
8 /****************************************************************************/
9 int lfds710_hash_a_get_by_key( struct lfds710_hash_a_state *has,
10 int (*key_compare_function)(void const *new_key, void const *existing_key),
11 void (*key_hash_function)(void const *key, lfds710_pal_uint_t *hash),
13 struct lfds710_hash_a_element **hae )
21 struct lfds710_btree_au_element
24 LFDS710_PAL_ASSERT( has != NULL );
25 // TRD : key_compare_function can be NULL
26 // TRD : key_hash_function can be NULL
27 // TRD : key can be NULL
28 LFDS710_PAL_ASSERT( hae != NULL );
30 if( key_compare_function == NULL )
31 key_compare_function = has->key_compare_function;
33 if( key_hash_function == NULL )
34 key_hash_function = has->key_hash_function;
36 key_hash_function( key, &hash );
38 rv = lfds710_btree_au_get_by_key( has->baus_array + (hash % has->array_size), key_compare_function, key, &baue );
41 *hae = LFDS710_BTREE_AU_GET_VALUE_FROM_ELEMENT( *baue );