refactor(lsm): allow modules to import other internal header files
This commit is contained in:
parent
c327be80e9
commit
0548efda97
9 changed files with 54 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue