refactor(lsm): allow modules to import other internal header files

This commit is contained in:
Jef Roosens 2023-10-13 13:07:40 +02:00
parent c327be80e9
commit 0548efda97
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
9 changed files with 54 additions and 4 deletions

View file

@ -2,6 +2,7 @@
#define LSM_TRIE
#include "lsm.h"
#include "lsm/str.h"
/**
* A struct representing a trie
@ -22,4 +23,38 @@ lsm_error lsm_trie_init(lsm_trie **ptr);
*/
void lsm_trie_free(lsm_trie *trie);
/**
* Insert a new element into the trie using the specified key.
*
* @param trie trie to insert into
* @param key key to insert data with
* @param data data to insert
*/
lsm_error lsm_trie_insert(lsm_trie *trie, lsm_str *key, void *data);
/**
* Search for an element in the trie.
*
* @param out where to store data opinter, if present
* @param trie trie to search in
* @param key key to search with
*/
lsm_error lsm_trie_search(void **data, lsm_trie *trie, lsm_str *key);
/**
* Remove an element from the trie.
*
* @param out where to store the removed data pointer, if present.
* @param trie trie to remove from
* @param key key to remove
*/
lsm_error lsm_trie_remove(void **data, lsm_trie *trie, lsm_str *key);
/**
* Return the size of a trie
*
* @param trie trie to return size for
*/
uint64_t lsm_trie_size(lsm_trie *trie);
#endif