static fr_htrie_funcs_t const default_funcs[] = {
[FR_HTRIE_HASH] = {
+ .match = (fr_htrie_find_t) fr_hash_table_find,
FUNC(hash_table, find),
FUNC(hash_table, insert),
FUNC(hash_table, replace),
FUNC(hash_table, num_elements)
},
[FR_HTRIE_RB] = {
+ .match = (fr_htrie_find_t) fr_rb_find,
FUNC(rb, find),
FUNC(rb, insert),
FUNC(rb, replace),
FUNC(rb, num_elements)
},
[FR_HTRIE_TRIE] = {
+ .match = (fr_htrie_find_t) fr_trie_match,
FUNC(trie, find),
FUNC(trie, insert),
FUNC(trie, replace),
*/
typedef struct {
fr_htrie_find_t find; //!< Absolute or prefix match.
+ fr_htrie_find_t match; //!< exact prefix match
fr_htrie_insert_t insert; //!< Insert a new item into the store.
fr_htrie_replace_t replace; //!< Replace an existing item in store.
fr_htrie_remove_t remove; //!< Remove an item from the store.
fr_trie_key_t get_key,
fr_free_t free_data);
+/** Match data in a htrie
+ *
+ */
+static inline CC_HINT(nonnull) void *fr_htrie_match(fr_htrie_t *ht, void const *data)
+{
+ return ht->funcs.match(ht->store, data);
+}
+
/** Find data in a htrie
*
*/